コード例 #1
0
ファイル: MonitorOverviewPage.java プロジェクト: SiteView/PDE
  private void fillBody(IManagedForm managedForm, FormToolkit toolkit) {
    Composite body = managedForm.getForm().getBody();
    body.setLayout(FormLayoutFactory.createFormTableWrapLayout(true, 2));

    Composite left = toolkit.createComposite(body);
    left.setLayout(FormLayoutFactory.createFormPaneTableWrapLayout(false, 1));
    left.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
    //		if (isFragment())
    //		fInfoSection = new FragmentMonitorInfoSection(this, left);
    //		else
    //		fInfoSection = new PluginMonitorInfoSection(this, left);

    fInfoSection = new SimpleMonitorInfoSection(this, left);
    //		fInfoSection = new PluginMonitorInfoSection(this, left);
    managedForm.addPart(fInfoSection);
    if (isBundle()) managedForm.addPart(new MonitorExecutionEnvironmentSection(this, left));

    Composite right = toolkit.createComposite(body);
    right.setLayout(FormLayoutFactory.createFormPaneTableWrapLayout(false, 1));
    right.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
    createContentSection(managedForm, right, toolkit);
    if (isEditable() || getPDEEditor().hasInputContext(PluginInputContext.CONTEXT_ID))
      createExtensionSection(managedForm, right, toolkit);
    if (isEditable()) {
      createTestingSection(managedForm, isBundle() ? right : left, toolkit);
    }
    if (isEditable()) createExportingSection(managedForm, right, toolkit);
  }
コード例 #2
0
  @Override
  protected void createMasterPart(IManagedForm managedForm, Composite parent) {
    // TODO Auto-generated method stub
    fManagedForm = managedForm;

    FormToolkit toolkit = managedForm.getToolkit();

    Composite composite = toolkit.createComposite(parent);
    composite.setLayout(new GridLayout(1, false));

    Section section = toolkit.createSection(composite, Section.TITLE_BAR);
    section.setText("overlay");

    Composite viewercomposite = toolkit.createComposite(composite, SWT.NONE);
    viewercomposite.setLayout(new GridLayout(2, false));
    viewercomposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    final Tree tree = toolkit.createTree(viewercomposite, SWT.BORDER);
    fTreeViewer = new TreeViewer(tree);
    // fTreeViewer.setContentProvider(new XULTreeContentProvider());
    // fTreeViewer.setLabelProvider(new XULLabelProvider());

    MenuManager menu_manager = new MenuManager();

    // final Action addmenu = new AddAction("add");
    // menu_manager.add(addmenu);

  }
コード例 #3
0
  private void createPlatformSpecificSection(FormToolkit toolkit, Composite parent) {
    fPlatformSectionControls = new ArrayList();
    // Create the section
    Section section = toolkit.createSection(parent, Section.EXPANDED | Section.TWISTIE);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.horizontalSpan = 3;
    section.setText(SOAMessages.PlatformSpecificPropLabel);
    section.setLayoutData(gd);

    Composite separator = toolkit.createCompositeSeparator(section);
    gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 3;
    separator.setLayoutData(gd);

    Composite client = toolkit.createComposite(section, SWT.WRAP);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginWidth = 2;
    layout.marginHeight = 2;
    client.setLayout(layout);

    // Fill the section with components
    Composite fieldComposite = toolkit.createComposite(client);
    layout = new GridLayout(2, false);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    fieldComposite.setLayout(layout);
    fieldComposite.setLayoutData(gd);

    Label cicsUriLabel = toolkit.createLabel(fieldComposite, SOAMessages.CICSURILabel);
    fPlatformSectionControls.add(cicsUriLabel);
    fCICSURIText = toolkit.createText(fieldComposite, "", SWT.SINGLE); // $NON-NLS-1$
    gd = new GridData(GridData.FILL_HORIZONTAL);
    fCICSURIText.setLayoutData(gd);
    fCICSURIText.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            HandleCICSURIModified();
          }
        });
    fPlatformSectionControls.add(fCICSURIText);
    fSOAPServiceSectionControls.add(fCICSURIText);

    toolkit.paintBordersFor(fieldComposite);
    section.setClient(client);

    if (!EDTCoreIDEPlugin.SUPPORT_SOAP) {
      section.setExpanded(false);
      section.setVisible(false);
    }
  }
