props.setLook( searchText ); searchText.setToolTipText( BaseMessages.getString( PKG, "EnterSelectionDialog.FilterString.ToolTip" ) ); wfilter.setControl( searchText ); wfilter.setWidth( 120 );
sep.setControl( zoomLabel ); swtToolbar.pack(); } catch ( Throwable t ) {
searchText.setToolTipText( BaseMessages .getString( PKG, "RepositoryExplorerDialog.Search.FilterString.ToolTip" ) ); wfilter.setControl( searchText ); wfilter.setWidth( 100 );
sep.setControl( zoomLabel ); swtToolbar.pack(); } catch ( Throwable t ) {
@Override void removeControl (Control control) { super.removeControl (control); for (int i=0; i<items.length; i++) { ToolItem item = items [i]; if (item != null && item.control == control) { item.setControl (null); } } }
void removeControl (Control control) { super.removeControl (control); for (int i=0; i<itemCount; i++) { ToolItem item = items [i]; if (item.control == control) item.setControl (null); } }
private void addSeparator(ToolBar toolBar) { ToolItem item= new ToolItem(toolBar, SWT.SEPARATOR); item.setWidth(4); item.setControl(new Label(toolBar, SWT.NONE)); }
@Override void removeControl (Control control) { super.removeControl (control); ToolItem [] items = getItems (); for (int i=0; i<items.length; i++) { ToolItem item = items [i]; if (item.control == control) item.setControl (null); } }
@Override void removeControl (Control control) { super.removeControl (control); ToolItem [] items = getItems (); for (int i=0; i<items.length; i++) { ToolItem item = items [i]; if (item.control == control) item.setControl (null); } }
@Override void removeControl (Control control) { super.removeControl (control); ToolItem [] items = getItems (); for (int i=0; i<items.length; i++) { ToolItem item = items [i]; if (item.control == control) item.setControl (null); } }
@Override void removeChild( Control control ) { super.removeChild( control ); ToolItem[] items = itemHolder.getItems(); for( int i = 0; i < items.length; i++ ) { ToolItem item = items[ i ]; if( item != null && item.getControl() == control ) { item.setControl( null ); } } }
/** * 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)); } }
textItem.setControl(filterText); textItem.setWidth(filterText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
@Override public Control replace(ToolBar parent, Control control, Thing thing) { ActionContext actionContext = (ActionContext) control.getData("_designer_actionContext"); actionContext.peek().put("parent", parent); for(ToolItem item : parent.getItems()){ if(item.getControl() == control){ Thing itemThing = Designer.getThing(item); //清空 itemThing.getChilds().clear(); itemThing.addChild(thing); itemThing.save(); Control newControl = thing.doAction("create", actionContext); item.setControl(newControl); //parent.getItem(index).dispose(); control.dispose(); ToolBarCreator.initToolBar(parent); return newControl; } } return null; }
@Override public Control update(ToolBar parent, Control control) { ToolItem item = null; Thing itemThing = null; for(ToolItem citem : parent.getItems()){ if(citem.getControl() == control){ item = citem; itemThing = Designer.getThing(item); break; } } ActionContext actionContext = Designer.getActionContext(control); actionContext.peek().put("parent", parent); control.dispose(); for(Thing child : itemThing.getChilds()){ Object obj = child.doAction("create", actionContext); if(obj instanceof Control){ item.setControl((Control) obj); } } ToolBarCreator.initToolBar(parent); return item.getControl(); }
c.pack(); item.setWidth(c.getSize ().x); item.setControl(c);
sep.setControl(newCtrl); newCtrl.pack(); sep.setWidth(newCtrl.getSize().x);
sep.setControl(newCtrl); newCtrl.pack(); sep.setWidth(newCtrl.getSize().x);