1 12 package org.eclipse.jdt.internal.ui.callhierarchy; 13 14 import org.eclipse.core.runtime.Assert; 15 16 import org.eclipse.jface.action.Action; 17 18 import org.eclipse.ui.PlatformUI; 19 20 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; 21 import org.eclipse.jdt.internal.ui.JavaPluginImages; 22 23 26 class ToggleCallModeAction extends Action { 27 28 private CallHierarchyViewPart fView; 29 private int fMode; 30 31 public ToggleCallModeAction(CallHierarchyViewPart v, int mode) { 32 super("", AS_RADIO_BUTTON); if (mode == CallHierarchyViewPart.CALL_MODE_CALLERS) { 34 setText(CallHierarchyMessages.ToggleCallModeAction_callers_label); 35 setDescription(CallHierarchyMessages.ToggleCallModeAction_callers_description); 36 setToolTipText(CallHierarchyMessages.ToggleCallModeAction_callers_tooltip); 37 JavaPluginImages.setLocalImageDescriptors(this, "ch_callers.gif"); } else if (mode == CallHierarchyViewPart.CALL_MODE_CALLEES) { 39 setText(CallHierarchyMessages.ToggleCallModeAction_callees_label); 40 setDescription(CallHierarchyMessages.ToggleCallModeAction_callees_description); 41 setToolTipText(CallHierarchyMessages.ToggleCallModeAction_callees_tooltip); 42 JavaPluginImages.setLocalImageDescriptors(this, "ch_callees.gif"); } else { 44 Assert.isTrue(false); 45 } 46 fView= v; 47 fMode= mode; 48 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.CALL_HIERARCHY_TOGGLE_CALL_MODE_ACTION); 49 } 50 51 public int getMode() { 52 return fMode; 53 } 54 55 58 public void run() { 59 fView.setCallMode(fMode); } 61 62 } 63 | Popular Tags |