Package org.eclipse.ui.forms.widgets

Examples of org.eclipse.ui.forms.widgets.ExpandableComposite


        deleteCommonUri
            .setEnabled(commonUriText.getText().length() > 0);
      }
    });

    ExpandableComposite pushUriArea = new ExpandableComposite(main,
        ExpandableComposite.TREE_NODE
            | ExpandableComposite.CLIENT_INDENT);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(pushUriArea);
    pushUriArea.setExpanded(!config.getPushURIs().isEmpty());
    pushUriArea.addExpansionListener(new ExpansionAdapter() {

      public void expansionStateChanged(ExpansionEvent e) {
        main.layout(true, true);
        main.getShell().pack();
      }
    });
    pushUriArea.setText(UIText.SimpleConfigurePushDialog_PushUrisLabel);
    final Composite pushUriDetails = new Composite(pushUriArea, SWT.NONE);
    pushUriArea.setClient(pushUriDetails);
    pushUriDetails.setLayout(new GridLayout(2, false));
    GridDataFactory.fillDefaults().grab(true, true).applyTo(pushUriDetails);
    uriViewer = new TableViewer(pushUriDetails, SWT.BORDER | SWT.MULTI);
    GridDataFactory.fillDefaults().grab(true, true)
        .minSize(SWT.DEFAULT, 30).applyTo(uriViewer.getTable());
View Full Code Here


  }

  private void createAdvancedSection(final Composite composite) {
    if (commitId != null)
      return;
    ExpandableComposite advanced = new ExpandableComposite(composite,
        ExpandableComposite.TREE_NODE
            | ExpandableComposite.CLIENT_INDENT);

    advanced.setText(UIText.CreateTagDialog_advanced);
    advanced.setToolTipText(UIText.CreateTagDialog_advancedToolTip);
    advanced.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
        .create());

    Composite advancedComposite = new Composite(advanced, SWT.WRAP);
    advancedComposite.setLayout(GridLayoutFactory.swtDefaults().create());
    advancedComposite.setLayoutData(GridDataFactory.fillDefaults()
        .grab(true, true).create());

    Label advancedLabel = new Label(advancedComposite, SWT.WRAP);
    advancedLabel.setText(UIText.CreateTagDialog_advancedMessage);
    advancedLabel.setLayoutData(GridDataFactory.fillDefaults()
        .grab(true, false).create());

    commitCombo = new CommitCombo(advancedComposite, SWT.NORMAL);
    commitCombo.setLayoutData(GridDataFactory.fillDefaults()
        .grab(true, false).hint(300, SWT.DEFAULT).create());

    advanced.setClient(advancedComposite);
    advanced.addExpansionListener(new ExpansionAdapter() {
      public void expansionStateChanged(ExpansionEvent e) {
        // fill the Combo lazily to improve UI responsiveness
        if (((Boolean) e.data).booleanValue()
            && commitCombo.getItemCount() == 0) {
          final Collection<RevCommit> commits = new ArrayList<RevCommit>();
View Full Code Here

  public void selectOption(Key key) {
    Control control = findControl(key);
    if (control != null) {
      if (!fExpandedComposites.isEmpty()) {
        ExpandableComposite expandable = getParentExpandableComposite(control);
        if (expandable != null) {
          for (int i = 0; i < fExpandedComposites.size(); i++) {
            ExpandableComposite curr = (ExpandableComposite) fExpandedComposites
                .get(i);
            curr.setExpanded(curr == expandable);
          }
          expandedStateChanged(expandable);
        }
      }
      control.setFocus();
View Full Code Here

    }
  }

  protected ExpandableComposite createStyleSection(Composite parent,
      String label, int nColumns) {
    ExpandableComposite excomposite = new ExpandableComposite(parent,
        SWT.NONE, ExpandableComposite.TWISTIE
            | ExpandableComposite.CLIENT_INDENT);
    excomposite.setText(label);
    excomposite.setExpanded(false);
    excomposite.setFont(JFaceResources.getFontRegistry().getBold(
        JFaceResources.DIALOG_FONT));
    excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL,
        true, false, nColumns, 1));
    excomposite.addExpansionListener(new ExpansionAdapter() {
      public void expansionStateChanged(ExpansionEvent e) {
        expandedStateChanged((ExpandableComposite) e.getSource());
      }
    });
    fExpandedComposites.add(excomposite);
View Full Code Here

    }
  }

  protected void restoreSectionExpansionStates(IDialogSettings settings) {
    for (int i = 0; i < fExpandedComposites.size(); i++) {
      ExpandableComposite excomposite = (ExpandableComposite) fExpandedComposites
          .get(i);
      if (settings == null) {
        excomposite.setExpanded(i == 0); // only expand the first node
        // by default
      } else {
        excomposite.setExpanded(settings.getBoolean(SETTINGS_EXPANDED
            + String.valueOf(i)));
      }
    }
  }
View Full Code Here

    }
  }

  protected void storeSectionExpansionStates(IDialogSettings settings) {
    for (int i = 0; i < fExpandedComposites.size(); i++) {
      ExpandableComposite curr = (ExpandableComposite) fExpandedComposites
          .get(i);
      settings.put(SETTINGS_EXPANDED + String.valueOf(i),
          curr.isExpanded());
    }
  }
