|
org.netbeans.spi.viewmodel/2 1.32.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.spi.viewmodel.Models.CompoundModel
public static final class Models.CompoundModel
This model encapsulates all currently supported models.
Models.createCompoundModel(java.util.List)
Field Summary |
---|
Fields inherited from interface org.netbeans.spi.viewmodel.TreeModel |
---|
ROOT |
Method Summary | |
---|---|
void |
addModelListener(ModelListener l)
Registers given listener. |
Executor |
asynchronous(AsynchronousModelFilter.CALL asynchCall,
Object node)
|
boolean |
canCopy(Object node)
Test whether this node permits copying. |
boolean |
canCut(Object node)
Test whether this node permits cutting. |
boolean |
canEditCell(Object node,
String columnID)
Test whether this renderer can edit the given cell. |
boolean |
canRename(Object node)
Test whether this node permits renaming. |
boolean |
canRenderCell(Object node,
String columnID)
Test whether this renderer can render the given cell. |
boolean |
canReorder(Object parent)
Provide if this model implementation can reorder children nodes. |
Transferable |
clipboardCopy(Object node)
Called when a node is to be copied to the clipboard. |
Transferable |
clipboardCut(Object node)
Called when a node is to be cut to the clipboard. |
Transferable |
drag(Object node)
Initiate a drag operation. |
Action[] |
getActions(Object node)
Returns set of actions for given node. |
int |
getAllowedDragActions()
Action constants from DnDConstants . |
int |
getAllowedDropActions(Transferable t)
Action constants from DnDConstants . |
TableCellEditor |
getCellEditor(Object node,
String columnID)
Get the editor of the given cell |
TableCellRenderer |
getCellRenderer(Object node,
String columnID)
Get the renderer of the given cell |
Object[] |
getChildren(Object parent,
int from,
int to)
Returns children for given parent on given indexes. |
int |
getChildrenCount(Object node)
Returns number of children for given node. |
ColumnModel[] |
getColumns()
Returns sorted array of ColumnModel s. |
String |
getDisplayName(Object node)
Returns display name for given node. |
PasteType |
getDropType(Object node,
Transferable t,
int action,
int index)
Determines if there is a paste operation that can be performed on provided transferable when drop is done. |
String |
getHelpId()
Get a help ID for this model. |
String |
getIconBase(Object node)
Returns icon for given node. |
String |
getIconBaseWithExtension(Object node)
Returns icon resource with extension for given node. |
PasteType[] |
getPasteTypes(Object node,
Transferable t)
Determine which paste operations are allowed when a given transferable is in the clipboard. |
Object |
getRoot()
Returns the root node of the tree or null, if the tree is empty. |
String |
getShortDescription(Object node)
Returns tooltip for given node. |
Object |
getValueAt(Object node,
String columnID)
Returns value to be displayed in column columnID
and row identified by node . |
boolean |
isCheckable(Object node)
Tell the renderer to display the check-box. |
boolean |
isCheckEnabled(Object node)
Provide the enabled state of the check-box. |
boolean |
isExpanded(Object node)
Defines default state (collapsed, expanded) of given node. |
boolean |
isLeaf(Object node)
Returns true if node is leaf. |
boolean |
isReadOnly(Object node,
String columnID)
Returns true if value displayed in column columnID
and row node is read only. |
Boolean |
isSelected(Object node)
Provide the selected state of the check-box. |
void |
nodeCollapsed(Object node)
Called when given node is collapsed. |
void |
nodeExpanded(Object node)
Called when given node is expanded. |
void |
performDefaultAction(Object node)
Performs default action for given node. |
void |
removeModelListener(ModelListener l)
Unregisters given listener. |
void |
reorder(Object parent,
int[] perm)
Reorder children nodes with a given permutation. |
void |
setName(Object node,
String name)
Sets a new name for given node. |
void |
setSelected(Object node,
Boolean selected)
Called by the renderer when the check-box gets selected/unselected |
void |
setValueAt(Object node,
String columnID,
Object value)
Changes a value displayed in column columnID
and row node . |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public String getHelpId()
null
.public Object getRoot()
getRoot
in interface TreeModel
public Object[] getChildren(Object parent, int from, int to) throws UnknownTypeException
getChildren
in interface TreeModel
parent
- a parent of returned nodesfrom
- a start indexto
- a end index
UnknownTypeException
- if this TreeModel implementation is not
able to resolve dchildren for given node typeTreeModel.getChildrenCount(java.lang.Object)
public int getChildrenCount(Object node) throws UnknownTypeException
getChildrenCount
in interface TreeModel
node
- the parent node
UnknownTypeException
- if this TreeModel implementation is not
able to resolve children for given node typeTreeModel.getChildren(java.lang.Object, int, int)
public boolean isLeaf(Object node) throws UnknownTypeException
isLeaf
in interface TreeModel
UnknownTypeException
- if this TreeModel implementation is not
able to resolve dchildren for given node typepublic boolean canReorder(Object parent) throws UnknownTypeException
ReorderableTreeModel
canReorder
in interface ReorderableTreeModel
parent
- The parent node of children that are test for reorder
true
if this model can handle reordering of children,
false
otherwise
UnknownTypeException
- if this model implementation is not
able to decide the reorder capability for given node typepublic void reorder(Object parent, int[] perm) throws UnknownTypeException
ReorderableTreeModel
reorder
in interface ReorderableTreeModel
parent
- The parent node of children that are being reorderedperm
- permutation with the length of current child nodes. The permutation
lists the new positions of the original nodes, that is, for nodes
[A,B,C,D]
and permutation [0,3,1,2]
, the final
order would be [A,C,D,B]
.
UnknownTypeException
- if this model implementation is not
able to perform the reorder for given node typepublic String getDisplayName(Object node) throws UnknownTypeException
getDisplayName
in interface NodeModel
UnknownTypeException
- if this NodeModel implementation is not
able to resolve display name for given node typepublic String getShortDescription(Object node) throws UnknownTypeException
getShortDescription
in interface NodeModel
UnknownTypeException
- if this NodeModel implementation is not
able to resolve tooltip for given node typepublic String getIconBase(Object node) throws UnknownTypeException
getIconBase
in interface NodeModel
UnknownTypeException
- if this NodeModel implementation is not
able to resolve icon for given node typepublic void performDefaultAction(Object node) throws UnknownTypeException
performDefaultAction
in interface NodeActionsProvider
UnknownTypeException
- if this NodeActionsProvider implementation
is not able to resolve actions for given node typepublic Action[] getActions(Object node) throws UnknownTypeException
getActions
in interface NodeActionsProvider
UnknownTypeException
- if this NodeActionsProvider implementation
is not able to resolve actions for given node typepublic ColumnModel[] getColumns()
ColumnModel
s.
public Object getValueAt(Object node, String columnID) throws UnknownTypeException
TableModel
columnID
and row identified by node
. Column ID is defined in by
ColumnModel.getID()
, and rows are defined by values returned from
TreeModel.getChildren(java.lang.Object, int, int)
.
getValueAt
in interface TableModel
node
- a object returned from
TreeModel.getChildren(java.lang.Object, int, int)
for this rowcolumnID
- a id of column defined by ColumnModel.getID()
UnknownTypeException
- if there is no TableModel defined for given
parameter typepublic boolean isReadOnly(Object node, String columnID) throws UnknownTypeException
TableModel
columnID
and row node
is read only. Column ID is defined in by
ColumnModel.getID()
, and rows are defined by values returned from
TreeModel.getChildren(java.lang.Object, int, int)
.
isReadOnly
in interface TableModel
node
- a object returned from TreeModel.getChildren(java.lang.Object, int, int)
for this rowcolumnID
- a id of column defined by ColumnModel.getID()
UnknownTypeException
- if there is no TableModel defined for given
parameter typepublic void setValueAt(Object node, String columnID, Object value) throws UnknownTypeException
TableModel
columnID
and row node
. Column ID is defined in by
ColumnModel.getID()
, and rows are defined by values returned from
TreeModel.getChildren(java.lang.Object, int, int)
.
setValueAt
in interface TableModel
node
- a object returned from TreeModel.getChildren(java.lang.Object, int, int)
for this rowcolumnID
- a id of column defined by ColumnModel.getID()
value
- a new value of variable on given position
UnknownTypeException
- if there is no TableModel defined for given
parameter typepublic boolean isExpanded(Object node) throws UnknownTypeException
isExpanded
in interface TreeExpansionModel
node
- a node
UnknownTypeException
public void nodeExpanded(Object node)
nodeExpanded
in interface TreeExpansionModel
node
- a expanded nodepublic void nodeCollapsed(Object node)
nodeCollapsed
in interface TreeExpansionModel
node
- a collapsed nodepublic void addModelListener(ModelListener l)
addModelListener
in interface NodeModel
addModelListener
in interface TableModel
addModelListener
in interface TableRendererModel
addModelListener
in interface TreeModel
l
- the listener to addpublic void removeModelListener(ModelListener l)
removeModelListener
in interface NodeModel
removeModelListener
in interface TableModel
removeModelListener
in interface TableRendererModel
removeModelListener
in interface TreeModel
l
- the listener to removepublic String toString()
toString
in class Object
public boolean canRename(Object node) throws UnknownTypeException
ExtendedNodeModel
canRename
in interface ExtendedNodeModel
true
if so
UnknownTypeException
public boolean canCopy(Object node) throws UnknownTypeException
ExtendedNodeModel
canCopy
in interface ExtendedNodeModel
true
if so
UnknownTypeException
public boolean canCut(Object node) throws UnknownTypeException
ExtendedNodeModel
canCut
in interface ExtendedNodeModel
true
if so
UnknownTypeException
public Transferable clipboardCopy(Object node) throws IOException, UnknownTypeException
ExtendedNodeModel
clipboardCopy
in interface ExtendedNodeModel
node
- The node object
IOException
- when the copy cannot be performed
UnknownTypeException
public Transferable clipboardCut(Object node) throws IOException, UnknownTypeException
ExtendedNodeModel
clipboardCut
in interface ExtendedNodeModel
node
- The node object
IOException
- when the cut cannot be performed
UnknownTypeException
public int getAllowedDragActions()
DnDNodeModel
DnDConstants
.
No actions are allowed by default.
getAllowedDragActions
in interface DnDNodeModel
public int getAllowedDropActions(Transferable t)
DnDNodeModel
DnDConstants
.
No actions are allowed by default.
getAllowedDropActions
in interface DnDNodeModel
t
- The transferable for which the allowed drop actions are requested,
or null
to get actions for the creation of DropTarget for the view.
public Transferable drag(Object node) throws IOException, UnknownTypeException
DnDNodeModel
drag
in interface DnDNodeModel
node
- The node to drag
IOException
- when the drag cannot be performed
UnknownTypeException
- if this model implementation is not
able to perform drag for given node typepublic PasteType[] getPasteTypes(Object node, Transferable t) throws UnknownTypeException
ExtendedNodeModel
getPasteTypes
in interface ExtendedNodeModel
node
- The node objectt
- the transferable in the clipboard
UnknownTypeException
public PasteType getDropType(Object node, Transferable t, int action, int index) throws UnknownTypeException
DnDNodeModel
getDropType
in interface DnDNodeModel
node
- The node where to dropt
- the transferable to dropaction
- the Drag and Drop action from DnDConstants
index
- index between children the drop occured at or -1 if not specified
UnknownTypeException
- if this model implementation is not
able to perform drop for given node typepublic void setName(Object node, String name) throws UnknownTypeException
ExtendedNodeModel
setName
in interface ExtendedNodeModel
node
- The object to set the new name to.name
- The new name for the given node
UnknownTypeException
public String getIconBaseWithExtension(Object node) throws UnknownTypeException
ExtendedNodeModel
org.netbeans.spi.viewmodel.NodeModel.getIconBase
getIconBaseWithExtension
in interface ExtendedNodeModel
node
- The node object
UnknownTypeException
- if this NodeModel implementation is not
able to resolve icon for given node typepublic boolean isCheckable(Object node) throws UnknownTypeException
CheckNodeModel
isCheckable
in interface CheckNodeModel
node
- the tree node object
true
if the check-box should be displayed, false
otherwise.
UnknownTypeException
public boolean isCheckEnabled(Object node) throws UnknownTypeException
CheckNodeModel
isCheckEnabled
in interface CheckNodeModel
node
- the tree node object
true
if the check-box should be enabled, false
otherwise.
UnknownTypeException
public Boolean isSelected(Object node) throws UnknownTypeException
CheckNodeModel
isSelected
in interface CheckNodeModel
node
- the tree node object
true
if the check-box should be selected,
false
if it should be unselected and
null
if the state is unknown.
UnknownTypeException
public void setSelected(Object node, Boolean selected) throws UnknownTypeException
CheckNodeModel
setSelected
in interface CheckNodeModel
node
- the tree node objectselected
- true
if the check-box was selected,
false
if the check-box was unselected.
UnknownTypeException
public Executor asynchronous(AsynchronousModelFilter.CALL asynchCall, Object node) throws UnknownTypeException
UnknownTypeException
public boolean canRenderCell(Object node, String columnID) throws UnknownTypeException
TableRendererModel
canRenderCell
in interface TableRendererModel
node
- Tree node representing the rowcolumnID
- The column name
true
if the implementation can render the given cell, false
otherwise
UnknownTypeException
- If the implementation can not decide whether to render the given cell.public TableCellRenderer getCellRenderer(Object node, String columnID) throws UnknownTypeException
TableRendererModel
getCellRenderer
in interface TableRendererModel
node
- Tree node representing the rowcolumnID
- The column name
UnknownTypeException
- If the implementation can not render the given cell.public boolean canEditCell(Object node, String columnID) throws UnknownTypeException
TableRendererModel
canEditCell
in interface TableRendererModel
node
- Tree node representing the rowcolumnID
- The column name
true
if the implementation can edit the given cell, false
otherwise
UnknownTypeException
- If the implementation can not decide whether to edit the given cell.public TableCellEditor getCellEditor(Object node, String columnID) throws UnknownTypeException
TableRendererModel
getCellEditor
in interface TableRendererModel
node
- Tree node representing the rowcolumnID
- The column name
UnknownTypeException
- If the implementation can not edit the given cell.
|
org.netbeans.spi.viewmodel/2 1.32.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |