Java Code Examples for org.eclipse.swt.widgets.Button.dispose()

The following are Jave code examples for showing how to use dispose() of the org.eclipse.swt.widgets.Button class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: eZooKeeper   File: ZnodeAclComposite.java   View Source Code Vote up 5 votes
private void removeItems(TableItem[] items) {

        Table table = getTable();
        table.setRedraw(false);
        try {

            for (TableItem item : items) {

                Control schemeTableEditorControl = _SchemeTableEditor.getEditor();
                if (schemeTableEditorControl != null) {
                    schemeTableEditorControl.dispose();
                }

                _SchemeTableEditor.setEditor(null, item, 0);

                Control idTableEditorControl = _IdTableEditor.getEditor();
                if (idTableEditorControl != null) {
                    idTableEditorControl.dispose();
                }

                _IdTableEditor.setEditor(null, item, 1);

                for (int perm : PERMS) {
                    TableEditor tableEditor = getItemPermTableEditor(item, perm);
                    Button checkBox = (Button) tableEditor.getEditor();
                    tableEditor.dispose();
                    checkBox.dispose();
                }

                item.dispose();
            }
        }
        finally {
            table.setRedraw(true);
        }
    }
 
Example 2
Project: neoscada   File: VisibilityTester.java   View Source Code Vote up 5 votes
public void removeTester ( final Button button )
{
    button.dispose ();
    if ( this.dialog != null )
    {
        this.dialog.layout ();
    }
    checkDisposeDialog ();
}
 
Example 3
Project: Hydrograph   File: HydrographInstallationDialog.java   View Source Code Vote up 5 votes
public void update(String currentPageId) {
	if (composite == null || composite.isDisposed())
		return;
	GC metricsGC = new GC(composite);
	FontMetrics metrics = metricsGC.getFontMetrics();
	metricsGC.dispose();
	List buttons = (List) buttonMap.get(currentPageId);
	Control[] children = composite.getChildren();

	int visibleChildren = 0;
	Button closeButton = getButton(IDialogConstants.CLOSE_ID);

	for (int i = 0; i < children.length; i++) {
		Control control = children[i];
		if (closeButton == control)
			closeButton.dispose();
		else {
			control.setVisible(false);
			setButtonLayoutData(metrics, control, false);
		}
	}
	if (buttons != null) {
		for (int i = 0; i < buttons.size(); i++) {
			Button button = (Button) buttons.get(i);
			button.setVisible(true);
			setButtonLayoutData(metrics, button, true);
			GridData data = (GridData) button.getLayoutData();
			data.exclude = false;
			visibleChildren++;
		}
	}

	GridLayout compositeLayout = (GridLayout) composite.getLayout();
	compositeLayout.numColumns = visibleChildren;
	composite.layout(true);
}