コード例 #4
0
ファイル: CommitEditorPage.java プロジェクト: stefanlay/egit
  private void createHeaderArea(Composite parent, FormToolkit toolkit, int span) {
    RevCommit commit = getCommit().getRevCommit();
    Composite top = toolkit.createComposite(parent);
    GridDataFactory.fillDefaults().grab(true, false).span(span, 1).applyTo(top);
    GridLayoutFactory.fillDefaults().numColumns(2).applyTo(top);

    Composite userArea = toolkit.createComposite(top);
    GridLayoutFactory.fillDefaults().spacing(2, 2).numColumns(1).applyTo(userArea);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(userArea);

    PersonIdent author = commit.getAuthorIdent();
    if (author != null) createUserArea(userArea, toolkit, author, true);

    PersonIdent committer = commit.getCommitterIdent();
    if (committer != null && !committer.equals(author))
      createUserArea(userArea, toolkit, committer, false);

    int count = commit.getParentCount();
    if (count > 0) {
      Composite parents = toolkit.createComposite(top);
      GridLayoutFactory.fillDefaults().spacing(2, 2).numColumns(2).applyTo(parents);
      GridDataFactory.fillDefaults().grab(false, false).applyTo(parents);

      for (int i = 0; i < count; i++) {
        final RevCommit parentCommit = commit.getParent(i);
        toolkit
            .createLabel(parents, UIText.CommitEditorPage_LabelParent)
            .setForeground(toolkit.getColors().getColor(IFormColors.TB_TOGGLE));
        final Hyperlink link =
            toolkit.createHyperlink(
                parents, parentCommit.abbreviate(PARENT_LENGTH).name(), SWT.NONE);
        link.addHyperlinkListener(
            new HyperlinkAdapter() {

              public void linkActivated(HyperlinkEvent e) {
                try {
                  CommitEditor.open(
                      new RepositoryCommit(getCommit().getRepository(), parentCommit));
                  if ((e.getStateMask() & SWT.MOD1) != 0) getEditor().close(false);
                } catch (PartInitException e1) {
                  Activator.logError("Error opening commit editor", e1); // $NON-NLS-1$
                }
              }
            });
      }
    }

    createTagsArea(userArea, toolkit, 2);
  }
コード例 #5
0
 @Override
 protected void createClient(Section section, FormToolkit toolkit) {
   container = toolkit.createComposite(section);
   GridLayout layout = new GridLayout();
   layout.numColumns = 2;
   container.setLayout(layout);
   section.setClient(container);
   linkContainer = toolkit.createComposite(container);
   linkContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
   GridLayout linkLayout = new GridLayout();
   linkLayout.marginWidth = 0;
   linkLayout.marginHeight = 0;
   linkLayout.verticalSpacing = 0;
   linkContainer.setLayout(linkLayout);
 }
コード例 #6
0
  protected void createRESTServicePropertiesSection(FormToolkit toolkit, Composite parent) {
    fRESTServiceSectionControls = new ArrayList();
    // Create the section
    Section section = toolkit.createSection(parent, Section.EXPANDED | Section.TWISTIE);
    section.setText(SOAMessages.TitleSectionRestService);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.horizontalSpan = 3;
    section.setLayoutData(gd);

    Composite separator = toolkit.createCompositeSeparator(section);
    gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 3;
    separator.setLayoutData(gd);

    Composite client = toolkit.createComposite(section, SWT.WRAP);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginWidth = 2;
    layout.marginHeight = 2;
    client.setLayout(layout);

    // Fill the section with components
    Composite fieldComposite = toolkit.createComposite(client);
    int layoutColumn = 3;
    layout = new GridLayout(layoutColumn, false);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    fieldComposite.setLayout(layout);
    fieldComposite.setLayoutData(gd);

    fRestUriLabel = toolkit.createLabel(fieldComposite, SOAMessages.LabelURI);
    fRESTServiceSectionControls.add(fRestUriLabel);
    fRestUri = toolkit.createText(fieldComposite, "", SWT.SINGLE); // $NON-NLS-1$
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = layoutColumn - 1;
    fRestUri.setLayoutData(gd);
    fRestUri.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            HandleRestURIModified();
          }
        });
    fRESTServiceSectionControls.add(fRestUri);

    createSpacer(toolkit, fieldComposite, layoutColumn);
    toolkit.paintBordersFor(fieldComposite);

    section.setClient(client);
  }
