projectviewer
Class ProjectViewer

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by projectviewer.ProjectViewer
All Implemented Interfaces:
java.awt.event.HierarchyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, org.gjt.sp.jedit.gui.DefaultFocusComponent

public final class ProjectViewer
extends javax.swing.JPanel
implements org.gjt.sp.jedit.gui.DefaultFocusComponent, java.awt.event.HierarchyListener

Main GUI for the project viewer plugin.

Up to 3.4.2 two states of ProjectViewer for a given view were possible:

  1. Dockable state. Dockable created
  2. Inactive state. Dockable not created, with ViewerEntry.pv member null. This state is good when no pv functionality is used, but it was also used for some actions, which actually didn't work well, because most of pv activity requires ProjectViewer instance. In this state getViewer returns null.
Due to problems with the second state, a new state was introduced in 3.4.3. This new state should replace the second state in situations, where pv functionality is required. The startup state is inactive. If pv dockable is activated by the user, it enters dockable state. If dockable state is not yet reached, and pv functionality is required, getViewer(View, int) should be called specifying FORCE flag. It triggers active without dockable state.

Author:
Marcelo Vanzin (with much code from original version)
See Also:
Serialized Form

Nested Class Summary
 class ProjectViewer.Helper
          Class to hold methods that require classes that may not be available, so that PV behaves well when called from a BeanShell script.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int FORCE
          For methods returning results: if no result is available, try to force the result by additional actions.
static int LATER
          Accept doing the call later, in idle state.
static int METHOD_FORCE
          Deprecated. Remove METHOD_ prefix.
static int METHOD_LATER
          Deprecated. Remove METHOD_ prefix.
static int METHOD_NO_FLAGS
          Deprecated. Remove METHOD_ prefix.
static int METHOD_ONCE
          Deprecated. Remove METHOD_ prefix.
static int METHOD_WARN
          Deprecated. Remove METHOD_ prefix.
static int NO_FLAGS
          Plain invocation, without additional flags.
static int ONCE
          Perform only once per session.
static int WARN
          For methods returning results: if no result is available, show a warning message to the user.
 
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
ProjectViewer(org.gjt.sp.jedit.View aView, boolean bDocked)
          Create a new ProjectViewer.
 
Method Summary
protected static void cleanViewEntry(org.gjt.sp.jedit.View aView)
          Removes the "viewer entry" related to the given view.
static java.lang.String compressPath(java.lang.String origPath)
           
static ProjectViewer createDockable(org.gjt.sp.jedit.View view)
          Creates a new instance of ProjectViewer to wrap it in the dockable.
 void focusOnDefaultComponent()
           
static VPTNode getActiveNode(org.gjt.sp.jedit.View aView)
          Return the current "active" node (opened project/group) for the view.
static VPTNode getActiveNode(org.gjt.sp.jedit.View aView, int methodFlags)
          Return the current "active" node (opened project/group) for the view.
static VPTProject getActiveProject(org.gjt.sp.jedit.View aView)
          Return the current active project for the view.
static VPTProject getActiveProject(org.gjt.sp.jedit.View aView, int methodFlags)
          Return the current active project for the view.
static org.gjt.sp.jedit.Buffer[] getBuffers(org.gjt.sp.jedit.View view)
          Gets an array of Buffers respecting current scope.
 javax.swing.JTree getCurrentTree()
          Returns the currently active tree.
 VPTNode getRoot()
          Returns the root node of the current tree.
 java.util.List getSelectedFilePaths()
          Returns a list of Strings containing the file paths of the selected file and folder nodes.
 VPTNode getSelectedNode()
          Returns the currently selected node in the tree.
 ProjectTreePanel getTreePanel()
          Returns the component that manages the trees shown in the UI.
 org.gjt.sp.jedit.View getView()
          Returns the View associated with this instance.
static ProjectViewer getViewer(org.gjt.sp.jedit.View view)
          Returns the viewer associated with the given view, or null if none exists.
