Revision 1209 org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/java/org/gvsig/scripting/swing/impl/composer/DefaultJScriptingComposer.java

View differences:

DefaultJScriptingComposer.java
1050 1050
        for (Action action : this.uimanager.getComposerTools()) {
1051 1051
            this.addTool(action);
1052 1052
        }
1053

  
1054 1053
        MenuBarHelper menuBarHelper = new MenuBarHelper(menuBar);
1055 1054
        for (ToolEntry entry : menus.values()) {
1056 1055
            try {
1057
                JMenuItem menu = menuBarHelper.add(entry.getText(), entry.getAction(), this);
1056
                Action action = entry.getAction();
1057
                if( action!=null ) {
1058
                  Boolean isVisible = (Boolean) action.getValue("Visible");
1059
                  if( isVisible!=null && !isVisible ) {
1060
                    continue;
1061
                  }
1062
                }
1063
                JMenuItem menu = menuBarHelper.add(entry.getText(), action, this);
1058 1064
                entry.setComponent(menu);
1059 1065
            } catch(Throwable th) {
1060 1066
                LOGGER.warn("Can't add entry '"+entry.getName()+"' to the toolbar.", th);
1061 1067
            }
1062 1068
        }
1063

  
1064 1069
        for (ToolEntry entry : tools.values()) {
1065 1070
            try {
1066
                JButton button = new ButtonWithContext(entry.getAction());
1071
                Action action = entry.getAction();
1072
                if( action!=null ) {
1073
                  Boolean isVisible = (Boolean) action.getValue("Visible");
1074
                  if( isVisible!=null && !isVisible ) {
1075
                    continue;
1076
                  }
1077
                }
1078
                JButton button = new ButtonWithContext(action);
1067 1079
                this.toolBar.add(button);
1068 1080
                entry.setComponent(button);
1069 1081
            } catch(Throwable th) {

Also available in: Unified diff