## org.w3c.jigadmin.editors
Class ResourceTreeBrowser

    java.lang.Object
      |
      +--java.awt.Component
            |
            +--java.awt.Container
                  |
                  +--javax.swing.JComponent
                        |
                        +--javax.swing.JTree
                              |
                              +--org.w3c.jigadmin.editors.ResourceTreeBrowser

Direct Known Subclasses:
  FrameBrowser

public class ResourceTreeBrowser
extends javax.swing.JTree
implements java.awt.dnd.DropTargetListener, ResourceActionListener

A JTree used to manage RemoteResource.

See Also:
  Serialized Form

Inner classes inherited from class javax.swing.JTree
`javax.swing.JTree.AccessibleJTree, javax.swing.JTree.DynamicUtilTreeNode, javax.swing.JTree.EmptySelectionModel, javax.swing.JTree.TreeModelHandler, javax.swing.JTree.TreeSelectionRedirector`

Inner classes inherited from class javax.swing.JComponent
`javax.swing.JComponent.AccessibleJComponent`

Field Summary
`static java.lang.String` `DELETE_RESOURCE_AC`
`protected javax.swing.JDialog` `popup`
`protected java.lang.String` `resClassname`
`protected java.lang.String` `resIdentifier`
`protected RemoteResourceWrapperNode` `rootNode`

Fields inherited from class javax.swing.JTree

`CELL_EDITOR_PROPERTY, CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, editable, EDITABLE_PROPERTY, INVOKES_STOP_CELL_EDITING_PROPERTY, invokesStopCellEditing, LARGE_MODEL_PROPERTY, largeModel, ROOT_VISIBLE_PROPERTY, rootVisible, ROW_HEIGHT_PROPERTY, rowHeight, SCROLLS_ON_EXPAND_PROPERTY, scrollsOnExpand, SELECTION_MODEL_PROPERTY, selectionModel, selectionRedirector, SHOWS_ROOT_HANDLES_PROPERTY, showsRootHandles, toggleClickCount, TREE_MODEL_PROPERTY, treeModel, treeModelListener, VISIBLE_ROW_COUNT_PROPERTY, visibleRowCount`

Fields inherited from class javax.swing.JComponent
`accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW`

