Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.merlotxml.merlot
Class GD_XMLEditorDocUI  view GD_XMLEditorDocUI download GD_XMLEditorDocUI.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.merlotxml.merlot.XMLEditorDocUI
                      extended byorg.merlotxml.merlot.GD_XMLEditorDocUI
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.event.ChangeListener, java.util.EventListener, GD_MerlotDOMNodeViewListener, java.awt.image.ImageObserver, java.awt.MenuContainer, MerlotConstants, java.awt.event.MouseListener, java.io.Serializable, StatusListener

public class GD_XMLEditorDocUI
extends XMLEditorDocUI
implements MerlotConstants, javax.swing.event.ChangeListener, StatusListener, GD_MerlotDOMNodeViewListener

XML Document UI L&F code

Version:
$Id: GD_XMLEditorDocUI.java,v 1.39 2002/10/29 15:22:02 flament Exp $

Nested Class Summary
(package private)  class GD_XMLEditorDocUI.AsyncSelect
           
protected  class GD_XMLEditorDocUI.AutoHideAttribute
           
protected  class GD_XMLEditorDocUI.NodeAddActionListener
           
 
Nested classes inherited from class org.merlotxml.merlot.XMLEditorDocUI
XMLEditorDocUI.EditCancelNodeActionListener, XMLEditorDocUI.EditorNodeListener, XMLEditorDocUI.EditSaveNodeActionListener, XMLEditorDocUI.NodeAddSpecialCommentActionListener, XMLEditorDocUI.NodeAddSpecialPIActionListener, XMLEditorDocUI.ShowNodeActionListener, XMLEditorDocUI.StatusCleaner
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  StateAction[] _actions
           
(package private)  GD_XMLEditorDocUI.AutoHideAttribute _autoHideAttribute
           
(package private)  java.util.Hashtable _views
           
(package private)  MerlotDOMNode _wishNode
           
(package private)  javax.swing.JSplitPane _workspace
           
 
Fields inherited from class org.merlotxml.merlot.XMLEditorDocUI
_doc, _menuBar, _mouseChangedTab, _openEditors, _openEditPanels, _openNodes, _splitPane, _status1, _status2, _status3, _statusPanel, _table, _treePanel, _treePasteMenu, _XMLmodel, STATUS_DISPLAY_TIME
 
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.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface org.merlotxml.merlot.MerlotConstants
ACTION_MENU_ACCELERATOR, ACTION_MENU_ICON, ACTION_NAME, ACTION_SHORT_DESCRIPTION, ACTION_SMALL_ICON, AFTER, BEFORE, ERR, INTO, UI, XML
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GD_XMLEditorDocUI(XMLEditorDoc doc)
           
 
Method Summary
protected  void addItemsToMenu(java.util.List menuItems, javax.swing.MenuElement menu)
           
 void asyncSelectNode(MerlotDOMNode node)
          call syncSelectNode with SwingUtilities.invokeLater
 boolean beforeSelect(GD_MerlotDOMNodeViewer view, MerlotDOMNode newNode)
          Propagate beforeSelect to all view expect from "view"
 void deleteNode(MerlotDOMNode node)
          call from GD_XMLEditorDoc to select another node when the deleted one
protected  void doPopup(java.awt.event.MouseEvent e)
           
protected  javax.swing.JMenuItem DTDElementToJMenuItem(MerlotDOMEditor editor, MerlotDOMNode node, org.merlotxml.util.xml.DTDElement el, boolean addShortCut, java.lang.StringBuffer shortcuts)
           
 void editNode(MerlotDOMNode node, boolean brandSpankinNew)
          call from GD_XMLEditorDoc
protected  void finalize()
          Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed.
 StateAction[] getActions()
          return action define in dtd plugin for this document
 javax.swing.JEditorPane getEditorPane()
          Get JEditorPane of styled view
protected  javax.swing.JMenu getNodeAddMenu(MerlotDOMNode node, int where)
          Creates the add-> menu popup for right-click actions on a particular node.
protected  java.util.List getNodeMenuItems(MerlotDOMNode node)
          return context menu for "node"
 java.awt.print.Printable getPrintable()
           
 MerlotDOMNode getSelectedNode()
          return the current select node (use the first view)
 MerlotDOMNode[] getSelectedNodes()
          return all nodes selected (for compatibilty : only one can selected)
 int getSelectedRow()
           
 java.awt.datatransfer.Transferable getTransferable()
          gets the transfer data for the current selection, or null if no selection exists
 java.awt.datatransfer.Transferable getTransferable(MerlotDOMNode node)
           
 java.awt.datatransfer.Transferable getTransferableOfChilds(MerlotDOMNode node)
           
