Author: scabanovich
Date: 2007-10-15 12:36:04 -0400 (Mon, 15 Oct 2007)
New Revision: 4204
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/AbstractMultiPageContributor.java
Log:
JBIDE-1065
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/AbstractMultiPageContributor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/AbstractMultiPageContributor.java 2007-10-15
16:24:41 UTC (rev 4203)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/AbstractMultiPageContributor.java 2007-10-15
16:36:04 UTC (rev 4204)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.model.ui.texteditors;
import java.util.*;
+
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.*;
@@ -217,12 +218,19 @@
ITextEditorActionConstants.UNDO,
ITextEditorActionConstants.REDO
};
+
+ Map<IAction, ActionHandler> used = new HashMap<IAction, ActionHandler>();
- public static void registerKeyBindings(IHandlerService handler, String[] actions,
ITextEditor editor) {
+ public void registerKeyBindings(IHandlerService handler, String[] actions, ITextEditor
editor) {
for (int i = 0; i < actions.length; i++) {
IAction action = editor.getAction(actions[i]);
if(action == null) continue;
- handler.activateHandler(actions[i], new ActionHandler(action));
+ ActionHandler h = used.get(action);
+ if(h == null) {
+ h = new ActionHandler(action);
+ used.put(action, h);
+ }
+ handler.activateHandler(actions[i], h);
}
}
Show replies by date