public class EditorTextField extends NonOpaquePanel implements EditorTextComponent, DocumentListener, DataProvider, java.awt.event.FocusListener, java.awt.event.MouseListener
Wrapper.North
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
java.awt.Container.AccessibleAWTContainer
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
NullableComponent.Check
Modifier and Type | Field and Description |
---|---|
static Key<java.lang.Boolean> |
SUPPLEMENTARY_KEY |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ARRAY_FACTORY, EMPTY_ARRAY
Constructor and Description |
---|
EditorTextField() |
EditorTextField(Document document,
Project project,
FileType fileType) |
EditorTextField(Document document,
Project project,
FileType fileType,
boolean isViewer) |
EditorTextField(Document document,
Project project,
FileType fileType,
boolean isViewer,
boolean oneLineMode) |
EditorTextField(Project project,
FileType fileType) |
EditorTextField(java.lang.String text) |
EditorTextField(java.lang.String text,
Project project,
FileType fileType) |
Modifier and Type | Method and Description |
---|---|
void |
addDocumentListener(DocumentListener listener) |
void |
addFocusListener(java.awt.event.FocusListener l) |
protected void |
addImpl(java.awt.Component comp,
java.lang.Object constraints,
int index) |
void |
addMouseListener(java.awt.event.MouseListener l) |
void |
addNotify() |
void |
addSettingsProvider(EditorSettingsProvider provider) |
void |
beforeDocumentChange(DocumentEvent event)
Called before the text of the document is changed.
|
protected Document |
createDocument() |
protected EditorEx |
createEditor() |
void |
documentChanged(DocumentEvent event)
Called after the text of the document has been changed.
|
void |
ensureWillComputePreferredSize() |
void |
focusGained(java.awt.event.FocusEvent e) |
void |
focusLost(java.awt.event.FocusEvent e) |
java.awt.Color |
getBackground() |
CaretModel |
getCaretModel() |
javax.swing.JComponent |
getComponent() |
java.lang.Object |
getData(java.lang.String dataId)
Returns the object corresponding to the specified data identifier.
|
Document |
getDocument() |
Editor |
getEditor() |
FileType |
getFileType() |
javax.swing.JComponent |
getFocusTarget() |
java.awt.Dimension |
getMinimumSize() |
java.awt.Component |
getNextFocusableComponent() |
java.awt.Dimension |
getPreferredSize() |
Project |
getProject() |
java.lang.String |
getText() |
boolean |
isFocusOwner() |
protected boolean |
isOneLineMode()
This option will be used for embedded editor creation.
|
boolean |
isViewer() |
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
protected boolean |
processKeyBinding(javax.swing.KeyStroke ks,
java.awt.event.KeyEvent e,
int condition,
boolean pressed) |
void |
removeDocumentListener(DocumentListener listener) |
void |
removeFocusListener(java.awt.event.FocusListener l) |
void |
removeMouseListener(java.awt.event.MouseListener l) |
void |
removeNotify() |
void |
removeSelection() |
boolean |
removeSettingsProvider(EditorSettingsProvider provider) |
void |
requestFocus() |
boolean |
requestFocusInWindow() |
void |
selectAll() |
void |
setAsRendererWithSelection(java.awt.Color backgroundColor,
java.awt.Color foregroundColor) |
void |
setBackground(java.awt.Color bg) |
void |
setCaretPosition(int position) |
void |
setDocument(Document document) |
void |
setEnabled(boolean enabled) |
void |
setFileType(FileType fileType) |
void |
setFont(java.awt.Font font) |
void |
setFontInheritedFromLAF(boolean b) |
void |
setNewDocumentAndFileType(FileType fileType,
Document document) |
void |
setNextFocusableComponent(java.awt.Component aComponent) |
void |
setOneLineMode(boolean oneLineMode) |
void |
setPlaceholder(java.lang.CharSequence text)
Allows to define
editor's placeholder . |
void |
setPreferredWidth(int preferredWidth) |
void |
setSupplementary(boolean supplementary) |
void |
setText(java.lang.String text) |
protected void |
setupBorder(EditorEx editor) |
static void |
setupTextFieldEditor(EditorEx editor) |
protected void |
setViewerEnabled(boolean enabled) |
protected boolean |
shouldHaveBorder() |
protected void |
updateBorder(EditorEx editor) |
setOpaque, setTransparent
getTargetComponent, isNull, requestFocus, requestFocusInternal, setContent, setHorizontalSizeReferent, setVerticalSizeReferent
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, 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, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, 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, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
bulkUpdateFinished, bulkUpdateStarting
public static final Key<java.lang.Boolean> SUPPLEMENTARY_KEY
public EditorTextField()
public EditorTextField(java.lang.String text)
public EditorTextField(Document document, Project project, FileType fileType, boolean isViewer)
public void setSupplementary(boolean supplementary)
public void setFontInheritedFromLAF(boolean b)
public java.lang.String getText()
getText
in interface EditorTextComponent
public void setBackground(java.awt.Color bg)
setBackground
in class javax.swing.JComponent
public javax.swing.JComponent getComponent()
getComponent
in interface EditorTextComponent
public void addDocumentListener(DocumentListener listener)
addDocumentListener
in interface EditorTextComponent
public void removeDocumentListener(DocumentListener listener)
removeDocumentListener
in interface EditorTextComponent
public void beforeDocumentChange(DocumentEvent event)
DocumentListener
beforeDocumentChange
in interface DocumentListener
event
- the event containing the information about the change.public void documentChanged(DocumentEvent event)
DocumentListener
documentChanged
in interface DocumentListener
event
- the event containing the information about the change.public Project getProject()
public Document getDocument()
getDocument
in interface EditorTextComponent
public void setDocument(Document document)
public void setText(java.lang.String text)
public void setPlaceholder(java.lang.CharSequence text)
editor's placeholder
. The trick here is that the editor
is instantiated lazily by the editor text field and provided placeholder text is applied to the editor during its
actual construction then.text
- editor's placeholder
text to usepublic void selectAll()
public void removeSelection()
public void setCaretPosition(int position)
JTextComponent.setCaretPosition(int)
public CaretModel getCaretModel()
public boolean isFocusOwner()
isFocusOwner
in class java.awt.Component
public void addNotify()
addNotify
in class javax.swing.JComponent
public void removeNotify()
removeNotify
in class javax.swing.JComponent
public void setFont(java.awt.Font font)
setFont
in class javax.swing.JComponent
protected boolean isOneLineMode()
public void setOneLineMode(boolean oneLineMode)
protected Document createDocument()
protected EditorEx createEditor()
public static void setupTextFieldEditor(EditorEx editor)
protected void updateBorder(EditorEx editor)
protected void setupBorder(EditorEx editor)
protected boolean shouldHaveBorder()
public void setEnabled(boolean enabled)
setEnabled
in class javax.swing.JComponent
protected void setViewerEnabled(boolean enabled)
public boolean isViewer()
public java.awt.Color getBackground()
getBackground
in class java.awt.Component
protected void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
addImpl
in class java.awt.Container
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class Wrapper
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public void setPreferredWidth(int preferredWidth)
public java.awt.Component getNextFocusableComponent()
getNextFocusableComponent
in class javax.swing.JComponent
public void setNextFocusableComponent(java.awt.Component aComponent)
setNextFocusableComponent
in class javax.swing.JComponent
protected boolean processKeyBinding(javax.swing.KeyStroke ks, java.awt.event.KeyEvent e, int condition, boolean pressed)
processKeyBinding
in class javax.swing.JComponent
public void requestFocus()
requestFocus
in class Wrapper
public boolean requestFocusInWindow()
requestFocusInWindow
in class Wrapper
public Editor getEditor()
createEditor()
,
addNotify()
public FileType getFileType()
public javax.swing.JComponent getFocusTarget()
public void addFocusListener(java.awt.event.FocusListener l)
addFocusListener
in class java.awt.Component
public void removeFocusListener(java.awt.event.FocusListener l)
removeFocusListener
in class java.awt.Component
public void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
public void addMouseListener(java.awt.event.MouseListener l)
addMouseListener
in class java.awt.Component
public void removeMouseListener(java.awt.event.MouseListener l)
removeMouseListener
in class java.awt.Component
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public java.lang.Object getData(java.lang.String dataId)
DataProvider
PlatformDataKeys
class.getData
in interface DataProvider
dataId
- the data identifier for which the value is requested.public void setFileType(FileType fileType)
public void setNewDocumentAndFileType(FileType fileType, Document document)
public void ensureWillComputePreferredSize()
public void setAsRendererWithSelection(java.awt.Color backgroundColor, java.awt.Color foregroundColor)
public void addSettingsProvider(EditorSettingsProvider provider)
public boolean removeSettingsProvider(EditorSettingsProvider provider)