Example #1
0
  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;
  }
  private void createSubSection(
      final ChangeDetail changeDetail,
      final PatchSetDetail patchSetDetail,
      final PatchSetPublishDetail publishDetail,
      Section section) {
    int style =
        ExpandableComposite.TWISTIE
            | ExpandableComposite.CLIENT_INDENT
            | ExpandableComposite.LEFT_TEXT_CLIENT_ALIGNMENT;
    if (changeDetail.isCurrentPatchSet(patchSetDetail)) {
      style |= ExpandableComposite.EXPANDED;
    }
    final Section subSection = toolkit.createSection(composite, style);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(subSection);
    subSection.setText(NLS.bind("Patch Set {0}", patchSetDetail.getPatchSet().getId().get()));
    subSection.setTitleBarForeground(toolkit.getColors().getColor(IFormColors.TITLE));

    addTextClient(toolkit, subSection, "", false); // $NON-NLS-1$
    updateTextClient(subSection, patchSetDetail, false);

    if (subSection.isExpanded()) {
      createSubSectionContents(changeDetail, patchSetDetail, publishDetail, subSection);
    }
    subSection.addExpansionListener(
        new ExpansionAdapter() {
          @Override
          public void expansionStateChanged(ExpansionEvent e) {
            if (subSection.getClient() == null) {
              createSubSectionContents(changeDetail, patchSetDetail, publishDetail, subSection);
            }
          }
        });
  }
  private void createUI22SmoothGradient(final Composite parent) {

    /*
     * image: gradient
     */
    _iconGradient = new CLabel(parent, SWT.NONE);
    GridDataFactory.fillDefaults().indent(16, 0).applyTo(_iconGradient);
    _iconGradient.setBackground(_tk.getColors().getBackground());
    _iconGradient.setImage(_imageGradient);

    /*
     * label: smooth gradient
     */
    final Label label =
        _tk.createLabel(parent, Messages.TourChart_Smoothing_Label_GradientSmoothing, SWT.CHECK);
    GridDataFactory.fillDefaults() //
        .align(SWT.FILL, SWT.CENTER)
        .applyTo(label);
    label.setToolTipText(Messages.TourChart_Smoothing_Label_GradientSmoothing_Tooltip);

    /*
     * spinner: gradient tau
     */
    _spinnerGradientTau = new Spinner(parent, SWT.BORDER);
    GridDataFactory.fillDefaults() //
        .align(SWT.BEGINNING, SWT.FILL)
        .applyTo(_spinnerGradientTau);
    _spinnerGradientTau.setDigits(1);
    _spinnerGradientTau.setMinimum(1);
    _spinnerGradientTau.setMaximum(MAX_TAU);
    _spinnerGradientTau.addSelectionListener(_selectionListener);
    _spinnerGradientTau.addMouseWheelListener(_spinnerMouseWheelListener);
  }
 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;
 }
  @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;
  }
Example #6
0
  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;
  }
  @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);

  }
Example #8
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);
  }
 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;
 }
  private void createButtons(Composite parent, FormToolkit toolkit) {
    fEnabledButton =
        toolkit.createButton(
            parent, Messages.DSServiceComponentSection_enabledButtonMessage, SWT.CHECK);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    fEnabledButton.setLayoutData(data);
    fEnabledButton.setEnabled(isEditable());
    fEnabledButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            fModel.getDSComponent().setEnabled(fEnabledButton.getSelection());
          }
        });

    fImmediateButton =
        toolkit.createButton(
            parent, Messages.DSServiceComponentSection_immediateButtonMessage, SWT.CHECK);
    fImmediateButton.setLayoutData(data);
    fImmediateButton.setEnabled(isEditable());
    fImmediateButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            fModel.getDSComponent().setImmediate(fImmediateButton.getSelection());
          }
        });
  }
  private void createUI24SmoothPulse(final Composite parent) {

    /*
     * image: pulse
     */
    _iconPulse = new CLabel(parent, SWT.NONE);
    GridDataFactory.fillDefaults().indent(16, 0).applyTo(_iconPulse);
    _iconPulse.setBackground(_tk.getColors().getBackground());
    _iconPulse.setImage(_imagePulse);

    /*
     * checkbox: smooth speed
     */
    _chkIsPulseSmoothing =
        _tk.createButton(parent, Messages.TourChart_Smoothing_Checkbox_IsPulseSmoothing, SWT.CHECK);
    GridDataFactory.fillDefaults() //
        .align(SWT.FILL, SWT.CENTER)
        .applyTo(_chkIsPulseSmoothing);
    _chkIsPulseSmoothing.addSelectionListener(_selectionListener);
    _chkIsPulseSmoothing.setToolTipText(
        Messages.TourChart_Smoothing_Checkbox_IsPulseSmoothing_Tooltip);

    /*
     * spinner: speed tau
     */
    _spinnerPulseTau = new Spinner(parent, SWT.BORDER);
    GridDataFactory.fillDefaults() //
        .align(SWT.BEGINNING, SWT.FILL)
        .applyTo(_spinnerPulseTau);
    _spinnerPulseTau.setDigits(1);
    _spinnerPulseTau.setMinimum(1);
    _spinnerPulseTau.setMaximum(MAX_TAU);
    _spinnerPulseTau.addSelectionListener(_selectionListener);
    _spinnerPulseTau.addMouseWheelListener(_spinnerMouseWheelListener);
  }
  @Override
  public void createPartControl(Composite parent) {

    FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    m_sform = toolkit.createScrolledForm(parent);
    m_sform.setText("FIAT News Search");
    m_sform.getBody().setLayout(new GridLayout());
    Composite editorComposite = m_sform.getBody();

    GridLayout layout = new GridLayout();
    layout.marginBottom = 10;
    layout.marginTop = 10;
    layout.marginLeft = 10;
    layout.marginRight = 10;
    layout.numColumns = 1;
    layout.makeColumnsEqualWidth = true;
    layout.verticalSpacing = 5;
    layout.horizontalSpacing = 5;
    editorComposite.setLayout(layout);
    editorComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    createContent(editorComposite, toolkit);
    m_sform.reflow(true);
    m_sform.setFocus();

    m_selectionProvider = new FiatNewsSearchViewSelectionProvider();
    getSite().setSelectionProvider(m_selectionProvider);
    m_SparqlQueryHelper = new SparqlQueryHelper();
  }
