public LibraryVisibilitySection(PDEFormPage formPage, Composite parent) { super(formPage, parent, Section.DESCRIPTION, new String[] {PDEUIMessages.ManifestEditor_ExportSection_add, PDEUIMessages.ManifestEditor_ExportSection_remove}); getSection().setText(PDEUIMessages.ManifestEditor_ExportSection_title); getSection().setDescription(PDEUIMessages.ManifestEditor_ExportSection_desc); fHandleDefaultButton = false; }
public Composite createStandardSection ( final Composite parent, final String sectionLabel, final boolean fillVeritcal ) { final Section section = this.toolkit.createSection ( parent, sectionLabel != null ? ExpandableComposite.TITLE_BAR : ExpandableComposite.NO_TITLE ); if ( sectionLabel != null ) { section.setText ( sectionLabel ); } final Composite client = createStandardComposite ( section ); section.setClient ( client ); client.setLayout ( new GridLayout ( 3, false ) ); section.setLayoutData ( new GridData ( GridData.FILL, GridData.BEGINNING, true, fillVeritcal ) ); return client; }
private void updateSectionTitle(int size) { if (errorStatus != null) { Label label = part.getToolkit().createLabel(section, null); label.setImage(PlatformUI.getWorkbench().getSharedImages().getImage( ISharedImages.IMG_OBJS_ERROR_TSK)); section.setTextClient(label); section.setText(Messages.EngineResultSection_sectionTitle_error); } else { section.setTextClient(null); } if (size == 1) section.setText(NLS.bind(Messages.EngineResultSection_sectionTitle_hit, desc.getLabel(), "" //$NON-NLS-1$ + hits.size())); else if (size <= HITS_PER_PAGE) section.setText(NLS.bind(Messages.EngineResultSection_sectionTitle_hits, desc.getLabel(), "" + hits.size())); //$NON-NLS-1$ else { int from = (resultOffset + 1); int to = (resultOffset + HITS_PER_PAGE); to = Math.min(to, size); section.setText(NLS.bind(Messages.EngineResultSection_sectionTitle_hitsRange, new String[] { desc.getLabel(), "" + from, "" + to, "" + size })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } }
/** * {@inheritDoc} */ @Override public void setVisible(boolean visible) { section.setVisible(visible); section.setExpanded(visible); }
/** * Adds listeners to the underlying widget. */ protected void hookListeners() { if ((section.getExpansionStyle() & ExpandableComposite.TWISTIE) != 0 || (section.getExpansionStyle() & ExpandableComposite.TREE_NODE) != 0) { section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanging(ExpansionEvent e) { SectionPart.this.expansionStateChanging(e.getState()); } @Override public void expansionStateChanged(ExpansionEvent e) { SectionPart.this.expansionStateChanged(e.getState()); } }); } }
private void configureUISection() { fSection.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); GridData data = new GridData(GridData.FILL_HORIZONTAL); fSection.setLayoutData(data); fSection.setText(PDEUIMessages.SplashProgressSection_progressName); fSection.setDescription(PDEUIMessages.SplashProgressSection_progressSectionDesc); }
section.setText(PDEUIMessages.CommandList_groupName); section.setLayoutData(new GridData(GridData.FILL_BOTH)); fToolkit.adapt(toolbar, true, true); toolbar.setBackground(null); section.setTextClient(toolbar); toolBarManager.update(true); fTreeViewer.addSelectionChangedListener(fCCP); section.setClient(comp);
/** * {@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); }
/** * 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 createClient(Section section, FormToolkit toolkit) { Composite container = toolkit.createComposite(section); container.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, 2)); createLeftSection(container, toolkit); createRightSection(container, toolkit); toolkit.paintBordersFor(container); section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.horizontalSpan = 2; section.setLayoutData(data); section.setClient(container); }
Section section = getSection(); section.marginWidth = 5; section.setText(Messages.ContextHelpPart_about); Composite container = toolkit.createComposite(section); section.setClient(container); section.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { if (e.getState()
/** * {@inheritDoc} */ @Override public void createContent(IManagedForm managedForm, Composite parent) { FormToolkit toolkit = managedForm.getToolkit(); section = toolkit.createSection(parent, Section.TITLE_BAR | Section.EXPANDED); section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); section.setText(title); descriptionLabel = toolkit.createLabel(section, ""); descriptionLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); section.setDescriptionControl(descriptionLabel); Composite main = toolkit.createComposite(section); main.setLayout(new GridLayout(1, false)); section.setClient(main); super.createContent(new DirtyStateDelegatingManagedForm(managedForm, section), main); }
/** * 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; }
private Section createSection(Composite parent, FormToolkit toolkit, String title) { Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR); section.clientVerticalSpacing = FormLayoutFactory.SECTION_HEADER_VERTICAL_SPACING; section.setText(title); section.setLayout(FormLayoutFactory.createClearTableWrapLayout(false, 1)); section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING)); return section; }
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);
public IncludedFeaturesSection(PDEFormPage page, Composite parent) { super(page, parent, Section.DESCRIPTION, new String[] { PDEUIMessages.FeatureEditor_IncludedFeatures_new, PDEUIMessages.FeatureEditor_IncludedFeatures_remove, PDEUIMessages.FeatureEditor_SpecSection_synchronize, PDEUIMessages.FeatureEditor_IncludedFeatures_up, PDEUIMessages.FeatureEditor_IncludedFeatures_down }); getSection().setText(PDEUIMessages.FeatureEditor_IncludedFeatures_title); getSection().setDescription(PDEUIMessages.FeatureEditor_IncludedFeatures_desc); getTablePart().setEditable(false); getSection().setLayoutData(new GridData(GridData.FILL_BOTH)); }
@Override protected void createClient(Section section, FormToolkit toolkit) { container = toolkit.createComposite(section); GridLayout layout = new GridLayout(); layout.numColumns = 2; container.setLayout(layout); section.setClient(container); linkContainer = toolkit.createComposite(container); linkContainer.setLayoutData(new GridData(GridData.FILL_BOTH)); GridLayout linkLayout = new GridLayout(); linkLayout.marginWidth = 0; linkLayout.marginHeight = 0; linkLayout.verticalSpacing = 0; linkContainer.setLayout(linkLayout); }
private FormText createClient(Section section, String content, FormToolkit toolkit) { FormText text = toolkit.createFormText(section, true); try { text.setText(content, true, false); } catch (SWTException e) { text.setText(e.getMessage(), false, false); } section.setClient(text); section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); text.addHyperlinkListener(this); return text; }
public Control createControl(Composite parent, final FormToolkit toolkit) { section = toolkit.createSection(parent, Section.SHORT_TITLE_BAR | Section.COMPACT | Section.TWISTIE | Section.EXPANDED | Section.LEFT_TEXT_CLIENT_ALIGNMENT); // section.marginHeight = 10; container = toolkit.createComposite(section); TableWrapLayout layout = new TableWrapLayout(); layout.topMargin = 0; layout.bottomMargin = 0; layout.leftMargin = 0; layout.rightMargin = 0; layout.verticalSpacing = 0; container.setLayout(layout); createFormText(container, toolkit); searchResults.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB)); searchResults.setColor("summary", parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW)); //$NON-NLS-1$ section.setClient(container); updateSectionTitle(0); section.addExpansionListener(new IExpansionListener() { public void expansionStateChanging(ExpansionEvent e) { if (needsUpdating) asyncUpdateResults(true, false); } public void expansionStateChanged(ExpansionEvent e) { } }); return section; }
/** * Creates header. * * @param heading * Heading to use. */ private void createHeading(String heading) { getSection().setText(heading); }