View Full Code Here

        ToolItem btnCreateFilter;
       
        GridLayout gridLayout;
        ComboViewer labelViewer;
       
        ExpandableComposite expandableComposite;
        Composite composite_1;
        FormText receiversText;
        parent.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
        parent.setLayout(new GridLayout());
       
        composite = this.toolkit.createComposite(parent, SWT.NONE);
        composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
        composite.setBackgroundMode(SWT.INHERIT_FORCE);
        gridLayout = new GridLayout();
        gridLayout.numColumns = 5;
        composite.setLayout(gridLayout);
        this.toolkit.paintBordersFor(composite);
       
        toolBar = new ToolBar(composite, SWT.FLAT);
        toolBar.setBackgroundMode(SWT.INHERIT_FORCE);
        gridData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
        gridData.horizontalIndent = 5;
        toolBar.setLayoutData(gridData);
        this.toolkit.adapt(toolBar, true, true);
       
        btnReply = new ToolItem(toolBar, SWT.PUSH);
        btnReply.setImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/reply_small.png"));
        btnReply.setToolTipText(MessageEditorMessages.getString("MessageEditor.btnReply.toolTipText")); //$NON-NLS-1$
       
        btnReplyAll = new ToolItem(toolBar, SWT.PUSH);
        btnReplyAll.setImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/reply_all_small.png"));
        btnReplyAll.setToolTipText(MessageEditorMessages.getString("MessageEditor.btnReplyAll.toolTipText")); //$NON-NLS-1$
       
        btnForward = new ToolItem(toolBar, SWT.PUSH);
        btnForward.setImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/forward_small.png"));
        btnForward.setToolTipText(MessageEditorMessages.getString("MessageEditor.btnForward.toolTipText")); //$NON-NLS-1$
       
        new ToolItem(toolBar, SWT.SEPARATOR);
       
        btnDelete = new ToolItem(toolBar, SWT.PUSH);
        btnDelete.setImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/delete_small.png"));
        btnDelete.setToolTipText(MessageEditorMessages.getString("MessageEditor.btnDelete.toolTipText")); //$NON-NLS-1$
       
        btnSpam = new ToolItem(toolBar, SWT.CHECK);
        btnSpam.setHotImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/virus-detected.png"));
        btnSpam.setImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/virus-detected-2.png"));
        btnSpam.setToolTipText(MessageEditorMessages.getString("MessageEditor.btnSpam.toolTipText")); //$NON-NLS-1$
       
        new ToolItem(toolBar, SWT.SEPARATOR);
       
        btnCreateFilter = new ToolItem(toolBar, SWT.PUSH);
        btnCreateFilter.setImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/kview.png"));
        btnCreateFilter.setToolTipText(MessageEditorMessages.getString("MessageEditor.btnCreateFilter.toolTipText")); //$NON-NLS-1$
       
        this.toolkit.createLabel(composite, MessageEditorMessages.getString("MessageEditor.label.text"), SWT.NONE); //$NON-NLS-1$
       
        labelViewer = new ComboViewer(composite, SWT.READ_ONLY);
        labelViewer.setLabelProvider(new ListLabelProvider());
        labelViewer.setContentProvider(new ContentProvider_1());
        labelViewer.setInput(new Object());
        this.combo = labelViewer.getCombo();
        this.toolkit.adapt(this.combo, true, true);
        this.combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
        new Label(composite, SWT.NONE);
        expandableComposite = this.toolkit.createExpandableComposite(composite, ExpandableComposite.COMPACT
                                                                                | ExpandableComposite.TWISTIE
                                                                                | ExpandableComposite.NO_TITLE
                                                                                | ExpandableComposite.FOCUS_TITLE);
        gridData = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
        gridData.widthHint = 295;
        expandableComposite.setLayoutData(gridData);
        expandableComposite.setText("Empf�nger");
        this.toolkit.paintBordersFor(expandableComposite);
        composite_1 = this.toolkit.createComposite(expandableComposite, SWT.NONE);
        this.toolkit.paintBordersFor(composite_1);
        expandableComposite.setClient(composite_1);
        receiversText = this.toolkit.createFormText(composite_1, false);
       
        this.lnkTo = this.toolkit.createImageHyperlink(receiversText, SWT.NONE);
        this.lnkTo.setBounds(0, 0, 130, 24);
        this.lnkTo.setImage(SWTResourceManager.getImage(MessageEditor.class, "/icons/abcard-item.png"));
