com.ibm.di.admin.ui
Class EditorUI

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.ibm.di.admin.ui.EditorUI
All Implemented Interfaces:
MetamergeConfigChangeListener, ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CaretListener, DocumentListener

public class EditorUI
extends JPanel
implements DocumentListener, ActionListener, CaretListener, MetamergeConfigChangeListener

User Interface component used for text editing

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
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
protected  UndoManager undo
          UndoManager that we add edits to.
protected  UndoableEditListener undoHandler
          Listener for the edits on the current document.
 
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.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
EditorUI()
          Constructor for the EditorUI object
EditorUI(BaseConfiguration config, String method)
          Constructor for the EditorUI object
EditorUI(BaseConfiguration config, String method, String simple)
          Constructor for the EditorUI object
 
Method Summary
 void actionPerformed(ActionEvent event)
           
 void addActionListener(ActionListener listener)
          Adds a feature to the ActionListener attribute of the EditorUI object
 void addToolItem(JComponent toolItem)
           
 void append(String p1)
           
 void caretUpdate(CaretEvent event)
           
 void changedUpdate(DocumentEvent d)
           
 void configurationChanged(MetamergeConfigChange changeEvent)
          Notifies that configuration is changed.
protected  JTextComponent createEditor()
          Create an editor to represent the given document.
 void doFind()
          Performs find.
 void findNext()
          Finds next match.
 void fireAction()
           
 void fireAction(String cmd)
           
 Action[] getActions()
          Fetch the list of actions supported by this editor.
protected  JTextComponent getEditor()
          Fetch the editor contained in this panel
 String getText()
          Gets the text attribute of the EditorUI object
 JTextArea getTextPane()
          Gets the textPane attribute of the EditorUI object
protected  Container getToolbar()
          Gets the toolbar attribute of the EditorUI object
 void init(BaseConfiguration config, String method, String simple)
          Initialize Component.
 void initMethods()
           
 void insertUpdate(DocumentEvent d)
           
 void removeActionListener(ActionListener listener)
           
 void removeUpdate(DocumentEvent d)
           
protected  void resetUndoManager()
          Resets the undo manager.
 void setData(BaseConfiguration config, String method)
          Sets the data attribute of the EditorUI object
 void setEnabled(boolean arg0)
           
 void setLines(int lines)
          Sets the number of lines in the JTextArea (impacts preferred size)
 void setTabSize(int p1)
          Sets the tabSize attribute of the EditorUI object
 void setText(String text)
          Sets the text attribute of the EditorUI object
 void setToolbarVisible(boolean visible)
          Sets the visibility flag of the toolbar.
 void updateConfig()
          Updates the config object.
 void updateEditor()
          Updates editor.
 void updateUI()
          Updates editor.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

undoHandler

protected UndoableEditListener undoHandler
Listener for the edits on the current document.


undo

protected UndoManager undo
UndoManager that we add edits to.

Constructor Detail

EditorUI

public EditorUI()
Constructor for the EditorUI object


EditorUI

public EditorUI(BaseConfiguration config,
                String method,
                String simple)
Constructor for the EditorUI object

Parameters:
config - specifies config object
method - specifies method
simple - specifies if listener to be used

EditorUI

public EditorUI(BaseConfiguration config,
                String method)
Constructor for the EditorUI object

Parameters:
config - specifies config object
method - specifies method
Method Detail

init

public void init(BaseConfiguration config,
                 String method,
                 String simple)
Initialize Component.

Parameters:
config - specifies config object
method - specifies method
simple - specifies if listener to be used

setEnabled

public void setEnabled(boolean arg0)
Overrides:
setEnabled in class JComponent

setToolbarVisible

public void setToolbarVisible(boolean visible)
Sets the visibility flag of the toolbar.

Parameters:
visible - true if toolbar should be shown

setLines

public void setLines(int lines)
Sets the number of lines in the JTextArea (impacts preferred size)

Parameters:
lines - Number of lines

updateUI

public void updateUI()
Updates editor.

Overrides:
updateUI in class JPanel

initMethods

public void initMethods()

setData

public void setData(BaseConfiguration config,
                    String method)
Sets the data attribute of the EditorUI object

Parameters:
config - specifies the config object
method - specifies method

updateEditor

public void updateEditor()
Updates editor.


setText

public void setText(String text)
Sets the text attribute of the EditorUI object

Parameters:
text - The new text value

setTabSize

public void setTabSize(int p1)
Sets the tabSize attribute of the EditorUI object

Parameters:
p1 - The new tabSize value

append

public void append(String p1)

getText

public String getText()
Gets the text attribute of the EditorUI object

Returns:
The text value

getTextPane

public JTextArea getTextPane()
Gets the textPane attribute of the EditorUI object

Returns:
The textPane value

changedUpdate

public void changedUpdate(DocumentEvent d)
Specified by:
changedUpdate in interface DocumentListener

insertUpdate

public void insertUpdate(DocumentEvent d)
Specified by:
insertUpdate in interface DocumentListener

removeUpdate

public void removeUpdate(DocumentEvent d)
Specified by:
removeUpdate in interface DocumentListener

caretUpdate

public void caretUpdate(CaretEvent event)
Specified by:
caretUpdate in interface CaretListener

updateConfig

public void updateConfig()
Updates the config object.


configurationChanged

public void configurationChanged(MetamergeConfigChange changeEvent)
Notifies that configuration is changed.

Specified by:
configurationChanged in interface MetamergeConfigChangeListener
Parameters:
changeEvent - notification event

actionPerformed

public void actionPerformed(ActionEvent event)
Specified by:
actionPerformed in interface ActionListener

doFind

public void doFind()
Performs find.


findNext

public void findNext()
Finds next match.


getActions

public Action[] getActions()
Fetch the list of actions supported by this editor. It is implemented to return the list of actions supported by the embedded JTextComponent augmented with the actions defined locally.

Returns:
The actions value

createEditor

protected JTextComponent createEditor()
Create an editor to represent the given document.

Returns:
Editor representing given document.

getEditor

protected JTextComponent getEditor()
Fetch the editor contained in this panel

Returns:
The editor value

getToolbar

protected Container getToolbar()
Gets the toolbar attribute of the EditorUI object

Returns:
The toolbar value

resetUndoManager

protected void resetUndoManager()
Resets the undo manager.


addToolItem

public void addToolItem(JComponent toolItem)

addActionListener

public void addActionListener(ActionListener listener)
Adds a feature to the ActionListener attribute of the EditorUI object

Parameters:
listener - The feature to be added to the ActionListener attribute

removeActionListener

public void removeActionListener(ActionListener listener)

fireAction

public void fireAction()

fireAction

public void fireAction(String cmd)