Revision 2757
trunk/frameworks/_fwAndami/src/com/iver/andami/ui/mdiFrame/MDIFrame.java | ||
---|---|---|
1142 | 1142 |
|
1143 | 1143 |
|
1144 | 1144 |
/** |
1145 |
* Get a JComponent previously added by name. For example
|
|
1145 |
* Get a previously added JComponent by name. For example
|
|
1146 | 1146 |
* you can use it if you need to obtain a JToolBar to |
1147 | 1147 |
* add some customized component. |
1148 | 1148 |
* @param name |
... | ... | |
1150 | 1150 |
*/ |
1151 | 1151 |
public JComponent getComponentByName(String name) |
1152 | 1152 |
{ |
1153 |
Iterator e = classesExtensions.values().iterator(); |
|
1154 |
e = controlClass.keySet().iterator(); |
|
1153 |
Iterator e = controlClass.keySet().iterator(); |
|
1155 | 1154 |
|
1156 | 1155 |
while (e.hasNext()) { |
1157 | 1156 |
JComponent control = (JComponent) e.next(); |
1158 |
if (control.getName().compareTo(name) == 0) |
|
1159 |
return control; |
|
1157 |
String nameCtrl = control.getName(); |
|
1158 |
if (nameCtrl != null) |
|
1159 |
if (nameCtrl.compareTo(name) == 0) |
|
1160 |
return control; |
|
1160 | 1161 |
} |
1162 |
Iterator it = toolBarMap.values().iterator(); |
|
1163 |
while (it.hasNext()) { |
|
1164 |
SelectableToolBar t = (SelectableToolBar) it.next(); |
|
1165 |
String nameCtrl = t.getName(); |
|
1166 |
if (nameCtrl != null) |
|
1167 |
if (nameCtrl.compareTo(name) == 0) |
|
1168 |
return t; |
|
1169 |
|
|
1170 |
} |
|
1171 |
|
|
1161 | 1172 |
return null; |
1162 | 1173 |
} |
1163 | 1174 |
} |
Also available in: Unified diff