1 11 package org.eclipse.debug.internal.ui.actions.context; 12 13 import org.eclipse.core.runtime.IAdaptable; 14 import org.eclipse.debug.internal.ui.DebugPluginImages; 15 import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; 16 import org.eclipse.debug.internal.ui.actions.ActionMessages; 17 import org.eclipse.debug.internal.ui.actions.provisional.IAsynchronousDropToFrameAdapter; 18 import org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor; 19 import org.eclipse.jface.resource.ImageDescriptor; 20 21 24 public class DropToFrameAction extends AbstractDebugContextAction { 25 29 protected void doAction(Object element) { 30 if (element instanceof IAdaptable) { 31 IAdaptable adaptable = (IAdaptable) element; 32 IAsynchronousDropToFrameAdapter dropper = (IAsynchronousDropToFrameAdapter) adaptable.getAdapter(IAsynchronousDropToFrameAdapter.class); 33 if (dropper != null) 34 dropper.dropToFrame(element, new ActionRequestMonitor()); 35 } 36 } 37 38 42 protected void isEnabledFor(Object element, IBooleanRequestMonitor monitor) { 43 if (element instanceof IAdaptable) { 44 IAdaptable adaptable = (IAdaptable) element; 45 IAsynchronousDropToFrameAdapter dropper = (IAsynchronousDropToFrameAdapter) adaptable.getAdapter(IAsynchronousDropToFrameAdapter.class); 46 if (dropper != null) { 47 dropper.canDropToFrame(element, monitor); 48 } else { 49 notSupported(monitor); 50 } 51 } 52 } 53 54 59 public String getText() { 60 return ActionMessages.DropToFrameAction_0; 61 } 62 63 68 public String getHelpContextId() { 69 return "drop_to_frame_action_context"; } 71 72 77 public String getId() { 78 return "org.eclipse.debug.ui.debugview.toolbar.dropToFrame"; } 80 81 86 public String getToolTipText() { 87 return ActionMessages.DropToFrameAction_3; 88 } 89 90 95 public ImageDescriptor getHoverImageDescriptor() { 96 return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DROP_TO_FRAME); 97 } 98 99 104 public ImageDescriptor getImageDescriptor() { 105 return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DROP_TO_FRAME); 106 } 107 108 111 public ImageDescriptor getDisabledImageDescriptor() { 112 return null; 113 } 114 } 115 | Popular Tags |