com.jaxfront.swing.ui.editor
Class TypeWorkspace

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.jaxfront.swing.ui.editor.TypeWorkspace
All Implemented Interfaces:
ValidationChangeListener, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class TypeWorkspace
extends javax.swing.JPanel
implements java.awt.event.ActionListener, ValidationChangeListener

An instance of this class visualises a jaxfront type For example:

 TypeWorkspace ws = new TypeWorkspace(editorPanel);
 ws.visualize(aType);
 
Note that the EditorPanel or XUIEditorPanel creates an instance of this class.

Version:
1.60
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static int EAST
          The orientation EAST in the button panel, where button could be added
static int WEST
          The orientation WEST in the button panel, where button could be added
 
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
TypeWorkspace(AbstractEditorPanel editor)
          Creates an instance of TypeWorkspace that would be hold af an AbstractEditorPanel
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Invoked when an action occurs.
 void addButton(javax.swing.JButton button)
          Add a button to the button panel at the position WEST
 void addButton(javax.swing.JButton button, int orientation)
          Add a button to the button panel at the specified position
 void clearWorkbench()
          Removes all visualizers from centerpanel
 javax.swing.Action getBackwardAction()
           
 javax.swing.JPanel getButtonBar()
           
 javax.swing.Action getCancelAction()
           
 javax.swing.JButton getCancelButton()
           
 javax.swing.JPanel getCenterPanel()
           
 Document getDOM()
          Returns the W3C DOM of the TypeWorkspace
 javax.swing.Action getForwardAction()
           
 javax.swing.JPanel getHeaderPanel()
           
 MessageTable getMessageTable()
           
 javax.swing.JComponent getMessageTablePanel()
          Returns a panel that holds the message table.
 javax.swing.Action getSaveAction()
           
 javax.swing.JButton getSaveButton()
           
 javax.swing.JScrollPane getScrollPane()
          Returns the scroll pane.
 ErrorMessageStatusBar getStatusBar()
          Returns the status bar.
 void release()
          Releases the W3C DOM, the status bar and TypeWorkspace
 void removeCancelButton()
          Removes the cancel button from the button panel
 void removeSaveButton()
          Removes the save button from the button panel
 void setBackwardAction(javax.swing.Action action)
           
 void setCancelAction(javax.swing.Action action)
           
 void setForwardAction(javax.swing.Action action)
           
 void setSaveAction(javax.swing.Action action)
           
 void showBannerPanel(javax.swing.JPanel component)
           
 void validationChanged(ValidationChangeEvent event)
          Tells the ValidationChangeListeners that a ValidationChangeEvent occured.
 void visualize(javax.swing.JComponent component)
          Visualizes the given component.
 Visualizer visualize(TreeNode node)
          Visualizes the specified TreeNode from the NavigationTree
 Visualizer visualize(TreeNode node, boolean forceRepaint)
          Visualizes the specified TreeNode from the NavigationTree
 Visualizer visualize(Type type)
          Visualizes the specific type from the NavigationTree
 Visualizer visualize(Type type, boolean readOnly)
          Visualizes the given type.
 Visualizer visualize(Type type, Type context, boolean readOnly)
          Visualizes the given type.
 void visualizeNextNode()
          Visualizes if possible the next TreeNode from current TreeNode
 void visualizePreviousNode()
          Visualizes if possible the previous TreeNode from current TreeNode
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WEST

public static final int WEST
The orientation WEST in the button panel, where button could be added

See Also:
Constant Field Values

EAST

public static final int EAST
The orientation EAST in the button panel, where button could be added

See Also:
Constant Field Values
Constructor Detail

TypeWorkspace

public TypeWorkspace(AbstractEditorPanel editor)
Creates an instance of TypeWorkspace that would be hold af an AbstractEditorPanel

Parameters:
editor - the AbstractEditorPanel, that holds this instance.
Method Detail

getSaveAction

public javax.swing.Action getSaveAction()

setSaveAction

public void setSaveAction(javax.swing.Action action)

getCancelAction

public javax.swing.Action getCancelAction()

setCancelAction

public void setCancelAction(javax.swing.Action action)

getForwardAction

public javax.swing.Action getForwardAction()

setForwardAction

public void setForwardAction(javax.swing.Action action)

getBackwardAction

public javax.swing.Action getBackwardAction()

setBackwardAction

public void setBackwardAction(javax.swing.Action action)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - an action event that occured

addButton

public void addButton(javax.swing.JButton button)
Add a button to the button panel at the position WEST

Parameters:
button - the button to add

addButton

public void addButton(javax.swing.JButton button,
                      int orientation)
Add a button to the button panel at the specified position

Parameters:
button - the button to add
orientation - the orientation of the button (WEST or EAST)

getDOM

public Document getDOM()
Returns the W3C DOM of the TypeWorkspace

Returns:
the W3C DOM

getScrollPane

public javax.swing.JScrollPane getScrollPane()
Returns the scroll pane.

Returns:
JScrollPane the scroll pane of the workspace

release

public void release()
Releases the W3C DOM, the status bar and TypeWorkspace


removeCancelButton

public void removeCancelButton()
Removes the cancel button from the button panel


removeSaveButton

public void removeSaveButton()
Removes the save button from the button panel


visualize

public Visualizer visualize(Type type)
Visualizes the specific type from the NavigationTree

Parameters:
type - the type to be visualised

visualize

public Visualizer visualize(Type type,
                            boolean readOnly)
Visualizes the given type.

Parameters:
type - the type to be visualized
readOnly - defines if the visualizer shows up as readOnly or not.

visualize

public Visualizer visualize(Type type,
                            Type context,
                            boolean readOnly)
Visualizes the given type.

Parameters:
type - the type to be visualized
readOnly - defines if the visualizer shows up as readOnly or not.

clearWorkbench

public void clearWorkbench()
Removes all visualizers from centerpanel


visualize

public void visualize(javax.swing.JComponent component)
Visualizes the given component.

Parameters:
component - a JComponent

visualize

public Visualizer visualize(TreeNode node)
Visualizes the specified TreeNode from the NavigationTree

Parameters:
node - TreeNode from NavigationTree

visualize

public Visualizer visualize(TreeNode node,
                            boolean forceRepaint)
Visualizes the specified TreeNode from the NavigationTree

Parameters:
node - TreeNode from NavigationTree

visualizeNextNode

public void visualizeNextNode()
Visualizes if possible the next TreeNode from current TreeNode


visualizePreviousNode

public void visualizePreviousNode()
Visualizes if possible the previous TreeNode from current TreeNode


getStatusBar

public ErrorMessageStatusBar getStatusBar()
Returns the status bar.

Returns:
the status bar

getMessageTable

public MessageTable getMessageTable()

getMessageTablePanel

public javax.swing.JComponent getMessageTablePanel()
Returns a panel that holds the message table.

Returns:
the messageTablePanel

getCenterPanel

public javax.swing.JPanel getCenterPanel()

getButtonBar

public javax.swing.JPanel getButtonBar()

getHeaderPanel

public javax.swing.JPanel getHeaderPanel()

showBannerPanel

public void showBannerPanel(javax.swing.JPanel component)

getSaveButton

public javax.swing.JButton getSaveButton()

getCancelButton

public javax.swing.JButton getCancelButton()

validationChanged

public void validationChanged(ValidationChangeEvent event)
Description copied from interface: ValidationChangeListener
Tells the ValidationChangeListeners that a ValidationChangeEvent occured.

Specified by:
validationChanged in interface ValidationChangeListener
Parameters:
event - a new ValidationChangeEvent