1 11 12 package org.eclipse.ui.internal.actions; 13 14 import org.eclipse.core.runtime.Assert; 15 import org.eclipse.jface.action.Action; 16 import org.eclipse.ui.PlatformUI; 17 import org.eclipse.ui.actions.WorkingSetFilterActionGroup; 18 import org.eclipse.ui.internal.IWorkbenchHelpContextIds; 19 import org.eclipse.ui.internal.WorkbenchMessages; 20 21 26 public class ClearWorkingSetAction extends Action { 27 private WorkingSetFilterActionGroup actionGroup; 28 29 34 public ClearWorkingSetAction(WorkingSetFilterActionGroup actionGroup) { 35 super(WorkbenchMessages.ClearWorkingSetAction_text); 36 Assert.isNotNull(actionGroup); 37 setToolTipText(WorkbenchMessages.ClearWorkingSetAction_toolTip); 38 setEnabled(actionGroup.getWorkingSet() != null); 39 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, 40 IWorkbenchHelpContextIds.CLEAR_WORKING_SET_ACTION); 41 this.actionGroup = actionGroup; 42 } 43 44 49 public void run() { 50 actionGroup.setWorkingSet(null); 51 } 52 } 53 | Popular Tags |