ilog.views.appframe.swing
Class IlvTextView

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 ilog.views.appframe.swing.IlvPanelView
                      extended by ilog.views.appframe.swing.IlvTextView
All Implemented Interfaces:
IlvDocumentView, ActionHandler, MessageListener, IlvPropertyManager, ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class IlvTextView
extends IlvPanelView

Defines a document view associated with the Swing text component.

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
static String COPY_COMMAND
          Action command key for transferring the currently selected text in the text view to the system clipboard.
static String CUT_COMMAND
          Action command key for transferring the currently selected text in the text view to the system clipboard and removing the selected text from the view.
static String PASTE_COMMAND
          Action command key for pasting the contents of the system clipboard into the text view.
static String SELECT_ALL_COMMAND
          Action command key for selecting all the text in the text view.
 
Fields inherited from class ilog.views.appframe.swing.IlvPanelView
DEFAULT_SETTINGS_NAME, DEFAULT_SETTINGS_TYPE
 
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 ilog.views.appframe.docview.IlvDocumentView
ACTIVE_PROPERTY, ACTIVE_VIEW_NAME, APPLICATION_PROPERTY, CLOSABLE_PROPERTY, CLOSING_VIEW_MSG, DOCUMENT_PROPERTY, SETTINGS_ELEMENT_PROPERTY, STATIC_VIEW_PROPERTY, VIEW_CONTAINER_PROPERTY
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IlvTextView()
          Constructs a new IlvTextView.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Invoked when receiving action events.
protected  void addEditorPane(JEditorPane editorPane)
          Adds the specified editorPane to the panel view.
protected  JEditorPane createEditorPane()
          Factory method for creating the editor pane.
protected  Document getTextDocument()
          Returns the text document displayed by the text view.
protected  void initializeEditorPane(JEditorPane editorPane)
          Invoked after a new editor pane has been created and added to the panel view to initialize it.
 void initializeView(IlvDocument document)
          Initializes the text view with the specified document.
 boolean isProcessingAction(String command)
          Determines whether the text view is able to process the action with the specified command key in its actionPerformed(java.awt.event.ActionEvent) method.
 boolean updateAction(Action action)
          Invoked by the application to update the state of the specified action.
 
Methods inherited from class ilog.views.appframe.swing.IlvPanelView
addActionHandler, close, getApplication, getDocument, getProperty, getSettings, getSettingsElement, getSettingsName, getSettingsQuery, getSettingsType, getViewContainer, isStaticView, readSettings, receiveMessage, registerMappings, removeActionHandler, setApplication, setDocument, setProperty, setSettings, setSettingsElement, setSettingsName, setSettingsQuery, setViewContainer, viewClosed, viewClosing, writeSettings
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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, setEnabled, 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
 
Methods inherited from interface ilog.views.appframe.util.IlvPropertyManager
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

PASTE_COMMAND

public static final String PASTE_COMMAND
Action command key for pasting the contents of the system clipboard into the text view.

See Also:
Constant Field Values

CUT_COMMAND

public static final String CUT_COMMAND
Action command key for transferring the currently selected text in the text view to the system clipboard and removing the selected text from the view.

See Also:
Constant Field Values

COPY_COMMAND

public static final String COPY_COMMAND
Action command key for transferring the currently selected text in the text view to the system clipboard.

See Also:
Constant Field Values

SELECT_ALL_COMMAND

public static final String SELECT_ALL_COMMAND
Action command key for selecting all the text in the text view.

See Also:
Constant Field Values
Constructor Detail

IlvTextView

public IlvTextView()
Constructs a new IlvTextView.

Method Detail

initializeView

public void initializeView(IlvDocument document)
Initializes the text view with the specified document. If the specified document is a text document, the text view will be set the text document returned by IlvTextDocument.getTextDocument().

Specified by:
initializeView in interface IlvDocumentView
Overrides:
initializeView in class IlvPanelView
Parameters:
document - The document to initialize the content of the view with.

getTextDocument

protected Document getTextDocument()
Returns the text document displayed by the text view.


addEditorPane

protected void addEditorPane(JEditorPane editorPane)
Adds the specified editorPane to the panel view. By default, a border layout is set to the panel view, a scroll pane is add to the panel with the BorderLayout.CENTER constraint, and the editor pane is added to the scroll pane if appropriate.


createEditorPane

protected JEditorPane createEditorPane()
Factory method for creating the editor pane.


initializeEditorPane

protected void initializeEditorPane(JEditorPane editorPane)
Invoked after a new editor pane has been created and added to the panel view to initialize it. By default, listeners are added to the specified editorPane to synchronize the updating of the actions Cut or Copy and Paste with the text selection changes.


isProcessingAction

public boolean isProcessingAction(String command)
Determines whether the text view is able to process the action with the specified command key in its actionPerformed(java.awt.event.ActionEvent) method. By default, the text view processes the action with the following command keys:

Specified by:
isProcessingAction in interface ActionHandler
Overrides:
isProcessingAction in class IlvPanelView
Parameters:
command - The command key of the action.
Returns:
true if the action listener performs the specified action; false otherwise.

updateAction

public boolean updateAction(Action action)
Invoked by the application to update the state of the specified action. By default, the text view updates the state of the action with the following command keys:

Specified by:
updateAction in interface ActionHandler
Overrides:
updateAction in class IlvPanelView
Parameters:
action - The action to update.
Returns:
true if the action handler has updated the state of the action; false otherwise.

actionPerformed

public void actionPerformed(ActionEvent e)
Invoked when receiving action events. By default, the text view processes the actions with the following command keys:

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class IlvPanelView
Parameters:
e - The action event.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.