コード例 #7
0
ファイル: DetailsSection.java プロジェクト: niwashun/fuseide
  protected Section bindNestedComplexProperties(
      FormToolkit toolkit,
      Composite parent,
      final IMessageManager mmng,
      ComplexPropertyDescriptor complexProperty,
      final Object id,
      String labelText,
      String tooltip) {
    Class<?> complexType = complexProperty.getPropertyType();
    Section section =
        toolkit.createSection(
            parent, Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
    section.setText(labelText);
    section.setToolTipText(tooltip);
    Composite sectionClient = toolkit.createComposite(section);
    sectionClient.setLayout(new GridLayout(2, false));
    section.setClient(sectionClient);

    // now lets introspect the composite...
    Object value = node.getPropertyValue(id);
    if (value == null) {
      value = ObjectHelper.newInstance(complexType);
      node.setPropertyValue(id, value);
    }
    bindNestedComplexProperties(toolkit, mmng, complexProperty, complexType, sectionClient, value);
    sectionClient.layout(true, true);
    return section;
  }
コード例 #8
0
  @Override
  protected Control createContent(FormToolkit toolkit, Composite parent) {
    attributesComposite = toolkit.createComposite(parent);
    attributesComposite.addListener(
        SWT.MouseDown,
        new Listener() {
          public void handleEvent(Event event) {
            Control focus = event.display.getFocusControl();
            if (focus instanceof Text && ((Text) focus).getEditable() == false) {
              getManagedForm().getForm().setFocus();
            }
          }
        });

    GridLayout attributesLayout = EditorUtil.createSectionClientLayout();
    attributesLayout.numColumns = 4;
    attributesLayout.horizontalSpacing = 9;
    attributesLayout.verticalSpacing = 6;
    attributesComposite.setLayout(attributesLayout);

    GridData attributesData = new GridData(GridData.FILL_BOTH);
    attributesData.horizontalSpan = 1;
    attributesData.grabExcessVerticalSpace = false;
    attributesComposite.setLayoutData(attributesData);

    createAttributeControls(attributesComposite, toolkit, attributesLayout.numColumns);
    toolkit.paintBordersFor(attributesComposite);

    return attributesComposite;
  }
コード例 #9
0
ファイル: PUTSection.java プロジェクト: simonharrer/bpelunit
  protected void createClient(Section section, FormToolkit toolkit) {

    section.setText("Process Under Test");

    section.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
    section.setDescription(
        "Enter a name, deployer, and WSDL file for the process under test (PUT).");

    Composite content = toolkit.createComposite(section);
    TableWrapLayout layout = new TableWrapLayout();
    layout.leftMargin = layout.rightMargin = toolkit.getBorderStyle() != SWT.NULL ? 0 : 2;
    layout.numColumns = 3;
    content.setLayout(layout);

    createNameEntry(content, toolkit);
    createTypeEntry(content, toolkit);
    createWSDLEntry(content, toolkit);

    createText(
        content,
        "<form><p><a href=\"deploymentOptions\">Configure Deployment Options...</a></p></form>",
        toolkit,
        this);

    section.setClient(content);
    toolkit.paintBordersFor(content);
  }
コード例 #10
0
  @Override
  protected void createClient(Section section, FormToolkit toolkit) {
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.minimumWidth = 250;
    gd.grabExcessVerticalSpace = true;

    section.setText(Msgs.general);
    section.setDescription(Msgs.specifyPluginPackageProperties);
    section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1));
    section.setLayoutData(gd);

    Composite client = toolkit.createComposite(section);
    client.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 3));

    IActionBars actionBars = page.getEditor().getEditorSite().getActionBars();

    createNameEntry(client, toolkit, actionBars);
    createChangeLogEntry(client, toolkit, actionBars);
    createModuleGroupIdEntry(client, toolkit, actionBars);
    createPageUrlEntry(client, toolkit, actionBars);
    createModuleIncrementalVersionEntry(client, toolkit, actionBars);
    createAuthorEntry(client, toolkit, actionBars);
    createTagsEntry(client, toolkit, actionBars);
    createLicensesEntry(client, toolkit, actionBars);
    createShortDescriptionEntry(client, toolkit, actionBars);
    createSpeedFiltersEntry(client, toolkit, actionBars);
    toolkit.paintBordersFor(client);

    section.setClient(client);

    getModel().addModelChangedListener(this);
  }
コード例 #11
0
  @Override
  public void createPartControl(Composite parent) {
    // Creates toolkit and form
    toolkit = createFormBodySection(parent, "Senate Crawler");
    Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR | Section.EXPANDED);
    GridDataFactory.fillDefaults().grab(true, false).span(3, 1).applyTo(section);
    section.setExpanded(true);

    // Create a composite to hold the other widgets
    ScrolledComposite sc = new ScrolledComposite(section, SWT.H_SCROLL | SWT.V_SCROLL);
    sc.setExpandHorizontal(true);
    sc.setExpandVertical(true);
    GridLayoutFactory.fillDefaults().numColumns(3).equalWidth(false).applyTo(sc);

    // Creates an empty to create a empty space
    TacitFormComposite.createEmptyRow(toolkit, sc);

    // Create a composite that can hold the other widgets
    Composite client = toolkit.createComposite(form.getBody());
    GridLayoutFactory.fillDefaults()
        .equalWidth(true)
        .numColumns(1)
        .applyTo(client); // Align the composite section to one column
    GridDataFactory.fillDefaults().grab(true, false).span(1, 1).applyTo(client);
    GridLayout layout = new GridLayout(); // Layout creation
    layout.numColumns = 2;

    createSenateInputParameters(client);
    TacitFormComposite.createEmptyRow(toolkit, client);
    outputLayout =
        TacitFormComposite.createOutputSection(toolkit, client, form.getMessageManager());
    // Add run and help button on the toolbar
    addButtonsToToolBar();
  }
