@Test public void testUpdateEnableState() { support = new ActionEnableSupport(action,ActionEnableSupport.ENABLE_FOR_NETWORK, applicationManager, networkViewManager); support.updateEnableState(); assertFalse(support.isCurrentlyEnabled()); support = new ActionEnableSupport(action,ActionEnableSupport.ENABLE_FOR_NETWORK_AND_VIEW, applicationManager, networkViewManager); support.updateEnableState(); assertFalse(support.isCurrentlyEnabled()); support = new ActionEnableSupport(action,ActionEnableSupport.ENABLE_FOR_NETWORK_WITHOUT_VIEW, applicationManager, networkViewManager); support.updateEnableState(); assertFalse(support.isCurrentlyEnabled()); support = new ActionEnableSupport(action,ActionEnableSupport.ENABLE_FOR_SELECTED_EDGES, applicationManager, networkViewManager); support.updateEnableState(); assertFalse(support.isCurrentlyEnabled()); support = new ActionEnableSupport(action,ActionEnableSupport.ENABLE_FOR_SELECTED_NODES, applicationManager, networkViewManager); support.updateEnableState(); assertFalse(support.isCurrentlyEnabled()); support = new ActionEnableSupport(action,ActionEnableSupport.ENABLE_FOR_SELECTED_NODES_OR_EDGES, applicationManager, networkViewManager); support.updateEnableState(); assertFalse(support.isCurrentlyEnabled()); support = new ActionEnableSupport(action,ActionEnableSupport.ENABLE_FOR_TABLE, applicationManager, networkViewManager); support.updateEnableState(); assertFalse(support.isCurrentlyEnabled()); support = new ActionEnableSupport(action,null, applicationManager, networkViewManager); support.updateEnableState(); assertTrue(support.isCurrentlyEnabled()); }
public void updateEnableState() { if (enableFor == null) setEnabled(true); else if (enableFor.equals(ENABLE_FOR_ALWAYS)) setEnabled(true); else if (enableFor.equals(ENABLE_FOR_NETWORK)) enableForNetwork(); else if (enableFor.equals(ENABLE_FOR_SINGLE_NETWORK)) enableForSingleNetwork(); else if (enableFor.equals(ENABLE_FOR_NETWORK_WITHOUT_VIEW)) enableForNetworkWithoutView(); else if (enableFor.equals(ENABLE_FOR_NETWORK_AND_VIEW)) enableForNetworkAndView(); else if (enableFor.equals(ENABLE_FOR_SELECTED_NODES_OR_EDGES)) enableForSelectedNodesOrEdges(); else if (enableFor.equals(ENABLE_FOR_SELECTED_NODES)) enableForSelectedNodes(); else if (enableFor.equals(ENABLE_FOR_SELECTED_EDGES)) enableForSelectedEdges(); else if (enableFor.equals(ENABLE_FOR_TABLE)) enableForTable(); else setEnabled(true); }
ActionEnableSupport extends AbstractEnableSupport { public void updateEnableState() { if (enableFor == null) setEnabled(true); else if (enableFor.equals(ENABLE_FOR_ALWAYS)) setEnabled(true); else if (enableFor.equals(ENABLE_FOR_NETWORK)) enableForNetwork(); else if (enableFor.equals(ENABLE_FOR_SINGLE_NETWORK)) enableForSingleNetwork(); else if (enableFor.equals(ENABLE_FOR_NETWORK_WITHOUT_VIEW)) enableForNetworkWithoutView(); else if (enableFor.equals(ENABLE_FOR_NETWORK_AND_VIEW)) enableForNetworkAndView(); else if (enableFor.equals(ENABLE_FOR_SELECTED_NODES_OR_EDGES)) enableForSelectedNodesOrEdges(); else if (enableFor.equals(ENABLE_FOR_SELECTED_NODES)) enableForSelectedNodes(); else if (enableFor.equals(ENABLE_FOR_SELECTED_EDGES)) enableForSelectedEdges(); else if (enableFor.equals(ENABLE_FOR_TABLE)) enableForTable(); else setEnabled(true); } }
ActionEnableSupport extends AbstractEnableSupport { public void updateEnableState() { if (enableFor == null) setEnabled(true); else if (enableFor.equals(ENABLE_FOR_ALWAYS)) setEnabled(true); else if (enableFor.equals(ENABLE_FOR_NETWORK)) enableForNetwork(); else if (enableFor.equals(ENABLE_FOR_SINGLE_NETWORK)) enableForSingleNetwork(); else if (enableFor.equals(ENABLE_FOR_NETWORK_WITHOUT_VIEW)) enableForNetworkWithoutView(); else if (enableFor.equals(ENABLE_FOR_NETWORK_AND_VIEW)) enableForNetworkAndView(); else if (enableFor.equals(ENABLE_FOR_SELECTED_NODES_OR_EDGES)) enableForSelectedNodesOrEdges(); else if (enableFor.equals(ENABLE_FOR_SELECTED_NODES)) enableForSelectedNodes(); else if (enableFor.equals(ENABLE_FOR_SELECTED_EDGES)) enableForSelectedEdges(); else if (enableFor.equals(ENABLE_FOR_TABLE)) enableForTable(); else setEnabled(true); } ActionEnableSupport(DynamicSubmenuListener submenuListener, String enableFor,
			final CyApplicationManager applicationManager, final CyNetworkViewManager networkViewManager);  ActionEnableSupport(Action action, String enableFor, CyApplicationManager applicationManager, final CyNetworkViewManager networkViewManager);  ActionEnableSupport(JMenuItem menuItem, String enableFor, CyApplicationManager applicationManager, final CyNetworkViewManager networkViewManager); }
