public class JMultilineTextEditor extends JComponent
JComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected Dimension |
dim
The Dialog dimension.
|
protected Document |
doc |
protected JTextComponent |
textComp
The text component used in the dialog.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
JMultilineTextEditor()
Constructor.
|
JMultilineTextEditor(int columns)
Constructor.
|
JMultilineTextEditor(JTextComponent comp)
Constructor.
|
JMultilineTextEditor(JTextComponent comp,
int columns)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addActionListener(ActionListener listener)
Add an ActionListener.
|
void |
allowDirectEdit(boolean allowDirectEdit)
Set if the text in the component can be edited directly (default is true).
|
protected AbstractMultilineDialog |
createMultilineDialog()
Create the dialog which will be used to edit the text.
|
void |
doLayout() |
Dimension |
getDialogDimension()
Return the dimension of the dialog.
|
Document |
getDocument()
Return the associated Document.
|
File |
getImportDefaultDirectory()
Return the default directory if the editor has an import text file option.
|
ExtensionFileFilter |
getImportFileFilter()
Return the file filter if the editor has an import text file option.
|
Dimension |
getPreferredSize() |
String |
getText()
Return the assocuated text.
|
JTextComponent |
getTextComponent() |
boolean |
isAllowingDirectEdit()
Return true if the text in the component can be edited directly (default is true).
|
boolean |
isAllowingImport()
Return true if the editor has an import text file option.
|
boolean |
isEditable()
Return true if the text is editable.
|
boolean |
isEnabled()
Return true if the List Selector is enabled.
|
void |
removeActionListener(ActionListener listener)
Removes an ActionListener.
|
void |
reset()
Resets the selector to the values of thetext component.
|
void |
setAllowImport(boolean allowImport)
Set if the editor has an import text file option.
|
void |
setBackground(Color color) |
void |
setDialogDimension(Dimension dim)
Set the dimension of the dialog.
|
void |
setDocument(Document doc)
Set the associated Document.
|
void |
setEditable(boolean isEditable)
Set if the text is editable.
|
void |
setEnabled(boolean enabled)
Enables or disables this component.
|
void |
setImportDefaultDirectory(File dir)
Set the default directory if the editor has an import text file option.
|
void |
setImportFileFilter(ExtensionFileFilter filter)
Set the file filter if the editor has an import text file option.
|
protected void |
setText()
Set the text in the component.
|
void |
setText(String text)
Set the associated text.
|
void |
setTextComponent(JTextComponent comp)
Set the text component to use with the text editor.
|
String |
toString() |
void |
updateUI() |
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, transferFocusDownCycle, validate, validateTreeaction, 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, getAccessibleContext, 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, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, 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, transferFocus, transferFocusBackward, transferFocusUpCycleprotected Document doc
protected JTextComponent textComp
protected Dimension dim
public JMultilineTextEditor()
public JMultilineTextEditor(JTextComponent comp)
comp - the text componentpublic JMultilineTextEditor(int columns)
columns - the number of columns of the text componentpublic JMultilineTextEditor(JTextComponent comp, int columns)
comp - the text componentcolumns - the number of columns of the text componentpublic void updateUI()
updateUI in class JComponentpublic void setDialogDimension(Dimension dim)
dim - the dimensionpublic void setAllowImport(boolean allowImport)
allowImport - true if the editor has an import text file optionpublic boolean isAllowingImport()
public void setImportDefaultDirectory(File dir)
dir - the default directory if the editor has an import text file optionpublic File getImportDefaultDirectory()
public void setImportFileFilter(ExtensionFileFilter filter)
filter - the file filter if the editor has an import text file optionpublic ExtensionFileFilter getImportFileFilter()
public Dimension getDialogDimension()
public void setEditable(boolean isEditable)
isEditable - true if the text is editablepublic void allowDirectEdit(boolean allowDirectEdit)
allowDirectEdit - true if the text in the component can be edited directlypublic boolean isAllowingDirectEdit()
public boolean isEditable()
public JTextComponent getTextComponent()
public void setTextComponent(JTextComponent comp)
comp - the text componentpublic Document getDocument()
public String getText()
public void setDocument(Document doc)
doc - the Documentpublic void setText(String text)
text - the textpublic void addActionListener(ActionListener listener)
listener - the ActionListenerpublic void removeActionListener(ActionListener listener)
listener - the ActionListenerpublic void reset()
public Dimension getPreferredSize()
getPreferredSize in class JComponentpublic void setBackground(Color color)
setBackground in class JComponentpublic void setEnabled(boolean enabled)
setEnabled in class JComponentenabled - true if this component should be enabled, false otherwisepublic boolean isEnabled()
protected void setText()
protected AbstractMultilineDialog createMultilineDialog()