コード例 #12
0
ファイル: MonitorOverviewPage.java プロジェクト: SiteView/PDE
 protected Composite createStaticSectionClient(FormToolkit toolkit, Composite parent) {
   Composite container = toolkit.createComposite(parent, SWT.NONE);
   container.setLayout(FormLayoutFactory.createSectionClientTableWrapLayout(false, 1));
   TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
   container.setLayoutData(data);
   return container;
 }
コード例 #13
0
  private void createFeaturesToolbar(FormToolkit toolkit, Section section) {
    Composite headerComposite = toolkit.createComposite(section, SWT.NONE);
    RowLayout rowLayout = new RowLayout();
    rowLayout.marginTop = 0;
    rowLayout.marginBottom = 0;
    headerComposite.setLayout(rowLayout);
    headerComposite.setBackground(null);

    toolBarManager = new ToolBarManager(SWT.FLAT | SWT.HORIZONTAL);
    toolBarManager.createControl(headerComposite);

    installAction = new InstallAction();
    installAction.setEnabled(false);
    toolBarManager.add(installAction);

    toolBarManager.add(new CheckForUpdatesAction());

    CommandContributionItem item =
        JBossCentralActivator.createContributionItem(
            getSite(), "org.jboss.tools.central.refreshDiscovery");
    toolBarManager.add(item);

    toolBarManager.update(true);

    section.setTextClient(headerComposite);
  }
コード例 #14
0
ファイル: CommitEditorPage.java プロジェクト: stefanlay/egit
  private Composite createUserArea(
      Composite parent, FormToolkit toolkit, PersonIdent person, boolean author) {
    Composite userArea = toolkit.createComposite(parent);
    GridLayoutFactory.fillDefaults().spacing(2, 2).numColumns(3).applyTo(userArea);

    Label userLabel = toolkit.createLabel(userArea, null);
    userLabel.setImage(getImage(author ? UIIcons.ELCL16_AUTHOR : UIIcons.ELCL16_COMMITTER));
    if (author) userLabel.setToolTipText(UIText.CommitEditorPage_TooltipAuthor);
    else userLabel.setToolTipText(UIText.CommitEditorPage_TooltipCommitter);

    boolean signedOff = isSignedOffBy(person);

    Text userText = new Text(userArea, SWT.FLAT | SWT.READ_ONLY);
    userText.setText(
        MessageFormat.format(
            author ? UIText.CommitEditorPage_LabelAuthor : UIText.CommitEditorPage_LabelCommitter,
            person.getName(),
            person.getEmailAddress(),
            person.getWhen()));
    toolkit.adapt(userText, false, false);
    userText.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);

    GridDataFactory.fillDefaults().span(signedOff ? 1 : 2, 1).applyTo(userText);
    if (signedOff) {
      Label signedOffLabel = toolkit.createLabel(userArea, null);
      signedOffLabel.setImage(getImage(UIIcons.SIGNED_OFF));
      if (author) signedOffLabel.setToolTipText(UIText.CommitEditorPage_TooltipSignedOffByAuthor);
      else signedOffLabel.setToolTipText(UIText.CommitEditorPage_TooltipSignedOffByCommitter);
    }

    return userArea;
  }
コード例 #15
0
  @Override
  public Composite createUI(
      final SmoothingUI smoothingUI, final Composite parent, final boolean isShowDescription) {

    _smoothingUI = smoothingUI;

    initUI(parent);

    final Composite container = _tk.createComposite(parent);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
    GridLayoutFactory.fillDefaults().spacing(5, 5).numColumns(3).applyTo(container);
    //		container.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
    {
      createUI10Tau(container);
      createUI20SmoothSpeed(container);
      createUI22SmoothGradient(container);
      createUI24SmoothPulse(container);
      createUI26SmoothAltitude(container);
      createUI30Iterations(container);

      createUI50Actions(container);
    }

    restoreState();
    enableControls();

    return container;
  }
