@Override public void runAction() { fieldItem.dispose(); parent.layout(true, true); } };
@Override final void releaseChildren() { ToolItem[] toolItems = itemHolder.getItems(); for( int i = 0; i < toolItems.length; i++ ) { toolItems[ i ].dispose(); } }
private void removePerspectiveItem(MPerspective toRemove) { ToolItem psItem = getItemFor(toRemove); if (psItem != null) { psItem.dispose(); } // update the size fixSize(); }
private void clearFilter() { for(ToolItem item: filterBar.getItems()) { Object data = item.getData(); if( data== null ) continue; if( data instanceof Field ) item.dispose(); } } }
public void dispose () { if ( this.summaryProvider != null ) { this.summaryProvider.dispose (); } this.styler.dispose (); this.blinker.dispose (); this.button.dispose (); }
void calculateChevronTrim() { ToolBar tb = new ToolBar( parent, SWT.FLAT ); ToolItem ti = new ToolItem( tb, SWT.PUSH ); // Image image = new Image (display, 1, 1); // ti.setImage (image); Point size = tb.computeSize( SWT.DEFAULT, SWT.DEFAULT ); size = parent.fixPoint( size.x, size.y ); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose(); ti.dispose(); // image.dispose (); }
void calculateChevronTrim () { ToolBar tb = new ToolBar (parent, SWT.FLAT); ToolItem ti = new ToolItem (tb, SWT.PUSH); Image image = new Image (display, 1, 1); ti.setImage (image); Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT); size = parent.fixPoint(size.x, size.y); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose (); ti.dispose (); image.dispose (); } /**
void calculateChevronTrim () { ToolBar tb = new ToolBar (parent, SWT.FLAT); ToolItem ti = new ToolItem (tb, SWT.PUSH); Image image = new Image (display, 1, 1); ti.setImage (image); Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT); size = parent.fixPoint(size.x, size.y); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose (); ti.dispose (); image.dispose (); } /**
void calculateChevronTrim () { ToolBar tb = new ToolBar (parent, SWT.FLAT); ToolItem ti = new ToolItem (tb, SWT.PUSH); Image image = new Image (display, 1, 1); ti.setImage (image); Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT); size = parent.fixPoint(size.x, size.y); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose (); ti.dispose (); image.dispose (); } /**
void calculateChevronTrim () { ToolBar tb = new ToolBar (parent, SWT.FLAT); ToolItem ti = new ToolItem (tb, SWT.PUSH); Image image = new Image (display, 1, 1); ti.setImage (image); Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT); size = parent.fixPoint(size.x, size.y); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose (); ti.dispose (); image.dispose (); } /**
if (toolBar != null) { for (ToolItem toolItem : toolBar.getItems()) { toolItem.dispose();
parent.addDisposeListener(e -> { toolItem.dispose(); toolItem = null; });
@Override public Control remove(ToolBar parent, Control control) { for(ToolItem item : parent.getItems()){ if(item.getControl() == control){ Thing parentThing = Designer.getThing(parent); Thing itemThing = Designer.getThing(item); parentThing.removeChild(itemThing); parentThing.save(); ItemInfo itemInfo = getItemIndex(parent, control); int index = itemInfo != null ? itemInfo.index : -1; item.dispose(); control.dispose(); ToolBarCreator.initToolBar(parent); if(index != -1){ if(index > 0 && parent.getItemCount() > index - 1){ return parent.getItem(index - 1).getControl(); }if(parent.getItemCount() > index){ return parent.getItem(index).getControl(); } } return parent; } } return null; }
trimStackTB.getItem(trimStackTB.getItemCount() - 1).dispose();
trimStackTB.getItem(trimStackTB.getItemCount() - 1).dispose();