本文整理匯總了Java中org.eclipse.ui.forms.widgets.Section.addExpansionListener方法的典型用法代碼示例。如果您正苦於以下問題:Java Section.addExpansionListener方法的具體用法?Java Section.addExpansionListener怎麽用?Java Section.addExpansionListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.forms.widgets.Section
的用法示例。
在下文中一共展示了Section.addExpansionListener方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createSectionComposite
import org.eclipse.ui.forms.widgets.Section; //導入方法依賴的package包/類
/**
* Constructs a section and returns a section client composite
*
* the section layout is TableWrapLayout
*
*
* @param parent parent container for the section
* @param title title of the section
* @param description description of the section
* @param toolkit toolkit to create the composite
* @param sectionFlags parameters of the section
* @param expansionListener
* @return a section client (the content container of the section)
*/
public static Section createSectionComposite(Composite parent, String title, String description,
FormToolkit toolkit, int sectionFlags, IExpansionListener expansionListener)
{
Section section = toolkit.createSection(parent, sectionFlags);
TableWrapData td = new TableWrapData(TableWrapData.FILL_GRAB);
td.grabHorizontal = true;
section.setLayoutData(td);
section.setText(title);
section.setDescription(description);
if (expansionListener != null)
{
section.addExpansionListener(expansionListener);
}
// create section client
Composite sectionClient = toolkit.createComposite(section);
TableWrapLayout layout = new TableWrapLayout();
layout.numColumns = 1;
sectionClient.setLayout(layout);
section.setClient(sectionClient);
// draw flat borders
toolkit.paintBordersFor(sectionClient);
return section;
}
示例2: createControl
import org.eclipse.ui.forms.widgets.Section; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent, final FormToolkit toolkit) {
final List<TaskAttribute> diffTaskAttributes = getDiffTaskAttributes();
if (diffTaskAttributes == null || diffTaskAttributes.isEmpty()) {
return;
}
int style = ExpandableComposite.TWISTIE | ExpandableComposite.SHORT_TITLE_BAR;
final Section groupSection = toolkit.createSection(parent, style);
groupSection.setText("Changes (" + diffTaskAttributes.size() + ')');
groupSection.clientVerticalSpacing = 0;
groupSection.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
if (groupSection.isExpanded()) {
addDiffViewersToSection(toolkit, diffTaskAttributes, groupSection);
} else {
groupSection.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
if (groupSection.getClient() == null) {
try {
getTaskEditorPage().setReflow(false);
addDiffViewersToSection(toolkit, diffTaskAttributes, groupSection);
} finally {
getTaskEditorPage().setReflow(true);
}
getTaskEditorPage().reflow();
}
}
});
}
}
示例3: createSectionTitle
import org.eclipse.ui.forms.widgets.Section; //導入方法依賴的package包/類
public Composite createSectionTitle(Composite parent, String text, boolean expandable, int columns, int span) {
int style = Section.EXPANDED | Section.TITLE_BAR;
if (expandable)
style = style | Section.TWISTIE;
Section section = new NotifyExpandSection(parent, style, sectionSizeChange);
section.titleBarTextMarginWidth = 0;
// section.marginWidth = 2;
section.setTitleBarBorderColor(SWTResourceManager.getColor(SWT.COLOR_GRAY));
section.setTitleBarBackground(SWTResourceManager.getColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND));
// section.setFont(SWTResourceManager.getBoldFont(section.getFont()));
if (parent.getLayout() instanceof GridLayout) {
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = span;
section.setLayoutData(gd);
}
section.setText(text);
if (sectionSizeChange != null)
section.addExpansionListener(sectionSizeChange);
// section.setSeparatorControl(new Label(section, SWT.SEPARATOR
// | SWT.HORIZONTAL));
parent = createComposite(section, SWT.BORDER);
GridLayout layout = new GridLayout(columns, false);
layout.marginHeight = 4;
layout.marginWidth = 2;
parent.setLayout(layout);
section.setClient(parent);
return parent;
}
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:32,代碼來源:TabbedPropertySheetWidgetFactory.java
示例4: createSection
import org.eclipse.ui.forms.widgets.Section; //導入方法依賴的package包/類
public Composite createSection(Composite parent, String text, boolean expandable, int columns, int span, int style) {
style = style | Section.EXPANDED;
if (expandable)
style = style | Section.TREE_NODE;
Section section = new NotifyExpandSection(parent, style, sectionSizeChange);
section.titleBarTextMarginWidth = 0;
section.setFont(SWTResourceManager.getBoldFont(section.getFont()));
if (parent.getLayout() instanceof GridLayout) {
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = span;
section.setLayoutData(gd);
}
section.setText(text);
section.setSeparatorControl(new Label(section, SWT.SEPARATOR | SWT.HORIZONTAL));
if (sectionSizeChange != null)
section.addExpansionListener(sectionSizeChange);
Composite cmp = createComposite(section, SWT.NONE);
GridLayout layout = new GridLayout(columns, false);
layout.marginHeight = 4;
layout.marginWidth = 2;
cmp.setLayout(layout);
section.setClient(cmp);
return cmp;
}
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:28,代碼來源:TabbedPropertySheetWidgetFactory.java
示例5: createAndGetSection
import org.eclipse.ui.forms.widgets.Section; //導入方法依賴的package包/類
/**
* Create a section and return it. The client of the section is a composite where the control can be created
*/
public Section createAndGetSection(Composite parent, String text, boolean expandable, int columns, int span, int style) {
style = style | Section.EXPANDED;
if (expandable)
style = style | Section.TREE_NODE;
Section section = new NotifyExpandSection(parent, style, sectionSizeChange);
section.titleBarTextMarginWidth = 0;
section.setFont(SWTResourceManager.getBoldFont(section.getFont()));
if (parent.getLayout() instanceof GridLayout) {
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = span;
section.setLayoutData(gd);
}
section.setText(text);
section.setSeparatorControl(new Label(section, SWT.SEPARATOR | SWT.HORIZONTAL));
if (sectionSizeChange != null)
section.addExpansionListener(sectionSizeChange);
Composite cmp = createComposite(section, SWT.NONE);
GridLayout layout = new GridLayout(columns, false);
layout.marginHeight = 4;
layout.marginWidth = 2;
cmp.setLayout(layout);
section.setClient(cmp);
return section;
}
開發者ID:OpenSoftwareSolutions,項目名稱:PDFReporter-Studio,代碼行數:31,代碼來源:TabbedPropertySheetWidgetFactory.java
示例6: createSection
import org.eclipse.ui.forms.widgets.Section; //導入方法依賴的package包/類
private Section createSection( final Composite parent,
final FormToolkit tk,
final String title,
final boolean isGrabVertical,
final boolean isExpandable) {
final int style = isExpandable ? //
Section.TWISTIE //
| Section.TITLE_BAR
: Section.TITLE_BAR;
final Section section = tk.createSection(parent, style);
section.setText(title);
GridDataFactory.fillDefaults().grab(true, isGrabVertical).applyTo(section);
final Composite sectionContainer = tk.createComposite(section);
section.setClient(sectionContainer);
section.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(final ExpansionEvent e) {
onExpandSection();
}
});
return section;
}