コード例 #16
0
  protected Composite createMaxOccurComp(Composite parent, FormToolkit toolkit) {
    fMaxLabel = toolkit.createLabel(parent, PDEUIMessages.AbstractSchemaDetails_maxOccurLabel);
    fMaxLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
    Composite comp = toolkit.createComposite(parent);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    GridLayout layout = new GridLayout(3, false);
    layout.marginHeight = layout.marginWidth = 0;
    comp.setLayout(layout);
    comp.setLayoutData(gd);

    fMaxOccurSpinner = new Spinner(comp, SWT.BORDER);
    fMaxOccurSpinner.setMinimum(1);
    fMaxOccurSpinner.setMaximum(999);
    fMaxOccurSpinner.setIncrement(1);

    fUnboundSelect =
        toolkit.createButton(comp, PDEUIMessages.AbstractSchemaDetails_unboundedButton, SWT.CHECK);
    gd = new GridData();
    gd.horizontalIndent = 10;
    fUnboundSelect.setLayoutData(gd);
    fUnboundSelect.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            if (blockListeners()) return;
            fMaxOccurSpinner.setEnabled(!fUnboundSelect.getSelection() && isEditableElement());
          }
        });

    return comp;
  }
コード例 #17
0
  public Section createControl(FormToolkit toolkit, Composite parent) {
    Section propSec = toolkit.createSection(parent, Section.TITLE_BAR | Section.EXPANDED);
    propSec.setText(_TITLE);

    // widgets
    Composite propSecCl = toolkit.createComposite(propSec, SWT.WRAP);
    Table propTable =
        toolkit.createTable(propSecCl, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    selectButton = toolkit.createButton(propSecCl, "Select All", SWT.CHECK);
    selectButton.setSelection(false);
    verifyButton = toolkit.createButton(propSecCl, "Perform Verification", SWT.PUSH);

    // layout
    propSec.setClient(propSecCl);
    propSecCl.setLayout(new GridLayout(2, false));
    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
    gd.heightHint = propTable.getItemHeight() * 3;
    propTable.setLayoutData(gd);
    verifyButton.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));

    addListeners();
    makeViewer(propTable);
    makeVerifyAction();

    return propSec;
  }
コード例 #18
0
ファイル: SimulationView.java プロジェクト: huybuidac/yakindu
 @Override
 public void createPartControl(Composite parent) {
   parent.setLayout(new FillLayout(SWT.VERTICAL));
   SashForm sashForm = new SashForm(parent, SWT.VERTICAL | SWT.SMOOTH);
   sashForm.setSashWidth(5);
   sashForm.setBackground(ColorConstants.white);
   sashForm.setLayout(new FillLayout());
   Composite top = kit.createComposite(sashForm);
   top.setLayout(new FillLayout(SWT.VERTICAL));
   Composite bottom = kit.createComposite(sashForm);
   bottom.setLayout(new FillLayout(SWT.VERTICAL));
   sashForm.setWeights(new int[] {3, 2});
   createViewer(top);
   createTimeScalingSection(bottom);
   hookActions();
   setActiveSession();
 }
コード例 #19
0
ファイル: CommitEditorPage.java プロジェクト: stefanlay/egit
 private void createTagsArea(Composite parent, FormToolkit toolkit, int span) {
   Composite tagArea = toolkit.createComposite(parent);
   GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(false).applyTo(tagArea);
   GridDataFactory.fillDefaults().span(span, 1).grab(true, false).applyTo(tagArea);
   toolkit
       .createLabel(tagArea, UIText.CommitEditorPage_LabelTags)
       .setForeground(toolkit.getColors().getColor(IFormColors.TB_TOGGLE));
   fillTags(tagArea, toolkit);
 }
コード例 #20
0
ファイル: SimulationView.java プロジェクト: huybuidac/yakindu
 private void createTimeScalingSection(Composite parent) {
   Section section = kit.createSection(parent, Section.TITLE_BAR);
   section.setText("time scaling");
   Composite client = kit.createComposite(section);
   client.setLayout(new GridLayout(3, false));
   section.setClient(client);
   createClocks(client);
   createScalingControls(client);
 }
