Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Composite


   
    // general section
    Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    section.setText("General");

        Composite sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);
        GridLayout sectionLayout = new GridLayout();
        GridData fillHSpan = new GridData(GridData.FILL_HORIZONTAL);
        fillHSpan.horizontalSpan = 2;
        GridData comboLayout = new GridData(GridData.GRAB_HORIZONTAL);
        comboLayout.minimumWidth = 150;
       
        sectionLayout.numColumns = 3;
        sectionClient.setLayout(sectionLayout);
       
        _comboWGADistribution = factory.createCombo(sectionClient, "WGA Distribution:", "wgaDeployment");
        _comboWGADistribution.setLayoutData(comboLayout);
       
//      _btnConfigureWGAInstallations = new Button(sectionClient, SWT.NONE);
//      _btnConfigureWGAInstallations.setText("Configure distributions ...");
//      _btnConfigureWGAInstallations.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
//      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
//        handleConfigureWGADistributions();
//      }
//    });
     
    HyperlinkGroup group = new HyperlinkGroup(sectionClient.getDisplay());     
      ImageHyperlink linkConfigureDistributions = new ImageHyperlink(sectionClient, SWT.None);
      linkConfigureDistributions.setText("Configure distributions ...");
      linkConfigureDistributions.addHyperlinkListener(new HyperlinkAdapter() {
      public void linkActivated(HyperlinkEvent e) {
        handleConfigureWGADistributions();
      }
    });   
      group.add(linkConfigureDistributions);
     
      //factory.createCheckBox(sectionClient, "Output TML-Warnings on server console:", "enabled", "outputTMLWarningsOnConsole");
      //factory.addFiller(sectionClient);
//      factory.createCheckBox(sectionClient, "TML-Script debugger:", "enabled", "tmlScriptDebuggerEnabled");
//      factory.addFiller(sectionClient);
//     
//      factory.createCheckBox(sectionClient, "Java debugging:", "enabled", "javaDebuggerEnabled");
//      factory.addFiller(sectionClient);
     
    group = new HyperlinkGroup(sectionClient.getDisplay());     
      ImageHyperlink linkConfigureGlobalRuntimePreferences = new ImageHyperlink(sectionClient, SWT.None);
      linkConfigureGlobalRuntimePreferences.setText("Configure global runtime settings ...");
      linkConfigureGlobalRuntimePreferences.addHyperlinkListener(new HyperlinkAdapter() {
      public void linkActivated(HyperlinkEvent e) {
        openGeneralPreferencesPage();
      }
    });   
      group.add(linkConfigureGlobalRuntimePreferences);
     
     
      // libraries section
      section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.COMPACT);
    section.setText("Tomcat libraries");

        sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);
        sectionLayout = new GridLayout();       
        sectionLayout.numColumns = 2;
        sectionClient.setLayout(sectionLayout);
     
        GridData fillBoth = new GridData(GridData.FILL_BOTH);
        fillBoth.minimumHeight = 100;
        fillBoth.verticalSpan = 2;
        _lstTomcatLibraries = new List(sectionClient, SWT.BORDER|SWT.MULTI);
        _lstTomcatLibraries.setLayoutData(fillBoth);
        _lstTomcatLibraries.setItems(_model.getTomcatLibraryNames());
       
        _btnAddTomcatLibrary = toolkit.createButton(sectionClient, "add...", SWT.PUSH);
        _btnAddTomcatLibrary.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleAddTomcatLibrary();
      }
    });
       
        GridData btnLayout = new GridData(GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_FILL, false, false);
        _btnAddTomcatLibrary.setLayoutData(btnLayout);
     
      _btnRemoveTomcatLibrary = toolkit.createButton(sectionClient, "remove...", SWT.PUSH);
     
      _btnRemoveTomcatLibrary.setLayoutData(btnLayout);       
      _btnRemoveTomcatLibrary.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleRemoveTomcatLibrary();
      }
    });
     
      // java section
      section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    section.setText("Java");

        sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);
        sectionLayout = new GridLayout();       
        sectionLayout.numColumns = 2;
        sectionClient.setLayout(sectionLayout);
     
        _comboJVM = factory.createCombo(sectionClient, "Execution Environment:", "executionEnvironment");
        _comboJVM.setLayoutData(comboLayout);

