1 11 package org.eclipse.ui.internal.ide.actions; 12 13 import org.eclipse.jface.action.IAction; 14 import org.eclipse.ui.actions.RetargetAction; 15 16 24 public class RetargetActionWithDefault extends RetargetAction { 25 26 private IAction defaultHandler; 27 28 34 public RetargetActionWithDefault(String actionID, String text) { 35 super(actionID, text); 36 } 37 38 41 protected void setActionHandler(IAction newHandler) { 42 super.setActionHandler(newHandler); 43 if (newHandler == null) { 47 super.setActionHandler(defaultHandler); 48 } 49 } 50 51 55 public void setDefaultHandler(IAction handler) { 56 this.defaultHandler = handler; 57 if (getActionHandler() == null && handler != null) { 58 super.setActionHandler(handler); 59 } 60 } 61 } 62 | Popular Tags |