public class TextPanel extends BaseXPanel
Modifier and Type | Class and Description |
---|---|
static class |
TextPanel.Action
Editor action.
|
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
TextEditor |
editor
Text editor.
|
History |
hist
Undo history.
|
protected SearchBar |
search
Search bar.
|
gui
SEPARATOR_SIZE
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
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
TextPanel(BaseXWindow win,
boolean editable)
Default constructor.
|
TextPanel(BaseXWindow win,
String text,
boolean editable)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
bracket()
Jumps to a matching bracket.
|
void |
comment()
Adds or removes a comment.
|
void |
componentResized(ComponentEvent e) |
void |
error(int pos)
Sets the error marker.
|
void |
format()
Formats the selected text.
|
SearchBar |
getSearch()
Returns the search bar.
|
byte[] |
getText()
Returns the output text.
|
boolean |
isEditable()
Returns the editable flag.
|
protected void |
jump(SearchBar.SearchDir dir,
boolean select)
Jumps to the current, next or previous search string.
|
void |
keyPressed(KeyEvent e) |
void |
keyTyped(KeyEvent e) |
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
mouseWheelMoved(MouseWheelEvent e) |
int[] |
pos()
Returns the line and column of the current caret position.
|
void |
refreshLayout(Font f)
Refreshes the layout.
|
protected void |
release(TextPanel.Action action)
Releases a key or mouse.
|
void |
resetError()
Removes the error marker.
|
String |
searchString()
Returns a currently marked string if it does not extend over more than one line.
|
boolean |
selected()
Tests if text has been selected.
|
void |
setCaret(int pos)
Sets the caret to the specified position.
|
void |
setEnabled(boolean enabled) |
void |
setFont(Font f) |
void |
setLinkListener(LinkListener ll)
Installs a link listener.
|
protected void |
setSyntax(IO file,
boolean opened)
Sets a syntax highlighter, based on the file format.
|
void |
setSyntax(org.basex.gui.text.Syntax syntax)
Sets a syntax highlighter.
|
void |
setText(byte[] t)
Sets the output text.
|
void |
setText(byte[] text,
int size)
Sets the output text.
|
void |
setText(String t)
Sets the output text.
|
void |
sort()
Sorts text.
|
void |
toCase(TextEditor.Case cs)
Case conversion.
|
componentHidden, componentMoved, componentShown, keyReleased
border, border, layout, paintComponent
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, getPreferredSize, 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, 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, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
public final TextEditor editor
public final History hist
protected SearchBar search
public TextPanel(BaseXWindow win, boolean editable)
win
- parent windoweditable
- editable flagpublic TextPanel(BaseXWindow win, String text, boolean editable)
win
- parent windowtext
- initial texteditable
- editable flagpublic void setText(String t)
t
- output textpublic void setText(byte[] t)
t
- output textpublic final String searchString()
public final int[] pos()
public final void setText(byte[] text, int size)
text
- output textsize
- text sizeprotected final void setSyntax(IO file, boolean opened)
file
- file referenceopened
- indicates if file was opened from diskpublic final boolean isEditable()
public final void setSyntax(org.basex.gui.text.Syntax syntax)
syntax
- syntax referencepublic final void setCaret(int pos)
pos
- caret positionpublic final byte[] getText()
public final boolean selected()
public final void setFont(Font f)
setFont
in class JComponent
public final void resetError()
public final void error(int pos)
pos
- start of optional error markpublic final void comment()
public final void toCase(TextEditor.Case cs)
cs
- case typepublic final void bracket()
public final void sort()
public final void format()
public final void setEnabled(boolean enabled)
setEnabled
in class JComponent
public final void setLinkListener(LinkListener ll)
ll
- link listenerpublic final SearchBar getSearch()
protected final void jump(SearchBar.SearchDir dir, boolean select)
dir
- search directionselect
- select hitpublic final void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
mouseEntered
in class BaseXPanel
public final void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
mouseExited
in class BaseXPanel
public final void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
mouseMoved
in class BaseXPanel
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class BaseXPanel
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
mouseClicked
in class BaseXPanel
public final void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class BaseXPanel
public final void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
mousePressed
in class BaseXPanel
public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
keyPressed
in class BaseXPanel
public void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
keyTyped
in class BaseXPanel
protected void release(TextPanel.Action action)
action
- actionpublic final void refreshLayout(Font f)
f
- used fontpublic final void mouseWheelMoved(MouseWheelEvent e)
mouseWheelMoved
in interface MouseWheelListener
mouseWheelMoved
in class BaseXPanel
public final void componentResized(ComponentEvent e)
componentResized
in interface ComponentListener
componentResized
in class BaseXPanel
Copyright © 2005–2023 BaseX Team. All rights reserved.