Example #13
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 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;
  }
  /**
   * Creates the testing area.
   *
   * @param client the client
   * @param toolkit the toolkit
   * @param actionBars the action bars
   */
  private void createTestingArea(
      final Composite client, final FormToolkit toolkit, final IActionBars actionBars) {
    ImageHyperlink imageHyperlink = toolkit.createImageHyperlink(client, SWT.None);
    imageHyperlink.setText("Launch a local component");
    imageHyperlink.setHref(TestingSection.TESTING_HREF_LOCAL_LAUNCH);
    imageHyperlink.addHyperlinkListener(this.getPage());
    imageHyperlink.setImage(ComponentImages.getImage(ComponentImages.RUN_EXEC));

    //		imageHyperlink = toolkit.createImageHyperlink(client, SWT.None);
    //		imageHyperlink.setText("Launch a remote component");
    //		imageHyperlink.setHref(TestingSection.TESTING_HREF);
    //		imageHyperlink.addHyperlinkListener(this.getPage());

    imageHyperlink = toolkit.createImageHyperlink(client, SWT.None);
    imageHyperlink.setText("Launch a local component in debug mode");
    imageHyperlink.setHref(TestingSection.TESTING_HREF_LOCAL_DEBUG);
    imageHyperlink.addHyperlinkListener(this.getPage());
    imageHyperlink.setEnabled(getPage().getEditor().getMainResource().getURI().isPlatform());
    imageHyperlink.setImage(ComponentImages.getImage(ComponentImages.DEBUG_EXEC));

    //		imageHyperlink = toolkit.createImageHyperlink(client, SWT.None);
    //		imageHyperlink.setText("Launch a remote component in debug mode");
    //		imageHyperlink.setHref(TestingSection.TESTING_HREF);
    //		imageHyperlink.addHyperlinkListener(this.getPage());
  }
Example #16
0
  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);
  }
  /**
   * @param parent
   * @return
   */
  public Control createContents(Composite parent) {
    final FormToolkit toolkit = new FormToolkit(parent.getDisplay());
    ScrolledForm sf = toolkit.createScrolledForm(parent);
    Composite comp = sf.getForm().getBody();
    comp.setLayout(new GridLayout(1, true));
    comp.setBackground(parent.getBackground());

    Section brandSection = toolkit.createSection(comp, Section.TITLE_BAR);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    brandSection.setLayoutData(gridData);
    brandSection.setText("Supported Interaction Types");

    Table table = new Table(comp, SWT.BORDER | SWT.FULL_SELECTION | SWT.CHECK | SWT.SINGLE);
    table.setHeaderVisible(true);
    TableLayout layout = new TableLayout();
    layout.addColumnData(new ColumnWeightData(1));
    table.setLayout(layout);
    TableColumn column = new TableColumn(table, SWT.NONE);
    column.setText("Interaction Type");
    column.setWidth(100);
    column.setResizable(true);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.heightHint = 200;
    table.setLayoutData(gd);

    viewer = new CheckboxTableViewer(table);
    viewer.setContentProvider(new InteractionTypeContentProvider());
    InteractionTypeLabelProvider labelProvider = new InteractionTypeLabelProvider();
    viewer.setLabelProvider(labelProvider);
    viewer.setCheckStateProvider(labelProvider);
    viewer.addCheckStateListener(this);
    viewer.setInput(this);

    return comp;
  }
  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;
  }
Example #19
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;
  }
  @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();
  }
