Package org.eclipse.ui.forms.widgets

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


    }


    protected ExpandableComposite createExpandableSection( 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 )
            {
                ExpandableComposite excomposite = ( ExpandableComposite ) e.getSource();
                excomposite.getParent().setSize( excomposite.getParent().computeSize( SWT.DEFAULT, SWT.DEFAULT ) );
            }
        } );
        return excomposite;
    }
View Full Code Here


    horizontalLine.setFont(fieldEditorParent.getFont());

    fields = new Combo[fAllKeys.length -1];
    int i = 0;
    for (Category category : manager.getCategories()) {
      ExpandableComposite group = createGroup(1, fieldEditorParent, category.getLabel());
      Composite inner = new Composite(group, SWT.NONE);
      inner.setFont(parent.getFont());
      inner.setLayout( new GridLayout(3, false));
      inner.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      group.setClient(inner);

      for (Validator v : category.getValidators()) {
        for (Type t : v.getTypes()) {
          Combo combo = fields[i] = addComboBox(inner, t.getLabel(), new Key(PEXAnalysisPlugin.VALIDATORS_PREFERENCES_NODE_ID + "/" + v.getId(), t.getId()), getSeverityValues(), getSeverityLabels());
          Label object = (Label)fLabels.get(combo);
View Full Code Here

    return fieldEditorParentWrap;
  }

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

    toolbars = new HashMap<String, ToolBar>();
    expandItems = new HashMap<String, ExpandableComposite>();
    parseGroupExtensions(container);
    parseWidgetExtensions();

    ExpandableComposite expandItem = new ExpandableComposite(container, SWT.NONE);
    expandItem.setExpanded(false);
    expandItem.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
    expandItem.setText("Custom Component");
    expandItem.addExpansionListener(new ExpansionAdapter() {
     
      public void expansionStateChanged(ExpansionEvent e) {
        updateScrolledComposite();
      }
    });
    ToolBar toolBar = new ToolBar(expandItem, SWT.VERTICAL | SWT.RIGHT | SWT.FLAT);
    expandItem.setClient(toolBar);
    ToolItem toolItem = new ToolItem(toolBar, SWT.CHECK);
    toolItem.setText("Custom Swing Component");
    toolItem.setToolTipText("Choose custom component");
    String iconUrl = "icons/beans.png";
    Image img = VisualSwingPlugin.getSharedImage(VisualSwingPlugin.PLUGIN_ID, iconUrl);
View Full Code Here

    if (displayName == null || displayName.equals("")) {
      displayName = id;
    }
    ToolBar toolbar = toolbars.get(id);
    if (toolbar == null) {
      ExpandableComposite expandItem = new ExpandableComposite(bar,
          SWT.NONE);
      String sExpanded = config.getAttribute("expanded");
      if (sExpanded == null || sExpanded.trim().length() == 0)
        sExpanded = "true";
      expandItem.setExpanded(sExpanded.equals("true"));
      expandItem.setFont(JFaceResources.getFontRegistry().getBold(
          JFaceResources.DIALOG_FONT));
      expandItem.setText(displayName);
      expandItem.addExpansionListener(new ExpansionAdapter() {
       
        public void expansionStateChanged(ExpansionEvent e) {
          updateScrolledComposite();
        }
      });
      toolbar = new ToolBar(expandItem, SWT.VERTICAL | SWT.RIGHT
          | SWT.FLAT);
      expandItem.setClient(toolbar);
      toolbars.put(id, toolbar);
      expandItems.put(id, expandItem);
    }
  }
View Full Code Here

        /*
         * Row 3: Server Options
         */
        new Label(this, SWT.NONE);

        serverOptionsExpandableComposite = new ExpandableComposite(this,
            SWT.NONE, ExpandableComposite.TWISTIE
                | ExpandableComposite.CLIENT_INDENT);
        serverOptionsExpandableComposite.setLayoutData(GridDataFactory
            .fillDefaults().grab(true, true).minSize(SWT.DEFAULT, 50).create());
        serverOptionsExpandableComposite.setText("Server Options");
View Full Code Here

    }
    return null;
  }
 
  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());
      }
    });
    fExpandables.add(excomposite);
View Full Code Here

    makeScrollableCompositeAware(excomposite);
    return excomposite;
  }
 
  protected Composite createStyleSectionWithContentComposite(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());
      }
    });
    fExpandables.add(excomposite);
    makeScrollableCompositeAware(excomposite);

    Composite inner = new Composite(excomposite, SWT.NONE);
    inner.setFont(excomposite.getFont());
    inner.setLayout(new GridLayout(nColumns, false));
    excomposite.setClient(inner);
    return inner;
  }
View Full Code Here

    return null;
  }
 
  protected void storeSectionExpansionStates(IDialogSettings section) {
    for(int i = 0; i < fExpandables.size(); i++) {
      ExpandableComposite comp = (ExpandableComposite) fExpandables.get(i);
      section.put(SETTINGS_EXPANDED + String.valueOf(i), comp.isExpanded());
    }
  }
View Full Code Here

    }
  }
 
  protected void restoreSectionExpansionStates(IDialogSettings settings) {
    for (int i= 0; i < fExpandables.size(); i++) {
      ExpandableComposite excomposite= (ExpandableComposite) fExpandables.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

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.