Fields inherited from class java.awt.Component
`BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

Constructor Summary
`protected` `ResourceTreeBrowser(RemoteResourceWrapperNode root)` Constructor

Method Summary
`protected void` `addResource(java.lang.String identifier, java.lang.String classname, RemoteResourceWrapper rrwf, javax.swing.tree.TreePath fpath)` Add a resource to the resource wrapped.
`protected void` `addResourceToSelectedContainer()` Add a (new) resource to the container associated to the selected node.
`protected void` `addResourceToSelectedContainer(java.lang.String classname, java.lang.String identifier)` Add a resource to the selected container.
`protected void` `deleteResource(RemoteResourceWrapper rrw)` Delete the resource wrapped by the given wrapper
`protected void` `deleteSelectedResources()` Delete the resources associated to the selected nodes.
`protected void` `disposeAddResourcePopup()` Dispose the "add resource" popup
`protected void` `doubleClick(javax.swing.tree.TreePath path)` A double click occured on the node with the given path.
`void` `dragEnter(java.awt.dnd.DropTargetDragEvent dropTargetDragEvent)` a Drag operation has encountered the DropTarget
`void` `dragExit(java.awt.dnd.DropTargetEvent dropTargetEvent)` The Drag operation has departed the DropTarget without dropping.
`void` `dragOver(java.awt.dnd.DropTargetDragEvent dropTargetDragEvent)` a Drag operation is ongoing on the DropTarget
`void` `drop(java.awt.dnd.DropTargetDropEvent dropTargetDropEvent)` The Drag operation has terminated with a Drop on this DropTarget
`void` `dropActionChanged(java.awt.dnd.DropTargetDragEvent dropTargetDragEvent)` The user as modified the current drop gesture
`protected boolean` `dropResource(ResourceCell cell)` Drop a resource.
`protected AddResourcePanel` `getAddResourcePanel(java.lang.String title, RemoteResourceWrapper rrw)` Get the Panel used to add a new resource
`protected java.lang.String` `getIdentifier(ResourceCell cell, RemoteResourceWrapper rrw)` Get (compute) the resource identifier of the dropped resource.
`protected javax.swing.JPopupMenu` `getPopupMenu(RemoteResourceWrapper rrw)` Get the popup menu relative to the selected resource.
`static ResourceTreeBrowser` `getResourceTreeBrowser(RemoteResourceWrapper rrw, java.lang.String rootName)` Get a ResourceTreeBrowser.
`protected RemoteResourceWrapper` `getSelectedResourceWrapper()` Get the RemoteResourceWrapper associated to the selected node.
`protected RemoteResourceWrapper` `getSelectedResourceWrapper(javax.swing.tree.TreePath path)` Get the RemoteResourceWrapper associated to the selected node.
`boolean` `isDragging()` Is the mouse dragging something on the resource tree?
`protected void` `popupAddResourceDialog(java.lang.String title, RemoteResourceWrapper rrw)` Popup a "add resource" Dialog
`protected void` `popupResource(RemoteResourceWrapper rrw)` Popup a dialog where the user can edit the resource properties.
`protected void` `reindexResource(RemoteResourceWrapper rrw, boolean rec)` Reindex the container wrapped by the given wrapper.
`protected void` `reindexSelectedResources(boolean rec)` Reindex the containers associated to the selected nodes.
`protected javax.swing.tree.TreePath[]` `removeDescendants(javax.swing.tree.TreePath[] paths)` Filter the TreePath array.
`void` `resourceActionPerformed(ResourceActionEvent e)` A resource action occured.
`protected void` `setCursor(int cursor)` Set the cursor.
`protected void` `setResourceToAdd(java.lang.String classname, java.lang.String identifier)` Specify some properties of the resource to add
`protected void` `showReferenceDocumentation()` Display (in another frame) the reference documentation relative to the resource associated to the selected node.
`protected void` `simpleClick(javax.swing.tree.TreePath path)` A simle click occured on the node with the given path.

Methods inherited from class javax.swing.JTree

`addSelectionInterval, addSelectionPath, addSelectionPaths, addSelectionRow, addSelectionRows, addTreeExpansionListener, addTreeSelectionListener, addTreeWillExpandListener, cancelEditing, clearSelection, clearToggledPaths, collapsePath, collapseRow, convertValueToText, createTreeModel, createTreeModelListener, expandPath, expandRow, fireTreeCollapsed, fireTreeExpanded, fireTreeWillCollapse, fireTreeWillExpand, fireValueChanged, getAccessibleContext, getCellEditor, getCellRenderer, getClosestPathForLocation, getClosestRowForLocation, getDefaultTreeModel, getDescendantToggledPaths, getEditingPath, getExpandedDescendants, getInvokesStopCellEditing, getLastSelectedPathComponent, getLeadSelectionPath, getLeadSelectionRow, getMaxSelectionRow, getMinSelectionRow, getModel, getPathBetweenRows, getPathBounds, getPathForLocation, getPathForRow, getPreferredScrollableViewportSize, getRowBounds, getRowCount, getRowForLocation, getRowForPath, getRowHeight, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getScrollsOnExpand, getSelectionCount, getSelectionModel, getSelectionPath, getSelectionPaths, getSelectionRows, getShowsRootHandles, getToolTipText, getUI, getUIClassID, getVisibleRowCount, hasBeenExpanded, isCollapsed, isCollapsed, isEditable, isEditing, isExpanded, isExpanded, isFixedRowHeight, isLargeModel, isPathEditable, isPathSelected, isRootVisible, isRowSelected, isSelectionEmpty, isVisible, makeVisible, paramString, removeDescendantToggledPaths, removeSelectionInterval, removeSelectionPath, removeSelectionPaths, removeSelectionRow, removeSelectionRows, removeTreeExpansionListener, removeTreeSelectionListener, removeTreeWillExpandListener, scrollPathToVisible, scrollRowToVisible, setCellEditor, setCellRenderer, setEditable, setExpandedState, setInvokesStopCellEditing, setLargeModel, setModel, setRootVisible, setRowHeight, setScrollsOnExpand, setSelectionInterval, setSelectionModel, setSelectionPath, setSelectionPaths, setSelectionRow, setSelectionRows, setShowsRootHandles, setUI, setVisibleRowCount, startEditingAtPath, stopEditing, treeDidChange, updateUI`

Methods inherited from class javax.swing.JComponent

`addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update`

Methods inherited from class java.awt.Container

`add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree`

Methods inherited from class java.awt.Component

`action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### DELETE_RESOURCE_AC

    public static final java.lang.String DELETE_RESOURCE_AC

