1 11 package org.eclipse.ui.internal.presentations; 12 13 import org.eclipse.jface.action.Action; 14 import org.eclipse.ui.internal.WorkbenchMessages; 15 import org.eclipse.ui.presentations.IPresentablePart; 16 import org.eclipse.ui.presentations.IStackPresentationSite; 17 18 public class SystemMenuCloseAll extends Action implements ISelfUpdatingAction { 19 20 private IStackPresentationSite presentation; 21 22 public SystemMenuCloseAll(IStackPresentationSite presentation) { 23 this.presentation = presentation; 24 setText(WorkbenchMessages.PartPane_closeAll); 25 } 26 27 public void dispose() { 28 presentation = null; 29 } 30 31 public void run() { 32 presentation.close(presentation.getPartList()); 33 } 34 35 public void update() { 36 IPresentablePart[] parts = presentation.getPartList(); 37 setEnabled(parts.length != 0); 38 } 39 40 public boolean shouldBeVisible() { 41 return true; 42 } 43 44 } 45 | Popular Tags |