|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--org.gjt.sp.jedit.gui.DockableWindowManager
The DockableWindowManager
keeps track of dockable windows.
Each View
has an instance of this class.
dockables.xml:
Dockable window definitions are read from dockables.xml
files
contained inside plugin JARs. A dockable definition file has the following
form:
<?xml version="1.0"?> <!DOCTYPE DOCKABLES SYSTEM "dockables.dtd"> <DOCKABLES> <DOCKABLE NAME="name"> // Code to create the dockable </DOCKABLE> </DOCKABLES>More than one
<DOCKABLE> tag may be present. The code that
creates the dockable can reference any BeanShell built-in variable
(see BeanShell
), along with a variable
position
whose value is one of
FLOATING
, TOP
, LEFT
, BOTTOM
,
and RIGHT
.
The following properties must be defined for each dockable window:
name.title
- the string to show in the title bar
of the dockable.
name.label
- the dockable's menu item label.
A number of actions are automatically created for each dockable window:
name
- opens the dockable window.
name-toggle
- toggles the dockable window's visibility.
name-float
- opens the dockable window in a new
floating window.
Note that only the first action needs a label
property, the
rest have automatically-generated labels.
Implementation details:
When an instance of this class is initialized by the View
class, it
iterates through the list of registered dockable windows (from jEdit itself,
and any loaded plugins) and
examines options supplied by the user in the Global
Options dialog box. Any plugins designated for one of the
four docking positions are displayed.
To create an instance of a dockable window, the DockableWindowManager
finds and executes the BeanShell code extracted from the appropriate
dockables.xml
file. This code will typically consist of a call
to the constructor of the dockable window component. The result of the
BeanShell expression, typically a newly constructed component, is placed
in a window managed by this class.
- Since:
- jEdit 2.6pre3
- Version:
- $Id: DockableWindowManager.java,v 1.49 2003/02/11 02:31:06 spestov Exp $
- Author:
- Slava Pestov, John Gellene (API documentation)
- See Also:
View.getDockableWindowManager()
,
Serialized Form
Nested Class Summary
class
DockableWindowManager.DockableLayout
Field Summary
static java.lang.String
BOTTOM
Bottom position.
static java.lang.String
FLOATING
Floating position.
static java.lang.String
LEFT
Left position.
static java.lang.String
RIGHT
Right position.
static java.lang.String
TOP
Top position.
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor Summary
DockableWindowManager(View view)
Creates a new dockable window manager.
Method Summary
void
addDockableWindow(java.lang.String name)
Opens the specified dockable window.
void
close()
Called when the view is being closed.
void
closeCurrentArea()
Closes the currently focused docking area.
javax.swing.JComponent
floatDockableWindow(java.lang.String name)
Opens a new instance of the specified dockable window in a floating
container.
PanelWindowContainer
getBottomDockingArea()
javax.swing.JComponent
getDockable(java.lang.String name)
Returns the specified dockable window.
java.lang.String
getDockableTitle(java.lang.String name)
Returns the title of the specified dockable window.
javax.swing.JComponent
getDockableWindow(java.lang.String name)
Returns the specified dockable window.
PanelWindowContainer
getLeftDockingArea()
static java.lang.String[]
getRegisteredDockableWindows()
PanelWindowContainer
getRightDockingArea()
PanelWindowContainer
getTopDockingArea()
View
getView()
Returns this dockable window manager's view.
void
init()
Initialises dockable window manager.
boolean
isDockableWindowDocked(java.lang.String name)
Returns if the specified dockable window is docked into the
view.
boolean
isDockableWindowVisible(java.lang.String name)
Returns if the specified dockable window is visible.
static boolean
loadDockableWindows(java.lang.String path,
java.io.Reader in,
ActionSet actionSet)
Plugins shouldn't need to call this method.
void
propertiesChanged()
Called by the view when properties change.
static void
registerDockableWindow(java.lang.String name,
java.lang.String code,
boolean actions,
ActionSet actionSet)
void
removeDockableWindow(java.lang.String name)
Removes the specified dockable window.
void
showDockableWindow(java.lang.String name)
Opens the specified dockable window.
void
toggleDockableWindow(java.lang.String name)
Toggles the visibility of the specified dockable window.
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
Methods 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Field Detail
FLOATING
public static final java.lang.String FLOATING
- Floating position.
- Since:
- jEdit 2.6pre3
- See Also:
- Constant Field Values
TOP
public static final java.lang.String TOP
- Top position.
- Since:
- jEdit 2.6pre3
- See Also:
- Constant Field Values
LEFT
public static final java.lang.String LEFT
- Left position.
- Since:
- jEdit 2.6pre3
- See Also:
- Constant Field Values
BOTTOM
public static final java.lang.String BOTTOM
- Bottom position.
- Since:
- jEdit 2.6pre3
- See Also:
- Constant Field Values
RIGHT
public static final java.lang.String RIGHT
- Right position.
- Since:
- jEdit 2.6pre3
- See Also:
- Constant Field Values
Constructor Detail
DockableWindowManager
public DockableWindowManager(View view)
- Creates a new dockable window manager.
- Parameters:
view
- The view- Since:
- jEdit 2.6pre3
Method Detail
loadDockableWindows
public static boolean loadDockableWindows(java.lang.String path,
java.io.Reader in,
ActionSet actionSet)
- Plugins shouldn't need to call this method.
- Since:
- jEdit 4.0pre1
registerDockableWindow
public static void registerDockableWindow(java.lang.String name,
java.lang.String code,
boolean actions,
ActionSet actionSet)
getRegisteredDockableWindows
public static java.lang.String[] getRegisteredDockableWindows()
init
public void init()
- Initialises dockable window manager.
- Since:
- jEdit 2.6pre3
getView
public View getView()
- Returns this dockable window manager's view.
- Since:
- jEdit 4.0pre2
floatDockableWindow
public javax.swing.JComponent floatDockableWindow(java.lang.String name)
- Opens a new instance of the specified dockable window in a floating
container.
- Parameters:
name
- The dockable window name
- Returns:
- The new dockable window instance
- Since:
- jEdit 4.1pre2
showDockableWindow
public void showDockableWindow(java.lang.String name)
- Opens the specified dockable window.
- Parameters:
name
- The dockable window name- Since:
- jEdit 2.6pre3
addDockableWindow
public void addDockableWindow(java.lang.String name)
- Opens the specified dockable window. As of version 4.0pre1, has the same
effect as calling showDockableWindow().
- Parameters:
name
- The dockable window name- Since:
- jEdit 2.6pre3
removeDockableWindow
public void removeDockableWindow(java.lang.String name)
- Removes the specified dockable window.
- Parameters:
name
- The dockable window name- Since:
- jEdit 2.6pre3
toggleDockableWindow
public void toggleDockableWindow(java.lang.String name)
- Toggles the visibility of the specified dockable window.
- Parameters:
name
- The dockable window name
getDockableWindow
public javax.swing.JComponent getDockableWindow(java.lang.String name)
- Returns the specified dockable window.
- Parameters:
name
- The name of the dockable window- Since:
- jEdit 4.1pre2
getDockable
public javax.swing.JComponent getDockable(java.lang.String name)
- Returns the specified dockable window. For historical reasons, this
does the same thing as
getDockableWindow(String)
.
- Parameters:
name
- The name of the dockable window- Since:
- jEdit 4.0pre1
getDockableTitle
public java.lang.String getDockableTitle(java.lang.String name)
- Returns the title of the specified dockable window.
- Parameters:
name
- The name of the dockable window.- Since:
- jEdit 4.1pre5
isDockableWindowVisible
public boolean isDockableWindowVisible(java.lang.String name)
- Returns if the specified dockable window is visible.
- Parameters:
name
- The dockable window name
isDockableWindowDocked
public boolean isDockableWindowDocked(java.lang.String name)
- Returns if the specified dockable window is docked into the
view.
- Parameters:
name
- The dockable's name- Since:
- jEdit 4.0pre2
closeCurrentArea
public void closeCurrentArea()
- Closes the currently focused docking area.
- Since:
- jEdit 4.1pre3
close
public void close()
- Called when the view is being closed.
- Since:
- jEdit 2.6pre3
getTopDockingArea
public PanelWindowContainer getTopDockingArea()
getLeftDockingArea
public PanelWindowContainer getLeftDockingArea()
getBottomDockingArea
public PanelWindowContainer getBottomDockingArea()
getRightDockingArea
public PanelWindowContainer getRightDockingArea()
propertiesChanged
public void propertiesChanged()
- Called by the view when properties change.
- Since:
- jEdit 2.6pre3
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD