|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.intel.gui.controls2.configurable.TextEditor
public class TextEditor
A simple text editor with file loading and saving and undo mechanism
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected com.intel.gui.controls2.configurable.TextEditor.CopyAction |
copyAction
copy text |
protected javax.swing.JMenuItem |
copyItem
edit menu entries |
protected com.intel.gui.controls2.configurable.TextEditor.CutAction |
cutAction
cut text |
protected javax.swing.JMenuItem |
cutItem
edit menu entries |
protected java.io.File |
file
file to edit |
protected com.intel.gui.controls2.configurable.TextEditor.MyFileChooser |
fileChooser
standard file chooser |
protected java.util.Vector |
fileFilters
list of file filters |
protected static java.util.logging.Logger |
logger
java logger |
protected javax.swing.JMenuBar |
menubar
|
protected com.intel.gui.controls2.configurable.TextEditor.NewAction |
newAction
new file |
protected javax.swing.JMenuItem |
newItem
file menu entries |
protected com.intel.gui.controls2.configurable.TextEditor.OpenAction |
openAction
open file |
protected javax.swing.JMenuItem |
openItem
file menu entries |
protected com.intel.gui.controls2.configurable.TextEditor.PasteAction |
pasteAction
paste text |
protected javax.swing.JMenuItem |
pasteItem
edit menu entries |
protected com.intel.gui.controls2.configurable.TextEditor.RedoAction |
redoAction
redo |
protected javax.swing.JMenuItem |
redoItem
edit menu entries |
protected com.intel.gui.controls2.configurable.TextEditor.SaveAction |
saveAction
save file |
protected com.intel.gui.controls2.configurable.TextEditor.SaveAction |
saveAsAction
save file as |
protected javax.swing.JMenuItem |
saveAsItem
file menu entries |
protected javax.swing.JMenuItem |
saveItem
file menu entries |
protected javax.swing.filechooser.FileFilter |
selectedFileFilter
current file filter |
protected javax.swing.JTextArea |
textArea
edit area |
protected javax.swing.undo.UndoManager |
undo
UndoManager that we add edits to. |
protected com.intel.gui.controls2.configurable.TextEditor.UndoAction |
undoAction
undo |
protected javax.swing.event.UndoableEditListener |
undoHandler
Listener for the edits on the current document. |
protected javax.swing.JMenuItem |
undoItem
edit menu entries |
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 | |
---|---|
TextEditor(INode node,
MessageAdapter messageAdapter)
Deprecated. |
|
TextEditor(INode node,
MessageProvider messageProvider)
Constructor |
Method Summary | |
---|---|
void |
addFileFilter(javax.swing.filechooser.FileFilter filter)
add a file filter to file chooser list |
void |
addFileNameChangeListener(com.intel.gpe.util.swing.controls.FileNameChangeListener listener)
|
protected void |
buildActions()
build actions |
protected javax.swing.JMenuBar |
buildMenubar()
build menu bar |
protected javax.swing.text.JTextComponent |
getEditor()
Fetch the editor contained in this panel |
java.awt.Font |
getEditorFont()
get editor font |
java.io.File |
getFile()
get file |
protected java.awt.Frame |
getFrame()
Find the hosting frame, for the file-chooser dialog. |
boolean |
getLineWrap()
lien wrap on? |
protected java.lang.String |
getStatusMessage()
get status message |
java.lang.String |
getText()
get current editor contents |
protected void |
initMenuItem(javax.swing.JMenuItem item,
javax.swing.Action action)
Helper method initializes menu items |
protected void |
initMenuItem(javax.swing.JMenuItem item,
javax.swing.Action action,
int keyCode)
Helper method initializing menu item including a CTRL-Shortcut |
void |
load()
Load current file into editor |
static void |
main(java.lang.String[] args)
a simple test main |
void |
removeFileFilter(javax.swing.filechooser.FileFilter filter)
remove a file filter from file chooser |
protected void |
resetUndoManager()
Resets the undo manager. |
void |
save()
Save current editor contents to current file |
void |
setEditorFont(java.awt.Font font)
set editor font |
void |
setEnabled(boolean enabled)
|
void |
setFile(java.io.File file)
Set the file |
void |
setFileFilter(javax.swing.filechooser.FileFilter selectedFileFilter)
Set current file filter |
void |
setLineWrap(boolean wrap)
Line wrapping on? |
protected void |
setStatusMessage(java.lang.String message)
Set status message |
void |
setText(java.lang.String text)
Set editor contents |
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, 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 |
---|
protected static java.util.logging.Logger logger
protected com.intel.gui.controls2.configurable.TextEditor.CopyAction copyAction
protected com.intel.gui.controls2.configurable.TextEditor.CutAction cutAction
protected javax.swing.JMenuItem cutItem
protected javax.swing.JMenuItem copyItem
protected javax.swing.JMenuItem pasteItem
protected javax.swing.JMenuItem undoItem
protected javax.swing.JMenuItem redoItem
protected java.io.File file
protected com.intel.gui.controls2.configurable.TextEditor.MyFileChooser fileChooser
protected java.util.Vector fileFilters
protected com.intel.gui.controls2.configurable.TextEditor.NewAction newAction
protected javax.swing.JMenuItem newItem
protected javax.swing.JMenuItem openItem
protected javax.swing.JMenuItem saveItem
protected javax.swing.JMenuItem saveAsItem
protected com.intel.gui.controls2.configurable.TextEditor.OpenAction openAction
protected com.intel.gui.controls2.configurable.TextEditor.PasteAction pasteAction
protected com.intel.gui.controls2.configurable.TextEditor.RedoAction redoAction
protected com.intel.gui.controls2.configurable.TextEditor.SaveAction saveAction
protected com.intel.gui.controls2.configurable.TextEditor.SaveAction saveAsAction
protected javax.swing.filechooser.FileFilter selectedFileFilter
protected javax.swing.JTextArea textArea
protected javax.swing.JMenuBar menubar
protected javax.swing.undo.UndoManager undo
protected com.intel.gui.controls2.configurable.TextEditor.UndoAction undoAction
protected javax.swing.event.UndoableEditListener undoHandler
Constructor Detail |
---|
@Deprecated public TextEditor(INode node, MessageAdapter messageAdapter)
public TextEditor(INode node, MessageProvider messageProvider)
Method Detail |
---|
public void save()
public void load()
public void addFileFilter(javax.swing.filechooser.FileFilter filter)
filter
- a new file filterprotected void buildActions()
protected javax.swing.JMenuBar buildMenubar()
protected javax.swing.text.JTextComponent getEditor()
public java.awt.Font getEditorFont()
public java.io.File getFile()
protected java.awt.Frame getFrame()
public boolean getLineWrap()
protected java.lang.String getStatusMessage()
public java.lang.String getText()
protected void initMenuItem(javax.swing.JMenuItem item, javax.swing.Action action)
item
- action
- protected void initMenuItem(javax.swing.JMenuItem item, javax.swing.Action action, int keyCode)
item
- keyCode
- action
- public void removeFileFilter(javax.swing.filechooser.FileFilter filter)
filter
- file filterprotected void resetUndoManager()
public void setEditorFont(java.awt.Font font)
font
- editor fontpublic void setFile(java.io.File file)
file
- file to editpublic void setFileFilter(javax.swing.filechooser.FileFilter selectedFileFilter)
selectedFileFilter
- file filterpublic void setLineWrap(boolean wrap)
wrap
- true, if yesprotected void setStatusMessage(java.lang.String message)
message
- status messagepublic void setText(java.lang.String text)
text
- new textpublic static void main(java.lang.String[] args)
args
- The command line argumentspublic void setEnabled(boolean enabled)
setEnabled
in class javax.swing.JComponent
public void addFileNameChangeListener(com.intel.gpe.util.swing.controls.FileNameChangeListener listener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |