[Jsxe-cvs] SF.net SVN: jsxe: [1214] trunk/jsxe
Status: Inactive
Brought to you by:
ian_lewis
|
From: <ian...@us...> - 2006-08-31 20:41:24
|
Revision: 1214
http://svn.sourceforge.net/jsxe/?rev=1214&view=rev
Author: ian_lewis
Date: 2006-08-31 13:41:10 -0700 (Thu, 31 Aug 2006)
Log Message:
-----------
merge from 05pre3 branch rev. 1213
Modified Paths:
--------------
trunk/jsxe/Changelog
trunk/jsxe/messages/messages.properties
trunk/jsxe/src/net/sourceforge/jsxe/ActionManager.java
trunk/jsxe/src/net/sourceforge/jsxe/LocalizedAction.java
trunk/jsxe/src/net/sourceforge/jsxe/action/CopyAction.java
trunk/jsxe/src/net/sourceforge/jsxe/action/CutAction.java
trunk/jsxe/src/net/sourceforge/jsxe/action/FindAction.java
trunk/jsxe/src/net/sourceforge/jsxe/action/FindNextAction.java
trunk/jsxe/src/net/sourceforge/jsxe/action/PasteAction.java
trunk/jsxe/src/net/sourceforge/jsxe/gui/GUIUtilities.java
trunk/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java
trunk/jsxe/src/net/sourceforge/jsxe/options/ShortcutsOptionPane.java
Added Paths:
-----------
trunk/jsxe/src/net/sourceforge/jsxe/action/ContextSpecificAction.java
Removed Paths:
-------------
trunk/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java
Modified: trunk/jsxe/Changelog
===================================================================
--- trunk/jsxe/Changelog 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/Changelog 2006-08-31 20:41:10 UTC (rev 1214)
@@ -1,3 +1,9 @@
+08/31/2006 Ian Lewis <Ian...@me...>
+
+ * Added new ContextSpecificActions to replace ViewSpecificActions. Now
+ actions such as cut and paste can be registered for specific components
+ not just a specific view.
+
08/29/2006 Ian Lewis <Ian...@me...>
* Fixed a memory leak with JMenuItems. ActionManager kept a cache of
Modified: trunk/jsxe/messages/messages.properties
===================================================================
--- trunk/jsxe/messages/messages.properties 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/messages/messages.properties 2006-08-31 20:41:10 UTC (rev 1214)
@@ -236,6 +236,10 @@
No.Xerces.Error.title={0} not found.
IO.Error.title=I/O Error
IO.Error.message=An I/O error has occurred
+
+#generic error message
+XML.Error.title=XML Error
+XML.Error.message={0}
#}}}
#}}}
Modified: trunk/jsxe/src/net/sourceforge/jsxe/ActionManager.java
===================================================================
--- trunk/jsxe/src/net/sourceforge/jsxe/ActionManager.java 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/src/net/sourceforge/jsxe/ActionManager.java 2006-08-31 20:41:10 UTC (rev 1214)
@@ -27,13 +27,13 @@
//{{{ imports
//{{{ jsXe classes
+import net.sourceforge.jsxe.action.ContextSpecificAction;
import net.sourceforge.jsxe.gui.Messages;
import net.sourceforge.jsxe.gui.GUIUtilities;
import net.sourceforge.jsxe.gui.KeyEventTranslator;
import net.sourceforge.jsxe.util.Log;
import net.sourceforge.jsxe.util.MiscUtilities;
import net.sourceforge.jsxe.msg.PropertyChanged;
-import net.sourceforge.jsxe.action.ViewSpecificAction;
//}}}
//{{{ Java classes
@@ -49,6 +49,7 @@
//}}}
//{{{ AWT classes
+import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
//}}}
@@ -73,16 +74,6 @@
*/
public class ActionManager {
- //{{{ Public static identifiers
-
- public static final String CUT_SUFFIX = ".cut";
- public static final String COPY_SUFFIX = ".copy";
- public static final String PASTE_SUFFIX = ".paste";
- public static final String FIND_SUFFIX = ".find";
- public static final String FIND_NEXT_SUFFIX = ".findnext";
-
- //}}}
-
//{{{ addActionSet()
/**
* Adds a set of actions to the jsXe's pool of action sets.
@@ -94,11 +85,51 @@
m_actionSets.add(set);
}//}}}
+ //{{{ addActionImplementation()
+ /**
+ * Register an ActionImplementation with a registered ContextSpecificAction.
+ * If the ContextSpecificAction isn't registered this method does nothing.
+ * @param actionName the name of the ContextSpecificAction
+ * @param comp the component context the recieves the action
+ * @param imp the action implementation
+ */
+ public static void addActionImplementation(String actionName, Component comp, ContextSpecificAction.ActionImplementation imp) {
+ ContextSpecificAction action = getContextSpecificAction(actionName);
+ if (action != null) {
+ action.registerComponent(comp, imp);
+ }
+ }//}}}
+
+ //{{{ removeActionImplementation()
+ /**
+ * Removes the ActionImplementation from the registered
+ * ContextSpecificAction.
+ */
+ public static void removeActionImplementation(String actionName, Component comp) {
+ ContextSpecificAction action = getContextSpecificAction(actionName);
+ if (action != null) {
+ action.removeComponent(comp);
+ }
+ }//}}}
+
+ //{{{ getContextSpecificAction()
+ /**
+ * Gets a context specific action or null if no context specific action
+ * exists with that name.
+ */
+ public static ContextSpecificAction getContextSpecificAction(String name) {
+ LocalizedAction action = getLocalizedAction(name);
+ if (action instanceof ContextSpecificAction) {
+ return (ContextSpecificAction)action;
+ }
+ return null;
+ }//}}}
+
//{{{ getLocalizedAction()
/**
* Gets the LocalizedAction set with the given name
- * @param the name of the action set.
- * @return the action set that matches the name, or null if none match.
+ * @param the name of the action.
+ * @return the action that matches the name, or null if none match.
*/
public static LocalizedAction getLocalizedAction(String name) {
for (int i = 0; i < m_actionSets.size(); i++) {
@@ -113,8 +144,8 @@
//{{{ getAction()
/**
- * Gets a true action for the LocalizedAction with the given name. This can be
- * used in menus and toobars etc.
+ * Creates a true action for the LocalizedAction with the given name. This
+ * can be used in menus and toobars etc.
* @param name the name of the action.
*/
public static Action getAction(String name) {
@@ -267,18 +298,6 @@
}
}//}}}
- //{{{ isDocviewSpecific()
- /**
- * Returns whether the action with the given name is document view specific.
- */
- public static boolean isDocViewSpecific(String actionName) {
- return (actionName.endsWith(CUT_SUFFIX) ||
- actionName.endsWith(COPY_SUFFIX) ||
- actionName.endsWith(PASTE_SUFFIX) ||
- actionName.endsWith(FIND_SUFFIX) ||
- actionName.endsWith(FIND_NEXT_SUFFIX));
- }//}}}
-
//{{{ Wrapper class
/**
* The Wrapper class wraps LocalizedActions so they can be invoked
Modified: trunk/jsxe/src/net/sourceforge/jsxe/LocalizedAction.java
===================================================================
--- trunk/jsxe/src/net/sourceforge/jsxe/LocalizedAction.java 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/src/net/sourceforge/jsxe/LocalizedAction.java 2006-08-31 20:41:10 UTC (rev 1214)
@@ -45,7 +45,7 @@
* @version $Id$
* @see jsXe
* @see ActionSet
- * @see InputManager
+ * @see ActionManager
* @since jsXe 0.5 pre1
*/
public abstract class LocalizedAction {
Copied: trunk/jsxe/src/net/sourceforge/jsxe/action/ContextSpecificAction.java (from rev 1213, tags/05pre3/jsxe/src/net/sourceforge/jsxe/action/ContextSpecificAction.java)
===================================================================
--- trunk/jsxe/src/net/sourceforge/jsxe/action/ContextSpecificAction.java (rev 0)
+++ trunk/jsxe/src/net/sourceforge/jsxe/action/ContextSpecificAction.java 2006-08-31 20:41:10 UTC (rev 1214)
@@ -0,0 +1,146 @@
+/*
+ContextSpecificAction.java
+:tabSize=4:indentSize=4:noTabs=true:
+:folding=explicit:collapseFolds=1:
+
+Copyright (C) 2006 Ian Lewis (Ian...@me...)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program 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. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+Optionally, you may find a copy of the GNU General Public License
+from http://www.fsf.org/copyleft/gpl.txt
+*/
+
+package net.sourceforge.jsxe.action;
+
+//{{{ imports
+
+//{{{ jsXe classes
+import net.sourceforge.jsxe.jsXe;
+import net.sourceforge.jsxe.ActionManager;
+import net.sourceforge.jsxe.LocalizedAction;
+import net.sourceforge.jsxe.gui.TabbedView;
+import net.sourceforge.jsxe.gui.GUIUtilities;
+//}}}
+
+//{{{ Java classes
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Iterator;
+//}}}
+
+//{{{ AWT components
+import java.awt.event.ActionEvent;
+import java.awt.Component;
+import java.awt.KeyboardFocusManager;
+//}}}
+
+//}}}
+
+/**
+ * The ContextSpecificAction is a class that defines actions that are
+ * context specific. i.e. Actions that are defined by jsXe but whose
+ * implementation is determined by the context or component that
+ * currently has focus.
+ *
+ * The ContextSpecificAction class allows components to be assocatied
+ * with a specific action implementation that is specific to that context
+ * (component). When the ContextSpecificAction is run, the action will
+ * search the registered components. If the component that has focus is owned
+ * by registered component then the action implementation associated with
+ * that component is then invoked.
+ *
+ * The order of the search is not specified and the first match that is found
+ * will be invoked.
+ *
+ * Examples where this class may be useful is cut, copy, paste, insert, or
+ * delete where the implementation may depend on the components implementation.
+ *
+ * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>)
+ * @version $Id$
+ * @since jsXe 0.5 pre3
+ */
+public abstract class ContextSpecificAction extends LocalizedAction {
+
+ //{{{ ContextSpecificAction constructor
+ public ContextSpecificAction(String name) {
+ super(name);
+ }//}}}
+
+ //{{{ invoke()
+ /**
+ * Invokes the specific ActionImplementation for the component in
+ * the current context. This method should generally not be overridden by
+ * subclasses.
+ */
+ public void invoke(TabbedView view, ActionEvent evt) {
+ /*
+ Invoke the action registered for the current component named
+ */
+ Component comp = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
+ Iterator itr = m_actionMap.keySet().iterator();
+ while (itr.hasNext()) {
+ Component key = (Component)itr.next();
+ if (GUIUtilities.isComponentParentOf(key, comp)) {
+ ActionImplementation imp = (ActionImplementation)m_actionMap.get(key);
+ imp.invoke(view, key, evt);
+ return;
+ }
+ }
+ }//}}}
+
+ //{{{ registerComponent()
+ /**
+ * Adds a component and implementation to the action map for this
+ * action.
+ * @param comp The component that will recieve the action
+ * @param imp the action implementation that implements the action for the
+ * given component.
+ */
+ public void registerComponent(Component comp, ActionImplementation imp) {
+ m_actionMap.put(comp, imp);
+ }//}}}
+
+ //{{{ removeComponent()
+ /**
+ * Removes the component from the action map for this action
+ */
+ public void removeComponent(Component comp) {
+ m_actionMap.remove(comp);
+ }//}}}
+
+ //{{{ interface ActionImplementation
+ /**
+ * An ActionImplementation is an implementation of an action that can be
+ * registered with a ContextSpecificAction and run in a context.
+ */
+ public static interface ActionImplementation {
+
+ /**
+ * This method is run when the ContextSpecificAction is run and
+ * the registered component has focus.
+ * @param view the view that invoked the action
+ * @param comp the registered component
+ * @param evt the event that triggered the action
+ */
+ public void invoke(TabbedView view, Component comp, ActionEvent evt);
+
+ }//}}}
+
+ //{{{ Private Members
+
+ private HashMap m_actionMap = new HashMap();
+
+ //}}}
+}
Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/CopyAction.java
===================================================================
--- trunk/jsxe/src/net/sourceforge/jsxe/action/CopyAction.java 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/src/net/sourceforge/jsxe/action/CopyAction.java 2006-08-31 20:41:10 UTC (rev 1214)
@@ -40,9 +40,13 @@
//}}}
//{{{ AWT components
+import java.awt.Component;
+import java.awt.KeyboardFocusManager;
import java.awt.event.ActionEvent;
//}}}
+import javax.swing.text.JTextComponent;
+
//}}}
/**
@@ -53,11 +57,23 @@
* @version $Id$
* @since jsXe 0.5 pre1
*/
-public class CopyAction extends ViewSpecificAction {
+public class CopyAction extends ContextSpecificAction {
//{{{ CopyAction constructor
public CopyAction() {
super("copy");
}//}}}
+ //{{{ invoke()
+ public void invoke(TabbedView view, ActionEvent evt) {
+ /*
+ Invoke the action registered for the current component named
+ */
+ Component comp = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
+ if (comp instanceof JTextComponent) {
+ ((JTextComponent)comp).copy();
+ } else {
+ super.invoke(view, evt);
+ }
+ }//}}}
}
Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/CutAction.java
===================================================================
--- trunk/jsxe/src/net/sourceforge/jsxe/action/CutAction.java 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/src/net/sourceforge/jsxe/action/CutAction.java 2006-08-31 20:41:10 UTC (rev 1214)
@@ -40,9 +40,13 @@
//}}}
//{{{ AWT components
+import java.awt.Component;
+import java.awt.KeyboardFocusManager;
import java.awt.event.ActionEvent;
//}}}
+import javax.swing.text.JTextComponent;
+
//}}}
/**
@@ -52,11 +56,24 @@
* @version $Id$
* @since jsXe 0.5 pre1
*/
-public class CutAction extends ViewSpecificAction {
+public class CutAction extends ContextSpecificAction {
//{{{ CutAction constructor
public CutAction() {
super("cut");
}//}}}
+ //{{{ invoke()
+ public void invoke(TabbedView view, ActionEvent evt) {
+ /*
+ Invoke the action registered for the current component named
+ */
+ Component comp = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
+ if (comp instanceof JTextComponent) {
+ ((JTextComponent)comp).cut();
+ } else {
+ super.invoke(view, evt);
+ }
+ }//}}}
+
}
Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/FindAction.java
===================================================================
--- trunk/jsxe/src/net/sourceforge/jsxe/action/FindAction.java 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/src/net/sourceforge/jsxe/action/FindAction.java 2006-08-31 20:41:10 UTC (rev 1214)
@@ -53,7 +53,7 @@
* @version $Id$
* @since jsXe 0.5 pre1
*/
-public class FindAction extends ViewSpecificAction {
+public class FindAction extends ContextSpecificAction {
//{{{ FindAction constructor
public FindAction() {
Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/FindNextAction.java
===================================================================
--- trunk/jsxe/src/net/sourceforge/jsxe/action/FindNextAction.java 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/src/net/sourceforge/jsxe/action/FindNextAction.java 2006-08-31 20:41:10 UTC (rev 1214)
@@ -53,7 +53,7 @@
* @version $Id$
* @since jsXe 0.5 pre1
*/
-public class FindNextAction extends ViewSpecificAction {
+public class FindNextAction extends ContextSpecificAction {
//{{{ FindNextAction constructor
public FindNextAction() {
Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/PasteAction.java
===================================================================
--- trunk/jsxe/src/net/sourceforge/jsxe/action/PasteAction.java 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/src/net/sourceforge/jsxe/action/PasteAction.java 2006-08-31 20:41:10 UTC (rev 1214)
@@ -40,9 +40,13 @@
//}}}
//{{{ AWT components
+import java.awt.Component;
+import java.awt.KeyboardFocusManager;
import java.awt.event.ActionEvent;
//}}}
+import javax.swing.text.JTextComponent;
+
//}}}
/**
@@ -53,11 +57,24 @@
* @version $Id$
* @since jsXe 0.5 pre1
*/
-public class PasteAction extends ViewSpecificAction {
+public class PasteAction extends ContextSpecificAction {
//{{{ PasteAction constructor
public PasteAction() {
super("paste");
}//}}}
-}
+ //{{{ invoke()
+ public void invoke(TabbedView view, ActionEvent evt) {
+ /*
+ Invoke the action registered for the current component named
+ */
+ Component comp = KeyboardFocusManager.getCurrentKeyboardFocusManager().getPermanentFocusOwner();
+ if (comp instanceof JTextComponent) {
+ ((JTextComponent)comp).paste();
+ } else {
+ super.invoke(view, evt);
+ }
+ }//}}}
+
+}
\ No newline at end of file
Deleted: trunk/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java
===================================================================
--- trunk/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java 2006-08-31 20:41:10 UTC (rev 1214)
@@ -1,81 +0,0 @@
-/*
-ViewSpecificAction.java
-:tabSize=4:indentSize=4:noTabs=true:
-:folding=explicit:collapseFolds=1:
-
-Copyright (C) 2006 Ian Lewis (Ian...@me...)
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program 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. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-Optionally, you may find a copy of the GNU General Public License
-from http://www.fsf.org/copyleft/gpl.txt
-*/
-
-package net.sourceforge.jsxe.action;
-
-//{{{ imports
-
-//{{{ jsXe classes
-import net.sourceforge.jsxe.jsXe;
-import net.sourceforge.jsxe.JARClassLoader;
-import net.sourceforge.jsxe.ActionManager;
-import net.sourceforge.jsxe.LocalizedAction;
-import net.sourceforge.jsxe.gui.TabbedView;
-import net.sourceforge.jsxe.gui.Messages;
-//}}}
-
-//{{{ Java classes
-import java.io.IOException;
-//}}}
-
-//{{{ AWT components
-import java.awt.event.ActionEvent;
-//}}}
-
-//}}}
-
-/**
- * The ViewSpecificAction is a class that defines actions that are
- * view specific. i.e. Actions that are defined by jsXe but whose
- * implementation is determined by the currently active view.
- *
- * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>)
- * @version $Id$
- * @since jsXe 0.5 pre3
- */
-public abstract class ViewSpecificAction extends LocalizedAction {
-
- //{{{ ViewSpecificAction constructor
- public ViewSpecificAction(String name) {
- super(name);
- }//}}}
-
- //{{{ invoke()
- public void invoke(TabbedView view, ActionEvent evt) {
- /*
- invoke the action registered for the current DocumentView named
- viewname.actionname if there is one.
- */
- ActionManager.invokeAction(getViewActionName(view), evt);
- }//}}}
-
- //{{{ getViewActionName()
- /**
- * Gets the view specific action name for the current DocumentView in the
- * given TabbedView.
- */
- private String getViewActionName(TabbedView view) {
- return jsXe.getPluginLoader().getPluginProperty(view.getDocumentView().getViewPlugin(), JARClassLoader.PLUGIN_NAME)+"."+getName();
- }//}}}
-}
Modified: trunk/jsxe/src/net/sourceforge/jsxe/gui/GUIUtilities.java
===================================================================
--- trunk/jsxe/src/net/sourceforge/jsxe/gui/GUIUtilities.java 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/src/net/sourceforge/jsxe/gui/GUIUtilities.java 2006-08-31 20:41:10 UTC (rev 1214)
@@ -1271,6 +1271,40 @@
return (p instanceof JDialog) ? (JDialog) p : null;
} //}}}
+ //{{{ isComponentParentOf() method
+ /**
+ * Returns true if the parent is a parent component of child.
+ * @param parent the parent component
+ * @param child the child component
+ * @since jsXe 0.5 pre3
+ */
+ public static boolean isComponentParentOf(Component parent, Component child) {
+ Component comp = child;
+ for(;;) {
+ if (comp == null) {
+ break;
+ }
+
+ if (comp instanceof JComponent) {
+ Component real = (Component)((JComponent)comp).getClientProperty("KORTE_REAL_FRAME");
+ if (real != null) {
+ comp = real;
+ }
+ }
+
+ if (comp.equals(parent)) {
+ return true;
+ } else {
+ if (comp instanceof JPopupMenu) {
+ comp = ((JPopupMenu)comp).getInvoker();
+ } else {
+ comp = comp.getParent();
+ }
+ }
+ }
+ return false;
+ }//}}}
+
//{{{ getComponentParent() method
/**
* Finds a parent of the specified component.
Modified: trunk/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java
===================================================================
--- trunk/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/src/net/sourceforge/jsxe/gui/TabbedView.java 2006-08-31 20:41:10 UTC (rev 1214)
@@ -589,69 +589,68 @@
m_editMenu.add(menuItem);
m_editMenu.addSeparator();
Action action = ActionManager.getAction("cut");
- if (view != null) {
- String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".cut";
- if (ActionManager.getLocalizedAction(name) == null) {
- action.setEnabled(false);
- } else {
- action.setEnabled(true);
- }
- } else {
- action.setEnabled(false);
- }
+ // if (view != null) {
+ // if (ActionManager.getLocalizedAction(name) == null) {
+ // action.setEnabled(false);
+ // } else {
+ // action.setEnabled(true);
+ // }
+ // } else {
+ // action.setEnabled(false);
+ // }
menuItem = new JMenuItem(action);
m_editMenu.add(menuItem);
action = ActionManager.getAction("copy");
- if (view != null) {
- String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".copy";
- if (ActionManager.getLocalizedAction(name) == null) {
- action.setEnabled(false);
- } else {
- action.setEnabled(true);
- }
- } else {
- action.setEnabled(false);
- }
+ // if (view != null) {
+ // String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".copy";
+ // if (ActionManager.getLocalizedAction(name) == null) {
+ // action.setEnabled(false);
+ // } else {
+ // action.setEnabled(true);
+ // }
+ // } else {
+ // action.setEnabled(false);
+ // }
menuItem = new JMenuItem(action);
m_editMenu.add(menuItem);
action = ActionManager.getAction("paste");
- if (view != null) {
- String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".paste";
- if (ActionManager.getLocalizedAction(name) == null) {
- action.setEnabled(false);
- } else {
- action.setEnabled(true);
- }
- } else {
- action.setEnabled(false);
- }
+ // if (view != null) {
+ // String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".paste";
+ // if (ActionManager.getLocalizedAction(name) == null) {
+ // action.setEnabled(false);
+ // } else {
+ // action.setEnabled(true);
+ // }
+ // } else {
+ // action.setEnabled(false);
+ // }
menuItem = new JMenuItem(action);
m_editMenu.add(menuItem);
m_editMenu.addSeparator();
action = ActionManager.getAction("find");
- if (view != null) {
- String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".find";
- if (ActionManager.getLocalizedAction(name) == null) {
- action.setEnabled(false);
- } else {
- action.setEnabled(true);
- }
- } else {
- action.setEnabled(false);
- }
+ // if (view != null) {
+ // String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".find";
+ // if (ActionManager.getLocalizedAction(name) == null) {
+ // action.setEnabled(false);
+ // } else {
+ // action.setEnabled(true);
+ // }
+ // } else {
+ // action.setEnabled(false);
+ // }
menuItem = new JMenuItem(action);
m_editMenu.add(menuItem);
action = ActionManager.getAction("findnext");
- if (view != null) {
- String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".findnext";
- if (ActionManager.getLocalizedAction(name) == null) {
- action.setEnabled(false);
- } else {
- action.setEnabled(true);
- }
- } else {
- action.setEnabled(false);
- }
+ // if (view != null) {
+ // String name = jsXe.getPluginLoader().getPluginProperty(view.getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".findnext";
+ // if (ActionManager.getLocalizedAction(name) == null) {
+ // action.setEnabled(false);
+ // } else {
+ // action.setEnabled(true);
+ // }
+ // } else {
+ // action.setEnabled(false);
+ // }
menuItem = new JMenuItem(action);
m_editMenu.add(menuItem);
}//}}}
Modified: trunk/jsxe/src/net/sourceforge/jsxe/options/ShortcutsOptionPane.java
===================================================================
--- trunk/jsxe/src/net/sourceforge/jsxe/options/ShortcutsOptionPane.java 2006-08-31 20:20:36 UTC (rev 1213)
+++ trunk/jsxe/src/net/sourceforge/jsxe/options/ShortcutsOptionPane.java 2006-08-31 20:41:10 UTC (rev 1214)
@@ -146,10 +146,8 @@
if (label == null) {
Log.log(Log.WARNING, this, names[i]+" has a null label");
} else {
- if (!ActionManager.isDocViewSpecific(names[i])) {
- String binding = jsXe.getProperty(names[i]+".shortcut");
- m_set.add(new GrabKeyDialog.KeyBinding(names[i], label, binding));
- }
+ String binding = jsXe.getProperty(names[i]+".shortcut");
+ m_set.add(new GrabKeyDialog.KeyBinding(names[i], label, binding));
}
}
MiscUtilities.quicksort(m_set, new KeyCompare());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|