Example #21
0
  private void createRelayCheck(Composite parent, Result notReferenced, FormToolkit toolkit) {
    Label l = toolkit.createLabel(parent, "Is Relay Port:", SWT.NONE);
    l.setLayoutData(new GridData(SWT.NONE));

    relayCheck = toolkit.createButton(parent, "", SWT.CHECK);
    relayCheck.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    relayCheck.setSelection(relay);
    relayCheck.setEnabled(notReferenced.isOk());

    RelayValidator validator = new RelayValidator();
    UpdateValueStrategy t2m = new UpdateValueStrategy();
    t2m.setAfterConvertValidator(validator);
    t2m.setBeforeSetValidator(validator);
    UpdateValueStrategy m2t = new UpdateValueStrategy();
    m2t.setAfterConvertValidator(validator);
    m2t.setBeforeSetValidator(validator);

    getBindingContext()
        .bindValue(
            SWTObservables.observeSelection(relayCheck),
            PojoObservables.observeValue(this, "relay"),
            t2m,
            m2t);

    if (notReferenced.isOk()) createDecorator(relayCheck, "");
    else createInfoDecorator(relayCheck, notReferenced.getMsg());
  }
  @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);
  }
 private void createLabel(FormToolkit toolkit, Composite composite, String label) {
   Label portLabel = toolkit.createLabel(composite, label);
   portLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
   GridData data = new GridData(GridData.FILL_HORIZONTAL);
   data.horizontalIndent = 20;
   data.widthHint = 20;
   portLabel.setLayoutData(data);
 }
 public void createPartControl(Composite parent) {
   FormToolkit toolkit = new FormToolkit(parent.getDisplay());
   ScrolledForm form = toolkit.createScrolledForm(parent);
   form.setText("Swimlanes");
   setPartLayout(form);
   createMaster(toolkit, form.getBody());
   createDetails(toolkit, form.getBody());
 }
 private ScrolledForm createPageStructure(Composite parent) {
   FormToolkit toolkit = getFormToolkit(parent);
   ScrolledForm allContent = toolkit.createScrolledForm(parent);
   toolkit.decorateFormHeading(allContent.getForm());
   allContent.setText(Messages.EditorDeployment);
   allContent.getBody().setLayout(new FormLayout());
   return allContent;
 }
  /*
   * (non-Javadoc)
   * @see  it.baeyens.avreclipse.ui.editors.targets.AbstractTargetConfigurationEditorPart#createSectionContent
   * (org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
   */
  @Override
  protected void createSectionContent(Composite parent, FormToolkit toolkit) {
    GridLayout layout = new GridLayout(2, false);
    layout.horizontalSpacing = 12;
    parent.setLayout(layout);

    //
    // The MCU Combo
    //
    toolkit.createLabel(parent, "MCU type:");
    fMCUcombo = new Combo(parent, SWT.READ_ONLY);
    toolkit.adapt(fMCUcombo, true, true);
    fMCUcombo.setLayoutData(new GridData(SWT.FILL, SWT.NONE, false, false));
    fMCUcombo.addSelectionListener(
        new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            String mcuid = AVRMCUidConverter.name2id(fMCUcombo.getText());
            getTargetConfiguration().setMCU(mcuid);
            refreshMessages();
            getManagedForm().dirtyStateChanged();
          }
        });

    //
    // The FCPU Combo
    //
    toolkit.createLabel(parent, "MCU clock frequency:");
    fFCPUcombo = new Combo(parent, SWT.NONE);
    toolkit.adapt(fFCPUcombo, true, true);
    fFCPUcombo.setLayoutData(new GridData(SWT.FILL, SWT.NONE, false, false));
    fFCPUcombo.setTextLimit(9); // max. 999 MHz
    fFCPUcombo.setToolTipText("Target Hardware Clock Frequency in Hz");
    fFCPUcombo.setVisibleItemCount(FCPU_VALUES.length);
    fFCPUcombo.setItems(FCPU_VALUES);

    fFCPUcombo.addModifyListener(
        new ModifyListener() {
          @Override
          public void modifyText(ModifyEvent e) {
            getTargetConfiguration().setFCPU(Integer.parseInt(fFCPUcombo.getText()));
            getManagedForm().dirtyStateChanged();
          }
        });

    // The verify listener to restrict the input to integers
    fFCPUcombo.addVerifyListener(
        new VerifyListener() {
          @Override
          public void verifyText(VerifyEvent event) {
            String text = event.text;
            if (!text.matches("[0-9]*")) {
              event.doit = false;
            }
          }
        });
  }
Example #27
0
 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);
 }
  /**
   * 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());
    }
  }
 /**
  * @param parent
  * @param title
  * @return - Creates a form body section for Naive Bayes Classifier
  */
 private FormToolkit createFormBodySection(Composite parent, String title) {
   // Every interface requires a toolkit(Display) and form to store the components
   FormToolkit toolkit = new FormToolkit(parent.getDisplay());
   form = toolkit.createScrolledForm(parent);
   toolkit.decorateFormHeading(form.getForm());
   form.setText(title);
   GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(true).applyTo(form.getBody());
   return toolkit;
 }
Example #30
0
 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);
 }