View Full Code Here

    ih.setText("Image link with no image");
    ih = toolkit.createImageHyperlink(form.getBody(), SWT.NULL);
    ih.setImage(ExamplesPlugin.getDefault().getImageRegistry().get(ExamplesPlugin.IMG_SAMPLE));
    ih.setText("Link with image and text");
   
    ExpandableComposite ec = toolkit.createExpandableComposite(form.getBody(), ExpandableComposite.TREE_NODE|ExpandableComposite.CLIENT_INDENT);
    ImageHyperlink eci = toolkit.createImageHyperlink(ec, SWT.NULL);
    eci.setImage(ExamplesPlugin.getDefault().getImageRegistry().get(ExamplesPlugin.IMG_SAMPLE));
    ec.setTextClient(eci);
    ec.setText("Expandable Composite title");
    String ctext = "We will now create a somewhat long text so that "+
    "we can use it as content for the expandable composite. "+
    "Expandable composite is used to hide or show the text using the "+
    "toggle control";
    Label client = toolkit.createLabel(ec, ctext, SWT.WRAP);
    ec.setClient(client);
    td = new TableWrapData();
    td.colspan = 2;
    ec.setLayoutData(td);
    ec.addExpansionListener(new ExpansionAdapter() {
      public void expansionStateChanged(ExpansionEvent e) {
        form.reflow(true);
      }
    });
    Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TWISTIE|Section.EXPANDED);
View Full Code Here

   * @return a new ExpandibleComposite widget
   * @since 3.6
   */
  public static ExpandableComposite createExpandibleComposite(Composite parent, int style, String label, int hspan,
      int fill) {
    ExpandableComposite ex = new ExpandableComposite(parent, SWT.NONE, style);
    ex.setText(label);
    ex.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    GridData gd = new GridData(fill);
    gd.horizontalSpan = hspan;
    ex.setLayoutData(gd);
    return ex;
  }
View Full Code Here

    createButtons(PROPERTY, sectionComposite, BeansSchemaConstants.ELEM_PROPERTY, propertiesTable);
  }

  private Composite createSection(final Composite container, String title, boolean expanded) {
    final ExpandableComposite section = new FormToolkit(getShell().getDisplay()).createExpandableComposite(
        container, ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR | ExpandableComposite.COMPACT);
    section.setText(title);
    GridData sectionData = new GridData(SWT.FILL, SWT.TOP, true, false);
    section.clientVerticalSpacing = 0;
    section.setLayoutData(sectionData);
    section.setBackground(container.getBackground());

    Composite sectionComposite = new Composite(section, SWT.NONE);
    section.setClient(sectionComposite);

    GridLayout layout = new GridLayout(2, false);
    layout.marginWidth = 0;
    sectionComposite.setLayout(layout);

    section.addExpansionListener(new ExpansionAdapter() {
      @Override
      public void expansionStateChanged(ExpansionEvent e) {
        getShell().pack();
      }
    });

    section.setExpanded(expanded);

    return sectionComposite;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.forms.widgets.ExpandableComposite

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