private  MerlotDOMNode getWishNode()
          return the node that GD_XMLEditorDoc want to show
 GD_XMLEditorDoc getXMLEditorDoc()
           
protected  void hideAttributes()
           
(package private)  boolean isThereElement(MerlotDOMNode[] nodes)
           
 java.util.Collection organizeDTDElement(MerlotDOMNode node, java.util.Collection elements)
          Get list of DTDElement and organize it with groups define in plugin
 void refreshNode(MerlotDOMNode node, boolean cancelOnly)
          override default to do nothing
 void selected(GD_MerlotDOMNodeViewer view)
          Select the node than the current node in "view"
 void selectNode(MerlotDOMNode node)
          override default to do nothing
protected  void setupAutoHideAttribute()
           
protected  void setupPanel()
          This panel looks a little like Windows Explorer.
protected  void setupViews(MerlotDOMNode root)
          create all view and add them this
protected  void showAttributes()
           
 void showNode(MerlotDOMNode node)
          override default to do nothing
 void stateChanged(javax.swing.event.ChangeEvent evt)
          Called by an object to notify the listener that the object's state has changed.
 void statusChanged(StatusEvent evt)
           
protected  boolean suppressToUser(MerlotDOMEditor editor, MerlotDOMNode node, org.merlotxml.util.xml.DTDElement el)
           
 boolean sync()
          Save the current node from view
 void syncSelectNode(MerlotDOMNode node)
          select a node in fact select a node in first view then all view are synchronize
 void updateNodeMenu(javax.swing.JMenu menu)
          updates the given node menu for the selected node
 void updateStyledView()
          Update styled view from MerlotDOMDocument
 
Methods inherited from class org.merlotxml.merlot.XMLEditorDocUI
createTreePasteMenu, editText, enablePasteItems, getMenuBar, getNodeAddSpecialMenu, getNodeForPath, getNodeForRow, getNodePopupMenu, getWorkspaceSize, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, saveOpenEditors, setStatus, setStatus, setupTreeTable
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_workspace

javax.swing.JSplitPane _workspace

_views

java.util.Hashtable _views

_actions

StateAction[] _actions

_wishNode

MerlotDOMNode _wishNode

_autoHideAttribute

GD_XMLEditorDocUI.AutoHideAttribute _autoHideAttribute
Constructor Detail

GD_XMLEditorDocUI

public GD_XMLEditorDocUI(XMLEditorDoc doc)
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Description copied from class: java.lang.Object
Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed. You would think that this means it eventually is called on every Object, but this is not necessarily the case. If execution terminates abnormally, garbage collection does not always happen. Thus you cannot rely on this method to always work. For finer control over garbage collection, use references from the java.lang.ref package.

Virtual Machines are free to not call this method if they can determine that it does nothing important; for example, if your class extends Object and overrides finalize to do simply super.finalize().

finalize() will be called by a java.lang.Thread that has no locks on any Objects, and may be called concurrently. There are no guarantees on the order in which multiple objects are finalized. This means that finalize() is usually unsuited for performing actions that must be thread-safe, and that your implementation must be use defensive programming if it is to always work.

If an Exception is thrown from finalize() during garbage collection, it will be patently ignored and the Object will still be destroyed.

It is allowed, although not typical, for user code to call finalize() directly. User invocation does not affect whether automatic invocation will occur. It is also permitted, although not recommended, for a finalize() method to "revive" an object by making it reachable from normal code again.

Unlike constructors, finalize() does not get called for an object's superclass unless the implementation specifically calls super.finalize().

The default implementation does nothing.


getActions

public StateAction[] getActions()
return action define in dtd plugin for this document


setupViews

protected void setupViews(MerlotDOMNode root)
create all view and add them this


setupAutoHideAttribute

protected void setupAutoHideAttribute()

showAttributes

protected void showAttributes()

hideAttributes

protected void hideAttributes()

setupPanel

protected void setupPanel()
This panel looks a little like Windows Explorer. It has a treetable at the left, a JSplitPane slider in the middle, and then an editing workspace at the right.

Overrides:
setupPanel in class XMLEditorDocUI

getXMLEditorDoc

public GD_XMLEditorDoc getXMLEditorDoc()

getEditorPane

public javax.swing.JEditorPane getEditorPane()
Get JEditorPane of styled view


getPrintable

public java.awt.print.Printable getPrintable()

updateStyledView

public void updateStyledView()
Update styled view from MerlotDOMDocument


sync

public boolean sync()
Save the current node from view


beforeSelect

public boolean beforeSelect(GD_MerlotDOMNodeViewer view,
                            MerlotDOMNode newNode)
Propagate beforeSelect to all view expect from "view"

