示例#1
0
 public void createControl(Composite parent) {
   toolkit = new FormToolkit(parent.getDisplay());
   int borderStyle = toolkit.getBorderStyle() == SWT.BORDER ? SWT.NULL : SWT.BORDER;
   container = new Composite(parent, borderStyle);
   FillLayout flayout = new FillLayout();
   flayout.marginWidth = 1;
   flayout.marginHeight = 1;
   container.setLayout(flayout);
   formText = new ScrolledFormText(container, SWT.V_SCROLL | SWT.H_SCROLL, false);
   if (borderStyle == SWT.NULL) {
     formText.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
     toolkit.paintBordersFor(container);
   }
   FormText ftext = toolkit.createFormText(formText, false);
   formText.setFormText(ftext);
   formText.setExpandHorizontal(true);
   formText.setExpandVertical(true);
   formText.setBackground(toolkit.getColors().getBackground());
   formText.setForeground(toolkit.getColors().getForeground());
   ftext.marginWidth = 2;
   ftext.marginHeight = 2;
   ftext.setHyperlinkSettings(toolkit.getHyperlinkGroup());
   formText.addDisposeListener(
       new DisposeListener() {
         public void widgetDisposed(DisposeEvent e) {
           if (toolkit != null) {
             toolkit.dispose();
             toolkit = null;
           }
         }
       });
   if (text != null) formText.setText(text);
 }
 protected Composite createDescriptionText(FormToolkit widgetFactory, Composite parent) {
   createDescription(
       parent,
       InteractionViewsRepository.InteractionUse.Properties.description,
       InteractionMessages.InteractionUsePropertiesEditionPart_DescriptionLabel);
   description = widgetFactory.createText(parent, ""); // $NON-NLS-1$
   description.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
   widgetFactory.paintBordersFor(parent);
   GridData descriptionData = new GridData(GridData.FILL_HORIZONTAL);
   description.setLayoutData(descriptionData);
   description.addFocusListener(
       new FocusAdapter() {
         /**
          * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
          */
         @Override
         @SuppressWarnings("synthetic-access")
         public void focusLost(FocusEvent e) {
           if (propertiesEditionComponent != null)
             propertiesEditionComponent.firePropertiesChanged(
                 new PropertiesEditionEvent(
                     InteractionUsePropertiesEditionPartForm.this,
                     InteractionViewsRepository.InteractionUse.Properties.description,
                     PropertiesEditionEvent.COMMIT,
                     PropertiesEditionEvent.SET,
                     null,
                     description.getText()));
         }
       });
   description.addKeyListener(
       new KeyAdapter() {
         /** @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) */
         @Override
         @SuppressWarnings("synthetic-access")
         public void keyPressed(KeyEvent e) {
           if (e.character == SWT.CR) {
             if (propertiesEditionComponent != null)
               propertiesEditionComponent.firePropertiesChanged(
                   new PropertiesEditionEvent(
                       InteractionUsePropertiesEditionPartForm.this,
                       InteractionViewsRepository.InteractionUse.Properties.description,
                       PropertiesEditionEvent.COMMIT,
                       PropertiesEditionEvent.SET,
                       null,
                       description.getText()));
           }
         }
       });
   EditingUtils.setID(
       description, InteractionViewsRepository.InteractionUse.Properties.description);
   EditingUtils.setEEFtype(description, "eef::Text"); // $NON-NLS-1$
   FormUtils.createHelpButton(
       widgetFactory,
       parent,
       propertiesEditionComponent.getHelpContent(
           InteractionViewsRepository.InteractionUse.Properties.description,
           InteractionViewsRepository.FORM_KIND),
       null); //$NON-NLS-1$
   return parent;
 }
  @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;
  }
示例#4
0
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);

    composite.setLayout(new FillLayout());

    toolkit = new FormToolkit(composite.getDisplay());
    form = toolkit.createScrolledForm(composite);

    FormColors colors = toolkit.getColors();
    colors.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));

    toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_HOVER);

    //
    //	toolkit.getHyperlinkGroup().setActiveForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
    //		toolkit.getHyperlinkGroup().setForeground(colors.getColor("Categorytitle"));
    toolkit
        .getHyperlinkGroup()
        .setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));

    body = form.getBody();
    GridLayout bodyLayout = new GridLayout();
    bodyLayout.verticalSpacing = 3;
    body.setLayout(bodyLayout);
    //		body.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    toolkit.paintBordersFor(body);

    return composite;
  }
