Revision 3897 trunk/frameworks/_fwAndami/src/com/iver/andami/ui/mdiFrame/SelectableToolBar.java
SelectableToolBar.java | ||
---|---|---|
89 | 89 |
group.add(btn); |
90 | 90 |
add(btn); |
91 | 91 |
} |
92 |
|
|
92 |
|
|
93 | 93 |
/** |
94 | 94 |
* Selects a toggleButton in this toolBar by ActionCommand |
95 | 95 |
* @param actionCommand |
96 | 96 |
*/ |
97 |
public void setSelectedTool(String actionCommand) |
|
98 |
{ |
|
97 |
public void setSelectedTool(String actionCommand){ |
|
99 | 98 |
for (int i = 0; i < getComponentCount(); i++) { |
100 | 99 |
if (getComponent(i) instanceof JToggleButton) |
101 | 100 |
{ |
102 | 101 |
JToggleButton toggleButton = (JToggleButton) getComponent(i); |
103 | 102 |
String aux = toggleButton.getActionCommand(); |
104 |
if (aux != null) |
|
105 |
if (aux.compareTo(actionCommand) == 0) |
|
106 |
{ |
|
103 |
if (aux != null) |
|
104 |
if (aux.equals(actionCommand)){ |
|
107 | 105 |
toggleButton.setSelected(true); |
108 | 106 |
} |
109 | 107 |
} |
110 | 108 |
} |
111 |
|
|
109 |
|
|
112 | 110 |
} |
113 | 111 |
} |
Also available in: Unified diff