1 11 package org.eclipse.ui.internal.cheatsheets.actions; 12 13 import org.eclipse.jface.action.Action; 14 import org.eclipse.jface.resource.ImageDescriptor; 15 import org.eclipse.jface.window.Window; 16 import org.eclipse.ui.PlatformUI; 17 import org.eclipse.ui.internal.cheatsheets.dialogs.CheatSheetCategoryBasedSelectionDialog; 18 import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetCollectionElement; 19 import org.eclipse.ui.internal.cheatsheets.registry.CheatSheetRegistryReader; 20 21 29 public class CheatSheetCategoryBasedSelectionAction extends Action { 30 31 34 public CheatSheetCategoryBasedSelectionAction() { 35 } 36 37 41 public CheatSheetCategoryBasedSelectionAction(String text) { 42 super(text); 43 } 44 45 50 public CheatSheetCategoryBasedSelectionAction(String text, ImageDescriptor image) { 51 super(text, image); 52 } 53 54 57 public void run() { 58 CheatSheetCollectionElement cheatSheets = (CheatSheetCollectionElement)CheatSheetRegistryReader.getInstance().getCheatSheets(); 59 60 CheatSheetCategoryBasedSelectionDialog dialog = new CheatSheetCategoryBasedSelectionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), cheatSheets); 61 62 if(dialog.open() != Window.OK || !dialog.getStatus().isOK()) { 63 notifyResult(false); 64 return; 65 } 66 67 notifyResult(true); 68 } 69 } 70 71 | Popular Tags |