1 11 package org.eclipse.ant.internal.ui.views.actions; 12 13 14 import org.eclipse.ant.internal.ui.AntUIImages; 15 import org.eclipse.ant.internal.ui.IAntUIConstants; 16 import org.eclipse.ant.internal.ui.IAntUIHelpContextIds; 17 import org.eclipse.ant.internal.ui.views.AntView; 18 import org.eclipse.jface.action.Action; 19 import org.eclipse.jface.dialogs.MessageDialog; 20 import org.eclipse.ui.PlatformUI; 21 import org.eclipse.ui.texteditor.IUpdate; 22 23 public class RemoveAllAction extends Action implements IUpdate { 24 private AntView view; 25 26 public RemoveAllAction(AntView view) { 27 super(AntViewActionMessages.RemoveAllAction_Remove_All, AntUIImages.getImageDescriptor(IAntUIConstants.IMG_REMOVE_ALL)); 28 setDescription(AntViewActionMessages.RemoveAllAction_Remove_All); 29 setToolTipText(AntViewActionMessages.RemoveAllAction_Remove_All); 30 this.view= view; 31 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IAntUIHelpContextIds.REMOVE_ALL_ACTION); 32 } 33 34 public void run() { 35 boolean proceed = MessageDialog.openQuestion(view.getViewSite().getShell(), AntViewActionMessages.RemoveAllAction_0, AntViewActionMessages.RemoveAllAction_1); 36 if (proceed) { 37 view.removeAllProjects(); 38 } 39 } 40 41 44 public void update() { 45 setEnabled(view.getViewer().getTree().getItemCount() != 0); 46 } 47 } 48 | Popular Tags |