|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.ceryle.XNodeShell
public class XNodeShell
This driver class can be used to launch the XNode shell UI application. This includes a lightweight application framework with a menu bar and editable text area. This is a singleton class because the XNode database implementation doesn't currently implement record locking.
Ceryle XNodeShell
The XNode Implementation (the package org.ceryle.xnode.*, both its source code and documentation), are released under the Apache 2.0 License. For more details, check the LICENSE file contained with the distribution, or see The Ceryle Project for more information. It is distributed with no warranty.
Note that the XNodeShell implementation uses the core set of the Ceryle message text resources, using only the ResourceBundle associated with the org.ceryle.util.MsgId/org.ceryle.util.Msg classes (but not MessageId/Messages). All MsgId keys must begin with an underscore character ("_").
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
APP_NAME
The displayed name of the application. |
File |
homeDirectory
The Ceryle application home directory. |
File |
m_defaultDirectory
The default directory used by the application for file operations. |
static int |
maxOutputChars
The maximum number of characters to show in the message area at any time. |
static String |
PROPERTY_USER_DIR
The System property name for the user directory. |
| Fields inherited from class javax.swing.JFrame |
|---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Method Summary | |
|---|---|
protected void |
clearDocument()
Clears the document content. |
void |
contentsChanged(ListDataEvent e)
A method required by the ListDataListener API informing the framework of any changes to the collections list. |
static XNodeShell |
createInstance(String[] args)
The XNodeShell factory method, returning an instance of XNodeShell. |
void |
dbAction(XNodeState state)
Uses an XNodeState as a directive to control the database. |
void |
deleteCollection(String cid)
Delete an XNodeCollection. |
void |
deleteDocument(String cid,
String nid)
Delete an XNode. |
void |
displayShell()
Display the UI frame. |
JCheckBoxMenuItem |
getCheckBoxMenuItem(String name,
String label,
int key,
boolean checked,
Action action)
Return a checkbox menu item provided with its features. |
String |
getCollectionID()
Returns the currently-selected Collection ID, or null if there is either no Collections or none is selected in the list. |
List |
getCollectionIndex()
Returns a List view of the collection index, as provided by the root collection. |
protected Document |
getContentAsDocument(String content)
Turns the String content into an XML Document, either as valid or well-formed XML, or as a CDATA section. |
PlainDocument |
getDocument()
Returns the document used in the JTextArea. |
MIME |
getFormat()
Returns the content type (DC.format) of the loaded document. |
XNodeStore |
getXNodeStore()
Returns a lazily-instantiated XNodeStore, providing database services. |
protected void |
indexCollection()
Indexes the currently-selected Collection, returning an iterator over the node IDs. |
protected void |
indexCollection(String cid)
Indexes a Collection whose ID is the String cid, returning an iterator over the node IDs. |
protected void |
indexCollections()
Set the Collection list to the current list provided by the XNodeStore, and enable the collection buttons, returning an Iterator over the list of collections. |
void |
indexNodes(String cid,
String selectnid)
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. |
boolean |
isConnected()
Returns true if a database connection is currently available. |
boolean |
isWriteable(String cid,
String nid)
Returns true if we can write to the provided collection and document ID. |
static void |
main(String[] args)
The XNodeShell main class, calling the factory method. |
void |
modifyDocument(String cid,
String nid)
Modify an existing XNode. |
void |
newCollection(String cid)
Create a new XNodeCollection. |
void |
newDocument(String cid,
String nid)
Create a new XNode. |
void |
op1()
unused. |
String |
openCollection(String cid)
Open an XNodeCollection, returning the Collection ID, null if unavailable. |
void |
openDocument(String cid,
String nid)
Open an XNode. |
void |
refresh()
Refreshes the display upon activating this DocumentView, such as updating the database node list (which is local to each DocumentView but may be altered by changes made in others). |
void |
scrollToLine(int line)
Scrolls the document content to line line of the document. |
void |
selectCollectionInList(String cid)
Selects the current collection in the Collection list based on the Collection ID String cid, if such a collection actually appears in the list. |
void |
selectNodeInList(String nid)
Selects the current node in the Node list based on the Node ID String nid, if such a node actually appears in the list. |
void |
setFormat(MIME mime)
Sets the content type (DC.format) of the loaded document to the MIME type mime. |
void |
setMessageDividerLocation(double loc)
Sets the position of the vertical divider location between the center pane and the message area. |
void |
unimplemented()
A temporary method to handle unimplemented menu and button method calls. |
void |
valueChanged(ListSelectionEvent e)
|
String |
writeMessage(int status,
String message)
Appends the String message to the message area, prepending a status indicator for errors and warnings. |
void |
writeMessage(String message)
Appends the String message to the message area. |
void |
writeStatus(String message)
Sets the status text to the String message. |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
public static final String APP_NAME
public static final String PROPERTY_USER_DIR
public static int maxOutputChars
public File m_defaultDirectory
public final File homeDirectory
| Method Detail |
|---|
public void displayShell()
public void newCollection(String cid)
public String openCollection(String cid)
public void deleteCollection(String cid)
public void newDocument(String cid,
String nid)
public void openDocument(String cid,
String nid)
public void modifyDocument(String cid,
String nid)
public void deleteDocument(String cid,
String nid)
public boolean isWriteable(String cid,
String nid)
protected Document getContentAsDocument(String content)
public PlainDocument getDocument()
protected void clearDocument()
public void scrollToLine(int line)
protected void indexCollections()
protected void indexCollection()
protected void indexCollection(String cid)
public void indexNodes(String cid,
String selectnid)
public void refresh()
public String getCollectionID()
public List getCollectionIndex()
public void selectCollectionInList(String cid)
public void selectNodeInList(String nid)
public void dbAction(XNodeState state)
public XNodeStore getXNodeStore()
public boolean isConnected()
public void writeMessage(String message)
writeMessage in interface MessageWriter
public String writeMessage(int status,
String message)
writeMessage in interface MessageWriterMessageHandlerpublic void writeStatus(String message)
writeStatus in interface MessageWriter
public JCheckBoxMenuItem getCheckBoxMenuItem(String name,
String label,
int key,
boolean checked,
Action action)
name - the menu item mnemonic identifier.label - the label text.key - the menu item accelerator keystroke.checked - the initial checked state.action - the action to be taken.public void setFormat(MIME mime)
public MIME getFormat()
public void setMessageDividerLocation(double loc)
public void contentsChanged(ListDataEvent e)
contentsChanged in interface ListDataListenerpublic void intervalAdded(ListDataEvent e)
intervalAdded in interface ListDataListenerpublic void intervalRemoved(ListDataEvent e)
intervalRemoved in interface ListDataListenerpublic void valueChanged(ListSelectionEvent e)
valueChanged in interface ListSelectionListenerpublic void op1()
public void unimplemented()
public static XNodeShell createInstance(String[] args)
public static void main(String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||