### rootNode

    protected RemoteResourceWrapperNode rootNode

### resIdentifier

    protected java.lang.String resIdentifier

### resClassname

    protected java.lang.String resClassname

### popup

    protected javax.swing.JDialog popup

Constructor Detail

### ResourceTreeBrowser

    protected ResourceTreeBrowser(RemoteResourceWrapperNode root)

  Constructor
  Parameters:
    `root` - The root node

Method Detail

### isDragging

    public boolean isDragging()

  Is the mouse dragging something on the resource tree?
  Returns:
    a boolean

### dragEnter

    public void dragEnter(java.awt.dnd.DropTargetDragEvent dropTargetDragEvent)

  a Drag operation has encountered the DropTarget
  Specified by:
    dragEnter in interface java.awt.dnd.DropTargetListener

### dragExit

    public void dragExit(java.awt.dnd.DropTargetEvent dropTargetEvent)

  The Drag operation has departed the DropTarget without dropping.
  Specified by:
    dragExit in interface java.awt.dnd.DropTargetListener

### dragOver

    public void dragOver(java.awt.dnd.DropTargetDragEvent dropTargetDragEvent)

  a Drag operation is ongoing on the DropTarget
  Specified by:
    dragOver in interface java.awt.dnd.DropTargetListener

### dropActionChanged

    public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dropTargetDragEvent)

  The user as modified the current drop gesture
  Specified by:
    dropActionChanged in interface java.awt.dnd.DropTargetListener

### drop

    public void drop(java.awt.dnd.DropTargetDropEvent dropTargetDropEvent)

  The Drag operation has terminated with a Drop on this DropTarget
  Specified by:
    drop in interface java.awt.dnd.DropTargetListener

### dropResource

    protected boolean dropResource(ResourceCell cell)

  Drop a resource.
  Parameters:
    `cell` - The resource cell
  See Also:
    `ResourceCell`

### resourceActionPerformed

    public void resourceActionPerformed(ResourceActionEvent e)

  A resource action occured.
  Specified by:
    resourceActionPerformed in interface ResourceActionListener
  Parameters:
    `e` - the ResourceActionEvent

### addResource

    protected void addResource(java.lang.String identifier,
                               java.lang.String classname,
                               RemoteResourceWrapper rrwf,
                               javax.swing.tree.TreePath fpath)
                        throws RemoteAccessException

  Add a resource to the resource wrapped.
  Parameters:
    `identifier` - The new resource identifier
    `classname` - The new resource class name
    `rrwf` - the Wrapper of the father resource
    `fpath` - The path of the father node

### addResourceToSelectedContainer

    protected void addResourceToSelectedContainer(java.lang.String classname,
                                                  java.lang.String identifier)
                                           throws RemoteAccessException

  Add a resource to the selected container.
  Parameters:
    `classname` - the resource class name
    `identifier` - the resource identifier

### getIdentifier

    protected java.lang.String getIdentifier(ResourceCell cell,
                                             RemoteResourceWrapper rrw)
                                      throws RemoteAccessException

  Get (compute) the resource identifier of the dropped resource.
  Parameters:
    `cell` - the ResourceCell dropped
    `rrw` - the RemoteResourceWrapper of the father
  Returns:
    a String instance
  See Also:
    `ResourceCell`

### getSelectedResourceWrapper

    protected RemoteResourceWrapper getSelectedResourceWrapper()

  Get the RemoteResourceWrapper associated to the selected node.
  Returns:
    a RemoteResourceWrapper

### getSelectedResourceWrapper

    protected RemoteResourceWrapper getSelectedResourceWrapper(javax.swing.tree.TreePath path)

  Get the RemoteResourceWrapper associated to the selected node.
  Parameters:
    `path` - the selected path
  Returns:
    a RemoteResourceWrapper

