1 19 20 package org.netbeans.modules.tasklist.suggestions.ui; 21 22 import org.netbeans.modules.tasklist.core.TaskListView; 23 import org.netbeans.modules.tasklist.suggestions.ui.SuggestionsView; 24 25 import org.openide.util.HelpCtx; 26 import org.openide.util.NbBundle; 27 import org.openide.util.actions.CallableSystemAction; 28 29 30 35 final public class SuggestionsAction extends CallableSystemAction { 36 37 private static final long serialVersionUID = 1; 38 39 private volatile boolean block = false; 42 43 protected boolean asynchronous() { 44 return false; } 46 47 public void performAction() { 48 if (block) { 49 return; 50 } 51 try { 52 block = true; 53 show(); 54 } finally { 55 block = false; 56 } 57 } 58 59 private static void show() { 60 TaskListView view = 61 TaskListView.getTaskListView(SuggestionsView.CATEGORY); if (view != null) { 63 view.showInMode(); 64 } else { 65 TaskListView tv = SuggestionsView.createSuggestionsView(); 67 tv.showInMode(); 68 } 69 } 70 71 public String getName() { 72 return NbBundle.getMessage(SuggestionsAction.class, "ShowSuggestions"); } 74 75 protected String iconResource() { 76 return "org/netbeans/modules/tasklist/suggestions/suggestion.gif"; } 78 79 public HelpCtx getHelpCtx() { 80 return HelpCtx.DEFAULT_HELP; 81 } 84 } 85 | Popular Tags |