List of usage examples for org.eclipse.jface.viewers TreeViewer setHasChildren
public void setHasChildren(final Object elementOrTreePath, final boolean hasChildren)
From source file:com.puppetlabs.geppetto.puppetdb.ui.treenode.LeafNode.java
License:Open Source License
@Override public void updateHasChildren(TreeViewer viewer) { viewer.setHasChildren(this, false); }
From source file:com.puppetlabs.geppetto.puppetdb.ui.views.PuppetDBQuery.java
License:Open Source License
@Override public void updateHasChildren(TreeViewer viewer) { viewer.setHasChildren(this, true); }
From source file:org.eclipse.viatra.query.tooling.ui.queryexplorer.content.matcher.CompositeContent.java
License:Open Source License
/** * Call this method if the element is already present in the tree viewer, but it is not expanded yet and the * children list has changed. In this case, even if the children are updated properly, the tree viewer will not show * that the element has children. Calling this method only has effect if the element is not expanded yet (because in * these cases the observable list propagates the updates properly). */// ww w . ja v a2s . c o m public void updateHasChildren() { // only perform it for items which are not expanded, ClassCastException will be thrown otherwise // due to the lazy tree content provider if (QueryExplorer.getInstance() != null) { TreeViewer viewer = QueryExplorer.getInstance().getMatcherTreeViewer(); if (!viewer.getExpandedState(this)) { viewer.setHasChildren(this, getChildren().size() > 0); } //Bug 491506: This explicit refresh avoid display issues on Linux viewer.refresh(this, true); } }