Revision 763
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/java/org/gvsig/scripting/swing/impl/DefaultScriptingUIManager.java | ||
---|---|---|
401 | 401 |
public JEditor createEditor(ScriptingUnit unit) { |
402 | 402 |
JEditor editor = null; |
403 | 403 |
for (EditorFactory factory : this.getEditorFactories() ) { |
404 |
if( factory.canCreate(unit) ) { |
|
405 |
editor = factory.create(unit); |
|
406 |
fireCreateComponent(editor); |
|
407 |
break; |
|
404 |
try { |
|
405 |
if( factory.canCreate(unit) ) { |
|
406 |
editor = factory.create(unit); |
|
407 |
fireCreateComponent(editor); |
|
408 |
break; |
|
409 |
} |
|
410 |
} catch(Exception ex) { |
|
411 |
logger.warn("Can't create an editor with factory '"+factory.getClass().getName()+"' for '"+unit.getClass().getName()+"'.",ex); |
|
408 | 412 |
} |
409 | 413 |
} |
410 | 414 |
return editor; |
... | ... | |
412 | 416 |
|
413 | 417 |
@Override |
414 | 418 |
public boolean hasEditor(ScriptingUnit unit) { |
419 |
if( unit == null ) { |
|
420 |
return false; |
|
421 |
} |
|
415 | 422 |
for (EditorFactory factory : this.getEditorFactories() ) { |
416 |
if( factory.canCreate(unit) ) { |
|
417 |
return true; |
|
423 |
try { |
|
424 |
if( factory.canCreate(unit) ) { |
|
425 |
return true; |
|
426 |
} |
|
427 |
} catch(Exception ex) { |
|
428 |
logger.warn("Can't check if factory '"+factory.getClass().getName()+"' can create an editor for '"+unit.getClass().getName()+"'.",ex); |
|
418 | 429 |
} |
419 | 430 |
} |
420 | 431 |
return false; |
Also available in: Unified diff