コード例 #21
0
  /**
   * Creates the SWT controls for this workbench part.
   *
   * @param parent the parent control
   */
  public void createSection(Composite parent) {
    super.createSection(parent);
    FormToolkit toolkit = getFormToolkit(parent.getDisplay());

    Section section =
        toolkit.createSection(
            parent,
            ExpandableComposite.TWISTIE
                | ExpandableComposite.EXPANDED
                | ExpandableComposite.TITLE_BAR
                | Section.DESCRIPTION
                | ExpandableComposite.FOCUS_TITLE);
    section.setText("Ports");
    section.setDescription("Modify the server ports.");
    section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));

    // ports
    Composite composite = toolkit.createComposite(section);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 8;
    layout.marginWidth = 8;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL));
    // IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
    // whs.setHelp(composite, ContextIds.CONFIGURATION_EDITOR_PORTS);
    toolkit.paintBordersFor(composite);
    section.setClient(composite);

    ports = toolkit.createTable(composite, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
    ports.setHeaderVisible(true);
    ports.setLinesVisible(true);
    // whs.setHelp(ports, ContextIds.CONFIGURATION_EDITOR_PORTS_LIST);

    TableLayout tableLayout = new TableLayout();

    TableColumn col = new TableColumn(ports, SWT.NONE);
    col.setText("Port Name");
    ColumnWeightData colData = new ColumnWeightData(15, 150, true);
    tableLayout.addColumnData(colData);

    col = new TableColumn(ports, SWT.NONE);
    col.setText("Value");
    colData = new ColumnWeightData(8, 80, true);
    tableLayout.addColumnData(colData);

    GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
    data.widthHint = 230;
    data.heightHint = 100;
    ports.setLayoutData(data);
    ports.setLayout(tableLayout);

    viewer = new TableViewer(ports);
    viewer.setColumnProperties(new String[] {"name", "port"});

    initialize();
  }
コード例 #22
0
  public void createClient(Section section, FormToolkit toolkit) {

    section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    section.setLayoutData(data);

    section.setText(PDEUIMessages.IntroSection_sectionText);
    section.setDescription(PDEUIMessages.IntroSection_sectionDescription);

    boolean canCreateNew = TargetPlatformHelper.getTargetVersion() >= NEW_INTRO_SUPPORT_VERSION;

    Composite client = toolkit.createComposite(section);
    client.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, canCreateNew ? 3 : 2));
    client.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Label label = toolkit.createLabel(client, PDEUIMessages.IntroSection_introLabel, SWT.WRAP);
    GridData td = new GridData();
    td.horizontalSpan = canCreateNew ? 3 : 2;
    label.setLayoutData(td);

    Label introLabel = toolkit.createLabel(client, PDEUIMessages.IntroSection_introInput);
    introLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));

    fIntroCombo = new ComboPart();
    fIntroCombo.createControl(client, toolkit, SWT.READ_ONLY);
    td = new GridData(GridData.FILL_HORIZONTAL);
    fIntroCombo.getControl().setLayoutData(td);
    loadManifestAndIntroIds(false);
    if (fAvailableIntroIds != null) fIntroCombo.setItems(fAvailableIntroIds);
    fIntroCombo.add(""); // $NON-NLS-1$
    fIntroCombo.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            handleSelection();
          }
        });

    if (canCreateNew) {
      Button button = toolkit.createButton(client, PDEUIMessages.IntroSection_new, SWT.PUSH);
      button.setEnabled(isEditable());
      button.setLayoutData(new GridData(GridData.FILL));
      button.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
              handleNewIntro();
            }
          });
    }

    fIntroCombo.getControl().setEnabled(isEditable());

    toolkit.paintBordersFor(client);
    section.setClient(client);
    // Register to be notified when the model changes
    getModel().addModelChangedListener(this);
  }
コード例 #23
0
 @Override
 protected void createFormContent(IManagedForm managedForm) {
   FormToolkit toolkit = managedForm.getToolkit();
   ScrolledForm form = UI.formHeader(managedForm, Messages.ContributionTree);
   Composite body = UI.formBody(form, toolkit);
   Composite composite = toolkit.createComposite(body);
   UI.gridLayout(composite, 2);
   FlowImpactSelection selector =
       FlowImpactSelection.on(result, Cache.getEntityCache())
           .withEventHandler(new SelectionHandler())
           .create(composite, toolkit);
   Composite treeContainer = toolkit.createComposite(body);
   UI.gridLayout(treeContainer, 1);
   UI.gridData(treeContainer, true, true);
   createTree(toolkit, treeContainer);
   form.reflow(true);
   for (TreeColumn column : tree.getTree().getColumns()) column.pack();
   selector.selectWithEvent(selection);
 }
