Esempio n. 1
0
  /* (non-Javadoc)
   * @see org.eclipse.pde.internal.ui.editor.PDESection#createClient(org.eclipse.ui.forms.widgets.Section, org.eclipse.ui.forms.widgets.FormToolkit)
   */
  protected void createClient(Section section, FormToolkit toolkit) {
    section.setText(PDEUIMessages.GeneralInfoSection_title);
    section.setDescription(PDEUIMessages.GeneralInfoSection_desc);
    section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1));
    TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
    data.colspan = 2;
    section.setLayoutData(data);

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

    IActionBars actionBars = getPage().getPDEEditor().getEditorSite().getActionBars();

    // general section
    createIdEntry(client, toolkit, actionBars);
    createVersionEntry(client, toolkit, actionBars);
    createNameEntry(client, toolkit, actionBars);
    createLaunchersOption(client, toolkit);

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

    getModel().addModelChangedListener(this);
  }
  public void createClient(Section section, FormToolkit toolkit) {

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

    Composite container = toolkit.createComposite(section);
    container.setLayout(FormLayoutFactory.createSectionClientTableWrapLayout(false, 2));

    fNameText =
        new FormEntry(
            container,
            toolkit,
            MDEUIMessages.SiteEditor_IncludedFeaturesDetailsSection_featureLabel,
            null,
            false);
    fNameText.setFormEntryListener(
        new FormEntryAdapter(this) {
          public void textValueChanged(FormEntry text) {
            if (fInput != null)
              try {
                fInput.setName(text.getValue());
              } catch (CoreException e) {
                MDEPlugin.logException(e);
              }
          }
        });
    fNameText.setEditable(isEditable());

    fVersionText =
        new FormEntry(
            container, toolkit, MDEUIMessages.FeatureEditor_SpecSection_version, null, false);
    fVersionText.setFormEntryListener(
        new FormEntryAdapter(this) {
          public void textValueChanged(FormEntry text) {
            if (fInput != null)
              try {
                fInput.setVersion(text.getValue());
              } catch (CoreException e) {
                MDEPlugin.logException(e);
              }
          }
        });
    fVersionText.setEditable(isEditable());

    fOptionalButton =
        toolkit.createButton(
            container, MDEUIMessages.SiteEditor_IncludedFeaturesDetailsSection_optional, SWT.CHECK);

    TableWrapData gd = new TableWrapData(TableWrapData.FILL);
    gd.colspan = 2;
    fOptionalButton.setLayoutData(gd);
    fOptionalButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            if (!fBlockNotification) {
              try {
                fInput.setOptional(fOptionalButton.getSelection());
              } catch (CoreException ce) {
              }
            }
          }
        });
    Label fSearchLocationDescLabel =
        toolkit.createLabel(
            container,
            MDEUIMessages.SiteEditor_IncludedFeaturesDetailsSection_searchLocation,
            SWT.WRAP);
    gd = new TableWrapData(TableWrapData.FILL);
    gd.colspan = 2;
    fSearchLocationDescLabel.setLayoutData(gd);

    fSearchRootButton =
        toolkit.createButton(
            container, MDEUIMessages.SiteEditor_IncludedFeaturesDetailsSection_root, SWT.RADIO);
    fSearchRootButton.setSelection(true);
    gd = new TableWrapData(TableWrapData.FILL);
    gd.colspan = 2;
    gd.indent = 5;
    fSearchRootButton.setLayoutData(gd);
    fSearchRootButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            if (!fBlockNotification) {
              try {
                if (fSearchRootButton.getSelection()) fInput.setSearchLocation(IFeatureChild.ROOT);
              } catch (CoreException ce) {
              }
            }
          }
        });

    fSearchSelfButton =
        toolkit.createButton(
            container, MDEUIMessages.SiteEditor_IncludedFeaturesDetailsSection_self, SWT.RADIO);
    fSearchSelfButton.setSelection(true);
    gd = new TableWrapData(TableWrapData.FILL);
    gd.colspan = 2;
    gd.indent = 5;
    fSearchSelfButton.setLayoutData(gd);
    fSearchSelfButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            if (!fBlockNotification) {
              try {
                if (fSearchSelfButton.getSelection()) fInput.setSearchLocation(IFeatureChild.SELF);
              } catch (CoreException ce) {
              }
            }
          }
        });

    fSearchBothButton =
        toolkit.createButton(
            container, MDEUIMessages.SiteEditor_IncludedFeaturesDetailsSection_both, SWT.RADIO);
    fSearchBothButton.setSelection(true);
    gd = new TableWrapData(TableWrapData.FILL);
    gd.colspan = 2;
    gd.indent = 5;
    fSearchBothButton.setLayoutData(gd);
    fSearchBothButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            if (!fBlockNotification) {
              try {
                if (fSearchBothButton.getSelection()) fInput.setSearchLocation(IFeatureChild.BOTH);
              } catch (CoreException ce) {
              }
            }
          }
        });

    toolkit.paintBordersFor(container);
    section.setClient(container);
  }