org.ceryle.ui.xnode
Class XNodeManager
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
org.ceryle.ui.xnode.XNodeManager
- All Implemented Interfaces:
- ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ListDataListener, ListSelectionListener, RootPaneContainer, WindowConstants
public class XNodeManager
- extends JDialog
- implements ListDataListener, ListSelectionListener
A singleton class that creates a dialog box used for managing XNodes
within Collections, including copying, moving, and deleting features.
- Since:
- JDK1.4
- Version:
- $Id: XNodeManager.java,v 3.18 2007-06-20 01:28:30 altheim Exp $
- Author:
- Murray Altheim
- See Also:
- Serialized Form
|
Field Summary |
static String |
dbMgrHelpNid
The node ID of the help document for this dialog. |
protected JTextArea |
help
|
static int |
LEFT
A constant indicating an action from right to left. |
static int |
RIGHT
A constant indicating an action from left to right. |
static int |
title_max
The maximum length of the displayed title prior to ellipsis. |
|
Method Summary |
void |
archive(Collection cids,
String zipBasename)
Archives the Collection cids containing the collection names
(as Strings) to a Zip file. |
void |
archiveCollection(String cid)
Archive collection cid. |
void |
archiveCollections()
Export the selected collections. |
protected void |
closeDialog()
Closes the dialog (disposing of it). |
void |
contentsChanged(ListDataEvent e)
A method required by the ListDataListener API informing
the desktop of any changes to the collections list. |
void |
copyNode(String scid,
String snid,
String dcid,
String dnid,
boolean move,
boolean overwrite)
Copy the XNode with ID snid from Collection scid
to XNode nid in the Collection ID cid. |
protected void |
copyToLeft(boolean move)
Delete the selected documents from right to left. |
protected void |
copyToRight(boolean move)
Copy the selected documents from left to right. |
protected void |
deleteDocuments()
Delete the selected documents. |
void |
exportCollection(String cid)
Exports the collection cid to either a directory of text or XNode (XML) files. |
static XNodeManager |
getInstance(DocumentView docview)
As this is a singleton class, this returns the single
instance of this class provided with an optional DocumentView. |
void |
importCollection(ActionListener listener)
Imports a new collection from a user-selected directory of files. |
protected void |
indexNodes(JList nodelist,
String cid,
String nid)
Set the Node list to the contents of the Collection whose ID is
cid, enable the node buttons, returning an Iterator over
the node list. |
void |
intervalAdded(ListDataEvent e)
A stub method required for API compliance. |
void |
intervalRemoved(ListDataEvent e)
A stub method required for API compliance. |
void |
restore(File file)
Restores one or more of the collections found in the selected Zip file. |
void |
selectDocument(String cid,
String nid)
Select the Collection and Document/Node based on their supplied IDs. |
void |
setDocumentView(DocumentView docview)
Sets the parent DocumentView for the XNodeManager. |
void |
valueChanged(ListSelectionEvent e)
Reacts to changes in the Collection or Node list. |
| Methods inherited from class javax.swing.JDialog |
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.awt.Dialog |
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, toBack, toFront |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
dbMgrHelpNid
public static final String dbMgrHelpNid
- The node ID of the help document for this dialog. Default is "dbManager".
- See Also:
- Constant Field Values
LEFT
public static final int LEFT
- A constant indicating an action from right to left.
- See Also:
- Constant Field Values
RIGHT
public static final int RIGHT
- A constant indicating an action from left to right.
- See Also:
- Constant Field Values
help
protected JTextArea help
title_max
public static int title_max
- The maximum length of the displayed title prior to ellipsis.
getInstance
public static XNodeManager getInstance(DocumentView docview)
- As this is a singleton class, this returns the single
instance of this class provided with an optional DocumentView.
setDocumentView
public void setDocumentView(DocumentView docview)
- Sets the parent DocumentView for the XNodeManager.
This affects which DocumentView's Collection and Node list is updated.
copyToRight
protected void copyToRight(boolean move)
- Copy the selected documents from left to right.
copyToLeft
protected void copyToLeft(boolean move)
- Delete the selected documents from right to left.
copyNode
public void copyNode(String scid,
String snid,
String dcid,
String dnid,
boolean move,
boolean overwrite)
- Copy the XNode with ID snid from Collection scid
to XNode nid in the Collection ID cid.
If move is true, will delete the source XNode once the copy has completed.
If overwrite is false, an attempt to overwrite will not succeed (registering an error).
This vets the various parameters and passes the functionality off to
XNodeStore.copyXNode(String,String,String,String,boolean,boolean).
- Parameters:
scid - the source Collection ID.snid - the source XNode ID.dcid - the destination Collection ID.dnid - the destination XNode ID.move - when true, deletes the source XNodeoverwrite - when true, will overwrite any existing dcid/dnid
deleteDocuments
protected void deleteDocuments()
- Delete the selected documents.
importCollection
public void importCollection(ActionListener listener)
- Imports a new collection from a user-selected directory of files.
This imports *.txt, *.htm, *.html, and *.xml files.
exportCollection
public void exportCollection(String cid)
- Exports the collection cid to either a directory of text or XNode (XML) files.
archiveCollections
public void archiveCollections()
- Export the selected collections.
archiveCollection
public void archiveCollection(String cid)
- Archive collection cid.
archive
public void archive(Collection cids,
String zipBasename)
- Archives the Collection cids containing the collection names
(as Strings) to a Zip file. The Zip file's name is autogenerated from
the optionally supplied base name.
restore
public void restore(File file)
- Restores one or more of the collections found in the selected Zip file.
If the parameter is null, a file selection dialog is displayed.
selectDocument
public void selectDocument(String cid,
String nid)
- Select the Collection and Document/Node based on their supplied IDs.
indexNodes
protected void indexNodes(JList nodelist,
String cid,
String nid)
- Set the Node list to the contents of the Collection whose ID is
cid, enable the node buttons, returning an Iterator over
the node list. If the Node nid is not null and is a member
of the specified collection, its ID will be selected and the list
will scroll to display it. This replaces any existing node list.
If cid is null, removes all elements (used to clear the list).
closeDialog
protected void closeDialog()
- Closes the dialog (disposing of it).
contentsChanged
public void contentsChanged(ListDataEvent e)
- A method required by the ListDataListener API informing
the desktop of any changes to the collections list.
- Specified by:
contentsChanged in interface ListDataListener
intervalAdded
public void intervalAdded(ListDataEvent e)
- A stub method required for API compliance.
- Specified by:
intervalAdded in interface ListDataListener
intervalRemoved
public void intervalRemoved(ListDataEvent e)
- A stub method required for API compliance.
- Specified by:
intervalRemoved in interface ListDataListener
valueChanged
public void valueChanged(ListSelectionEvent e)
- Reacts to changes in the Collection or Node list.
This is public only to comply with the ListDataListener API.
- Specified by:
valueChanged in interface ListSelectionListener
The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.