public final class ElementTreeViewAdapter
extends java.lang.Object
ElementTree in a View.
A typical usage for a view would be to have a private instance:
private ElementTreeViewAdapter _elementTreeViewAdapter;That instance is initialized in the getGUI():
public Component getGUI() {
if (_ui == null) {
_elementTreeViewAdapter = new ElementTreeViewAdapter(this, rootElement);
_ui = _elementTreeViewAdapter.getComponent();
}
return _ui;
}
To handle the selection, add the following method to your view:
protected final Element[] getSelectionFromUI() {
return _elementTreeViewAdapter.getSelectionFromUI();
}| Constructor and Description |
|---|
ElementTreeViewAdapter(View view,
Element rootElement) |
| Modifier and Type | Method and Description |
|---|---|
javax.swing.JComponent |
getComponent() |
ElementTree |
getElementTree()
Get or create the
ElementTree. |
Element[] |
getSelectionFromUI()
This method can be called directly from your
View.getSelectionFromUI(): |
protected static java.util.concurrent.Future |
nextPage(ElementTree tree,
javax.swing.tree.TreePath path,
boolean selectFirstNewChild) |
void |
setDragAction(int action) |
public ElementTree getElementTree()
ElementTree.
You should use getComponent() if you intend to create the UI.public javax.swing.JComponent getComponent()
ElementTree hosted in a JScrollPanepublic Element[] getSelectionFromUI()
View.getSelectionFromUI():
protected final Element[] getSelectionFromUI() {
return _elementTreeViewAdapter.getSelectionFromUI();
}public void setDragAction(int action)
protected static java.util.concurrent.Future nextPage(ElementTree tree, javax.swing.tree.TreePath path, boolean selectFirstNewChild)