//      _txtMinHeap = factory.createText(sectionClient, "Minimum java heap size (in MB):", "minHeapSize");
View Full Code Here


  }

  @Override
  protected Control createContents(Composite parent) {

    _container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.horizontalSpacing = 0;
View Full Code Here

  public WGARemoteServerPrefPage() {
    setDescription("WGA Remoteservers");
  }

  protected Control createContents(Composite parent) {
    _container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.horizontalSpacing = 0;
View Full Code Here

  public void setSelection(IClasspathEntry containerEntry) {
    _containerEntry = containerEntry;
  }

  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    container.setLayout(layout);
   
    _tabLibraries = new Table(container, SWT.CHECK|SWT.READ_ONLY);
    GridData tabLayout = new GridData(GridData.FILL_BOTH);
    _tabLibraries.setLayoutData(tabLayout);
   
View Full Code Here

    _deployment = deployment;   
  }

  @Override
  protected Control createDialogArea(Composite parent) {
    _composite = new Composite(parent, SWT.None);
    GridData compositeStyle = new GridData(SWT.FILL, SWT.FILL, true, true);
    _composite.setLayoutData(compositeStyle);
    GridLayout layout = new GridLayout(2, false);
    _composite.setLayout(layout);
   
View Full Code Here

    setTitle("Select an external Design");

  }

  protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
    GridLayout layout = new GridLayout(3, false);
    composite.setLayout(layout);

    Label messageLabel = createMessageArea(composite);
    _treeViewer = createTreeViewer(composite);
    GridData gridDataLabel = new GridData(GridData.FILL_HORIZONTAL);
    gridDataLabel.horizontalSpan = 3;
View Full Code Here

    _deployment = deployment;     
  }

  @Override
  protected Control createDialogArea(Composite parent) {
    Composite composite = new Composite(parent, SWT.None);
    composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
    GridLayout layout = new GridLayout(3, false);
    composite.setLayout(layout);
   
    GridData txtStyle = new GridData(GridData.FILL_HORIZONTAL);
    txtStyle.minimumWidth = convertWidthInCharsToPixels(60);

   
View Full Code Here

   
    return messages;
  }

  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    container.setLayout(layout);
   
    Label label = new Label(container, SWT.NONE);
    label.setText("Remote location (root url to WGA server):");   
    _txtRemoteLocation = new Text(container, SWT.BORDER);
    _txtRemoteLocation.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));   
View Full Code Here

    setTitle("Select an external Design");

  }

  protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
    GridLayout layout = new GridLayout(3, false);
    composite.setLayout(layout);

    Label messageLabel = createMessageArea(composite);
    _treeViewer = createTreeViewer(composite);
    GridData gridDataLabel = new GridData(GridData.FILL_HORIZONTAL);
    gridDataLabel.horizontalSpan = 3;
View Full Code Here

   
    // management section
        Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
    section.setText("Management");

    Composite sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);
        GridLayout sectionLayout = new GridLayout();       
        sectionLayout.numColumns = 2;
        sectionClient.setLayout(sectionLayout);
       
       
        Label lblStateDesc = new Label(sectionClient, SWT.NONE);
        lblStateDesc.setText("State:");
       
        _lblState = new Label(sectionClient, SWT.NONE);
       
        Composite buttonGroup = toolkit.createComposite(sectionClient);
        GridLayout buttonGroupLayout = new GridLayout();       
        buttonGroupLayout.numColumns = 3;
        buttonGroup.setLayout(buttonGroupLayout);
        GridData buttonGroupLayoutData = new GridData();
        buttonGroupLayoutData.horizontalSpan = 2;
        buttonGroup.setLayoutData(buttonGroupLayoutData);
       
      _btnStartRuntime = new Button(buttonGroup, SWT.PUSH);
      _btnStartRuntime.setData(SWTBotIDs.WIDGET_KEY, ResourceIDs.SWTBOT_WGARUNTIME_EDITOR_BUTTON_START);
      _btnStartRuntime.setText("Start");

      _btnStartRuntime.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_START));
      _btnStartRuntime.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        try {
          StartWGARuntime.call(_model.getWgaRuntime());
          //_btnStartRuntime.setEnabled(false);
        } catch (Exception ex) {         
        }
      }
       
      });

     
      _btnStopRuntime = new Button(buttonGroup, SWT.PUSH);
      _btnStopRuntime.setText("Stop");
      _btnStopRuntime.setData(SWTBotIDs.WIDGET_KEY, ResourceIDs.SWTBOT_WGARUNTIME_EDITOR_BUTTON_STOP);
      _btnStopRuntime.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_STOP));
      _btnStopRuntime.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        try {
          StopWGARuntime.call();
          //_btnStopRuntime.setEnabled(false);
        } catch (Exception ex) {         
        }
      }
       
      });
     
     
      _btnRestartRuntime = new Button(buttonGroup, SWT.PUSH);
      _btnRestartRuntime.setText("Restart");

      _btnRestartRuntime.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_SERVER_RESTART));
      _btnRestartRuntime.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        try {
          RestartWGARuntime.call();
        } catch (Exception ex) {         
        }
      }
       
      });

      HyperlinkGroup group = new HyperlinkGroup(sectionClient.getDisplay());
     
      _linkOpenAdminPage = new Hyperlink(sectionClient, SWT.NONE);
      _linkOpenAdminPage.setText("Open Admin Page");
      _linkOpenAdminPage.addHyperlinkListener(new HyperlinkAdapter() {

      @Override
      public void linkActivated(HyperlinkEvent e) {
        OpenWGAAdminPage.call(_model.getWgaRuntime());
      }
       
      });     
      Label filler = new Label(sectionClient, SWT.NONE);
     