### getAddResourcePanel

    protected AddResourcePanel getAddResourcePanel(java.lang.String title,
                                                   RemoteResourceWrapper rrw)
                                            throws RemoteAccessException

  Get the Panel used to add a new resource
  Parameters:
    `title` - The title
    `rrw` - The wrapper of the father RemoteResource
  Returns:
    a AddResourcePanel instance
  See Also:
    `AddResourcePanel`

### popupAddResourceDialog

    protected void popupAddResourceDialog(java.lang.String title,
                                          RemoteResourceWrapper rrw)

  Popup a "add resource" Dialog
  Parameters:
    `title` - the popup title
    `rrw` - The wrapper of the father RemoteResource

### disposeAddResourcePopup

    protected void disposeAddResourcePopup()

  Dispose the "add resource" popup

### setResourceToAdd

    protected void setResourceToAdd(java.lang.String classname,
                                    java.lang.String identifier)

  Specify some properties of the resource to add
  Parameters:
    `classnema` - the new resource class name
    `identifier` - the new resource identifier

### addResourceToSelectedContainer

    protected void addResourceToSelectedContainer()

  Add a (new) resource to the container associated to the selected node.

### removeDescendants

    protected javax.swing.tree.TreePath[] removeDescendants(javax.swing.tree.TreePath[] paths)

  Filter the TreePath array. Remove all nodes that have one of their parent in this array.
  Parameters:
    `paths` - the TreePath array
  Returns:
    the filtered array

### reindexSelectedResources

    protected void reindexSelectedResources(boolean rec)

  Reindex the containers associated to the selected nodes. Display an error message (dialog) if there is no node selected or if one of the selected resource is not a ResourceContainer.
  Parameters:
    `rec` - recursivly?

### reindexResource

    protected void reindexResource(RemoteResourceWrapper rrw,
                                   boolean rec)
                            throws RemoteAccessException

  Reindex the container wrapped by the given wrapper. Display an error message (dialog) if the resource is not a ResourceContainer.
  Parameters:
    `rrw` - the RemoteResourceWrapper
    `rec` - recursivly?
  Throws:
    RemoteAccessException - if a Remote Error occurs

### deleteSelectedResources

    protected void deleteSelectedResources()

  Delete the resources associated to the selected nodes. Display an error message if there is no node selected or if the resource is not editable.

### deleteResource

    protected void deleteResource(RemoteResourceWrapper rrw)
                           throws RemoteAccessException

  Delete the resource wrapped by the given wrapper
  Parameters:
    `rrw` - The RemoteResourceWrapper

### showReferenceDocumentation

    protected void showReferenceDocumentation()

  Display (in another frame) the reference documentation relative to the resource associated to the selected node. Display en error message (dialog) if no node is selected.

### simpleClick

    protected void simpleClick(javax.swing.tree.TreePath path)

  A simle click occured on the node with the given path.
  Parameters:
    `path` - The path where the click occured.

### doubleClick

    protected void doubleClick(javax.swing.tree.TreePath path)

  A double click occured on the node with the given path.
  Parameters:
    `path` - The path where the double click occured.

### popupResource

    protected void popupResource(RemoteResourceWrapper rrw)

  Popup a dialog where the user can edit the resource properties.
  Parameters:
    `rrw` - the wrapper if the resource to edit.

### setCursor

    protected void setCursor(int cursor)

  Set the cursor.
  Parameters:
    `a` - cursor type

### getPopupMenu

    protected javax.swing.JPopupMenu getPopupMenu(RemoteResourceWrapper rrw)

  Get the popup menu relative to the selected resource.
  Parameters:
    `rrw` - the wrapper of the resource
  Returns:
    a JPopupMenu instance

### getResourceTreeBrowser

    public static ResourceTreeBrowser getResourceTreeBrowser(RemoteResourceWrapper rrw,
                                                             java.lang.String rootName)

  Get a ResourceTreeBrowser.
  Parameters:
    `rrw` - The root resource
    `rootName` - The root identifier.
  Returns:
    a ResourceTreeBrowser instance