private void hookExpansionGrabbing(final Section section) { section.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { ((GridData) section.getLayoutData()).grabExcessVerticalSpace = e .getState(); getManagedForm().getForm().getBody().layout(true, true); } }); }
/** * 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()); } }); } }
/** * 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()); } }); } }
public Control createControl(Composite parent, final FormToolkit toolkit) { section = createSection(parent, toolkit); if ((section.getExpansionStyle() & ExpandableComposite.EXPANDED) != 0) { Control content = createContent(section, toolkit); section.setClient(content); } else { section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent event) { if (section.getClient() == null) { Control content = createContent(section, toolkit); section.setClient(content); getPage().reflow(); } } }); } setSection(toolkit, section); return control; }
section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) {
section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) {
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 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; }
/** * Clients can implement to provide attribute overlay text * * @param section */ private void createInfoOverlay(Composite composite, Section section, FormToolkit toolkit) { String text = getInfoOverlayText(); if (text == null) { return; } final Label label = toolkit.createLabel(composite, CommonUiUtil.toLabel(text)); label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE)); label.setBackground(null); label.setVisible(!section.isExpanded()); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanging(ExpansionEvent e) { label.setVisible(!e.getState()); } }); }
/** * 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; }
Composite container = toolkit.createComposite(section); section.setClient(container); section.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { if (e.getState()
section.setText(Messages.SearchPart_title); section.marginWidth = 5; section.addExpansionListener(new IExpansionListener() { public void expansionStateChanging(ExpansionEvent e) {