restrore the function of SpecialPropertyEditorFactory
authorMatthias Mann
Tue Jan 17 08:04:08 2012 +0100 (4 months ago)
changeset 442fa38df480961
parent 441 a07c800cd964
child 443 d97138e5ba62
restrore the function of SpecialPropertyEditorFactory
src/de/matthiasmann/twlthemeeditor/gui/PropertyPanel.java
     1.1 --- a/src/de/matthiasmann/twlthemeeditor/gui/PropertyPanel.java	Sun Jan 15 20:54:18 2012 +0100
     1.2 +++ b/src/de/matthiasmann/twlthemeeditor/gui/PropertyPanel.java	Tue Jan 17 08:04:08 2012 +0100
     1.3 @@ -78,10 +78,10 @@
     1.4          }
     1.5      }
     1.6  
     1.7 -    @SuppressWarnings("unchecked")
     1.8      protected<T> void addProperty(Property<T> p) {
     1.9 -        PropertyEditorFactory factoryNew = factories.getFactory(p);
    1.10 -        if(factoryNew != null) {
    1.11 +        @SuppressWarnings("unchecked")
    1.12 +        PropertyEditorFactory<T> factory = (PropertyEditorFactory<T>)factories.getFactory(p);
    1.13 +        if(factory != null) {
    1.14              PresentModel activeModel = null;
    1.15              if(p instanceof OptionalProperty<?>) {
    1.16                  OptionalProperty<?> op = (OptionalProperty<?>)p;
    1.17 @@ -90,10 +90,18 @@
    1.18                  }
    1.19              }
    1.20              
    1.21 +            if(activeModel == null && (factory instanceof SpecialPropertyEditorFactory<?>)) {
    1.22 +                @SuppressWarnings("unchecked")
    1.23 +                SpecialPropertyEditorFactory<T> specialFactory = (SpecialPropertyEditorFactory<T>)factory;
    1.24 +                if(specialFactory.createSpecial(getHorizontalGroup(), getVerticalGroup(), p)) {
    1.25 +                    return;
    1.26 +                }
    1.27 +            }
    1.28 +            
    1.29              PresentModel ef = (activeModel != null)
    1.30                      ? activeModel : new PresentModel(null);
    1.31  
    1.32 -            Widget content = factoryNew.create(p, ef);
    1.33 +            Widget content = factory.create(p, ef);
    1.34  
    1.35              if(activeModel != null && ef.focusWidgetCB != null) {
    1.36                  focusWidgets.put(p.getName(), ef.focusWidgetCB);