]> source.dussan.org Git - vaadin-framework.git/commitdiff
making it easier to extend ApplicationConnection (and creating own widget set)
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 12 Sep 2007 13:24:55 +0000 (13:24 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 12 Sep 2007 13:24:55 +0000 (13:24 +0000)
svn changeset:2292/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java
src/com/itmill/toolkit/terminal/gwt/client/DefaultWidgetFactory.java

index 68d0c7faa8a0fc19cb010869d1033c5aea0d1b00..c045a280b7e821c7de931ae9db743f1d4338b314 100755 (executable)
@@ -46,11 +46,15 @@ public class ApplicationConnection implements EntryPoint, FocusListener {
 
        private HashMap paintableToId = new HashMap();
 
-       private WidgetFactory widgetFactory = new DefaultWidgetFactory();
+       private final WidgetFactory widgetFactory;
 
        private IContextMenu contextMenu = null;
        
        private IView view = new IView();
+       
+       public ApplicationConnection() {
+               widgetFactory = createWidgetFactory();
+       }
 
        /**
         * This is the entry point method.
@@ -72,6 +76,10 @@ public class ApplicationConnection implements EntryPoint, FocusListener {
                
        }
        
+       protected static WidgetFactory createWidgetFactory() {
+               return new DefaultWidgetFactory();
+       }
+
        public static Console getConsole() {
                return console;
        }
@@ -313,14 +321,6 @@ public class ApplicationConnection implements EntryPoint, FocusListener {
                                buf.toString(), immediate, 'a');
        }
 
-       public WidgetFactory getWidgetFactory() {
-               return widgetFactory;
-       }
-
-       public void setWidgetFactory(WidgetFactory widgetFactory) {
-               this.widgetFactory = widgetFactory;
-       }
-
        public static Layout getParentLayout(Widget component) {
                Widget parent = component.getParent();
                while (parent != null && !(parent instanceof Layout))
index fdaaf8a4f83c53e0143622accb28eae5899f093f..60c972f78e379741455aa9a911d75217f4f35ae7 100644 (file)
@@ -154,9 +154,11 @@ public class DefaultWidgetFactory implements WidgetFactory {
                 * TODO: Class based impl, use when GWT supports return
                 * (Widget)GWT.create(resolveWidgetClass(uidl));
                 */
+               
+               
        }
 
-       private String resolveWidgetTypeName(UIDL uidl) {
+       protected String resolveWidgetTypeName(UIDL uidl) {
 
                String tag = uidl.getTag();
                if ("button".equals(tag)) {