コード例 #24
0
  /** {@inheritDoc} */
  @Override
  public void createPartControl(Composite parent, FormToolkit toolkit) {
    main = toolkit.createComposite(parent, SWT.BORDER);
    main.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    GridLayout gl = new GridLayout(8, false);
    main.setLayout(gl);

    toolkit
        .createLabel(main, null)
        .setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_DATABASE));

    totalSql = toolkit.createFormText(main, false);
    totalSql.setToolTipText("Total amount of SQL Statements executed in the invocation");
    totalSql.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

    toolkit
        .createLabel(main, null)
        .setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_TIME));

    totalDuration = toolkit.createFormText(main, false);
    totalDuration.setToolTipText("Duration sum of all SQL Statements executed in the invocation");
    totalDuration.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

    toolkit
        .createLabel(main, null)
        .setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_INVOCATION));

    percentageOfDuration = toolkit.createFormText(main, false);
    percentageOfDuration.setToolTipText(
        "Percentage of the time spent in the invocation on SQL Statements execution");
    percentageOfDuration.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

    toolkit
        .createLabel(main, null)
        .setImage(InspectIT.getDefault().getImage(InspectITImages.IMG_HELP));

    slowestCount = toolkit.createFormText(main, false);
    slowestCount.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    slowestCount.setToolTipText(
        "Amount of slowest SQL Statements that take 80%/20% time of total SQL execution duration");

    // remove left and right margins from the parent
    Layout parentLayout = parent.getLayout();
    if (parentLayout instanceof GridLayout) {
      ((GridLayout) parentLayout).marginWidth = 0;
      ((GridLayout) parentLayout).marginHeight = 0;
    }

    setDefaultText();

    slowestHyperlinkSettings = new HyperlinkSettings(parent.getDisplay());
    slowestHyperlinkSettings.setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_HOVER);
    slowestCount.setHyperlinkSettings(slowestHyperlinkSettings);
    slowestCount.addHyperlinkListener(getHyperlinkAdapter());
  }
コード例 #25
0
ファイル: ContentsForm.java プロジェクト: justinedelson/felix
  @Override
  protected void createFormContent(IManagedForm managedForm) {
    FormToolkit toolkit = managedForm.getToolkit();

    ScrolledForm form = managedForm.getForm();
    form.setText("Contents");

    Composite body = form.getBody();
    TableWrapLayout layout = new TableWrapLayout();
    layout.bottomMargin = 10;
    layout.topMargin = 5;
    layout.leftMargin = 10;
    layout.rightMargin = 10;
    layout.numColumns = 1;
    layout.horizontalSpacing = 10;
    body.setLayout(layout);
    body.setLayoutData(new TableWrapData(TableWrapData.FILL));

    Composite top = toolkit.createComposite(body);
    layout = new TableWrapLayout();
    layout.verticalSpacing = 20;
    top.setLayout(layout);
    TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
    // data.colspan = 2;
    top.setLayoutData(data);

    Composite bottom = toolkit.createComposite(body);
    layout = new TableWrapLayout();
    layout.verticalSpacing = 20;
    bottom.setLayout(layout);
    bottom.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));

    try {
      ClasspathSection classpath = new ClasspathSection(this, top, project);
      managedForm.addPart(classpath);

      ResourceBuildSection runtimeBuild = new ResourceBuildSection(this, bottom, project);
      managedForm.addPart(runtimeBuild);
    } catch (CoreException e) {
      SigilCore.error("Failed to create contents form", e);
    }
  }
コード例 #26
0
  @Override
  protected void createMasterPart(IManagedForm managedForm, Composite parent) {
    FormToolkit toolkit = managedForm.getToolkit();

    Composite container = toolkit.createComposite(parent);
    container.setLayoutData(new GridData(GridData.FILL_BOTH));
    container.setLayout(new GridLayout(1, false));

    compListPart = new ComponentListPart(container, toolkit, Section.TITLE_BAR | Section.EXPANDED);
    managedForm.addPart(compListPart);
  }
