public class View extends javax.swing.JFrame implements InputHandlerProvider
View
is jEdit's top-level frame window.
In a BeanShell script, you can obtain the current view instance from the
view
variable.
The largest component it contains is an EditPane
that in turn
contains a JEditTextArea
that displays a
Buffer
.
A view can have more than one edit pane in a split window configuration.
A view also contains a menu bar, an optional toolbar and other window
decorations, as well as docked windows.
The View class performs two important operations dealing with plugins: creating plugin menu items, and managing dockable windows.
EditPlugin
class.DockableWindowManager
object. This object is
responsible for creating, closing and managing dockable windows.jEdit
class.Modifier and Type | Class and Description |
---|---|
static class |
View.ViewConfig |
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
static int |
ABOVE_SYSTEM_BAR_LAYER
Above system tool bar layer.
|
static int |
ACTION_BAR |
static int |
ACTION_BAR_LAYER
Action bar layer.
|
static int |
BELOW_SEARCH_BAR_LAYER
Below search bar layer.
|
static int |
BELOW_STATUS_BAR_LAYER
Status bar layer.
|
static int |
BELOW_SYSTEM_BAR_LAYER
Below system tool bar layer.
|
static int |
BOTTOM_GROUP
The group of tool bars below the DockableWindowManager
|
static int |
BOTTOM_LAYER
The lowest possible layer.
|
static int |
DEFAULT_GROUP |
static int |
DEFAULT_LAYER
The default layer for tool bars with no preference.
|
static java.lang.String |
DOCKING_FRAMEWORK_PROVIDER_SERVICE |
static int |
SEARCH_BAR_LAYER
Search bar layer.
|
static int |
STATUS_BAR_LAYER
Status bar layer.
|
static int |
SYSTEM_BAR_LAYER
System tool bar layer.
|
static int |
TEXT_AREA |
static int |
TOP_GROUP
The group of tool bars above the DockableWindowManager
|
static int |
TOP_LAYER
The highest possible layer.
|
static int |
VIEW |
static java.lang.String |
VIEW_DOCKING_FRAMEWORK_PROPERTY |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Modifier and Type | Method and Description |
---|---|
void |
actionBar()
Shows the action bar if needed, and sends keyboard focus there.
|
void |
addToolBar(java.awt.Component toolBar)
Adds a tool bar to this view.
|
void |
addToolBar(int group,
java.awt.Component toolBar)
Adds a tool bar to this view.
|
void |
addToolBar(int group,
int layer,
java.awt.Component toolBar)
Adds a tool bar to this view.
|
void |
adjust(View parent,
View.ViewConfig config) |
void |
closeAllMenus()
closes any popup menus that may have been opened
|
ActionBar |
getActionBar()
Returns the action bar.
|
Buffer |
getBuffer()
Returns the current edit pane's buffer.
|
Buffer[] |
getBuffers()
Returns all Buffers opened in this View,
Sorted according to View options.
|
DockableWindowManager |
getDockableWindowManager()
Returns the dockable window manager associated with this view.
|
static java.lang.String |
getDockingFrameworkName() |
static DockingFrameworkProvider |
getDockingFrameworkProvider() |
EditPane |
getEditPane()
Returns the current edit pane.
|
EditPane[] |
getEditPanes()
Returns all edit panes.
|
InputHandler |
getInputHandler()
Returns the input handler.
|
java.awt.event.KeyListener |
getKeyEventInterceptor()
Returns the listener that will handle all key events in this
view, if any.
|
Macros.Recorder |
getMacroRecorder()
Returns the macro recorder.
|
java.awt.Dimension |
getMinimumSize() |
View |
getNext()
Returns the next view in the list.
|
java.awt.Component |
getPrefixFocusOwner() |
View |
getPrev()
Returns the previous view in the list.
|
SearchBar |
getSearchBar()
Returns the search bar.
|
java.lang.String |
getSplitConfig()
Split configurations are recorded in a simple RPN "language".
|
javax.swing.JSplitPane |
getSplitPane()
Returns the top-level split pane, if any.
|
StatusBar |
getStatus()
Returns the status bar.
|
JEditTextArea |
getTextArea()
Returns the current edit pane's text area.
|
java.awt.Container |
getToolBar()
Returns the view's tool bar.
|
View.ViewConfig |
getViewConfig() |
EditPane |
goToBuffer(Buffer buffer)
If this buffer is open in one of the view's edit panes, sets focus
to that edit pane.
|
void |
handleBufferUpdate(BufferUpdate msg) |
void |
handleEditPaneUpdate(EditPaneUpdate msg) |
void |
handlePropertiesChanged(PropertiesChanged msg) |
void |
handleSearchSettingsChanged(SearchSettingsChanged msg) |
void |
handleViewUpdate(ViewUpdate msg) |
void |
hideWaitCursor()
Hides the wait cursor.
|
boolean |
isClosed()
Returns true if this view has been closed with
jEdit.closeView(View) . |
boolean |
isFullScreenMode() |
boolean |
isPlainView()
Returns true if this is an auxilliary view with no dockable windows.
|
void |
nextTextArea()
Moves keyboard focus to the next text area.
|
void |
prevTextArea()
Moves keyboard focus to the previous text area.
|
void |
processKeyEvent(java.awt.event.KeyEvent evt)
Forwards key events directly to the input handler.
|
void |
processKeyEvent(java.awt.event.KeyEvent evt,
boolean calledFromTextArea)
Forwards key events directly to the input handler.
|
void |
processKeyEvent(java.awt.event.KeyEvent evt,
int from)
Forwards key events directly to the input handler.
|
void |
quickHyperSearch(boolean word)
Quick HyperSearch.
|
void |
quickIncrementalSearch(boolean word)
Quick search.
|
void |
removeToolBar(java.awt.Component toolBar)
Removes a tool bar from this view.
|
void |
resplit()
Restore the split configuration as it was before unsplitting.
|
void |
setBuffer(Buffer buffer)
Sets the current edit pane's buffer.
|
void |
setInputHandler(InputHandler inputHandler)
Sets the input handler.
|
void |
setKeyEventInterceptor(java.awt.event.KeyListener listener)
Sets the listener that will handle all key events in this
view.
|
void |
setMacroRecorder(Macros.Recorder recorder)
Sets the macro recorder.
|
void |
setPrefixFocusOwner(java.awt.Component prefixFocusOwner) |
void |
setSplitConfig(Buffer buffer,
java.lang.String splitConfig)
sets the split configuration as per the splitConfig.
|
void |
setUserTitle(java.lang.String title)
Sets a user-defined title for this view instead of the "view.title" property.
|
void |
setWaitSocket(java.net.Socket waitSocket)
This socket is closed when the buffer is closed.
|
EditPane |
showBuffer(Buffer buffer)
If this buffer is open in one of the view's edit panes, activates
that edit pane.
|
void |
showUserTitleDialog()
Shows a dialog for selecting a user-defined title for this view.
|
void |
showWaitCursor()
Shows the wait cursor.
|
EditPane |
split(int orientation)
Splits the view.
|
EditPane |
splitHorizontally()
Splits the view horizontally.
|
EditPane |
splitVertically()
Splits the view vertically.
|
void |
toggleFullScreen() |
java.lang.String |
toString() |
void |
unsplit()
Unsplits the view.
|
void |
unsplitCurrent()
Removes the current split.
|
void |
updateBufferSwitcherStates()
Enables or Disables the "Focus Buffer Switcher" menu item in the View menu
depending on the visible state of the buffer switcher.
|
void |
updateFullScreenProps() |
void |
updateTitle()
Updates the title bar.
|
void |
visit(JEditVisitor visitor)
Visit the the editpanes and textareas of the view
|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String VIEW_DOCKING_FRAMEWORK_PROPERTY
public static final java.lang.String DOCKING_FRAMEWORK_PROVIDER_SERVICE
public static final int TOP_GROUP
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int BOTTOM_GROUP
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int DEFAULT_GROUP
public static final int TOP_LAYER
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int DEFAULT_LAYER
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int BOTTOM_LAYER
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int ABOVE_SYSTEM_BAR_LAYER
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int SYSTEM_BAR_LAYER
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int BELOW_SYSTEM_BAR_LAYER
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int SEARCH_BAR_LAYER
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int BELOW_SEARCH_BAR_LAYER
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int ACTION_BAR_LAYER
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int STATUS_BAR_LAYER
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int BELOW_STATUS_BAR_LAYER
addToolBar(int,int,java.awt.Component)
,
Constant Field Valuespublic static final int VIEW
public static final int TEXT_AREA
public static final int ACTION_BAR
public DockableWindowManager getDockableWindowManager()
public static java.lang.String getDockingFrameworkName()
public static DockingFrameworkProvider getDockingFrameworkProvider()
public java.awt.Container getToolBar()
public void addToolBar(java.awt.Component toolBar)
toolBar
- The tool barpublic void addToolBar(int group, java.awt.Component toolBar)
group
- The tool bar group to add totoolBar
- The tool barToolBarManager
public void addToolBar(int group, int layer, java.awt.Component toolBar)
group
- The tool bar group to add tolayer
- The layer of the group to add totoolBar
- The tool barToolBarManager
public void removeToolBar(java.awt.Component toolBar)
toolBar
- The tool barpublic void showWaitCursor()
hideWaitCursor()
are implemented using a reference
count of requests for wait cursors, so that nested calls work
correctly; however, you should be careful to use these methods in
tandem.
To ensure that hideWaitCursor()
is always called
after a showWaitCursor()
, use a
try
/finally
block, like this:
try { view.showWaitCursor(); // ... } finally { view.hideWaitCursor(); }
public void hideWaitCursor()
public final SearchBar getSearchBar()
public final ActionBar getActionBar()
public StatusBar getStatus()
StatusBar.setMessage(String)
and
StatusBar.setMessageAndClear(String)
methods can
be called on the return value of this method to display status
information to the user.public void quickIncrementalSearch(boolean word)
public void quickHyperSearch(boolean word)
public void actionBar()
public java.awt.event.KeyListener getKeyEventInterceptor()
public void setKeyEventInterceptor(java.awt.event.KeyListener listener)
listener
- The key event interceptor.public InputHandler getInputHandler()
getInputHandler
in interface InputHandlerProvider
public void setInputHandler(InputHandler inputHandler)
inputHandler
- The new input handlerpublic Macros.Recorder getMacroRecorder()
public void setMacroRecorder(Macros.Recorder recorder)
recorder
- The macro recorderpublic void processKeyEvent(java.awt.event.KeyEvent evt)
processKeyEvent
in class java.awt.Component
public void processKeyEvent(java.awt.event.KeyEvent evt, boolean calledFromTextArea)
public void processKeyEvent(java.awt.event.KeyEvent evt, int from)
public EditPane splitHorizontally()
public EditPane splitVertically()
public EditPane split(int orientation)
orientation
- the orientation JSplitPane.HORIZONTAL_SPLIT
or
JSplitPane.VERTICAL_SPLIT
public void unsplit()
public void unsplitCurrent()
public void resplit()
public java.lang.String getSplitConfig()
public void setSplitConfig(Buffer buffer, java.lang.String splitConfig)
buffer
- if null, checks all buffers to restore View's split config.splitConfig
- the split config, as returned by getSplitConfig()public void nextTextArea()
public void prevTextArea()
public javax.swing.JSplitPane getSplitPane()
public Buffer getBuffer()
public Buffer[] getBuffers()
public void setBuffer(Buffer buffer)
buffer
- The bufferpublic EditPane goToBuffer(Buffer buffer)
buffer
- The bufferpublic EditPane showBuffer(Buffer buffer)
buffer
- The buffer to showpublic JEditTextArea getTextArea()
public EditPane getEditPane()
public EditPane[] getEditPanes()
public View.ViewConfig getViewConfig()
public boolean isClosed()
jEdit.closeView(View)
.public boolean isPlainView()
public View getNext()
public View getPrev()
public void handlePropertiesChanged(PropertiesChanged msg)
public void handleSearchSettingsChanged(SearchSettingsChanged msg)
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Container
public void setWaitSocket(java.net.Socket waitSocket)
public java.lang.String toString()
toString
in class java.awt.Component
public void updateTitle()
public void setUserTitle(java.lang.String title)
public void showUserTitleDialog()
public java.awt.Component getPrefixFocusOwner()
public void setPrefixFocusOwner(java.awt.Component prefixFocusOwner)
public void visit(JEditVisitor visitor)
visitor
- the visitorpublic void closeAllMenus()
public void updateFullScreenProps()
public boolean isFullScreenMode()
public void toggleFullScreen()
public void updateBufferSwitcherStates()
public void handleBufferUpdate(BufferUpdate msg)
public void handleEditPaneUpdate(EditPaneUpdate msg)
public void handleViewUpdate(ViewUpdate msg)
public void adjust(View parent, View.ViewConfig config)