public final class ActionEnableSupport extends Object
Module: swing-application-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>swing-application-api</artifactId> </dependency>
Modifier and Type | Field and Description |
---|---|
static String |
ENABLE_FOR_ALWAYS
Enable always.
|
static String |
ENABLE_FOR_NETWORK
Enable when at least one network exists.
|
static String |
ENABLE_FOR_NETWORK_AND_VIEW
Enable when at least one network WITH view exists.
|
static String |
ENABLE_FOR_NETWORK_WITHOUT_VIEW
Enable when at least one network with NO view exists.
|
static String |
ENABLE_FOR_SELECTED_EDGES
Enable when edges have been selected in a network.
|
static String |
ENABLE_FOR_SELECTED_NODES
Enable when nodes have been selected in a network.
|
static String |
ENABLE_FOR_SELECTED_NODES_OR_EDGES
Enable when either nodes or edges have been selected in a network.
|
static String |
ENABLE_FOR_SINGLE_NETWORK
Enable when only one network is selected.
|
static String |
ENABLE_FOR_TABLE
Enable when at least one network exists.
|
Constructor and Description |
---|
ActionEnableSupport(Action action,
String enableFor,
CyApplicationManager applicationManager,
CyNetworkViewManager networkViewManager)
Constructor.
|
ActionEnableSupport(DynamicSubmenuListener submenuListener,
String enableFor,
CyApplicationManager applicationManager,
CyNetworkViewManager networkViewManager)
Constructor.
|
ActionEnableSupport(JMenuItem menuItem,
String enableFor,
CyApplicationManager applicationManager,
CyNetworkViewManager networkViewManager)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isCurrentlyEnabled()
Returns true if the action/menuListener/menuItem is enabled, false otherwise.
|
protected void |
setEnabled(boolean b) |
void |
updateEnableState()
Updates the enable state for the specified action/menuListener/menuItem
for the specified enableFor description and the state of the system.
|
public static final String ENABLE_FOR_NETWORK
public static final String ENABLE_FOR_SINGLE_NETWORK
public static final String ENABLE_FOR_NETWORK_WITHOUT_VIEW
public static final String ENABLE_FOR_NETWORK_AND_VIEW
public static final String ENABLE_FOR_SELECTED_NODES_OR_EDGES
public static final String ENABLE_FOR_SELECTED_NODES
public static final String ENABLE_FOR_SELECTED_EDGES
public static final String ENABLE_FOR_TABLE
public static final String ENABLE_FOR_ALWAYS
public ActionEnableSupport(DynamicSubmenuListener submenuListener, String enableFor, CyApplicationManager applicationManager, CyNetworkViewManager networkViewManager)
submenuListener
- The submenu listener whose enabled state will be updated.enableFor
- The description of how the submenu should be enabled.
See class documentation above for allowable values for this string.applicationManager
- The application manager.public ActionEnableSupport(Action action, String enableFor, CyApplicationManager applicationManager, CyNetworkViewManager networkViewManager)
action
- The action whose enabled state will be updated.enableFor
- The description of how the action should be enabled.
See class documentation above for allowable values for this string.applicationManager
- The application manager.public ActionEnableSupport(JMenuItem menuItem, String enableFor, CyApplicationManager applicationManager, CyNetworkViewManager networkViewManager)
menuItem
- The menuItem whose enabled state will be updated.enableFor
- The description of how the menuItem should be enabled.
See class documentation above for allowable values for this string.applicationManager
- The application manager.public void updateEnableState()
protected void setEnabled(boolean b)
public final boolean isCurrentlyEnabled()
Copyright 2011-2015 Cytoscape Consortium. All rights reserved.