java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.gjt.sp.jedit.EditPane
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,EventListener,Accessible,BufferSetListener
A panel containing a text area.
In a BeanShell script, you can obtain the current edit pane from the
editPane variable.
Each View can have multiple editPanes, one is active at a time.
Each EditPane has a single JEditTextArea, and is operating on single buffer.
The EditPane also can switch buffers.
This is the "controller" between a JEditTextArea (view) and a buffer (model).
This class does not have a public constructor.
Edit panes can be created and destroyed using methods in the
View class.
- Version:
- $Id: EditPane.java 25334 2020-05-10 09:51:15Z kpouer $
- Author:
- Slava Pestov
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a marker at the caret position.voidbufferAdded(Buffer buffer, int index) A buffer was added in the bufferSet.voidbufferMoved(Buffer buffer, int oldIndex, int newIndex) A buffer was moved in the BufferSet.voidbufferRemoved(Buffer buffer, int index) A buffer was removed from the bufferSet.voidThe bufferSet was sortedvoidPops up and focuses on the buffer switcher combo box.voidSets the focus onto the text area.static EditPaneReturns the EditPane of a TextArea.Returns the current buffer.Returns the current buffer set.Returns the buffer switcher combo box instance.final DimensionReturns 0,0 for split pane compatibility.Returns the view's text area.getView()Returns the view containing this edit pane.voidgoToMarker(char shortcut, boolean select) Moves the caret to the marker with the specified shortcut.voidgoToNextMarker(boolean select) Moves the caret to the next marker.voidgoToPrevMarker(boolean select) Moves the caret to the previous marker.voidvoidstatic voidinitPainter(TextAreaPainter painter) Init the painter of a textarea.voidLoads the caret and selection information from this EditPane, fall back to the information from the current buffer if none is already in this EditPane.voidSelects the next buffer.voidSelects the previous buffer.voidSelects the most recently edited buffer.voidSaves the caret information to the current buffer.voidSets the current buffer.voidSets the current buffer.voidswapMarkerAndCaret(char shortcut) Moves the caret to the marker with the specified shortcut, then sets the marker position to the former caret position.toString()Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponent
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, 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, 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, updateMethods 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, transferFocusDownCycle, validate, validateTreeMethods 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Method Details
-
getView
Returns the view containing this edit pane.- Returns:
- the view that contains this EditPane
- Since:
- jEdit 2.5pre2
-
get
Returns the EditPane of a TextArea.- Parameters:
ta- the textArea- Returns:
- the EditPane containing the TextArea.
-
getBuffer
Returns the current buffer.- Returns:
- the current buffer
- Since:
- jEdit 2.5pre2
-
setBuffer
Sets the current buffer.- Parameters:
buffer- The buffer to edit.- Since:
- jEdit 2.5pre2
-
setBuffer
Sets the current buffer.- Parameters:
buffer- The buffer to edit.requestFocus- true if the textarea should request focus, false otherwise- Since:
- jEdit 4.3pre6
-
prevBuffer
public void prevBuffer()Selects the previous buffer.- Since:
- jEdit 2.7pre2
-
nextBuffer
public void nextBuffer()Selects the next buffer.- Since:
- jEdit 2.7pre2
-
recentBuffer
public void recentBuffer()Selects the most recently edited buffer.- Since:
- jEdit 2.7pre2
-
focusOnTextArea
public void focusOnTextArea()Sets the focus onto the text area.- Since:
- jEdit 2.5pre2
-
getTextArea
Returns the view's text area.- Returns:
- the text area of the edit pane
- Since:
- jEdit 2.5pre2
-
getBufferSwitcher
Returns the buffer switcher combo box instance.- Returns:
- the buffer switcher (it can be null)
- Since:
- jEdit 4.1pre8
-
focusBufferSwitcher
public void focusBufferSwitcher()Pops up and focuses on the buffer switcher combo box.- Since:
- jEdit 4.3pre18 (previously known as showBufferSwitcher)
-
saveCaretInfo
public void saveCaretInfo()Saves the caret information to the current buffer.- Since:
- jEdit 2.5pre2
-
loadCaretInfo
public void loadCaretInfo()Loads the caret and selection information from this EditPane, fall back to the information from the current buffer if none is already in this EditPane.- Since:
- jEdit 2.5pre2
-
goToNextMarker
public void goToNextMarker(boolean select) Moves the caret to the next marker.- Parameters:
select- whether to select the marker- Since:
- jEdit 4.3pre3
-
goToPrevMarker
public void goToPrevMarker(boolean select) Moves the caret to the previous marker.- Parameters:
select- whether to select the marker- Since:
- jEdit 2.7pre2
-
goToMarker
public void goToMarker(char shortcut, boolean select) Moves the caret to the marker with the specified shortcut.- Parameters:
shortcut- The shortcutselect- True if the selection should be extended, false otherwise- Since:
- jEdit 3.2pre2
-
addMarker
public void addMarker()Adds a marker at the caret position.- Since:
- jEdit 3.2pre1
-
swapMarkerAndCaret
public void swapMarkerAndCaret(char shortcut) Moves the caret to the marker with the specified shortcut, then sets the marker position to the former caret position.- Parameters:
shortcut- The shortcut- Since:
- jEdit 3.2pre2
-
handlePropertiesChanged
-
getMinimumSize
Returns 0,0 for split pane compatibility.- Overrides:
getMinimumSizein classJComponent
-
getBufferSet
Returns the current buffer set. This can be changed by setBufferSetScope().- Returns:
- the buffer set which is currently used by this EditPane
- Since:
- jEdit 4.3pre17
-
bufferAdded
A buffer was added in the bufferSet.- Specified by:
bufferAddedin interfaceBufferSetListener- Parameters:
buffer- the added bufferindex- the position where it was added- Since:
- jEdit 4.3pre15
-
bufferRemoved
A buffer was removed from the bufferSet.- Specified by:
bufferRemovedin interfaceBufferSetListener- Parameters:
buffer- the removed bufferindex- the position where it was before being removed- Since:
- jEdit 4.3pre15
-
bufferMoved
A buffer was moved in the BufferSet.- Specified by:
bufferMovedin interfaceBufferSetListener- Parameters:
buffer- the moved bufferoldIndex- the position it was beforenewIndex- the new position- Since:
- jEdit 4.3pre15
-
bufferSetSorted
public void bufferSetSorted()The bufferSet was sorted- Specified by:
bufferSetSortedin interfaceBufferSetListener- Since:
- jEdit 4.3pre16
-
toString
-
initPainter
Init the painter of a textarea.- Parameters:
painter- the painter of a textarea- Since:
- jEdit 4.3pre12
-
handleBufferUpdate
-