ActionEnableSupport extends AbstractEnableSupport { public void updateEnableState() { if (enableFor == null) setEnabled(true); else if (enableFor.equals(ENABLE_FOR_ALWAYS)) setEnabled(true); else if (enableFor.equals(ENABLE_FOR_NETWORK)) enableForNetwork(); else if (enableFor.equals(ENABLE_FOR_SINGLE_NETWORK)) enableForSingleNetwork(); else if (enableFor.equals(ENABLE_FOR_NETWORK_WITHOUT_VIEW)) enableForNetworkWithoutView(); else if (enableFor.equals(ENABLE_FOR_NETWORK_AND_VIEW)) enableForNetworkAndView(); else if (enableFor.equals(ENABLE_FOR_SELECTED_NODES_OR_EDGES)) enableForSelectedNodesOrEdges(); else if (enableFor.equals(ENABLE_FOR_SELECTED_NODES)) enableForSelectedNodes(); else if (enableFor.equals(ENABLE_FOR_SELECTED_EDGES)) enableForSelectedEdges(); else if (enableFor.equals(ENABLE_FOR_TABLE)) enableForTable(); else setEnabled(true); } ActionEnableSupport(DynamicSubmenuListener submenuListener, String enableFor,
			final CyApplicationManager applicationManager, final CyNetworkViewManager networkViewManager);  ActionEnableSupport(Action action, String enableFor, CyApplicationManager applicationManager, final CyNetworkViewManager networkViewManager);  ActionEnableSupport(JMenuItem menuItem, String enableFor, CyApplicationManager applicationManager, final CyNetworkViewManager networkViewManager); void updateEnableState(); }
ActionEnableSupport extends AbstractEnableSupport { public void updateEnableState() { if (enableFor == null) setEnabled(true); else if (enableFor.equals(ENABLE_FOR_ALWAYS)) setEnabled(true); else if (enableFor.equals(ENABLE_FOR_NETWORK)) enableForNetwork(); else if (enableFor.equals(ENABLE_FOR_SINGLE_NETWORK)) enableForSingleNetwork(); else if (enableFor.equals(ENABLE_FOR_NETWORK_WITHOUT_VIEW)) enableForNetworkWithoutView(); else if (enableFor.equals(ENABLE_FOR_NETWORK_AND_VIEW)) enableForNetworkAndView(); else if (enableFor.equals(ENABLE_FOR_SELECTED_NODES_OR_EDGES)) enableForSelectedNodesOrEdges(); else if (enableFor.equals(ENABLE_FOR_SELECTED_NODES)) enableForSelectedNodes(); else if (enableFor.equals(ENABLE_FOR_SELECTED_EDGES)) enableForSelectedEdges(); else if (enableFor.equals(ENABLE_FOR_TABLE)) enableForTable(); else setEnabled(true); } ActionEnableSupport(DynamicSubmenuListener submenuListener, String enableFor,
			final CyApplicationManager applicationManager, final CyNetworkViewManager networkViewManager);  ActionEnableSupport(Action action, String enableFor, CyApplicationManager applicationManager, final CyNetworkViewManager networkViewManager);  ActionEnableSupport(JMenuItem menuItem, String enableFor, CyApplicationManager applicationManager, final CyNetworkViewManager networkViewManager); void updateEnableState(); static final String ENABLE_FOR_NETWORK; static final String ENABLE_FOR_SINGLE_NETWORK; static final String ENABLE_FOR_NETWORK_WITHOUT_VIEW; static final String ENABLE_FOR_NETWORK_AND_VIEW; static final String ENABLE_FOR_SELECTED_NODES_OR_EDGES; static final String ENABLE_FOR_SELECTED_NODES; static final String ENABLE_FOR_SELECTED_EDGES; static final String ENABLE_FOR_TABLE; static final String ENABLE_FOR_ALWAYS; }