Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.jdeveloper.vcs.util
Class VCSMenuUtils

java.lang.Object
  extended by oracle.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 void addCompareSubmenu(java.util.Collection<? super javax.swing.JMenuItem> menus, Context context)
          Conditionally add the compare submenu to the specified collection of menu items, iff at least one compare submenu item is enabled in the specified context.
static javax.swing.JMenuItem addDynamicMenuItem(ContextMenu menu, int cmdId, float section)
           
static javax.swing.JMenuItem addDynamicMenuItem(javax.swing.JMenu menu, int cmdId, float section, Context context)
          Deprecated. replaced by addLazyDynamicMenuItem(javax.swing.JMenu, int, float, oracle.ide.Context).
static void addLazyDynamicMenuItem(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(ContextMenu menu, int cmdId, float section)
           
static javax.swing.JMenuItem addMenuItem(ContextMenu menu, ToggleAction action, float section)
           
static java.awt.Component addMenuItem(javax.swing.JMenu menu, java.awt.Component component, float section)
          Add a component to the menu.
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 addMenuItem(javax.swing.JMenu menu, ToggleAction action, float section)
          Create and add a menu item for the specified action.
static javax.swing.JMenuItem addMenuItemToTeamMenu(int cmdId, java.lang.String alterativeName, float section)
          Add a menu item to the View -> Team sub menu.
static void addRawMenuItemNoAction(javax.swing.JMenu menu, javax.swing.JMenuItem item, float section, Context context)
           
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()
          Deprecated. replaced by declarative registration through menu-hook.
static javax.swing.JMenu getViewTeamSubmenu()
          Get the View, Team submenu
static void installCompareMenuItem(int cmdId, java.lang.String vcsId)
          Install a menu item into the Compare With menu.
static void installContextMenuListener(ContextMenuListener listener)
          Install the specified context menu listener.
static javax.swing.JMenu installMainSystemMenu(java.lang.String vcsId, VCSExtensionInformation information)
          Install the system menu for the given extension into the Versioning main menu.
static void installReplaceMenuItem(int cmdId, java.lang.String vcsId)
          Install an item into the Replace With menu
static javax.swing.JMenuItem installVersionHistoryMenuItem(javax.swing.JMenu menu, int cmdId)
          Install the standard "Version History" menu item at the end of the Versioning menu
static void registerContextMenuForCompare(ContextMenu contextMenu)
           
static void registerContextMenuForReplace(ContextMenu contextMenu)
           
static KeyStrokeContext registerKeyStrokes(java.util.Collection<IdeAction> 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 setLazyDynamicMenuDefaultAction(javax.swing.JMenu menu, int cmdId, Context context)
          Sets the default action for the given lazy dynamic 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

@Deprecated
public static javax.swing.JMenu getMainVersioningMenu()
Deprecated. replaced by declarative registration through menu-hook.
Get the main, top-level Versioning menu.
Returns:
the versioning menu.

getViewTeamSubmenu

public static javax.swing.JMenu getViewTeamSubmenu()
Get the View, Team submenu
Returns:
team sub menu

installVersionHistoryMenuItem

public static javax.swing.JMenuItem installVersionHistoryMenuItem(javax.swing.JMenu menu,
                                                                  int cmdId)
Install the standard "Version History" menu item at the end of the Versioning menu
Returns:
the installed menu item.

createVersioningSubmenu

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

installMainSystemMenu

public static javax.swing.JMenu installMainSystemMenu(java.lang.String vcsId,
                                                      VCSExtensionInformation information)
Install the system menu for the given extension into the Versioning main menu. This method must be called by version control extensions during the oracle.jdeveloper.vcs.spi.VCSExtension#activate() phase of initialization.
Parameters:
vcsId - the extension ID.
information - the displayable information.
Returns:
the installed menu item.

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<IdeAction> 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.

addMenuItem

public static javax.swing.JMenuItem addMenuItem(ContextMenu menu,
                                                int cmdId,
                                                float section)

addMenuItem

public static javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu,
                                                ToggleAction action,
                                                float section)
Create and add a menu item for the specified action.
Parameters:
menu - the menu to which the item will be added.
action - the menu action to add.
section - the section value.
Returns:
the new menu item.

addMenuItem

public static javax.swing.JMenuItem addMenuItem(ContextMenu menu,
                                                ToggleAction action,
                                                float section)

addMenuItem

public static java.awt.Component addMenuItem(javax.swing.JMenu menu,
                                             java.awt.Component component,
                                             float section)
Add a component to the menu.
Parameters:
menu - the menu to which the item will be added.
component - the component to add.
section - the section value.
Returns:
the component added.

addDynamicMenuItem

@Deprecated
public static javax.swing.JMenuItem addDynamicMenuItem(javax.swing.JMenu menu,
                                                                  int cmdId,
                                                                  float section,
                                                                  Context context)
Deprecated. replaced by addLazyDynamicMenuItem(javax.swing.JMenu, int, float, oracle.ide.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.

addRawMenuItemNoAction

public static void addRawMenuItemNoAction(javax.swing.JMenu menu,
                                          javax.swing.JMenuItem item,
                                          float section,
                                          Context context)

addDynamicMenuItem

public static javax.swing.JMenuItem addDynamicMenuItem(ContextMenu menu,
                                                       int cmdId,
                                                       float section)

addLazyDynamicMenuItem

public static final void addLazyDynamicMenuItem(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. It will also be added lazily when the given menu is selected (this prevents interference with the performance of the parent menu).
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.

setLazyDynamicMenuDefaultAction

public static final void setLazyDynamicMenuDefaultAction(javax.swing.JMenu menu,
                                                         int cmdId,
                                                         Context context)
Sets the default action for the given lazy dynamic menu. If a default action is not explicitly set for a menu, a 'No Operations Available' item will be used when menu actions are left disabled by controllers.
Parameters:
menu - the menu for which the action will be set.
cmdId - the command identifier for the menu action to set.
context - the current context.

addMenuItemToTeamMenu

public static javax.swing.JMenuItem addMenuItemToTeamMenu(int cmdId,
                                                          java.lang.String alterativeName,
                                                          float section)
Add a menu item to the View -> Team sub menu.
Parameters:
cmdId -
alterativeName - - for the menu item, maybe null
section -
Returns:
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,
                                          java.lang.String vcsId)
Install a menu item into the Compare With menu.
Parameters:
cmdId - the command identifier for the compare with menu action.
vcsId - the extension owning the command, required to make the command contextual.

installReplaceMenuItem

public static void installReplaceMenuItem(int cmdId,
                                          java.lang.String vcsId)
Install an item into the Replace With menu
Parameters:
cmdId - the command identifier for the replace with menu action.
vcsId - the extension owning the command, required to make the command contextual.

addCompareSubmenu

public static void addCompareSubmenu(java.util.Collection<? super javax.swing.JMenuItem> menus,
                                     Context context)
Conditionally add the compare submenu to the specified collection of menu items, iff at least one compare submenu item is enabled in the specified context.
Parameters:
menus - a collection of menu items.

registerContextMenuForCompare

public static final void registerContextMenuForCompare(ContextMenu contextMenu)

registerContextMenuForReplace

public static final void registerContextMenuForReplace(ContextMenu contextMenu)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


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