Revision 42548 trunk/org.gvsig.desktop/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/ui/mdiFrame/MDIFrame.java
MDIFrame.java | ||
---|---|---|
97 | 97 |
import org.gvsig.tools.i18n.I18nManager; |
98 | 98 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
99 | 99 |
import org.gvsig.tools.swing.icontheme.IconTheme; |
100 |
|
|
101 | 100 |
import org.slf4j.Logger; |
102 | 101 |
import org.slf4j.LoggerFactory; |
103 | 102 |
|
... | ... | |
355 | 354 |
logger.warn("Unable to find icon '" + selectableTool.getIcon() + "'."); |
356 | 355 |
image = PluginServices.getIconTheme().get(noIcon); |
357 | 356 |
} |
358 |
|
|
357 |
|
|
359 | 358 |
ToggleButtonModel buttonModel = new ToggleButtonModel(); |
360 | 359 |
JToolBarToggleButton btn = new JToolBarToggleButton(selectableTool.getText(), image); |
361 | 360 |
btn.setModel(buttonModel); |
... | ... | |
373 | 372 |
group = new ButtonGroup(); |
374 | 373 |
buttonGroupMap.put(selectableTool.getGroup(), group); |
375 | 374 |
} |
376 |
|
|
375 |
|
|
377 | 376 |
jtb.addButton(group, btn); |
378 |
|
|
377 |
|
|
379 | 378 |
buttonModel.setGroupName(selectableTool.getGroup()); |
380 | 379 |
if ( selectableTool.getIsDefault() ) { |
381 | 380 |
btn.setSelected(true); |
... | ... | |
573 | 572 |
btn.setToolTip(i18nManager.getTranslation(action.getTooltip())); |
574 | 573 |
btn.setToolTipKey(action.getTooltip()); |
575 | 574 |
} |
576 |
|
|
575 |
|
|
577 | 576 |
SelectableToolBar jtb = getToolBar(toolBarName); |
578 | 577 |
jtb.addButton(group, btn); |
579 |
|
|
578 |
|
|
580 | 579 |
addControl(btn); |
581 | 580 |
|
582 | 581 |
} |
... | ... | |
1193 | 1192 |
}); |
1194 | 1193 |
return; |
1195 | 1194 |
} |
1195 |
logger.info("ENABLE CONTROOOOOLS"); |
|
1196 |
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); |
|
1197 |
for(int i=0; i<stackTrace.length; i++){ |
|
1198 |
logger.info(stackTrace[i].toString()); |
|
1199 |
} |
|
1196 | 1200 |
|
1197 | 1201 |
ActionInfoManager actionManager = PluginsLocator.getActionInfoManager(); |
1198 | 1202 |
ActionInfoStatusCache cache = actionManager.createActionStatusCache(); |
... | ... | |
1213 | 1217 |
DropDownButton dropDownButton = (DropDownButton)control; |
1214 | 1218 |
visible = !dropDownButton.isAllHiden(); |
1215 | 1219 |
enabled = !dropDownButton.isAllDisabled(); |
1220 |
if (visible && enabled){ |
|
1221 |
dropDownButton.updateMainButton(); |
|
1222 |
} |
|
1216 | 1223 |
} else if( control instanceof JMenuTraslatable ) { |
1217 | 1224 |
enabled = true; |
1218 | 1225 |
visible = true; |
... | ... | |
1237 | 1244 |
control.setEnabled(enabled); |
1238 | 1245 |
control.setVisible(visible); |
1239 | 1246 |
} catch (Throwable ex) { |
1240 |
// Catch exceptins and errors (class not found) |
|
1247 |
// Catch exceptions and errors (class not found)
|
|
1241 | 1248 |
logger.info("Can't enable/show control '" + actionName + "'.", ex); |
1242 | 1249 |
this.message("Can't enable/show control '" + actionName + "'.", JOptionPane.ERROR_MESSAGE); |
1243 | 1250 |
try { |
... | ... | |
1322 | 1329 |
} |
1323 | 1330 |
|
1324 | 1331 |
public synchronized void refreshControls() { |
1332 |
logger.info("ESTOY AQUIIIIIIIIIII 1"); |
|
1325 | 1333 |
if ( !SwingUtilities.isEventDispatchThread() ) { |
1326 | 1334 |
SwingUtilities.invokeLater(new Runnable() { |
1327 | 1335 |
public void run() { |
... | ... | |
1331 | 1339 |
return; |
1332 | 1340 |
} |
1333 | 1341 |
|
1342 |
logger.info("ESTOY AQUIIIIIIIIIII 2"); |
|
1334 | 1343 |
if(refreshingControls){ |
1335 | 1344 |
return; |
1336 | 1345 |
} |
1337 | 1346 |
try { |
1347 |
// enableControls(); |
|
1338 | 1348 |
refreshingControls = true; |
1339 | 1349 |
ActionInfoManager actionManager = PluginsLocator.getActionInfoManager(); |
1340 | 1350 |
ActionInfoStatusCache cache = actionManager.createActionStatusCache(); |
... | ... | |
1364 | 1374 |
} |
1365 | 1375 |
} |
1366 | 1376 |
} |
1377 |
logger.info("ESTOY AQUIIIIIIIIIII 3"); |
|
1378 |
|
|
1367 | 1379 |
enableControls(); |
1380 |
logger.info("ESTOY AQUIIIIIIIIIII 4"); |
|
1381 |
logger.info(" "); |
|
1382 |
|
|
1368 | 1383 |
} finally { |
1369 | 1384 |
refreshingControls = false; |
1370 | 1385 |
} |
Also available in: Unified diff