Extension SDK 9.0.5

oracle.jdeveloper.vcs.util
Class VCSMenuUtils

java.lang.Object
  extended byoracle.jdeveloper.vcs.util.VCSMenuUtils

public class VCSMenuUtils
extends java.lang.Object

Utility class for initializing and manipulating version control menus.

Since:
9.0.5

Constructor Summary
VCSMenuUtils()
           
 
Method Summary
static javax.swing.JMenuItem addDynamicMenuItem(javax.swing.JMenu menu, int cmdId, float section, Context context)
          Create and add a dynamic menu item for the specified command.
static javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu, int cmdId, float section)
          Create and add a menu item for the specified command.
static javax.swing.JMenuItem createMenuItem(int cmdId)
          Create a menu item for the specified command.
static javax.swing.JMenuItem createMenuItem(int cmdId, float weight)
          Create a menu item for the specified command, with the specified weight.
static javax.swing.JMenu createVersioningSubmenu()
          Create the Versioning submenu for the editor or navigator.
static javax.swing.JMenu getMainVersioningMenu()
          Get the main, top-level Versioning menu.
static void installCompareMenuItem(int cmdId)
          Install a menu item into the Compare With menu.
static void installContextMenuListener(ContextMenuListener listener)
          Install the specified context menu listener.
static void installSelectExtensionMenuItem()
          Install the standard "Select Extension" menu item at the end of the Versioning menu
static KeyStrokeContext registerKeyStrokes(java.util.Collection actions, java.lang.String keyStrokeContextName)
          Register a key stroke context for the specified collection of actions so that the user can define accelerators from Tools->Preferences.
static void uninstallCompareMenuItem(int cmdId)
          Uninstall a menu item into the Compare With menu.
static void uninstallContextMenuListener(ContextMenuListener listener)
          Uninstalls the specified context menu listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VCSMenuUtils

public VCSMenuUtils()
Method Detail

getMainVersioningMenu

public static javax.swing.JMenu getMainVersioningMenu()
Get the main, top-level Versioning menu.

Returns:
the versioning menu.

installSelectExtensionMenuItem

public static void installSelectExtensionMenuItem()
Install the standard "Select Extension" menu item at the end of the Versioning menu


createVersioningSubmenu

public static javax.swing.JMenu createVersioningSubmenu()
Create the Versioning submenu for the editor or navigator.

Returns:
the new versioning submenu.

installContextMenuListener

public static void installContextMenuListener(ContextMenuListener listener)
Install the specified context menu listener. This currently adds a listener to the editor and navigator so that a versioning context menu is displayed in both places. To create a default context menu listener, use the VCSDefaultUtils.createContextMenuListener() method.

Parameters:
listener - the listener to install.

uninstallContextMenuListener

public static void uninstallContextMenuListener(ContextMenuListener listener)
Uninstalls the specified context menu listener.

Parameters:
listener - the listener to uninstall.

registerKeyStrokes

public static KeyStrokeContext registerKeyStrokes(java.util.Collection actions,
                                                  java.lang.String keyStrokeContextName)
Register a key stroke context for the specified collection of actions so that the user can define accelerators from Tools->Preferences.

Parameters:
actions - the key stroke actions to register
keyStrokeContextName - the context name for the key stroke.
Returns:
the created key stroke context.

addMenuItem

public static javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu,
                                                int cmdId,
                                                float section)
Create and add a menu item for the specified command.

Parameters:
cmdId - the command identifier for the menu action to add.
menu - the menu to which the item will be added.
section - the section value.
Returns:
the new menu item.

addDynamicMenuItem

public static javax.swing.JMenuItem addDynamicMenuItem(javax.swing.JMenu menu,
                                                       int cmdId,
                                                       float section,
                                                       Context context)
Create and add a dynamic menu item for the specified command. The menu item will not be added if the command's corresponding action is not made available by its controller.

Parameters:
menu - the menu to which the item will be added.
cmdId - the command identifier for the menu action to add.
section - the section value.
context - the current context.
Returns:
the new menu item.

createMenuItem

public static javax.swing.JMenuItem createMenuItem(int cmdId)
Create a menu item for the specified command.

Parameters:
cmdId - the command identifier for the menu action to add.
Returns:
the new menu item.

createMenuItem

public static javax.swing.JMenuItem createMenuItem(int cmdId,
                                                   float weight)
Create a menu item for the specified command, with the specified weight.

Parameters:
cmdId - the command identifier for the menu action to add.
weight - the weight for the menu item.
Returns:
the new menu item.

installCompareMenuItem

public static void installCompareMenuItem(int cmdId)
Install a menu item into the Compare With menu.

Parameters:
cmdId - the command identifier for the compare with menu action.

uninstallCompareMenuItem

public static void uninstallCompareMenuItem(int cmdId)
Uninstall a menu item into the Compare With menu.

Parameters:
cmdId - the command identifier for the compare with menu action.

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.