Specified by:
beforeSelect in interface GD_MerlotDOMNodeViewListener

selected

public void selected(GD_MerlotDOMNodeViewer view)
Select the node than the current node in "view"

Specified by:
selected in interface GD_MerlotDOMNodeViewListener

getWishNode

private MerlotDOMNode getWishNode()
return the node that GD_XMLEditorDoc want to show


editNode

public void editNode(MerlotDOMNode node,
                     boolean brandSpankinNew)
call from GD_XMLEditorDoc

Overrides:
editNode in class XMLEditorDocUI

selectNode

public void selectNode(MerlotDOMNode node)
override default to do nothing

Overrides:
selectNode in class XMLEditorDocUI

syncSelectNode

public void syncSelectNode(MerlotDOMNode node)
select a node in fact select a node in first view then all view are synchronize


asyncSelectNode

public void asyncSelectNode(MerlotDOMNode node)
call syncSelectNode with SwingUtilities.invokeLater


refreshNode

public void refreshNode(MerlotDOMNode node,
                        boolean cancelOnly)
override default to do nothing

Overrides:
refreshNode in class XMLEditorDocUI

showNode

public void showNode(MerlotDOMNode node)
override default to do nothing

Overrides:
showNode in class XMLEditorDocUI

deleteNode

public void deleteNode(MerlotDOMNode node)
call from GD_XMLEditorDoc to select another node when the deleted one

Overrides:
deleteNode in class XMLEditorDocUI

getSelectedNode

public MerlotDOMNode getSelectedNode()
return the current select node (use the first view)

Overrides:
getSelectedNode in class XMLEditorDocUI

getSelectedNodes

public MerlotDOMNode[] getSelectedNodes()
return all nodes selected (for compatibilty : only one can selected)

Overrides:
getSelectedNodes in class XMLEditorDocUI

getNodeMenuItems

protected java.util.List getNodeMenuItems(MerlotDOMNode node)
return context menu for "node"

Overrides:
getNodeMenuItems in class XMLEditorDocUI

addItemsToMenu

protected void addItemsToMenu(java.util.List menuItems,
                              javax.swing.MenuElement menu)
Overrides:
addItemsToMenu in class XMLEditorDocUI

getNodeAddMenu

protected javax.swing.JMenu getNodeAddMenu(MerlotDOMNode node,
                                           int where)
Creates the add-> menu popup for right-click actions on a particular node.

Overrides:
getNodeAddMenu in class XMLEditorDocUI

organizeDTDElement

public java.util.Collection organizeDTDElement(MerlotDOMNode node,
                                               java.util.Collection elements)
Get list of DTDElement and organize it with groups define in plugin


suppressToUser

protected boolean suppressToUser(MerlotDOMEditor editor,
                                 MerlotDOMNode node,
                                 org.merlotxml.util.xml.DTDElement el)

DTDElementToJMenuItem

protected javax.swing.JMenuItem DTDElementToJMenuItem(MerlotDOMEditor editor,
                                                      MerlotDOMNode node,
                                                      org.merlotxml.util.xml.DTDElement el,
                                                      boolean addShortCut,
                                                      java.lang.StringBuffer shortcuts)

doPopup

protected void doPopup(java.awt.event.MouseEvent e)
Overrides:
doPopup in class XMLEditorDocUI

getTransferable

public java.awt.datatransfer.Transferable getTransferable()
Description copied from class: XMLEditorDocUI
gets the transfer data for the current selection, or null if no selection exists

Overrides:
getTransferable in class XMLEditorDocUI

getSelectedRow

public int getSelectedRow()
Overrides:
getSelectedRow in class XMLEditorDocUI

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent evt)
Description copied from interface: javax.swing.event.ChangeListener
Called by an object to notify the listener that the object's state has changed. The incoming event identifies the source of the event, allowing the listener to differentiate when it is listening for changes in multiple sources.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener
Overrides:
stateChanged in class XMLEditorDocUI

isThereElement

boolean isThereElement(MerlotDOMNode[] nodes)

statusChanged

public void statusChanged(StatusEvent evt)
Specified by:
statusChanged in interface StatusListener
Overrides:
statusChanged in class XMLEditorDocUI

getTransferable

public java.awt.datatransfer.Transferable getTransferable(MerlotDOMNode node)

getTransferableOfChilds

public java.awt.datatransfer.Transferable getTransferableOfChilds(MerlotDOMNode node)

updateNodeMenu

public void updateNodeMenu(javax.swing.JMenu menu)
Description copied from class: XMLEditorDocUI
updates the given node menu for the selected node

Overrides:
updateNodeMenu in class XMLEditorDocUI