1 11 package org.eclipse.jdt.internal.debug.ui.display; 12 13 14 import org.eclipse.jdt.internal.debug.ui.IJavaDebugHelpContextIds; 15 import org.eclipse.jdt.internal.debug.ui.JavaDebugImages; 16 import org.eclipse.jface.action.Action; 17 import org.eclipse.ui.IWorkbenchPart; 18 import org.eclipse.ui.help.WorkbenchHelp; 19 20 23 public class ClearDisplayAction extends Action { 24 25 private IWorkbenchPart fWorkbenchPart; 26 27 public ClearDisplayAction(IWorkbenchPart workbenchPart) { 28 fWorkbenchPart= workbenchPart; 29 30 setText(DisplayMessages.getString("ClearDisplay.label")); setToolTipText(DisplayMessages.getString("ClearDisplay.tooltip")); setDescription(DisplayMessages.getString("ClearDisplay.description")); WorkbenchHelp.setHelp(this, IJavaDebugHelpContextIds.CLEAR_DISPLAY_VIEW_ACTION); 34 35 JavaDebugImages.setLocalImageDescriptors(this, "clear_co.gif"); } 37 38 41 public void run() { 42 Object value= fWorkbenchPart.getAdapter(IDataDisplay.class); 43 if (value instanceof IDataDisplay) { 44 IDataDisplay dataDisplay= (IDataDisplay) value; 45 dataDisplay.clear(); 46 } 47 } 48 } 49 | Popular Tags |