示例#5
0
  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);
  }
  @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);
  }
 protected Composite createValueText(FormToolkit widgetFactory, Composite parent) {
   FormUtils.createPartLabel(
       widgetFactory,
       parent,
       DroidMessages.BooleanVDPropertiesEditionPart_ValueLabel,
       propertiesEditionComponent.isRequired(
           DroidViewsRepository.BooleanVD.Properties.value, DroidViewsRepository.FORM_KIND));
   value = widgetFactory.createText(parent, ""); // $NON-NLS-1$
   value.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
   widgetFactory.paintBordersFor(parent);
   GridData valueData = new GridData(GridData.FILL_HORIZONTAL);
   value.setLayoutData(valueData);
   value.addFocusListener(
       new FocusAdapter() {
         /**
          * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
          */
         @Override
         @SuppressWarnings("synthetic-access")
         public void focusLost(FocusEvent e) {
           if (propertiesEditionComponent != null)
             propertiesEditionComponent.firePropertiesChanged(
                 new PropertiesEditionEvent(
                     BooleanVDPropertiesEditionPartForm.this,
                     DroidViewsRepository.BooleanVD.Properties.value,
                     PropertiesEditionEvent.COMMIT,
                     PropertiesEditionEvent.SET,
                     null,
                     value.getText()));
         }
       });
   value.addKeyListener(
       new KeyAdapter() {
         /** @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent) */
         @Override
         @SuppressWarnings("synthetic-access")
         public void keyPressed(KeyEvent e) {
           if (e.character == SWT.CR) {
             if (propertiesEditionComponent != null)
               propertiesEditionComponent.firePropertiesChanged(
                   new PropertiesEditionEvent(
                       BooleanVDPropertiesEditionPartForm.this,
                       DroidViewsRepository.BooleanVD.Properties.value,
                       PropertiesEditionEvent.COMMIT,
                       PropertiesEditionEvent.SET,
                       null,
                       value.getText()));
           }
         }
       });
   EditingUtils.setID(value, DroidViewsRepository.BooleanVD.Properties.value);
   EditingUtils.setEEFtype(value, "eef::Text"); // $NON-NLS-1$
   FormUtils.createHelpButton(
       widgetFactory,
       parent,
       propertiesEditionComponent.getHelpContent(
           DroidViewsRepository.BooleanVD.Properties.value, DroidViewsRepository.FORM_KIND),
       null); //$NON-NLS-1$
   return parent;
 }
  /**
   * Set the major UI features of this basic view composite
   *
   * @param textEditor
   * @param parentComposite
   * @param styleBit
   */
  public Transition(final XMLEditor textEditor, final Composite parentComposite, int styleBit) {
    super(parentComposite, SWT.BORDER);
    setBackground(SWTResourceManager.getColor(SWT.COLOR_DARK_MAGENTA));
    this.textEditor = textEditor;
    addDisposeListener(
        new DisposeListener() {
          @Override
          public void widgetDisposed(DisposeEvent e) {
            toolkit.dispose();
          }
        });
    toolkit.adapt(this);
    toolkit.paintBordersFor(this);
    setLayout(new FormLayout());
    setLayoutData(new GridData(GridData.FILL_BOTH));

    final ScrolledComposite parentScrolledComposite =
        new ScrolledComposite(this, SWT.BORDER | SWT.V_SCROLL);
    parentScrolledComposite.setAlwaysShowScrollBars(true);
    parentScrolledComposite.setExpandHorizontal(true);
    parentScrolledComposite.setExpandVertical(true);
    FormData parentScrolledCompositeFormLayoutData = new FormData();
    parentScrolledCompositeFormLayoutData.right = new FormAttachment(100);
    parentScrolledCompositeFormLayoutData.bottom = new FormAttachment(100);
    parentScrolledCompositeFormLayoutData.top = new FormAttachment(0, 5);
    parentScrolledCompositeFormLayoutData.left = new FormAttachment(0, 5);
    parentScrolledComposite.setLayoutData(parentScrolledCompositeFormLayoutData);
    this.setData(parentScrolledComposite);

    baseContainer = new Composite(parentScrolledComposite, SWT.NONE);
    baseContainer.setBackground(SWTResourceManager.getColor(204, 153, 255));
    parentScrolledComposite.setContent(baseContainer);

    baseContainer.setLayout(new GridLayout(1, true));
    try {
      CentralUtils centralUtils = CentralUtils.getCentralUtils(textEditor);
      centralUtils.setBasicUI(parentScrolledComposite, baseContainer);
      centralUtils.unmarshal(textEditor);
    } catch (JAXBException e) {
      LOG.info(e.getMessage());
    }

    // create a THumanInteractions object if humanInteractions variable is
    // null
    if (textEditor.getRootElement() == null) {
      humanInteractions = new THumanInteractions();
      textEditor.setRootElement(humanInteractions);
    }
    try {
      // create the biggest xml element- UI section
      humanInteractionsUI =
          new THumanInteractionsUI(
              textEditor, baseContainer, this, SWT.NONE, textEditor.getRootElement(), 0, 0);
    } catch (JAXBException e1) {
      LOG.info(e1.getMessage());
    }
  }
  /**
   * 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();
  }
  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);
  }
示例#11
0
  private void initEquipmentMonitorBlock(Composite container) {
    // groupEquipment
    groupEquipment = UIContext.getInstance().getGroupEquipment(container, SWT.BORDER);
    formToolkit.adapt(groupEquipment);
    formToolkit.paintBordersFor(groupEquipment);

    Composite composite = new Composite(container, SWT.NONE);
    composite.setEnabled(true);
    composite.setLayoutData(BorderLayout.SOUTH);
    formToolkit.adapt(composite);
    formToolkit.paintBordersFor(composite);
    composite.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));

    // load signalMonitorBlock
    initSignalMonitorBlock(composite);

    // load MonitorParaBlock
    initMonitorParaBlock(groupEquipment);
  }
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite comp = (Composite) super.createDialogArea(parent);
    comp.setLayout(new GridLayout(1, false));

    Composite composite = new Composite(comp, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));
    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    formToolkit.adapt(composite);
    formToolkit.paintBordersFor(composite);

    Composite composite_1 = new Composite(composite, SWT.NONE);
    composite_1.setLayout(new GridLayout(1, false));
    composite_1.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, false, 1, 1));
    formToolkit.adapt(composite_1);
    formToolkit.paintBordersFor(composite_1);

    Composite composite_6 = new Composite(composite_1, SWT.NONE);
    composite_6.setLayout(new GridLayout(2, false));
    composite_6.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
    composite_6.setBounds(0, 0, 64, 64);
    formToolkit.adapt(composite_6);
    formToolkit.paintBordersFor(composite_6);

    Label lblNewLabel_project = new Label(composite_6, SWT.NONE);
    lblNewLabel_project.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    formToolkit.adapt(lblNewLabel_project, true, true);
    lblNewLabel_project.setText(Messages.RunSimulatorDialog_PROJECT_NAME);

    this.list = new ComboViewer(composite_6, SWT.READ_ONLY);
    GridData gd_text1 = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_text1.widthHint = 181;
    this.list.getCombo().setLayoutData(gd_text1);
    this.list.setLabelProvider(new ProjectLabelProvider());
    this.list.setContentProvider(new ArrayContentProvider());
    this.list.setInput(projects);
    this.list.getCombo().select(0);
    formToolkit.adapt(list.getCombo(), true, true);

    return parent;
  }
示例#13
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();
  }
  @Override
  protected void createFormContent(IManagedForm managedForm) {
    FormToolkit toolkit = managedForm.getToolkit();
    form = managedForm.getForm();

    Composite body = form.getBody();
    GridLayout gridLayout = new GridLayout(1, true);
    gridLayout.horizontalSpacing = 7;
    body.setLayout(gridLayout);
    toolkit.paintBordersFor(body);

    Composite left = createComposite(toolkit, body);
    createFeaturesSection(toolkit, left);
    toolkit.paintBordersFor(left);

    // Composite right = createComposite(toolkit, body);
    // Section toInstall = createSection(toolkit, right, "To install",
    // ExpandableComposite.TITLE_BAR|ExpandableComposite.TWISTIE|ExpandableComposite.EXPANDED);

    // toolkit.paintBordersFor(right);

    super.createFormContent(managedForm);
  }
示例#15
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);
    }
  }
  @Override
  public final void createContents(Composite parent) {
    // This is a hacked fix to ensure that the label columns on every details
    // page have the same width. SchemaDetails_translatable plus 11 pixels
    // represents the longest label on any field on any details page. This
    // occurs on SchemaStringAttributeDetails and 11 is the size of the
    // horizontal indent that contributes to the label's width.
    GC gc = new GC(parent);
    minLabelWeight = gc.textExtent(PDEUIMessages.SchemaDetails_translatable).x + 11;
    gc.dispose();
    gc = null;

    parent.setLayout(FormLayoutFactory.createDetailsGridLayout(false, 1));
    FormToolkit toolkit = getManagedForm().getToolkit();
    fSection = toolkit.createSection(parent, Section.DESCRIPTION | ExpandableComposite.TITLE_BAR);
    fSection.clientVerticalSpacing = FormLayoutFactory.SECTION_HEADER_VERTICAL_SPACING;
    fSection.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));

    GridData gd;
    if (fShowDescription) gd = new GridData(GridData.FILL_BOTH);
    else gd = new GridData(GridData.FILL_HORIZONTAL);
    fSection.setLayoutData(gd);

    // Align the master and details section headers (misalignment caused
    // by section toolbar icons)
    getPage().alignSectionHeaders(fElementSection.getSection(), fSection);

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

    createDetails(client);

    if (fShowDescription) createDescription(client, toolkit);

    // If the DTD Approximation section was requested, instantiate it and create it's contents
    // on the same parent Composite
    if (fShowDTD) {
      fDtdSection = new SchemaDtdDetailsSection();
      fDtdSection.initialize(getManagedForm());
      fDtdSection.createContents(parent);
    }

    toolkit.paintBordersFor(client);
    fSection.setClient(client);
    markDetailsPart(fSection);

    if (fShowDescription) fDescriptionViewer.createUIListeners();
    hookListeners();
  }
示例#17
0
  private void initBaseSitTreeBlock(Composite container) {
    // BaseSiteTreeGroup
    groupBaseSite = new Group(container, SWT.BORDER);
    groupBaseSite.setText("基站名称");
    groupBaseSite.setLayoutData(BorderLayout.WEST);
    formToolkit.adapt(groupBaseSite);
    formToolkit.paintBordersFor(groupBaseSite);

    // BaseSiteTree
    treeBaseSite = new Tree(groupBaseSite, SWT.NONE);
    treeBaseSite.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {

            System.out.println(e.item.toString());
            TreeItem etim = (TreeItem) e.item;
            setBaseID(etim.getText());
          }
        });
    contextService.LoadBaseSiteTree(treeBaseSite);
    treeBaseSite.setBounds(10, 20, 200, 650);
    formToolkit.paintBordersFor(treeBaseSite);
  }
示例#18
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);
  }
  @Override
  protected void createClient(Section section, FormToolkit toolkit) {

    initializeAttributes();

    section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    section.setLayoutData(data);
    section.setText(Messages.DSOptionsSection_title);
    section.setDescription(Messages.DSOptionsSection_description);

    Composite client = toolkit.createComposite(section);
    client.setLayout(new GridLayout(3, false));
    client.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // Attribute: factory
    fFactoryEntry =
        new FormEntry(client, toolkit, Messages.DSComponentDetails_factoryEntry, SWT.NONE);

    // Attribute: configuration policy
    Label label =
        toolkit.createLabel(client, Messages.DSComponentDetails_configurationPolicy, SWT.WRAP);
    label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
    fConfigurationPolicy = new ComboPart();
    fConfigurationPolicy.createControl(client, toolkit, SWT.READ_ONLY);

    String[] items =
        new String[] {
          "", //$NON-NLS-1$
          IDSConstants.VALUE_CONFIGURATION_POLICY_OPTIONAL,
          IDSConstants.VALUE_CONFIGURATION_POLICY_REQUIRE,
          IDSConstants.VALUE_CONFIGURATION_POLICY_IGNORE
        };
    fConfigurationPolicy.setItems(items);
    GridDataFactory.fillDefaults()
        .grab(true, false)
        .indent(3, 0)
        .applyTo(fConfigurationPolicy.getControl());

    createButtons(client, toolkit);

    setListeners();
    updateUIFields();

    toolkit.paintBordersFor(client);
    section.setClient(client);
  }
示例#20
0
    @Override
    protected Control createDialogArea(Composite parent) {

      getShell().setText("Betroffene Bahn(en) bearbeiten");

      Composite container = (Composite) super.createDialogArea(parent);
      container.setLayout(new FillLayout(SWT.HORIZONTAL));

      parentForm = formToolkit.createForm(container);
      formToolkit.paintBordersFor(parentForm);
      formToolkit.decorateFormHeading(parentForm);
      parentForm.setText("Betroffene Bahn(en) bearbeiten");

      parentForm.getBody().setLayout(new GridLayout(1, true));

      for (Integer i = 1; i <= 6; i++) {

        final Button trackButton =
            formToolkit.createButton(parentForm.getBody(), "Bahn 1", SWT.CHECK);
        trackButton.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
        trackButton.setText("Bahn " + i.toString());

        if (bandAction.getTrack().contains(i)) trackButton.setSelection(true);

        trackButton.setData(TRACK_KEY, i);

        trackButton.addSelectionListener(
            new SelectionAdapter() {
              @Override
              public void widgetSelected(SelectionEvent e) {
                if (((Button) e.widget).getSelection()) {
                  bandAction.getTrack().add((Integer) e.widget.getData(TRACK_KEY));
                } else {
                  bandAction.getTrack().remove((Integer) e.widget.getData(TRACK_KEY));
                }
              }
            });

        if (i == 2 || i == 4) {
          Label seperator =
              formToolkit.createLabel(parentForm.getBody(), "", SWT.SEPARATOR | SWT.HORIZONTAL);
          seperator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        }
      }
      return container;
    }
示例#21
0
  private void createFilesAddedView(FormToolkit toolkit, Composite parent) {
    Section section = toolkit.createSection(parent, Section.TITLE_BAR | Section.DESCRIPTION);
    section.setText("Files selected");
    section.setDescription("Double click to remove from current project");

    Composite client = toolkit.createComposite(section, SWT.WRAP);

    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.marginWidth = 2;
    layout.marginHeight = 2;

    client.setLayout(layout);

    Table t = toolkit.createTable(client, SWT.NULL);

    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 20;
    gd.widthHint = 200;

    t.setLayoutData(gd);
    toolkit.paintBordersFor(client);

    section.setClient(client);

    table = new TableViewer(t);
    ArrayContentProvider tmp = new ArrayContentProvider();
    table.setContentProvider(tmp);

    TableViewerColumn viewerColumn = new TableViewerColumn(table, SWT.LEFT);
    viewerColumn.getColumn().setWidth(300);
    viewerColumn.setLabelProvider(
        new ColumnLabelProvider() {
          @Override
          public String getText(Object element) {
            return element.toString();
          };

          public Image getImage(Object element) {
            return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE);
          };
        });

    hookContextMenu2();
    hookDoubleClickAction2();
  }
  /* (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.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
    GridData sectionData = new GridData(GridData.FILL_BOTH);
    sectionData.verticalSpan = 2;
    section.setLayoutData(sectionData);

    Composite container = createClientContainer(section, 2, toolkit);
    createViewerPartControl(container, SWT.MULTI, 2, toolkit);
    container.setLayoutData(new GridData(GridData.FILL_BOTH));

    createOptionalDependenciesButton(container);

    TablePart tablePart = getTablePart();
    fPluginTable = tablePart.getTableViewer();
    fPluginTable.setContentProvider(new ContentProvider());
    fPluginTable.setLabelProvider(PDEPlugin.getDefault().getLabelProvider());
    fPluginTable.setComparator(
        new ViewerComparator() {
          public int compare(Viewer viewer, Object e1, Object e2) {
            IProductPlugin p1 = (IProductPlugin) e1;
            IProductPlugin p2 = (IProductPlugin) e2;
            return super.compare(viewer, p1.getId(), p2.getId());
          }
        });
    GridData data = (GridData) tablePart.getControl().getLayoutData();
    data.minimumWidth = 200;
    fPluginTable.setInput(getProduct());

    tablePart.setButtonEnabled(0, isEditable());
    tablePart.setButtonEnabled(1, isEditable());
    tablePart.setButtonEnabled(2, isEditable());

    // remove buttons will be updated on refresh

    tablePart.setButtonEnabled(5, isEditable());

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

    section.setText(PDEUIMessages.Product_PluginSection_title);
    section.setDescription(PDEUIMessages.Product_PluginSection_desc);
    getModel().addModelChangedListener(this);
    createSectionToolbar(section, toolkit);
  }
  /** {@inheritDoc} */
  @Override
  protected void createClient(final Section section, final FormToolkit toolkit) {
    section.setText("General Information");
    section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1));
    final TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
    section.setLayoutData(data);

    section.setDescription("This section describes general information about this node.");

    final IActionBars actionBars = getPage().getEditor().getEditorSite().getActionBars();
    this.client = new GeneralInformationComposite(section, SWT.None, toolkit, actionBars);
    section.setClient(this.client);

    addListeners(actionBars);

    toolkit.adapt(this.client);
    toolkit.paintBordersFor(this.client);
  }
