Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipse-incubator-e4-dev] Initial discussion onthe'modelled'workbenchUI


Cool, I'm getting Paul to help me get ste up so that we can chat 'offline' (I say "out of the Vortex"...;-). While you're at it can you determine what a client would have to do to add a new 'sub class' of the 'Stack' with additional 'custom' properties ? I'm giving you the heads up because that'll be the ffirst question I expect to ask...;-).

Talk to you in a bit...
Eric



Tom Schindl <tom.schindl@xxxxxxxxxxxxxxx>
Sent by: eclipse-incubator-e4-dev-bounces@xxxxxxxxxxx

04/08/2008 04:23 AM

Please respond to
E4 developer list <eclipse-incubator-e4-dev@xxxxxxxxxxx>

To
E4 developer list <eclipse-incubator-e4-dev@xxxxxxxxxxx>
cc
Subject
Re: [eclipse-incubator-e4-dev]        Initial        discussion        onthe'modelled'workbenchUI





Hi,

In my current EricToTom-Transformation I've modeled it currently like this:

EPresentationModelElement                  EStyle
   ^                                        ^ ^
   |                                        | |
   -----------------------------------------| |
                  |                           |
                  |                           |
            EGUIElement x------------> EStyleClass
                                  0..1

Tom

Yves YANG schrieb:
>> public class UIElement {
>>    private Style style;
>>
>>    private class WrappedStyle extends Style {
>>        private HashMap ownMap = new HashMap();
>>
>>        private WrappedStyle(Style style) {
>>            this.style = style;
>>        }
>>
>>        public String get(String name) {
>>           if( ownMap.contains(name) ) {
>>              return ownMap.get(name);
>>           }
>>        }
>>
>>        public void set(String name, String value) {
>>           ownMap.put(name,value);
>>        }
>>    }
>>
>>    // Allows reading without the need to wrap
>>    public String getStyleAttribute(String name) {
>>        return style.get(name)
>>    }
>>
>>
>>    public String setStyleAttribute(String name, String value) {
>>        getStyle().set(name,value);
>>    }
>>
>>    public Style getStyle() {
>>        if( !( style instanceof WrappedStyle ) ) {
>>            this.style = new WrappedStyle(this.style);
>>        }
>>
>>        return style;
>>    }
>> }
>
> In general, we have the same idea.
> Here is what I suggest:
> public class UIElement {
>     private Style style;
>     private HashMap ownMap = new HashMap();
>
>     // Allows reading without the need to wrap
>     public Object getValue(String name) {
>                    if (ownMap.containsKey(name)) {
>                                   return ownMap.get(name);
>                    }
>                    return getDefaultValue(name);
>     }
>
>     protected Object getDefaultValue (String name) {
>                    if (style != null) {
>                                   return style.get(name);
>                    }
>                    return null;
>     }
>    
>     public Object getLocalValue(String name) {
>        return ownMap.get(name);
>     }
>
>     public boolean hasLocalValue(String name) {
>        return ownMap.containsKey(name);
>     }
>     public void unsetValue(String name) {
>        ownMap.remove(name);
>     }
>
>     public void setValue(String name, Object value) {
>         ownMap.set(name, value);
>     }
>
>     public Style getStyle() {
>         return style;
>     }
> }
>
> Style is subclass UIElement.
>
> yves
>
> _______________________________________________
> eclipse-incubator-e4-dev mailing list
> eclipse-incubator-e4-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipse-incubator-e4-dev


--
B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
------------------------------------------------------------------------
tom schindl                               leiter softwareentwicklung/CSO
------------------------------------------------------------------------
eduard-bodem-gasse 8/3    A-6020 innsbruck      phone    ++43 512 935834
_______________________________________________
eclipse-incubator-e4-dev mailing list
eclipse-incubator-e4-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipse-incubator-e4-dev


Back to the top