com.fg.xmleditor
Class FXDoubleView

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.fg.xmleditor.FXDoubleView
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class FXDoubleView
extends javax.swing.JPanel

FXDoubleView component exposes two FXView components, both of which connected to the same instance of the FXModel data model. This design allows a user to edit two different sections of the same XML document without scrolling the whole document back and forth and search a document for certain element/attribute values in one view, maintaining at the same time current posintion in anoter view.

Version:
2.0
Author:
Felix Golubov
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
FXDoubleView()
          Creates a new instance of the FXDoubleView component with default FXDocumentModelImpl data model object.
FXDoubleView(FXModel model)
          Creates a new instance of the FXDoubleView component.
 
Method Summary
 void addExternalDialog(java.lang.String id, javax.swing.JDialog dialog)
          Method registers an external dialog under the specified id.
 void cancelEditing()
          Method cancels node editing and discards field editor values in both FXView components.
 FXView getLeftView()
          Method returns left (or top) FXView component.
 FXView getRightView()
          Method returns right (or bottom) FXView component.
 boolean getSyncSelectNodes()
           
 boolean hasDocument()
          Returns true when current FXModel contains an XML document and false otherwise.
 boolean isDocChanged()
          Returns true if current XML document has been changed by the editor and false otherwise.
 boolean isDocValid()
          Returns true if current XML document is valid and false otherwise.
 void removeAllExternalDialogs()
          Method removes all the registered external dialogs.
 void removeExternalDialog(java.lang.String id)
          Method removes an external dialog which was registered under the specified id.
 void setOrientation(int orientation)
          Sets orientation of the JSplitPane component which holds two FXView components.
 void setSyncSelectNodes(boolean sync)
           
 void showErrorMessage(java.lang.String message)
          Shows a message in the right-bottom text area of each FXView component.
 void showInfoMessage(java.lang.String message)
          Shows a message in the left-bottom text area of each FXView component.
 void stopEditing()
          Method stops cell editing and assignes edited values to the respective nodes in both FXView components.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, 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, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FXDoubleView

public FXDoubleView(FXModel model)
Creates a new instance of the FXDoubleView component.

Parameters:
model - a FXModel data model object.

FXDoubleView

public FXDoubleView()
Creates a new instance of the FXDoubleView component with default FXDocumentModelImpl data model object.

Method Detail

getLeftView

public FXView getLeftView()
Method returns left (or top) FXView component.

Returns:
left (or top) FXView component.

getRightView

public FXView getRightView()
Method returns right (or bottom) FXView component.

Returns:
right (or bottom) FXView component.

setSyncSelectNodes

public void setSyncSelectNodes(boolean sync)

getSyncSelectNodes

public boolean getSyncSelectNodes()

addExternalDialog

public void addExternalDialog(java.lang.String id,
                              javax.swing.JDialog dialog)
Method registers an external dialog under the specified id.

Parameters:
id - a string identifier of the external dialog.
dialog - a JDialog - external field editor.

removeExternalDialog

public void removeExternalDialog(java.lang.String id)
Method removes an external dialog which was registered under the specified id.

Parameters:
id - a string identifier of the external dialog.

removeAllExternalDialogs

public void removeAllExternalDialogs()
Method removes all the registered external dialogs.


hasDocument

public boolean hasDocument()
Returns true when current FXModel contains an XML document and false otherwise.

Returns:
true when current FXModel contains an XML document and false otherwise.

isDocChanged

public boolean isDocChanged()
Returns true if current XML document has been changed by the editor and false otherwise.

Returns:
true if current XML document has been changed by the editor and false otherwise.

isDocValid

public boolean isDocValid()
Returns true if current XML document is valid and false otherwise.

Returns:
true if current XML document is valid and false otherwise.

showErrorMessage

public void showErrorMessage(java.lang.String message)
Shows a message in the right-bottom text area of each FXView component.

Parameters:
message - an error message to show

showInfoMessage

public void showInfoMessage(java.lang.String message)
Shows a message in the left-bottom text area of each FXView component.

Parameters:
message - an info message to show

setOrientation

public void setOrientation(int orientation)
Sets orientation of the JSplitPane component which holds two FXView components.

Parameters:
orientation - either JSplitPane.HORIZONTAL_SPLIT or JSplitPane.VERTICAL_SPLIT

stopEditing

public void stopEditing()
Method stops cell editing and assignes edited values to the respective nodes in both FXView components. It does nothing when no field is currently editing.


cancelEditing

public void cancelEditing()
Method cancels node editing and discards field editor values in both FXView components. It does nothing when no field is currently editing.