示例#24
0
  /**
   * Create contents of the form.
   *
   * @param managedForm
   */
  @Override
  protected void createFormContent(IManagedForm managedForm) {
    FormToolkit toolkit = managedForm.getToolkit();
    ScrolledForm form = managedForm.getForm();
    form.setText("Empty FormPage");
    Composite body = form.getBody();
    toolkit.decorateFormHeading(form.getForm());
    toolkit.paintBordersFor(body);
    managedForm.getForm().getBody().setLayout(new GridLayout(1, false));

    display = Display.getCurrent();
    shell = display.getActiveShell();

    createButtonPanel(body).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    createScrollingPreview(body).setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    updateJob();
  }
  /** {@inheritDoc} */
  @Override
  protected void createClient(final Section section, final FormToolkit toolkit) {
    // There seems to be a bug that cuts off last letter. Even eclipse editors
    // say "Testin". Intentionally misspelling so testing section says "Testing"
    section.setText("Testing \t"); // append space and tab to workaround Eclipse Bug 408509
    section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1));
    final TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB);
    section.setLayoutData(data);

    section.setDescription("Test the component by:");
    final Composite client = toolkit.createComposite(section);
    client.setLayout(FormLayoutFactory.createClearTableWrapLayout(true, 1));
    section.setClient(client);

    final IActionBars actionBars = getPage().getEditor().getEditorSite().getActionBars();

    createTestingArea(client, toolkit, actionBars);

    toolkit.paintBordersFor(client);
  }
