|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.node.TextStructure
A TextStructure object provides a tree structure that can be used in the structure pane. Actually the TextStructure object will manage a tree object, handling all user inputs, and showing and updating the tree. There are a handfull of methods that a derived class should override:
Inner Class Summary | |
protected class |
TextStructure.StructureSelectionListener
|
Field Summary | |
protected static javax.swing.tree.DefaultTreeCellRenderer |
defaultTreeCellRenderer
|
protected FileNode |
fileNode
|
protected javax.swing.JTree |
tree
|
protected javax.swing.tree.DefaultTreeModel |
treeModel
|
Constructor Summary | |
TextStructure()
|
Method Summary | |
protected java.lang.Object[] |
findPath(java.lang.Object root,
java.lang.String[] stringPath,
int index)
Helper function for setExpandState to find an expansion path by name. |
EditorPane |
getEditorPane()
Retrieve the editorPane of the viewer associated with this TextStructure This will work for files displayed in one of the tabbed views of the content pane in the Browser. |
java.util.List |
getExpandState()
Look at the tree in the structure pane, find all the expanded nodes, and encode all the expansion path in an array list. |
javax.swing.JPopupMenu |
getPopup()
One of the functions that a derived class should override. |
javax.swing.Icon |
getStructureIcon(java.lang.Object value)
One of the functions that a derived class should override. |
javax.swing.JTree |
getTree()
Return the JTree object that this TextStructure is currently using. |
java.awt.Component |
getTreeCellRendererComponent(javax.swing.JTree tree,
java.lang.Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)
Implements the TreeCellRenderer interface by calling the getTreeCellRendererComponent function of the defaultTreeCellRenderer. |
void |
keyPressed(java.awt.event.KeyEvent e)
Key listener implementation which basically translates into a call to the nodeActivated function of the currently selected node. |
void |
keyReleased(java.awt.event.KeyEvent e)
Key listener implementation which by default does nothing. |
void |
keyTyped(java.awt.event.KeyEvent e)
Key listener implementation which by default does nothing. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Mouse listener implementation which basically translates into a call to the nodeSelected function of the node under the mouse. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Mouse listener implementation which by default does nothing. |
void |
mouseExited(java.awt.event.MouseEvent e)
Mouse listener implementation which by default does nothing. |
void |
mousePressed(java.awt.event.MouseEvent e)
Mouse listener implementation which by default only checks if the popup menu should be displayed. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Mouse listener implementation which by default only checks if the popup menu should be displayed. |
void |
nodeActivated(javax.swing.tree.DefaultMutableTreeNode node)
One of the functions that a derived class should override. |
void |
nodeSelected(javax.swing.tree.DefaultMutableTreeNode node)
One of the functions that a derived class should override. |
void |
setCaretOffset(int offset,
boolean requestFocus)
Make the fileNode associated with this TextStructure into the active fileNode, retrieve the text node viewer, and make that viewer the active viewer, retrieve the editor, and set the caret and the focus. |
void |
setCaretPosition(int offset,
boolean requestFocus)
Get the editor of the fileNode associated with this TextStructure, position the caret at a certain file offset, and optionally request the focus. |
void |
setCaretPosition(int line,
int column,
boolean requestFocus)
Get the editor of the fileNode associated with this TextStructure, position the caret at a certain line and column, and optionally request the focus. |
void |
setExpandState(java.util.List expansionList)
Taking an array list with encoded expansion paths, try to apply these expansions to the current tree. |
void |
setFileNode(FileNode fileNode)
Remember the file that provides the information displayed in this TextStructure object. |
void |
setTree(javax.swing.JTree tree)
Hook a tree up to this TextStructure object so it can be managed correctly. |
void |
updateStructure(javax.swing.text.Document doc)
One of the functions that a derived class should override. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected javax.swing.JTree tree
protected FileNode fileNode
protected javax.swing.tree.DefaultTreeModel treeModel
protected static javax.swing.tree.DefaultTreeCellRenderer defaultTreeCellRenderer
Constructor Detail |
public TextStructure()
Method Detail |
public void setFileNode(FileNode fileNode)
fileNode
- the FileNode object describing the active file.public void setTree(javax.swing.JTree tree)
tree
- the tree object that this TextStructure should manage.public javax.swing.JTree getTree()
public void updateStructure(javax.swing.text.Document doc)
doc
- The document that provides information for the structure pane.public javax.swing.JPopupMenu getPopup()
public void nodeSelected(javax.swing.tree.DefaultMutableTreeNode node)
node
- The node selected, for instance through a
single mouse click.public void nodeActivated(javax.swing.tree.DefaultMutableTreeNode node)
node
- The node activated, for instance through a
double mouse click.public javax.swing.Icon getStructureIcon(java.lang.Object value)
value
- The node that wants an icon.public EditorPane getEditorPane()
public void setCaretOffset(int offset, boolean requestFocus)
offset
- the desired zero based file offset for the caretrequestFocus
- if true, request focus for the editor.public void setCaretPosition(int line, int column, boolean requestFocus)
line
- the desired one based line for the caretcolumn
- the desired one based column for the caretrequestFocus
- if true, request focus for the editorpublic void setCaretPosition(int offset, boolean requestFocus)
offset
- the desired zero based file offset for the caretpublic java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree, java.lang.Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
getTreeCellRendererComponent
in interface javax.swing.tree.TreeCellRenderer
tree
- the tree this TextStructure manages.value
- the object representing a nodeselected
- true if the node is selectedexpanded
- true if the node is expandedleaf
- true if the node is a leafrow
- the location in the treehasFocus
- true if the node has focus.public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
e
- the keyEvent caused by the key press.public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
e
- the keyEvent caused by the key press.public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
e
- the keyEvent caused by the key press.public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
e
- the mouseEvent caused by the mouse clickpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
e
- the mouseEvent caused by the mouse press.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
e
- the mouseEvent caused by the mouse releasepublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
e
- the mouseEvent caused by the mouse enter.public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
e
- the mouseEvent caused by the mouse exit.public java.util.List getExpandState()
protected java.lang.Object[] findPath(java.lang.Object root, java.lang.String[] stringPath, int index)
public void setExpandState(java.util.List expansionList)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |