Java Code Examples for org.eclipse.swt.widgets.Tree#isDisposed()

The following examples show how to use org.eclipse.swt.widgets.Tree#isDisposed() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BaseOutlinePage.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
public boolean isDisconnectedFromTree() {
    TreeViewer treeViewer2 = getTreeViewer();
    if (treeViewer2 == null) {
        return true;
    }
    Tree tree = treeViewer2.getTree();
    if (tree == null) {
        return true;
    }
    return tree.isDisposed();
}
 
Example 2
Source File: TreeCompositeViewer.java    From ice with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * This operation sets the TreeComposite that should be displayed for the
 * current FormEditor.
 * 
 * @param tree
 *            The tree composite
 * @param source
 *            The source editor for the tree.
 */
public void setInput(TreeComposite tree, ICEFormEditor source) {

	if (tree != inputTree) {
		// Unregister from the old root TreeComposite, if possible.
		if (tree != null) {
			tree.unregister(this);
		}
		// Set the reference to the new root TreeComposite.
		inputTree = tree;

		// Clear the old meta data (parent and child maps).
		clearMetaData();

		if (inputTree != null) {
			// Load the root element. This also builds the meta data
			// associated with it.
			loadTree(inputTree);
			// Register with the root element. This also has the effect of
			// registering with all of its child data nodes and,
			// recursively, all of its child TreeComposites. New and deleted
			// children are registered and unregistered automatically.
			inputTree.register(this);
		}

		// Send the updated tree to the TreeViewer.
		Tree treeWidget = treeViewer.getTree();
		if (treeWidget != null && !treeWidget.isDisposed()) {
			treeViewer.setInput(inputTree);
		}

		// Set the name of the view
		setPartName(inputTree.getName() + " -- Tree View");
	}

	// Set the reference to the source of the input tree. It may need to be
	// marked as dirty later if the tree is updated.
	this.editor = source;

	return;
}