1 19 20 25 26 package org.netbeans.modules.css.actions; 27 28 29 import java.awt.BorderLayout ; 30 import javax.swing.JLabel ; 31 import javax.swing.JPanel ; 32 import org.openide.nodes.Node; 33 import org.openide.explorer.ExplorerManager; 34 import org.openide.util.HelpCtx; 35 import org.openide.util.NbBundle; 36 import org.openide.util.actions.CookieAction; 37 38 39 44 public class CssRuleNavigationAction extends CookieAction { 45 46 49 private static final Class [] REQUIRED_COOKIES = new Class [] { 50 }; 52 53 54 public HelpCtx getHelpCtx() { 55 return HelpCtx.DEFAULT_HELP; 56 } 57 58 61 public String getName() { 62 return NbBundle.getMessage(CssRuleNavigationAction.class, "RULE_LIST_ACTION"); 63 } 64 65 68 protected int mode() { 69 return MODE_EXACTLY_ONE; 70 } 71 72 protected Class [] cookieClasses() { 73 return REQUIRED_COOKIES; 74 } 75 76 79 protected void performAction(Node[] activatedNodes) { 80 } 82 83 public java.awt.Component getToolbarPresenter() { 84 java.awt.Component c = new ToolbarPresenter(); 85 return c; 86 } 87 88 private static class ToolbarPresenter extends JPanel { 89 90 private static final int FIXED_WIDTH = 200; 91 92 CssRuleNavigationView explorerView; 93 JLabel comboLabel; 94 ExplorerManager manager; 95 96 ToolbarPresenter() { 97 initComponents(); 98 } 99 100 private void initComponents() { 101 setLayout(new BorderLayout (2,0)); 102 103 explorerView = new CssRuleNavigationView(); 104 105 comboLabel = new JLabel (); 106 comboLabel.setLabelFor(explorerView); 107 108 add(explorerView, BorderLayout.CENTER); 109 add(comboLabel, BorderLayout.WEST); 110 } 111 112 public java.awt.Dimension getMinimumSize() { 113 return new java.awt.Dimension (FIXED_WIDTH, getPreferredSize().height); 115 } 116 117 public java.awt.Dimension getMaximumSize() { 118 return new java.awt.Dimension (FIXED_WIDTH, getPreferredSize().height); 120 } 121 122 } 123 } 124 | Popular Tags |