searchText.setToolTipText( BaseMessages.getString( PKG, "EnterSelectionDialog.FilterString.ToolTip" ) ); wfilter.setControl( searchText ); wfilter.setWidth( 120 );
zoomLabel.pack(); sep.setWidth( 80 ); sep.setControl( zoomLabel ); swtToolbar.pack();
.getString( PKG, "RepositoryExplorerDialog.Search.FilterString.ToolTip" ) ); wfilter.setControl( searchText ); wfilter.setWidth( 100 );
zoomLabel.pack(); sep.setWidth( 80 ); sep.setControl( zoomLabel ); swtToolbar.pack();
private void addSeparator(ToolBar toolBar) { ToolItem item= new ToolItem(toolBar, SWT.SEPARATOR); item.setWidth(4); item.setControl(new Label(toolBar, SWT.NONE)); }
/** * The control item implementation of this <code>IContributionItem</code> * method calls the <code>createControl</code> framework method to * create a control under the given parent, and then creates * a new tool item to hold it. * Subclasses must implement <code>createControl</code> rather than * overriding this method. */ @Override public final void fill(ToolBar parent, int index) { Control control = createControl(parent); if (control == null) { Policy.logException(new IllegalStateException( "createControl(Composite) of " + getClass() //$NON-NLS-1$ + " returned null, cannot fill toolbar")); //$NON-NLS-1$ } else { ToolItem ti = new ToolItem(parent, SWT.SEPARATOR, index); ti.setControl(control); ti.setWidth(computeWidth(control)); } } }
/** * The control item implementation of this <code>IContributionItem</code> * method calls the <code>createControl</code> framework method to * create a control under the given parent, and then creates * a new tool item to hold it. * Subclasses must implement <code>createControl</code> rather than * overriding this method. */ @Override public final void fill(ToolBar parent, int index) { Control control = createControl(parent); if (control == null) { Policy.logException(new IllegalStateException( "createControl(Composite) of " + getClass() //$NON-NLS-1$ + " returned null, cannot fill toolbar")); //$NON-NLS-1$ } else { ToolItem ti = new ToolItem(parent, SWT.SEPARATOR, index); ti.setControl(control); ti.setWidth(computeWidth(control)); } } }
/** * The control item implementation of this <code>IContributionItem</code> * method calls the <code>createControl</code> framework method to * create a control under the given parent, and then creates * a new tool item to hold it. * Subclasses must implement <code>createControl</code> rather than * overriding this method. */ public final void fill(ToolBar parent, int index) { Control control = createControl(parent); ToolItem ti = new ToolItem(parent, SWT.SEPARATOR, index); ti.setControl(control); ti.setWidth(computeWidth(control)); } }
public static void initToolBar(ToolBar toolBar){ for (ToolItem coolItem : toolBar.getItems()) { Control ccontrol = coolItem.getControl(); if(ccontrol == null) continue; Thing itemThing = Designer.getThing(coolItem); int width = -1; if(itemThing != null){ width = itemThing.getInt("width", -1); } if(width <= 0){ width = ccontrol.computeSize(SWT.DEFAULT, SWT.DEFAULT).x; } coolItem.setWidth(width); } } }
toolItem.setWidth(toolbarItem.getInt("width"));
afterPageLabel.setText(pageToolbar.getString("afterPageText").replace("{0}", "" + totalPage)); afterPageLabel.pack(); afterPageItem.setWidth(afterPageLabel.getSize().x + 5);
sep.setControl(newCtrl); newCtrl.pack(); sep.setWidth(newCtrl.getSize().x);
sep.setControl(newCtrl); newCtrl.pack(); sep.setWidth(newCtrl.getSize().x);
combo.setText (combo.getItem (0)); combo.pack (); item.setWidth (combo.getSize ().x); item.setControl (combo); combo.setText (combo.getItem (0)); combo.pack (); item.setWidth (combo.getSize ().x); item.setControl (combo); combo.setText (combo.getItem (0)); combo.pack (); item.setWidth (combo.getSize ().x); item.setControl (combo);
if(control == null) continue; Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT); coolItem.setWidth(size.y);
if(control == null) continue; Point size = control.computeSize(SWT.DEFAULT, SWT.DEFAULT); coolItem.setWidth(size.y);