示例#26
0
  /**
   * Creates the master part of the master-details block.
   *
   * @param managedForm managed for for toolkit reference
   * @param parent composite parent for the part; we put a new composite on it
   */
  protected void createMasterPart(final IManagedForm managedForm, Composite parent) {
    // final ScrolledForm form = managedForm.getForm();
    FormToolkit toolkit = managedForm.getToolkit();
    Section section = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
    section.setText("Contributed Examples");
    section.setDescription("Select a category or example for details");
    section.marginWidth = 10;
    section.marginHeight = 5;
    toolkit.createCompositeSeparator(section);

    Composite client = toolkit.createComposite(section, SWT.WRAP);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    client.setLayout(layout);
    Tree t = toolkit.createTree(client, SWT.NULL);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 300;
    gd.widthHint = 200;
    t.setLayoutData(gd);
    toolkit.paintBordersFor(client);
    section.setClient(client);

    final SectionPart spart = new SectionPart(section);
    managedForm.addPart(spart);

    TreeViewer viewer = new TreeViewer(t);
    viewer.addSelectionChangedListener(
        new ISelectionChangedListener() {
          public void selectionChanged(SelectionChangedEvent event) {
            managedForm.fireSelectionChanged(spart, event.getSelection());
            wizardPage.setSelectedNode(event.getSelection());
          }
        });

    viewer.setContentProvider(new MasterContentProvider());
    viewer.setLabelProvider(new MasterLabelProvider());
    viewer.setInput(ec);
    viewer.expandAll();
  }
  @Override
  protected void createClient(Section section, FormToolkit toolkit) {
    section.setText(PDEUIMessages.ExportPackageSection_title);
    if (isFragment()) section.setDescription(PDEUIMessages.ExportPackageSection_descFragment);
    else section.setDescription(PDEUIMessages.ExportPackageSection_desc);

    Composite container = createClientContainer(section, 2, toolkit);
    createViewerPartControl(container, SWT.MULTI, 2, toolkit);
    TablePart tablePart = getTablePart();
    fPackageViewer = tablePart.getTableViewer();
    fPackageViewer.setContentProvider(new ExportPackageContentProvider());
    fPackageViewer.setLabelProvider(PDEPlugin.getDefault().getLabelProvider());
    fPackageViewer.setComparator(
        new ViewerComparator() {
          @Override
          public int compare(Viewer viewer, Object e1, Object e2) {
            String s1 = e1.toString();
            String s2 = e2.toString();
            if (s1.indexOf(" ") != -1) // $NON-NLS-1$
            s1 = s1.substring(0, s1.indexOf(" ")); // $NON-NLS-1$
            if (s2.indexOf(" ") != -1) // $NON-NLS-1$
            s2 = s2.substring(0, s2.indexOf(" ")); // $NON-NLS-1$
            return super.compare(viewer, s1, s2);
          }
        });
    toolkit.paintBordersFor(container);
    section.setClient(container);
    GridData gd = new GridData(GridData.FILL_BOTH);
    if (((ManifestEditor) getPage().getEditor()).isEquinox()) {
      gd.verticalSpan = 2;
      gd.minimumWidth = 300;
    }
    section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
    section.setLayoutData(gd);
    makeActions();

    IBundleModel model = getBundleModel();
    fPackageViewer.setInput(model);
    model.addModelChangedListener(this);
    updateButtons();
  }
  /**
   * Create contents of the form.
   *
   * @param managedForm
   */
  @Override
  protected void createFormContent(IManagedForm managedForm) {
    FormToolkit toolkit = managedForm.getToolkit();
    ScrolledForm form = managedForm.getForm();
    form.setText(AdapterFactoryUtil.getInstance().getLabelProvider().getText(object));
    Composite body = form.getBody();
    toolkit.decorateFormHeading(form.getForm());
    toolkit.paintBordersFor(body);
    managedForm.getForm().getBody().setLayout(new GridLayout(1, false));

    BeschreibbarWidget beschreibbarWidget =
        new BeschreibbarWidget(managedForm.getForm().getBody(), SWT.NONE, object, toolkit);
    GridData gd_beschreibbarWidget = new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1);
    gd_beschreibbarWidget.widthHint = 0;
    gd_beschreibbarWidget.heightHint = 0;
    beschreibbarWidget.setLayoutData(gd_beschreibbarWidget);
    managedForm.getToolkit().adapt(beschreibbarWidget);
    managedForm.getToolkit().paintBordersFor(beschreibbarWidget);

    m_bindingContext = initDataBindings();
  }
  @Override
  protected void createDescriptionLayout(Composite composite) {
    FormToolkit toolkit = this.getManagedForm().getToolkit();
    Section section = toolkit.createSection(composite, ExpandableComposite.TITLE_BAR);
    section.setText(getSectionLabel(SECTION_NAME.DESCRIPTION_SECTION));
    section.setExpanded(true);
    section.setLayout(new GridLayout());
    section.setLayoutData(new GridData(GridData.FILL_BOTH));

    Composite descriptionComposite = toolkit.createComposite(section);
    GridLayout descriptionLayout = new GridLayout();

    descriptionComposite.setLayout(descriptionLayout);
    GridData descriptionData = new GridData(GridData.FILL_BOTH);
    descriptionData.grabExcessVerticalSpace = true;
    descriptionComposite.setLayoutData(descriptionData);
    section.setClient(descriptionComposite);

    descriptionTextViewer =
        addTextEditor(
            repository,
            descriptionComposite,
            taskData.getDescription(),
            true,
            SWT.FLAT | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
    descriptionTextViewer.setEditable(true);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.widthHint = DESCRIPTION_WIDTH;
    gd.minimumHeight = DESCRIPTION_HEIGHT;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    descriptionTextViewer.getControl().setLayoutData(gd);
    descriptionTextViewer
        .getControl()
        .setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);

    addDuplicateDetection(descriptionComposite);

    toolkit.paintBordersFor(descriptionComposite);
  }
 private void createUI() {
   // Create the container
   Composite container = createUISectionContainer(fSection);
   // Create the template field label
   createUILabelType(container);
   // Create the template field
   createUIFieldTemplateCombo(container);
   // Create the template field decoration
   createUIFieldDecorationTemplate();
   // Create the progress field label
   createUILabelProgress(container);
   // Create the progress bar fields
   createProgressBarConfig(container);
   // Create the message bar fields
   createProgressMessageConfig(container);
   // Paint the borders for the container
   fToolkit.paintBordersFor(container);
   // Set the container as the section client
   fSection.setClient(container);
   // Register to be notified when the model changes
   getModel().addModelChangedListener(this);
 }