コード例 #27
0
 /**
  * Creates a section given the title and description.
  *
  * @param title
  * @param description
  * @return
  */
 private Section createSection(String title, String description) {
   ScrolledForm form = getManagedForm().getForm();
   FormToolkit tk = getManagedForm().getToolkit();
   Section sect = tk.createSection(form.getBody(), Section.TITLE_BAR | Section.DESCRIPTION);
   sect.setText(title);
   sect.setDescription(description);
   Composite comp = tk.createComposite(sect, SWT.BORDER);
   comp.setLayout(new GridLayout(2, false));
   sect.setClient(comp);
   return sect;
 }
  protected void createAttributesControlPanel(Composite container, FormToolkit widgetFactory) {
    Composite result = widgetFactory.createComposite(container, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    result.setLayout(layout);
    addAttributes =
        widgetFactory.createButton(
            result, EntityrelationMessages.PropertiesEditionPart_AddListViewerLabel, SWT.NONE);
    GridData addData = new GridData(GridData.FILL_HORIZONTAL);
    addAttributes.setLayoutData(addData);
    addAttributes.addSelectionListener(
        new SelectionAdapter() {

          /**
           * {@inheritDoc}
           *
           * @see
           *     org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
           */
          public void widgetSelected(SelectionEvent e) {
            addAttributes();
          }
        });
    EditingUtils.setID(
        addAttributes, EntityrelationViewsRepository.Identifier.Properties.attributes);
    EditingUtils.setEEFtype(addAttributes, "eef::ReferencesTable::addbutton"); // $NON-NLS-1$
    removeAttributes =
        widgetFactory.createButton(
            result, EntityrelationMessages.PropertiesEditionPart_RemoveListViewerLabel, SWT.NONE);
    GridData removeData = new GridData(GridData.FILL_HORIZONTAL);
    removeAttributes.setLayoutData(removeData);
    removeAttributes.addSelectionListener(
        new SelectionAdapter() {

          /**
           * {@inheritDoc}
           *
           * @see
           *     org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
           */
          public void widgetSelected(SelectionEvent e) {
            if (attributes.getSelection() instanceof IStructuredSelection) {
              removeAttributes((IStructuredSelection) attributes.getSelection());
            }
          }
        });
    EditingUtils.setID(
        removeAttributes, EntityrelationViewsRepository.Identifier.Properties.attributes);
    EditingUtils.setEEFtype(removeAttributes, "eef::ReferencesTable::removebutton"); // $NON-NLS-1$
    // Start of user code for createAttributesControlPanel

    // End of user code
  }
コード例 #29
0
  @Override
  public void createSection(Composite parent) {
    super.createSection(parent);
    FormToolkit toolkit = getFormToolkit(parent.getDisplay());

    Section section =
        toolkit.createSection(
            parent,
            ExpandableComposite.TWISTIE
                | ExpandableComposite.EXPANDED
                | ExpandableComposite.TITLE_BAR
                | Section.DESCRIPTION
                | ExpandableComposite.FOCUS_TITLE);
    section.setText("Connection");
    section.setDescription("Connection details for this server");
    section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));

    // ports
    Composite composite = toolkit.createComposite(section);

    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight = 8;
    layout.marginWidth = 8;
    composite.setLayout(layout);
    GridData gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
    composite.setLayoutData(gridData);
    toolkit.paintBordersFor(composite);
    section.setClient(composite);

    createLabel(toolkit, composite, "Port");
    portText = createText(toolkit, composite, SWT.SINGLE);

    createLabel(toolkit, composite, "Debug Port");
    debugPortText = createText(toolkit, composite, SWT.SINGLE);

    createLabel(toolkit, composite, "Context path");
    contextPathText = createText(toolkit, composite, SWT.SINGLE);

    // TODO wrong parent
    Label separator = toolkit.createSeparator(parent, SWT.HORIZONTAL);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    separator.setLayoutData(data);

    createLabel(toolkit, composite, "Username");
    usernameText = createText(toolkit, composite, SWT.SINGLE);

    createLabel(toolkit, composite, "Password");
    passwordText = createText(toolkit, composite, SWT.PASSWORD);

    initialize();
  }
コード例 #30
0
  private void createSearchSection(Composite editorComposite, FormToolkit toolkit) {

    Section section =
        toolkit.createSection(
            editorComposite,
            ExpandableComposite.EXPANDED
                | ExpandableComposite.TITLE_BAR
                | ExpandableComposite.TWISTIE);
    section.setText("Search");
    section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    section.addExpansionListener(
        new IExpansionListener() {
          public void expansionStateChanging(ExpansionEvent e) {
            m_sform.reflow(true);
          }

          public void expansionStateChanged(ExpansionEvent e) {
            m_sform.reflow(true);
          }
        });

    Composite sectionClient = toolkit.createComposite(section);
    section.setClient(sectionClient);

    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    sectionClient.setLayout(layout);
    sectionClient.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Label label_freeSearch = toolkit.createLabel(sectionClient, "Query", SWT.NONE);
    label_freeSearch.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
    m_text_freeSearch = toolkit.createText(sectionClient, new String(), SWT.BORDER);
    m_text_freeSearch.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    m_text_freeSearch.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            firePropertyChange(IEditorPart.PROP_DIRTY);
          }
        });

    Label label_state = toolkit.createLabel(sectionClient, "State");
    label_state.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
    m_combo_news_state = new Combo(sectionClient, SWT.DROP_DOWN);
    m_combo_news_state.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    try {
      m_combo_news_state.setItems(FieldDataHelper.getStates());
    } catch (Exception e1) {
      m_combo_news_state.setEnabled(false);
      label_state.setEnabled(false);
    }
  }