public void setLayoutData(GridData layoutData) { expandable.setLayoutData(layoutData); } }
public static Section create(Composite parentComposite, String label, String previewKey) { final ExpandableComposite excomposite= new FormatterPreferenceSectionComposite(parentComposite, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.clientVerticalSpacing= 0; excomposite.setText(label); excomposite.setExpanded(false); excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, GRID_COLUMNS, 1)); Composite inner= new Composite(excomposite, SWT.NONE); inner.setFont(parentComposite.getFont()); GridLayout layout= new GridLayout(GRID_COLUMNS, false); layout.marginWidth= 0; layout.marginLeft= 5; inner.setLayout(layout); excomposite.setClient(inner); return new Section(label, excomposite, inner, previewKey); }
/** * Creates an ExpandibleComposite widget * @param parent the parent to add this widget to * @param style the style for ExpandibleComposite expanding handle, and layout * @param label the label for the widget * @param hspan how many columns to span in the parent * @param fill the fill style for the widget * Can be one of <code>GridData.FILL_HORIZONAL</code>, <code>GridData.FILL_BOTH</code> or <code>GridData.FILL_VERTICAL</code> * @return a new ExpandibleComposite widget * @since 3.6 */ public static ExpandableComposite createExpandibleComposite(Composite parent, int style, String label, int hspan, int fill) { ExpandableComposite ex = new ExpandableComposite(parent, SWT.NONE, style); ex.setText(label); ex.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); GridData gd = new GridData(fill); gd.horizontalSpan = hspan; ex.setLayoutData(gd); return ex; }
/** * Creates an ExpandibleComposite widget * * @param parent the parent to add this widget to * @param style the style for ExpandibleComposite expanding handle, and layout * @param label the label for the widget * @param hspan how many columns to span in the parent * @param fill the fill style for the widget * Can be one of <code>GridData.FILL_HORIZONAL</code>, <code>GridData.FILL_BOTH</code> or <code>GridData.FILL_VERTICAL</code> * @return a new ExpandibleComposite widget */ public static ExpandableComposite createExpandibleComposite(Composite parent, String label, int hspan, int fill) { ExpandableComposite ex = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); ex.setText(label); ex.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); GridData gd = new GridData(fill); gd.horizontalSpan = hspan; gd.grabExcessHorizontalSpace = true; ex.setLayoutData(gd); return ex; }
/** * Creates an ExpandibleComposite widget * @param parent the parent to add this widget to * @param style the style for ExpandibleComposite expanding handle, and layout * @param label the label for the widget * @param hspan how many columns to span in the parent * @param fill the fill style for the widget * Can be one of <code>GridData.FILL_HORIZONAL</code>, <code>GridData.FILL_BOTH</code> or <code>GridData.FILL_VERTICAL</code> * @return a new ExpandibleComposite widget */ public static ExpandableComposite createExpandibleComposite(Composite parent, int style, String label, int hspan, int fill) { ExpandableComposite ex = new ExpandableComposite(parent, SWT.NONE, style); ex.setText(label); ex.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); GridData gd = new GridData(fill); gd.horizontalSpan = hspan; ex.setLayoutData(gd); return ex; }
/** * Creates an ExpandibleComposite widget * * @param parent the parent to add this widget to * @param label the label for the widget * @param hspan how many columns to span in the parent * @param fill the fill style for the widget * Can be one of <code>GridData.FILL_HORIZONAL</code>, <code>GridData.FILL_BOTH</code> or <code>GridData.FILL_VERTICAL</code> * @return a new ExpandibleComposite widget */ public static ExpandableComposite createExpandibleComposite(Composite parent, String label, int hspan, int fill) { ExpandableComposite ex = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); ex.setText(label); ex.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); GridData gd = new GridData(fill); gd.horizontalSpan = hspan; gd.grabExcessHorizontalSpace = true; ex.setLayoutData(gd); return ex; }
excomposite.setExpanded(false); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
excomposite.setExpanded(false); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
/** * Creates an ExpandibleComposite widget * * @param parent the parent to add this widget to * @param style the style for ExpandibleComposite expanding handle, and layout * @param label the label for the widget * @param hspan how many columns to span in the parent * @param fill the fill style for the widget * Can be one of <code>GridData.FILL_HORIZONAL</code>, <code>GridData.FILL_BOTH</code> or <code>GridData.FILL_VERTICAL</code> * @return a new ExpandibleComposite widget */ public static ExpandableComposite createExpandibleComposite(Composite parent, String label, int hspan, int fill) { ExpandableComposite ex = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); ex.setText(label); ex.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); GridData gd = new GridData(fill); gd.horizontalSpan = hspan; gd.grabExcessHorizontalSpace = true; ex.setLayoutData(gd); return ex; }
protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) { ExpandableComposite excomposite= new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label); excomposite.setExpanded(false); excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1)); excomposite.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } }); fExpandedComposites.add(excomposite); makeScrollableCompositeAware(excomposite); return excomposite; }
excomposite.setExpanded(false); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) { ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label); excomposite.setExpanded(false); excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1)); excomposite.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } }); expandedComposites.add(excomposite); makeScrollableCompositeAware(excomposite); return excomposite; }
protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) { ExpandableComposite excomposite = new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label); excomposite.setExpanded(false); excomposite.setFont(JFaceResources.getFontRegistry().getBold( JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1)); excomposite.addExpansionListener(new ExpansionAdapter() { public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } }); fExpandedComposites.add(excomposite); makeScrollableCompositeAware(excomposite); return excomposite; }
protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns, Key key) { ExpandableComposite excomposite= new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label); if (key != null) { excomposite.setData(key); } excomposite.setExpanded(false); excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1)); excomposite.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } }); fExpandableComposites.add(excomposite); makeScrollableCompositeAware(excomposite); return excomposite; }
protected ExpandableComposite createStyleSection(Composite parent, String label, int nColumns, Key key) { ExpandableComposite excomposite= new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT); excomposite.setText(label); if (key != null) { excomposite.setData(key); } excomposite.setExpanded(false); excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1)); excomposite.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent e) { expandedStateChanged((ExpandableComposite) e.getSource()); } }); fExpandableComposites.add(excomposite); makeScrollableCompositeAware(excomposite); return excomposite; }
expandable.setBackground(scrolledForm.getBackground()); expandable.setLayout(new GridLayout()); expandable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, area.grabExcessVerticalSpace())); expandable.addExpansionListener(new ExpansionAdapter() { @Override
@Override public void expansionStateChanged(ExpansionEvent e) { if ((Boolean) e.data == true && grabExcessVerticalSpace) { GridData g = (GridData) section.getLayoutData(); g.verticalAlignment = GridData.FILL; g.grabExcessVerticalSpace = true; section.setLayoutData(g); } else { GridData g = (GridData) section.getLayoutData(); g.verticalAlignment = GridData.BEGINNING; g.grabExcessVerticalSpace = false; section.setLayoutData(g); } layout(true); Point newSize = section.getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true); Rectangle currentbounds = section.getShell().getBounds(); if (newSize.x > currentbounds.width || newSize.y > currentbounds.height) { Object shellData = section.getShell().getData(); if (shellData instanceof Window) { Window window = (Window) shellData; Rectangle preferredSize = new Rectangle(currentbounds.x, currentbounds.y, Math.max( currentbounds.width, newSize.x), Math.max(currentbounds.height, newSize.y)); Rectangle result = WindowUtil.getConstrainedShellBounds(window, preferredSize); section.getShell().setBounds(result); } } reflow(true); getParent().layout(true, true); } });
patchOptions.setText(PatchMessages.PreviewPatchPage_PatchOptions_title); patchOptions.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); patchOptions.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 3, 1)); patchOptions.addExpansionListener(new ExpansionAdapter() { @Override
expandable.setBackground(workArea.getBackground()); expandable.setLayout(new GridLayout()); expandable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); expandable.addExpansionListener(new IExpansionListener() {
advanced.setLayoutData(GridDataFactory.fillDefaults().grab(true, false) .create());