/** * 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()); } }); } }
/** * Returns the title bar gradient background color when TITLE_BAR style is * used. * * @return the title bar gradient background */ public Color getTitleBarGradientBackground() { if (titleColors == null) return null; if ((getExpansionStyle() & SHORT_TITLE_BAR) != 0) return getBackground(); return titleColors.get(COLOR_GBG); }
/** * Returns the title bar gradient background color when TITLE_BAR style is * used. * * @return the title bar gradient background */ public Color getTitleBarGradientBackground() { if (titleColors == null) return null; if ((getExpansionStyle() & SHORT_TITLE_BAR) != 0) return getBackground(); return titleColors.get(COLOR_GBG); }
/** * Sets the foreground of the section. * * @param fg * the new foreground. */ @Override public void setForeground(Color fg) { super.setForeground(fg); if (descriptionControl != null && (getExpansionStyle() & DESCRIPTION) != 0) descriptionControl.setForeground(fg); }
/** * Sets the foreground of the section. * * @param fg * the new foreground. */ @Override public void setForeground(Color fg) { super.setForeground(fg); if (descriptionControl != null && (getExpansionStyle() & DESCRIPTION) != 0) descriptionControl.setForeground(fg); }
/** * Sets the background of the section. * * @param bg * the new background */ @Override public void setBackground(Color bg) { super.setBackground(bg); if (descriptionControl != null && (getExpansionStyle() & DESCRIPTION) != 0) descriptionControl.setBackground(bg); }
/** * Sets the background of the section. * * @param bg * the new background */ @Override public void setBackground(Color bg) { super.setBackground(bg); if (descriptionControl != null && (getExpansionStyle() & DESCRIPTION) != 0) descriptionControl.setBackground(bg); }
@Override protected void internalSetExpanded(boolean expanded) { super.internalSetExpanded(expanded); if ((getExpansionStyle() & TITLE_BAR) != 0) { if (!expanded) super.setBackgroundImage(null); } reflow(); }
/** * Sets the description control of this section. The control must not be * <samp>null</samp> and must be a direct child of this container. If * defined, contol will be placed below the title text and the separator and * will be hidden int he collapsed state. * <p> * This method and <code>DESCRIPTION</code> style are mutually exclusive. * Use the method only if you want to create the description control * yourself. * * @since 3.1 * @param descriptionControl * the control that will be placed below the title text. */ public void setDescriptionControl(Control descriptionControl) { Assert.isTrue((getExpansionStyle() & DESCRIPTION) == 0); Assert.isTrue(descriptionControl != null && descriptionControl.getParent().equals(this)); this.descriptionControl = descriptionControl; }
@Override protected void internalSetExpanded(boolean expanded) { super.internalSetExpanded(expanded); if ((getExpansionStyle() & TITLE_BAR) != 0) { if (!expanded) super.setBackgroundImage(null); } reflow(); }
/** * Sets the description control of this section. The control must not be * <samp>null</samp> and must be a direct child of this container. If * defined, control will be placed below the title text and the separator * and will be hidden in the collapsed state. * <p> * This method and <code>DESCRIPTION</code> style are mutually exclusive. * Use the method only if you want to create the description control * yourself. * * @since 3.1 * @param descriptionControl * the control that will be placed below the title text. */ public void setDescriptionControl(Control descriptionControl) { Assert.isTrue((getExpansionStyle() & DESCRIPTION) == 0); Assert.isTrue(descriptionControl != null && descriptionControl.getParent().equals(this)); this.descriptionControl = descriptionControl; }
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; }
if ((getExpansionStyle() & TITLE_BAR) != 0) { buffer = new Image(getDisplay(), bounds.width, bounds.height); buffer.setBackground(getBackground()); int gradientheight = 0; int tvmargin = IGAP; if ((getExpansionStyle() & TITLE_BAR) != 0) { Point tsize = null; Point tcsize = null; theight = 5; if ((getExpansionStyle() & TITLE_BAR) != 0) { if (getBackgroundImage() == null) updateHeaderImage(bg, bounds, gradientheight, theight); bounds.width - marginWidth, marginHeight + 3 }); gc.setForeground(border); if (isExpanded() || (getExpansionStyle() & TITLE_BAR) != 0) { marginHeight); if ((getExpansionStyle() & TITLE_BAR) != 0 || isExpanded()) { if ((getExpansionStyle() & TITLE_BAR) != 0) {
if ((getExpansionStyle() & TITLE_BAR) != 0) { buffer = new Image(getDisplay(), bounds.width, bounds.height); buffer.setBackground(getBackground()); int gradientheight = 0; int tvmargin = IGAP; if ((getExpansionStyle() & TITLE_BAR) != 0) { Point tsize = null; Point tcsize = null; theight = 5; if ((getExpansionStyle() & TITLE_BAR) != 0) { if (getBackgroundImage() == null) updateHeaderImage(bg, bounds, gradientheight, theight); bounds.width - marginWidth, marginHeight + 3 }); gc.setForeground(border); if (isExpanded() || (getExpansionStyle() & TITLE_BAR) != 0) { marginHeight); if ((getExpansionStyle() & TITLE_BAR) != 0 || isExpanded()) { if ((getExpansionStyle() & TITLE_BAR) != 0) {