示例#1
0
文件: Toolbar.java 项目: ltly/firefly
 private void addListeners() {
   if (command instanceof GeneralCommand) {
     final GeneralCommand c = (GeneralCommand) command;
     c.addPropertyChangeListener(
         new PropertyChangeListener() {
           public void propertyChange(PropertyChangeEvent ev) {
             if (ev.getPropertyName().equals(GeneralCommand.PROP_ENABLED)) {
               setButtonEnabled(c.isEnabled());
             }
           }
         });
   }
 }
 public Map makeCommandTable() {
   HashMap<String, GeneralCommand> commands = new HashMap<String, GeneralCommand>();
   GeneralCommand cmd = new OverviewHelpCmd();
   commands.put(cmd.getName(), cmd);
   return commands;
 }