1 11 package org.eclipse.jdt.ui.actions; 12 13 import org.eclipse.jdt.ui.IContextMenuConstants; 14 import org.eclipse.jface.action.IMenuManager; 15 import org.eclipse.jface.action.Separator; 16 import org.eclipse.ui.IViewPart; 17 import org.eclipse.ui.IWorkbenchWindow; 18 import org.eclipse.ui.actions.ActionGroup; 19 import org.eclipse.ui.actions.ExportResourcesAction; 20 import org.eclipse.ui.actions.ImportResourcesAction; 21 22 32 public class ImportActionGroup extends ActionGroup { 33 34 private static final String GROUP_IMPORT= "group.import"; 36 private ImportResourcesAction fImportAction; 37 private ExportResourcesAction fExportAction; 38 39 46 public ImportActionGroup(IViewPart part) { 47 IWorkbenchWindow workbenchWindow = part.getSite().getWorkbenchWindow(); 48 fImportAction= new ImportResourcesAction(workbenchWindow); 49 fExportAction= new ExportResourcesAction(workbenchWindow); 50 } 51 52 55 public void fillContextMenu(IMenuManager menu) { 56 menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, new Separator(GROUP_IMPORT)); 57 menu.appendToGroup(GROUP_IMPORT, fImportAction); 58 menu.appendToGroup(GROUP_IMPORT, fExportAction); 59 super.fillContextMenu(menu); 60 } 61 62 65 public void dispose() { 66 fImportAction.dispose(); 67 fExportAction.dispose(); 68 super.dispose(); 69 } 70 } 71 | Popular Tags |