Class DefaultContextMenuManager
java.lang.Object
de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.editing_tools.ContextMenuManager
de.ipk_gatersleben.ag_nw.graffiti.plugins.gui.editing_tools.DefaultContextMenuManager
- All Implemented Interfaces:
IContextMenuManager
public class DefaultContextMenuManager extends ContextMenuManager
This is the default context menu manager, that is used by the enhanced
editing tools for displaying a context menu. Currently two ways to add
context menus exist: (1) Plugin-Algorithms can implement the interface
AlgorithmWithContextMenu
. (2a) BeanShell Scripts can be placed
in the home folder (extension .bsh). There the menu command text is detected
from the first line of text. "// (at)Test-Command " would result in the Menu
Item "Test-Command" ("//" is replaced by "" and then a String.trim() call is
issued). Only scripts with a (at) in the first line will be placed in the
context menu. (2b) The search folder (standard is the home directory) for the
.bsh commands can be modified by adding a "scriptHomes" variable in the
"~./.bshrc" init script. My sources the .bshrc file and uses this variable.
Example: .bshrc: scriptHomes = "/home/klukas;/tmp"; ==> the home and the temp
path will be scanned for ".bsh" files.- Author:
- Christian Klukas
-
Constructor Summary
Constructors Constructor Description DefaultContextMenuManager()
-
Method Summary
Modifier and Type Method Description void
ensureActiveSession(MouseEvent e)
This Method should be called by the editing tools in the mouse entered event-handler.static String
getContent(String fileName)
static String
getContent(IOurl url)
JPopupMenu
getContextMenu(MouseEvent e)
This Method returns a Context Menu.static void
returnScriptMenu(JMenu scriptEntries)
-
Constructor Details
-
DefaultContextMenuManager
public DefaultContextMenuManager()
-
-
Method Details
-
getContextMenu
Description copied from interface:IContextMenuManager
This Method returns a Context Menu.- Parameters:
e
- The MouseEvent to be processed.- Returns:
- ContextMenu for the MouseEvent
-
returnScriptMenu
-
getContent
-
getContent
-
ensureActiveSession
Description copied from interface:IContextMenuManager
This Method should be called by the editing tools in the mouse entered event-handler. It should activate the view and session where the mouse button is over.- Parameters:
e
- TheMouseEvent
.
-