public class VCSMenuUtils
extends java.lang.Object
Utility class for initializing and manipulating version control menus.
Constructor and Description |
---|
VCSMenuUtils() |
Modifier and Type | Method and Description |
---|---|
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.
|
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()
Deprecated.
replaced with
getWindowTeamSubmenu |
static javax.swing.JMenu |
getWindowTeamSubmenu()
Get the Window, 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.
|
@Deprecated public static javax.swing.JMenu getMainVersioningMenu()
public static javax.swing.JMenu getWindowTeamSubmenu()
@Deprecated public static javax.swing.JMenu getViewTeamSubmenu()
getWindowTeamSubmenu
public static javax.swing.JMenuItem installVersionHistoryMenuItem(javax.swing.JMenu menu, int cmdId)
public static javax.swing.JMenu createVersioningSubmenu()
public static javax.swing.JMenu installMainSystemMenu(java.lang.String vcsId, VCSExtensionInformation information)
oracle.jdeveloper.vcs.spi.VCSExtension#activate()
phase of
initialization.vcsId
- the extension ID.information
- the displayable information.public static void installContextMenuListener(ContextMenuListener listener)
listener
- the listener to install.public static void uninstallContextMenuListener(ContextMenuListener listener)
listener
- the listener to uninstall.public static KeyStrokeContext registerKeyStrokes(java.util.Collection<IdeAction> actions, java.lang.String keyStrokeContextName)
actions
- the key stroke actions to registerkeyStrokeContextName
- the context name for the key stroke.public static javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu, int cmdId, float section)
cmdId
- the command identifier for the menu action to add.menu
- the menu to which the item will be added.section
- the section value.public static javax.swing.JMenuItem addMenuItem(ContextMenu menu, int cmdId, float section)
public static javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu, ToggleAction action, float section)
menu
- the menu to which the item will be added.action
- the menu action to add.section
- the section value.public static javax.swing.JMenuItem addMenuItem(ContextMenu menu, ToggleAction action, float section)
public static java.awt.Component addMenuItem(javax.swing.JMenu menu, java.awt.Component component, float section)
menu
- the menu to which the item will be added.component
- the component to add.section
- the section value.@Deprecated public static javax.swing.JMenuItem addDynamicMenuItem(javax.swing.JMenu menu, int cmdId, float section, Context context)
addLazyDynamicMenuItem(javax.swing.JMenu, int, float, oracle.ide.Context)
.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.public static void addRawMenuItemNoAction(javax.swing.JMenu menu, javax.swing.JMenuItem item, float section, Context context)
public static javax.swing.JMenuItem addDynamicMenuItem(ContextMenu menu, int cmdId, float section)
public static final void addLazyDynamicMenuItem(javax.swing.JMenu menu, int cmdId, float section, Context context)
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.public static final void setLazyDynamicMenuDefaultAction(javax.swing.JMenu menu, int cmdId, Context context)
menu
- the menu for which the action will be set.cmdId
- the command identifier for the menu action to set.context
- the current context.public static javax.swing.JMenuItem addMenuItemToTeamMenu(int cmdId, java.lang.String alterativeName, float section)
cmdId
- alterativeName
- - for the menu item, maybe nullsection
- public static javax.swing.JMenuItem createMenuItem(int cmdId)
cmdId
- the command identifier for the menu action to add.public static javax.swing.JMenuItem createMenuItem(int cmdId, float weight)
cmdId
- the command identifier for the menu action to add.weight
- the weight for the menu item.public static void installCompareMenuItem(int cmdId, java.lang.String vcsId)
cmdId
- the command identifier for the compare with menu action.vcsId
- the extension owning the command, required to make the
command contextual.public static void installReplaceMenuItem(int cmdId, java.lang.String vcsId)
cmdId
- the command identifier for the replace with menu action.vcsId
- the extension owning the command, required to make the
command contextual.public static void addCompareSubmenu(java.util.Collection<? super javax.swing.JMenuItem> menus, Context context)
menus
- a collection of menu items.public static final void registerContextMenuForCompare(ContextMenu contextMenu)
public static final void registerContextMenuForReplace(ContextMenu contextMenu)