/** * {@inheritDoc} */ @Override public void setVisible(boolean visible) { section.setVisible(visible); section.setExpanded(visible); }
ScrolledForm scrldfrm = managedForm.getForm(); scrldfrm.getBody().setLayout(new GridLayout()); scrldfrm.setText("Hello there!"); Section section = managedForm.getToolkit().createSection( managedForm.getForm().getBody(), Section.TWISTIE | Section.TITLE_BAR); section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); managedForm.getToolkit().paintBordersFor(section); section.setText("Selected API"); section.setExpanded(true); textName = new Text(managedForm.getForm().getBody(), SWT.BORDER); textName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false); managedForm.getToolkit().adapt(textName, true, true); textName.setEnabled(false);
/** * {@inheritDoc} */ @Override public void createPartControl(Composite parent, Set<PreferenceId> preferenceSet, InputDefinition inputDefinition, IToolBarManager toolBarManager) { section = toolkit.createSection(parent, ExpandableComposite.NO_TITLE); section.setText("Preferences"); section.setLayout(new GridLayout(1, false)); section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); section.setVisible(false); Composite innerComposite = toolkit.createComposite(section); innerComposite.setLayout(new GridLayout(1, false)); innerComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); // only add buttons and some controls if the set is not empty if ((null != preferenceSet) && !preferenceSet.isEmpty()) { if (null != toolBarManager) { createButtons(preferenceSet, toolBarManager, inputDefinition); } createPreferenceControls(innerComposite, preferenceSet, inputDefinition); } section.setClient(innerComposite); section.setExpanded(false); }
public DependencyManagementSection(PDEFormPage formPage, Composite parent) { super(formPage, parent, ExpandableComposite.TWISTIE | ExpandableComposite.COMPACT, new String[] {ADD, REMOVE, UP, DOWN}); IBuildModel model = getBuildModel(false); if (model != null) { IBuildEntry entry = model.getBuild().getEntry(IBuildEntry.SECONDARY_DEPENDENCIES); if (entry != null && entry.getTokens().length > 0) getSection().setExpanded(true); } }
public void initialize() { getBuildModel().addModelChangedListener(this); IBuildEntry entry = getBuildModel().getBuild().getEntry(IBuildPropertiesConstants.PROPERTY_JAR_EXTRA_CLASSPATH); getSection().setExpanded(entry != null && entry.getTokens().length > 0); }
@Override public void refresh() { super.refresh(); tree.removeAll(); if (!isAggregate()) { getSection().setText("Sofa Mappings (Only used in aggregate Descriptors)"); getSection().setDescription("This part is only used for Aggregate Descriptors"); getSection().setExpanded(false); } else { getSection().setDescription(titleMsg); String[][] sns = getCapabilitySofaNames(); String[] inputSofaNames = sns[0]; String[] outputSofaNames = sns[1]; // getAggrSofas the names declared in the capability // plus any undeclared names in the mappings // sorted... alphabetically String[] inputAggrSofas = getAggrSofas(inputSofaNames, outputSofaNames); fillMap(inputAggrSofas, INPUT); fillMap(outputSofaNames, OUTPUT); tree.setSelection(new TreeItem[] { tree.getItems()[0] }); if (0 == (inputAggrSofas.length + outputSofaNames.length)) { getSection().setText("Sofa Mappings (No Sofas are defined)"); getSection().setExpanded(false); } else { getSection().setText("Sofa Mappings"); getSection().setExpanded(true); } } enable(); }
/** * Creates a new section with table layout * * @param toolkit Toolkit for the new section * @param parent Parent of the new section * @param text Title for the new section * @param description New section description * @return the new section */ public static Section createStaticSection(FormToolkit toolkit, Composite parent, String text ,String description) { Section section = toolkit.createSection(parent, Section.DESCRIPTION | ExpandableComposite.TITLE_BAR); section.clientVerticalSpacing = FormLayoutFactory.SECTION_HEADER_VERTICAL_SPACING; section.setText(text); section.setDescription(description); section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1)); TableWrapData data = new TableWrapData(TableWrapData.FILL_GRAB); section.setLayoutData(data); section.setExpanded(true); section.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { //form.reflow(false); } }); return section; }
@Override public void initialize(IManagedForm form) { super.initialize(form); sectionClient = new2ColumnComposite(getSection()); tree = newTree(sectionClient); Composite buttonContainer = newButtonContainer(sectionClient); addButton = newPushButton(buttonContainer, S_ADD, "Click here to add a component Sofa binding."); editButton = newPushButton(buttonContainer, S_EDIT, S_EDIT_TIP); removeButton = newPushButton(buttonContainer, S_REMOVE, S_REMOVE_TIP); tree.addListener(SWT.MouseDoubleClick, this); // edit gesture enableBorders(sectionClient); toolkit.paintBordersFor(sectionClient); if (!isAggregate()) getSection().setExpanded(false); }
.toArray(new FederatedSearchEntry[entries.size()]); if (scopeSection.isExpanded()) { scopeSection.setExpanded(false); parent.reflow();
/** * Creates a new expandable static section for a given form * * @param toolkit Toolkit for the new section * @param parent Parent of the new section * @param text Title for the new section * @param description New section description * @param form the given form * @return the new section */ public static Section createStaticSection(FormToolkit toolkit, Composite parent, String text ,String description, final ScrolledForm form) { final Section section = toolkit.createSection(parent, Section.DESCRIPTION | ExpandableComposite.TITLE_BAR | Section.TWISTIE); section.setActiveToggleColor(toolkit.getHyperlinkGroup().getActiveForeground()); section.setToggleColor(toolkit.getColors().getColor(IFormColors.SEPARATOR)); section.clientVerticalSpacing = FormLayoutFactory.SECTION_HEADER_VERTICAL_SPACING; section.setText(text); section.setDescription(description); section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1)); section.setExpanded(true); section.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { form.reflow(false); form.setFocus(); } }); return section; }