static ProjectViewer getViewer(org.gjt.sp.jedit.View view, int methodFlags)
          Returns the viewer associated with the given view, or null if none exists.
 void handleBufferUpdate(org.gjt.sp.jedit.msg.BufferUpdate msg)
           
 void handleDockableWindowUpdate(org.gjt.sp.jedit.msg.DockableWindowUpdate msg)
           
 void handleDynamicMenuChanged(org.gjt.sp.jedit.msg.DynamicMenuChanged dmg)
           
 void handleEditorExitRequested(org.gjt.sp.jedit.msg.EditorExitRequested msg)
           
 void handleEditPaneUpdate(org.gjt.sp.jedit.msg.EditPaneUpdate msg)
           
 void handleProjectUpdate(ProjectUpdate msg)
          Resets the auto-reimporter task.
 void handleViewUpdate(org.gjt.sp.jedit.msg.ViewUpdate vu)
          Handles a ViewUpdate EditBus message.
 void hierarchyChanged(java.awt.event.HierarchyEvent e)
           
static void insertNodeInto(VPTNode child, VPTNode parent)
          Inserts a node in the given parent node (in a sorted position according to VPTNode.findIndexForChild(VPTNode) and notifies folder trees in all instances of ProjectViewer.
static void nodeChanged(VPTNode node)
          Notify all project viewer instances of a change in a node.
static void nodeStructureChanged(VPTNode node)
          Notify all project viewer instances of a change in a node's structure.
static void nodeStructureChangedFlat(VPTNode node)
          Notify all "flat trees" in any project viewer instances of a change in a node's structure.
static void projectRemoved(VPTProject p)
          Notify all "flat trees" in any project viewer instances of a change in a node's structure.
static void removeNodeFromParent(VPTNode child)
          Removes a node from its parent, and notifies all folder trees in all instances of ProjectViewer.
 void sendUpdate(VPTNode n, ViewerUpdate.Type type)
          Sends a project viewer update message with the given data.
static void setActiveNode(org.gjt.sp.jedit.View aView, VPTNode n)
          Sets the current active node for the view.
 void setChangingBuffers(boolean flag)
          Method intended for use by classes that manage clicks on the project trees to open buffers in jEdit; by setting this flag to true, the auto-selecting of the new active buffer in jEdit is temporarily disabled, preventing the tree from shifting around when the user is interacting with it.
 void setEnabled(boolean flag)
          Enables or disables the viewer GUI.
 void setRootNode(VPTNode n)
          Sets the root node of the trees shown by this viewer.
 void setStatus(java.lang.String message)
          Changes jEdit's status bar message for the current view.
static void showMessage(java.awt.Component parent, java.lang.String message)
          Same as showMessage(int, Component, String, String, int), but with no flags, with a default title and default messageType.
static void showMessage(java.awt.Component parent, java.lang.String message, int messageType)
          Same as showMessage(int, Component, String, String, int), but with no flags and with a default title.
static void showMessage(java.awt.Component parent, java.lang.String message, java.lang.String title, int messageType)
          Same as showMessage(int, Component, String, String, int), but with no flags.
static void showMessage(int flags, java.awt.Component parent, java.lang.String message)
          Same as showMessage(int, Component, String, String, int), but with a default title and default messageType.
static void showMessage(int flags, java.awt.Component parent, java.lang.String message, java.lang.String title, int messageType)
          Shows a message dialog through JOptionPane.showMessageDialog.
static void showMessage(int flags, java.lang.String message)
          Same as showMessage(int, Component, String, String, int), but with a default title and default messageType.
static void showMessage(java.lang.String message)
          Same as showMessage(int, Component, String, String, int), but with a default title and default messageType.
protected  void unload()
          Cleans up the current open project, and also clean up the loaded project list when unloading PV from the current view.
 void updateVCSState(VPTProject p, VPTNode f)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods 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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, 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, 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, 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, hide, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_FLAGS

public static final int NO_FLAGS
Plain invocation, without additional flags.

Since:
3.4.3
See Also:
Constant Field Values

FORCE

public static final int FORCE
For methods returning results: if no result is available, try to force the result by additional actions. For instance getActiveProject invoked with this parameter will force a project to be loaded.

Since:
3.4.3
See Also:
Constant Field Values

WARN

public static final int WARN
For methods returning results: if no result is available, show a warning message to the user.

Since:
3.4.3
See Also:
Constant Field Values

LATER

public static final int LATER
Accept doing the call later, in idle state.

Since:
3.4.3
See Also:
Constant Field Values

ONCE

public static final int ONCE
Perform only once per session.

Since:
3.4.3
See Also:
Constant Field Values

METHOD_NO_FLAGS

@Deprecated
public static final int METHOD_NO_FLAGS
Deprecated. Remove METHOD_ prefix.
Since:
3.3.0
See Also:
Constant Field Values

METHOD_FORCE

@Deprecated
public static final int METHOD_FORCE
Deprecated. Remove METHOD_ prefix.
Since:
3.3.0
See Also:
Constant Field Values

METHOD_WARN

@Deprecated
public static final int METHOD_WARN
Deprecated. Remove METHOD_ prefix.
Since:
3.3.0
See Also:
Constant Field Values

METHOD_LATER

@Deprecated
public static final int METHOD_LATER
Deprecated. Remove METHOD_ prefix.
Since:
3.3.0
See Also:
Constant Field Values

METHOD_ONCE

@Deprecated
public static final int METHOD_ONCE
Deprecated. Remove METHOD_ prefix.
Since:
3.4.2
See Also:
Constant Field Values
Constructor Detail

ProjectViewer

public ProjectViewer(org.gjt.sp.jedit.View aView,
                     boolean bDocked)
Create a new ProjectViewer. Only one instance is allowed per view.

This constructor should not be called from outside ProjectViewer. If an instance of this object is required, obtain it through getViewer(org.gjt.sp.jedit.View).

Up to 3.4.2 version this constructor was taking only the View argument.

Parameters:
aView - The jEdit view where the viewer is to be created.
bDocked - Whether pv is being created for the dockable window.
Throws:
java.lang.UnsupportedOperationException - If a viewer is already instantiated for the given view.
Since:
3.4.3 `
Method Detail

getViewer

public static ProjectViewer getViewer(org.gjt.sp.jedit.View view)
Returns the viewer associated with the given view, or null if none exists.


compressPath

public static java.lang.String compressPath(java.lang.String origPath)
Returns:
a compressed path using a variable-prefix if a suitable variable is found.

getViewer

public static ProjectViewer getViewer(org.gjt.sp.jedit.View view,
                                      int methodFlags)
Returns the viewer associated with the given view, or null if none exists. Optionally shows a warning message.

Parameters:
methodFlags -
  • Show a warning message if WARN is supplied.
  • Create a new instance of ProjectViewer if FORCE is specified. This is the way to achieve full pv functionality if there is no dockable active. See ProjectViewer, active without dockable state. This flag is supported since 3.4.3.
Since:
3.3.0

nodeStructureChanged

public static void nodeStructureChanged(VPTNode node)
Notify all project viewer instances of a change in a node's structure.


nodeChanged

public static void nodeChanged(VPTNode node)
Notify all project viewer instances of a change in a node.


insertNodeInto

public static void insertNodeInto(VPTNode child,
                                  VPTNode parent)
Inserts a node in the given parent node (in a sorted position according to VPTNode.findIndexForChild(VPTNode) and notifies folder trees in all instances of ProjectViewer.


nodeStructureChangedFlat

public static void nodeStructureChangedFlat(VPTNode node)
Notify all "flat trees" in any project viewer instances of a change in a node's structure.


removeNodeFromParent

public static void removeNodeFromParent(VPTNode child)
Removes a node from its parent, and notifies all folder trees in all instances of ProjectViewer.


projectRemoved

public static void projectRemoved(VPTProject p)
Notify all "flat trees" in any project viewer instances of a change in a node's structure. Then, rebuild the project combo boxes.

Since:
PV 3.0.0

setActiveNode

public static void setActiveNode(org.gjt.sp.jedit.View aView,
                                 VPTNode n)
Sets the current active node for the view. If a viewer is available for the given view, the root node of the viewer is also changed.

Throws:
java.lang.IllegalArgumentException - If node is not a project or group.
Since:
PV 2.1.0

getActiveNode

public static VPTNode getActiveNode(org.gjt.sp.jedit.View aView)
Return the current "active" node (opened project/group) for the view. Returns null if no active node is known for the view.

Since:
PV 2.1.0

getActiveNode

public static VPTNode getActiveNode(org.gjt.sp.jedit.View aView,
                                    int methodFlags)
Return the current "active" node (opened project/group) for the view. Returns null if no active node is known for the view.

Should not be called from outside ProjectViewer. For public usage getActiveNode(View) is suitable.

Parameters:
methodFlags - NO_FLAGS or FORCE.
Since:
PV 3.3.0

getActiveProject

public static VPTProject getActiveProject(org.gjt.sp.jedit.View aView)
Return the current active project for the view. If no project is active, return null.

Since:
PV 2.1.0

getActiveProject

public static VPTProject getActiveProject(org.gjt.sp.jedit.View aView,
                                          int methodFlags)
Return the current active project for the view. If no project is active, return null.

Should not be called from outside ProjectViewer. For public usage getActiveProject(View) is suitable.

Parameters:
methodFlags - NO_FLAGS or combination of FORCE, WARN
Since:
3.3.1

cleanViewEntry

protected static void cleanViewEntry(org.gjt.sp.jedit.View aView)
Removes the "viewer entry" related to the given view. Called by the ProjectPlugin class when a view closed message is received.


unload

protected void unload()
Cleans up the current open project, and also clean up the loaded project list when unloading PV from the current view.


createDockable

public static ProjectViewer createDockable(org.gjt.sp.jedit.View view)
Creates a new instance of ProjectViewer to wrap it in the dockable. If ProjectViewer is already instantiated for the given view (but the dockable was not yet created), that instance is returned.

Since:
3.4.3

setStatus

public void setStatus(java.lang.String message)
Changes jEdit's status bar message for the current view.


getSelectedNode

public VPTNode getSelectedNode()
Returns the currently selected node in the tree.


getSelectedFilePaths

public java.util.List getSelectedFilePaths()
Returns a list of Strings containing the file paths of the selected file and folder nodes. This is mostly a utility method so other plugins/macros can peform actions on a selection of files.


getCurrentTree

public javax.swing.JTree getCurrentTree()
Returns the currently active tree.


getView

public org.gjt.sp.jedit.View getView()
Returns the View associated with this instance.


getBuffers

public static org.gjt.sp.jedit.Buffer[] getBuffers(org.gjt.sp.jedit.View view)
Gets an array of Buffers respecting current scope. If EditPane scope is active, a combined set for the view is returned.

Parameters:
view - Can be null, which defaults to jEdit.getActiveView()
Since:
3.4.0

setRootNode

public void setRootNode(VPTNode n)
Sets the root node of the trees shown by this viewer. The current root is cleaned up before setting the new root (e.g., project files are closed, etc.)

Throws:
java.lang.IllegalArgumentException - If node is not a project or group.
Since:
PV 2.1.0

getRoot

public VPTNode getRoot()
Returns the root node of the current tree.


setEnabled

public void setEnabled(boolean flag)
Enables or disables the viewer GUI.

Overrides:
setEnabled in class javax.swing.JComponent

setChangingBuffers

public void setChangingBuffers(boolean flag)
Method intended for use by classes that manage clicks on the project trees to open buffers in jEdit; by setting this flag to true, the auto-selecting of the new active buffer in jEdit is temporarily disabled, preventing the tree from shifting around when the user is interacting with it.

Since:
PV 2.1.1

hierarchyChanged

public void hierarchyChanged(java.awt.event.HierarchyEvent e)
Specified by:
hierarchyChanged in interface java.awt.event.HierarchyListener

getTreePanel

public ProjectTreePanel getTreePanel()
Returns the component that manages the trees shown in the UI.

Since:
PV 3.0.0

sendUpdate

public void sendUpdate(VPTNode n,
                       ViewerUpdate.Type type)
Sends a project viewer update message with the given data.

Since:
PV 3.0.0

handleDockableWindowUpdate

public void handleDockableWindowUpdate(org.gjt.sp.jedit.msg.DockableWindowUpdate msg)

handleDynamicMenuChanged

public void handleDynamicMenuChanged(org.gjt.sp.jedit.msg.DynamicMenuChanged dmg)

handleEditorExitRequested

public void handleEditorExitRequested(org.gjt.sp.jedit.msg.EditorExitRequested msg)

handleViewUpdate

public void handleViewUpdate(org.gjt.sp.jedit.msg.ViewUpdate vu)
Handles a ViewUpdate EditBus message. Checks only whether the EditPane was changed, and focus the file corresponding to the buffer on the EditPane on the PV tree.


handleBufferUpdate

public void handleBufferUpdate(org.gjt.sp.jedit.msg.BufferUpdate msg)

handleEditPaneUpdate

public void handleEditPaneUpdate(org.gjt.sp.jedit.msg.EditPaneUpdate msg)

handleProjectUpdate

public void handleProjectUpdate(ProjectUpdate msg)
Resets the auto-reimporter task.


showMessage

public static void showMessage(int flags,
                               java.awt.Component parent,
                               java.lang.String message,
                               java.lang.String title,
                               int messageType)
Shows a message dialog through JOptionPane.showMessageDialog. It can be called either from AWT Event Thread or from other thread. If current thread is awt event thread, then this method blocks. If current thread is not awt, does it through invokeLater. This is a default behaviour which can be changed through flags.

Parameters:
flags -
  • NO_FLAGS: default behaviour.
  • FORCE: blocks always, even if current thread is not awt. May cause deadlocks.
  • ONCE: do not repeat this message until jEdit restart.
Since:
3.3.0

showMessage

public static void showMessage(int flags,
                               java.awt.Component parent,
                               java.lang.String message)
Same as showMessage(int, Component, String, String, int), but with a default title and default messageType.


showMessage

public static void showMessage(int flags,
                               java.lang.String message)
Same as showMessage(int, Component, String, String, int), but with a default title and default messageType. Current view is used as a parent component.


showMessage

public static void showMessage(java.lang.String message)
Same as showMessage(int, Component, String, String, int), but with a default title and default messageType. Current view is used as a parent component.


showMessage

public static void showMessage(java.awt.Component parent,
                               java.lang.String message,
                               java.lang.String title,
                               int messageType)
Same as showMessage(int, Component, String, String, int), but with no flags.


showMessage

public static void showMessage(java.awt.Component parent,
                               java.lang.String message,
                               int messageType)
Same as showMessage(int, Component, String, String, int), but with no flags and with a default title.


showMessage

public static void showMessage(java.awt.Component parent,
                               java.lang.String message)
Same as showMessage(int, Component, String, String, int), but with no flags, with a default title and default messageType.


focusOnDefaultComponent

public void focusOnDefaultComponent()
Specified by:
focusOnDefaultComponent in interface org.gjt.sp.jedit.gui.DefaultFocusComponent

updateVCSState

public void updateVCSState(VPTProject p,
                           VPTNode f)