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.core.ToggleViewAction; 24 import org.netbeans.modules.tasklist.suggestions.ui.SuggestionsView; 25 26 import org.openide.util.HelpCtx; 27 import org.openide.util.NbBundle; 28 import org.openide.util.actions.CallableSystemAction; 29 import org.openide.windows.TopComponent; 30 31 32 38 final public class ToggleSuggestionsAction extends ToggleViewAction { 39 40 private static final long serialVersionUID = 1; 41 42 protected boolean isViewOpened() { 43 TaskListView view = 44 TaskListView.getTaskListView(SuggestionsView.CATEGORY); 45 if (view == null) 46 return false; 47 return super.isViewOpened(); 48 } 49 50 protected TopComponent getView(){ 51 TaskListView view = 52 TaskListView.getTaskListView(SuggestionsView.CATEGORY); 53 if (view != null) { 54 return view; 55 } else { 56 return SuggestionsView.createSuggestionsView(); 58 } 59 } 60 61 public String getName() { 62 return NbBundle.getMessage(ToggleSuggestionsAction.class, "ToggleSuggestions"); } 64 65 protected String iconResource() { 66 return "org/netbeans/modules/tasklist/suggestions/suggestion.gif"; } 68 69 public HelpCtx getHelpCtx() { 70 return HelpCtx.DEFAULT_HELP; 71 } 74 } 75 | Popular Tags |