//      _linkOpenContentManager = new Hyperlink(sectionClient, SWT.NONE);
//      _linkOpenContentManager.setText("Open Content Manager");     
//      _linkOpenContentManager.addHyperlinkListener(new HyperlinkAdapter() {
//        @Override
//      public void linkActivated(HyperlinkEvent e) {
//          OpenContentManager.call(_model.getWgaRuntime());
//      }
//      });
     
      group.add(_linkOpenAdminPage);
     
      TomcatUtils.getInstance().addListener(this);
     
      //group.add(_linkOpenContentManager);
   
    // web app section
        _webAppSection = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.EXPANDED);
        _webAppSection.setText("Web Applications");

    List<WebApplication> apps = retrieveWebApplications();
    WGAConfiguration config = null;
    try {
      config = _model.getWgaRuntime().retrieveWGAConfig(false);
    } catch (Exception e2) {
      WGADesignerPlugin.getDefault().logError("Unable to read wga configuration." , e2);
    }
    _webAppModel = new WebApplicationsModel(apps, config);
   
    // register as runtime listener to refresh web app model on wga config changes
    _model.getWgaRuntime().addListener(this);
   
    ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
    ToolBar toolbar = toolBarManager.createControl(_webAppSection);
  
    Action action1 = new Action("refresh", WGADesignerPlugin.getDefault().getImageRegistry().getDescriptor(WGADesignerPlugin.IMAGE_REFRESH)) {
      public void run() {
        refreshWebApplications();       
      }


    };
    toolBarManager.add(action1);

    toolBarManager.update(true);
    _webAppSection.setTextClient(toolbar);



    sectionClient = toolkit.createComposite(_webAppSection);
    _webAppSection.setClient(sectionClient);
        sectionLayout = new GridLayout();
        sectionLayout.verticalSpacing  =0;
        sectionLayout.numColumns = 2;
        sectionClient.setLayout(sectionLayout);

       
        HyperlinkGroup generalHyperLinkGroup = new HyperlinkGroup(sectionClient.getDisplay());
     
      _linkCreateWebApp = new ImageHyperlink(sectionClient, SWT.NONE);
      _linkCreateWebApp.setText("Create new web application");     
      _linkCreateWebApp.setImage(WGADesignerPlugin.getDefault().getImageRegistry().get(WGADesignerPlugin.IMAGE_WGA_DESIGN_ADD));
      _linkCreateWebApp.addHyperlinkListener(new HyperlinkAdapter() {

      @Override
      public void linkActivated(HyperlinkEvent e) {
        try {
          WorkbenchUtils.openWizard(WGADesignerPlugin.getDefault().getWorkbench(), ResourceIDs.WIZARD_NEW_WGA_DESIGN, new SingleStructuredSelection(_model.getWgaRuntime().getProject()));
        } catch (CoreException e1) {
          WorkbenchUtils.showErrorDialog(WGADesignerPlugin.getDefault(), getSite().getShell(), "Unable to open wizard 'New WGADesign'", e1);
        }
      }
       
      });
     
           
      generalHyperLinkGroup.add(_linkCreateWebApp);
      filler = new Label(sectionClient, SWT.NONE);
     
 
     
     
       
        _tblWebApplications = new EditableTableControl<WebApplication>(sectionClient, SWT.NONE,SWT.BORDER|SWT.FULL_SELECTION) {

      @Override
      protected boolean isButtonAreaNeeded() {
        return false;
      }
         
     
        };
       
       
       
       
        GridData tblGridData = new GridData(GridData.FILL_BOTH);     
        tblGridData.minimumHeight = 200;
        tblGridData.verticalSpan = 5;
        _tblWebApplications.setLayoutData(tblGridData);
       
        String[] columnNames = new String[] { "Key", "Title", "Domain", "Design" };       
        _tblWebApplications.init(columnNames, _webAppModel);       
       
        Composite tableActionsContainer = new Composite(sectionClient, SWT.NONE);
        tableActionsContainer.setLayout(new GridLayout(1, false));
        tableActionsContainer.setLayoutData(new GridData(SWT.BEGINNING));
       
        GridData linkGridData = new GridData(SWT.BEGINNING);
        linkGridData.verticalAlignment = SWT.TOP;
        Label lblOpenIn = new Label(tableActionsContainer, SWT.NONE);
        lblOpenIn.setLayoutData(GridDataFactory.copyData(linkGridData));
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Composite

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.