@Override protected Control createMessageArea( Composite composite ) { GridLayout gridLayout = (GridLayout) composite.getLayout(); gridLayout.numColumns = 1; composite.setLayout( gridLayout ); if ( this.message != null ) { this.messageLabel = new Label( composite, this.getMessageLabelStyle() ); this.messageLabel.setText( this.message ); } if ( this.details != null ) { this.detailsText = new Text( composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL ); this.detailsText.pack(); this.detailsText.setText( this.details ); GridData gridData = new GridData( ); gridData.widthHint = 1024; gridData.heightHint = 300; this.detailsText.setLayoutData( gridData ); this.detailsText.setSelection( this.details.length() ); } return composite; }
@Override protected void contributeButtons(Composite parent) { ((GridLayout) parent.getLayout()).numColumns++; Button button = new Button(parent, SWT.NONE); button.setText("&Import a theme...");
public static int getHeightHint(int hHint, Control c) { if (c instanceof Composite) { Layout layout = ((Composite) c).getLayout(); if (layout instanceof ColumnLayout) return hHint; } return SWT.DEFAULT; }
public static int getHeightHint(int hHint, Control c) { if (c instanceof Composite) { Layout layout = ((Composite) c).getLayout(); if (layout instanceof ColumnLayout) return hHint; } return SWT.DEFAULT; }
/** Checks that the layout of the composite has the proper class, then returns the cast layout. */ @SuppressWarnings("unchecked") private static <T extends Layout> T getLayout(Composite composite, Class<T> clazz) { Layout layout = composite.getLayout(); if (layout == null || !clazz.isAssignableFrom(layout.getClass())) { throw new IllegalArgumentException("Expected parent to have layout " + clazz.getName() + ", but was " + layout + "."); } return (T) layout; }
@Override public org.eclipse.swt.widgets.Layout getLayout() { buildWidgets(); return super.getLayout(); }
void removeChild ( final BreadcrumbItem item ) { this.items.remove ( item ); if ( this.horizontal ) { ( (GridLayout)this.composite.getLayout () ).numColumns = this.items.size (); } this.composite.layout (); }
@Override public Composite initComposite(Composite composite) { parent = new Composite(composite, SWT.BORDER); parent.setLayout(new FormLayout()); Layout layout = composite.getLayout(); if (layout instanceof GridLayout) { parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); } else if (layout instanceof FormLayout) { parent.setLayoutData(Utils.getFilledFormData()); } return parent; }
protected void createButtonsForButtonBar(Composite parent) { fApplyButton= createButton(parent, APPLAY_BUTTON_ID, FormatterMessages.ModifyDialog_apply_button, false); fApplyButton.setEnabled(false); GridLayout layout= (GridLayout) parent.getLayout(); layout.numColumns++; layout.makeColumnsEqualWidth= false; Label label= new Label(parent, SWT.NONE); GridData data= new GridData(); data.widthHint= layout.horizontalSpacing; label.setLayoutData(data); super.createButtonsForButtonBar(parent); }
protected void createButtonsForButtonBar(Composite parent) { fApplyButton= createButton(parent, APPLY_BUTTON_ID, SaveParticipantMessages.CleanUpSaveParticipantConfigurationModifyDialog_Apply_Button, false); fApplyButton.setEnabled(false); GridLayout layout= (GridLayout)parent.getLayout(); layout.numColumns++; layout.makeColumnsEqualWidth= false; Label label= new Label(parent, SWT.NONE); GridData data= new GridData(); data.widthHint= layout.horizontalSpacing; label.setLayoutData(data); super.createButtonsForButtonBar(parent); }
private void handleExploreViewSelectionEvent() { GridLayout gl; gl = (GridLayout) primaryGroup_.getLayout(); gl.numColumns = 2; gl.makeColumnsEqualWidth = true; GridData gd = new GridData(GridData.FILL_BOTH); primaryGroup_.setLayout(gl); primaryGroup_.setLayoutData(gd); runtimesGroup_.moveAbove(serversGroup_); primaryGroup_.layout(); // TODO: Show all servers and runtimes from the type id }
public static Composite createLegendComposite( Composite panel, Color[] blockColors, String[] keys, boolean horizontal ) { Object layout = panel.getLayout(); Object layoutData = null; if (layout instanceof GridLayout) layoutData = new GridData(GridData.FILL_HORIZONTAL); return createLegendComposite(panel, blockColors, keys, null, layoutData, horizontal ); }
private int getMarginWidths( Control control ) { // get the width added by container margins and (wm-specific) decorations int extraWidth = 0; for ( Composite parent = control.getParent(); !parent.equals( getParent() ); parent = parent.getParent() ) { extraWidth += parent.computeTrim( 0, 0, 0, 0 ).width; if ( parent.getLayout() instanceof FormLayout ) { extraWidth += 2 * ( (FormLayout) parent.getLayout() ).marginWidth; } } return extraWidth; }
private int getMarginWidths( Control control ) { // get the width added by container margins and (wm-specific) decorations int extraWidth = 0; for ( Composite parent = control.getParent(); !parent.equals( getParent() ); parent = parent.getParent() ) { extraWidth += parent.computeTrim( 0, 0, 0, 0 ).width; if ( parent.getLayout() instanceof FormLayout ) { extraWidth += 2 * ( (FormLayout) parent.getLayout() ).marginWidth; } } return extraWidth; }
private int getMarginWidths( Control control ) { // get the width added by container margins and (wm-specific) decorations int extraWidth = 0; for ( Composite parent = control.getParent(); !parent.equals( getParent() ); parent = parent.getParent() ) { extraWidth += parent.computeTrim( 0, 0, 0, 0 ).width; if ( parent.getLayout() instanceof FormLayout ) { extraWidth += 2 * ( (FormLayout) parent.getLayout() ).marginWidth; } } return extraWidth; }
private void makeControlVisible( Control control ) { ZIndexStackLayout stack = ( ZIndexStackLayout )pageParent.getLayout(); stack.setOnTopControl( control ); pageParent.layout( true ); }
public void widgetSelected( SelectionEvent e ) { super.widgetSelected( e ); namedCluster.setUseGateway( gatewayButton.getSelection() ); StackLayout layout = (StackLayout) compositeSwitcher.getLayout(); layout.topControl = namedCluster.isUseGateway() ? gatewayComposite : noGatewayComposite; compositeSwitcher.layout(); stateChanged(); } } );
/** * Fills this field editor's basic controls into the given parent. * * @param parent the composite used as a parent for the basic controls; * the parent's layout must be a <code>GridLayout</code> * @param numColumns the number of columns */ public void fillIntoGrid(Composite parent, int numColumns) { Assert.isTrue(numColumns >= getNumberOfControls()); Assert.isTrue(parent.getLayout() instanceof GridLayout); doFillIntoGrid(parent, numColumns); }
@Override public Object getUIContainer(MUIElement element) { MUIElement parent = element.getParent(); if (parent == null) { // might be a detached window parent = (MUIElement) ((EObject) element).eContainer(); return parent == null ? null : parent.getWidget(); } Composite shellComp = (Composite) element.getParent().getWidget(); TrimmedPartLayout tpl = (TrimmedPartLayout) shellComp.getLayout(); return tpl.clientArea; }
public void createControl(Composite parent) { Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_BOTH); ((GridLayout)comp.getLayout()).verticalSpacing = 0; createProjectEditor(comp); createVerticalSpacer(comp, 1); createMainTypeEditor(comp, LauncherMessages.JavaMainTab_Main_cla_ss__4); setControl(comp); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IJavaDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB); }