Author: kono
Date: 2012-07-02 11:54:51 -0700 (Mon, 02 Jul 2012)
New Revision: 29734
Modified:
core3/impl/trunk/command-executor-impl/src/main/java/org/cytoscape/command/internal/CyActivator.java
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/CommandListAction.java
Log:
Command related menus are consolidated.
Modified:
core3/impl/trunk/command-executor-impl/src/main/java/org/cytoscape/command/internal/CyActivator.java
===================================================================
---
core3/impl/trunk/command-executor-impl/src/main/java/org/cytoscape/command/internal/CyActivator.java
2012-07-02 18:29:24 UTC (rev 29733)
+++
core3/impl/trunk/command-executor-impl/src/main/java/org/cytoscape/command/internal/CyActivator.java
2012-07-02 18:54:51 UTC (rev 29734)
@@ -44,8 +44,8 @@
Properties commandExecutorTaskFactoryProps = new Properties();
-
commandExecutorTaskFactoryProps.setProperty(PREFERRED_MENU,"Tools");
- commandExecutorTaskFactoryProps.setProperty(TITLE,"Run
Commands...");
+
commandExecutorTaskFactoryProps.setProperty(PREFERRED_MENU,"Tools.Command");
+ commandExecutorTaskFactoryProps.setProperty(TITLE,"Run Command
File...");
registerService(bc,commandExecutorTaskFactory,TaskFactory.class,
commandExecutorTaskFactoryProps);
registerService(bc,commandExecutorTaskFactory,CommandExecutorTaskFactory.class,
commandExecutorTaskFactoryProps);
Modified:
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/CommandListAction.java
===================================================================
---
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/CommandListAction.java
2012-07-02 18:29:24 UTC (rev 29733)
+++
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/CommandListAction.java
2012-07-02 18:54:51 UTC (rev 29734)
@@ -1,50 +1,41 @@
-
/*
- Copyright (c) 2006, The Cytoscape Consortium (www.cytoscape.org)
+ Copyright (c) 2006, The Cytoscape Consortium (www.cytoscape.org)
- The Cytoscape Consortium is:
- - Institute for Systems Biology
- - University of California San Diego
- - Memorial Sloan-Kettering Cancer Center
- - Institut Pasteur
- - Agilent Technologies
+ The Cytoscape Consortium is:
+ - Institute for Systems Biology
+ - University of California San Diego
+ - Memorial Sloan-Kettering Cancer Center
+ - Institut Pasteur
+ - Agilent Technologies
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2.1 of the License, or
- any later version.
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License, or
+ any later version.
- This library is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
- documentation provided hereunder is on an "as is" basis, and the
- Institute for Systems Biology and the Whitehead Institute
- have no obligations to provide maintenance, support,
- updates, enhancements or modifications. In no event shall the
- Institute for Systems Biology and the Whitehead Institute
- be liable to any party for direct, indirect, special,
- incidental or consequential damages, including lost profits, arising
- out of the use of this software and its documentation, even if the
- Institute for Systems Biology and the Whitehead Institute
- have been advised of the possibility of such damage. See
- the GNU Lesser General Public License for more details.
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and
+ documentation provided hereunder is on an "as is" basis, and the
+ Institute for Systems Biology and the Whitehead Institute
+ have no obligations to provide maintenance, support,
+ updates, enhancements or modifications. In no event shall the
+ Institute for Systems Biology and the Whitehead Institute
+ be liable to any party for direct, indirect, special,
+ incidental or consequential damages, including lost profits, arising
+ out of the use of this software and its documentation, even if the
+ Institute for Systems Biology and the Whitehead Institute
+ have been advised of the possibility of such damage. See
+ the GNU Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public License
- along with this library; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-*/
+ You should have received a copy of the GNU Lesser General Public License
+ along with this library; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
package org.cytoscape.internal.actions;
import java.awt.event.ActionEvent;
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.IdentityHashMap;
-import java.util.List;
-import java.util.Map;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
@@ -58,35 +49,42 @@
*/
public class CommandListAction extends AbstractCyAction {
+ private static final long serialVersionUID = 8750641831904687541L;
private final CySwingApplication swingApp;
- private final AvailableCommands availableCommands;
+ private final AvailableCommands availableCommands;
public CommandListAction(CySwingApplication swingApp, AvailableCommands
availableCommands) {
super("List All Commands...");
- setPreferredMenu("Tools");
- this.swingApp = swingApp;
- this.availableCommands = availableCommands;
+ setPreferredMenu("Tools.Command");
+ this.swingApp = swingApp;
+ this.availableCommands = availableCommands;
}
+ @Override
public void actionPerformed(ActionEvent ae) {
- SwingUtilities.invokeLater( new Runnable() {
+ SwingUtilities.invokeLater(new Runnable() {
public void run() {
- StringBuilder sb = new StringBuilder();
- for ( String namespace :
availableCommands.getNamespaces() ) {
- for ( String command :
availableCommands.getCommands(namespace) ) {
- sb.append(namespace);
- sb.append(" ");
- sb.append(command);
- sb.append(" ");
- for ( String arg :
availableCommands.getArguments(namespace,command) ) {
- sb.append(arg);
- sb.append(" ");
- }
-
sb.append(System.getProperty("line.separator"));
- }
- }
-
JOptionPane.showMessageDialog(swingApp.getJFrame(), sb.toString());
+ showCommandList();
}
});
}
+
+ private final void showCommandList() {
+ final StringBuilder sb = new StringBuilder();
+ for (String namespace : availableCommands.getNamespaces()) {
+ for (String command :
availableCommands.getCommands(namespace)) {
+ sb.append(namespace);
+ sb.append(" ");
+ sb.append(command);
+ sb.append(" ");
+ for (String arg :
availableCommands.getArguments(namespace, command)) {
+ sb.append(arg);
+ sb.append(" ");
+ }
+ sb.append(System.getProperty("line.separator"));
+ }
+ }
+ JOptionPane.showMessageDialog(swingApp.getJFrame(),
sb.toString(), "List of All Available Commands",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
}
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.