]> source.dussan.org Git - vaadin-framework.git/commitdiff
Added Welcome page to menu.
authorJani Laakso <jani.laakso@itmill.com>
Tue, 6 Feb 2007 18:03:11 +0000 (18:03 +0000)
committerJani Laakso <jani.laakso@itmill.com>
Tue, 6 Feb 2007 18:03:11 +0000 (18:03 +0000)
svn changeset:488/svn branch:toolkit

src/com/itmill/toolkit/demo/features/FeatureBrowser.java
src/com/itmill/toolkit/demo/features/IntroWelcome.java [new file with mode: 0644]

index 7f60282102ef201dec4ecdf7075f868bd749cfc0..711045a63818795e804aa2063d967f908f069675 100644 (file)
@@ -51,20 +51,10 @@ public class FeatureBrowser extends CustomComponent implements
 
        private PropertyPanel properties;
 
-       private Component welcome;
-
        private boolean initialized = false;
 
        private Select themeSelector = new Select();
 
-       private static final String WELCOME_TEXT = "<h3>Welcome to the IT Mill Toolkit feature tour!</h3>"
-                       + "In this application you may view and play with some features of IT Mill Toolkit.<br/>"
-                       + "Most of the features can be tested online and include simple example of their "
-                       + "usage associated with it.<br/><br/>"
-                       + "Start your tour by selecting features from the list on the left.<br/><br/>"
-                       + "For more information, point your browser to: <a href=\"http://www.itmill.com\""
-                       + " target=\"_new\">www.itmill.com</a>";
-
        public void attach() {
 
                if (initialized)
@@ -118,6 +108,7 @@ public class FeatureBrowser extends CustomComponent implements
                left.addComponent(close);
 
                // Test component
+               registerFeature("/Welcome", new IntroWelcome());
                registerFeature("/UI Components", new IntroComponents());
                registerFeature("/UI Components/Basic", new IntroBasic());
                registerFeature("/UI Components/Basic/Text Field",
@@ -170,7 +161,7 @@ public class FeatureBrowser extends CustomComponent implements
                        features.expandItem(i.next());
 
                // Add demo component and tabs
-               currentFeature = new FeatureTable();
+               currentFeature = new IntroWelcome();
                layout.addComponent(currentFeature);
 
                // Add properties
@@ -181,8 +172,10 @@ public class FeatureBrowser extends CustomComponent implements
                propertiesSelect.setSwitchMode(true);
                right.addComponent(propertiesSelect);
                properties = currentFeature.getPropertyPanel();
-               properties.setVisible(false);
-               right.addComponent(properties);
+               if (properties != null) {
+                       properties.setVisible(false);
+                       right.addComponent(properties);
+               }
        }
 
        public void registerFeature(String path, Feature feature) {
@@ -245,7 +238,8 @@ public class FeatureBrowser extends CustomComponent implements
        }
 
        public void buttonClick(ClickEvent event) {
-               properties.setVisible(((Boolean) propertiesSelect.getValue())
-                               .booleanValue());
+               if (properties != null)
+                       properties.setVisible(((Boolean) propertiesSelect.getValue())
+                                       .booleanValue());
        }
 }
diff --git a/src/com/itmill/toolkit/demo/features/IntroWelcome.java b/src/com/itmill/toolkit/demo/features/IntroWelcome.java
new file mode 100644 (file)
index 0000000..d723181
--- /dev/null
@@ -0,0 +1,82 @@
+/* *************************************************************************
+ IT Mill Toolkit 
+
+ Development of Browser User Interfaces Made Easy
+
+ Copyright (C) 2000-2006 IT Mill Ltd
+ *************************************************************************
+
+ This product is distributed under commercial license that can be found
+ from the product package on license.pdf. Use of this product might 
+ require purchasing a commercial license from IT Mill Ltd. For guidelines 
+ on usage, see licensing-guidelines.html
+
+ *************************************************************************
+ For more information, contact:
+ IT Mill Ltd                           phone: +358 2 4802 7180
+ Ruukinkatu 2-4                        fax:   +358 2 4802 7181
+ 20540, Turku                          email:  info@itmill.com
+ Finland                               company www: www.itmill.com
+ Primary source for information and releases: www.itmill.com
+
+ ********************************************************************** */
+
+package com.itmill.toolkit.demo.features;
+
+import com.itmill.toolkit.ui.Component;
+import com.itmill.toolkit.ui.Label;
+import com.itmill.toolkit.ui.OrderedLayout;
+
+public class IntroWelcome extends Feature {
+
+       private static final String WELCOME_TEXT = ""
+                       + "In this application you may view and play with some features of IT Mill Toolkit.<br/>"
+                       + "Most of the features can be tested online and include simple example of their "
+                       + "usage associated with it.<br/><br/>"
+                       + "Start your tour by selecting features from the list on the left.<br/><br/>"
+                       + "For more information, point your browser to: <a href=\"http://www.itmill.com\""
+                       + " target=\"_new\">www.itmill.com</a>";
+
+       public IntroWelcome() {
+               super();
+       }
+
+       protected Component getDemoComponent() {
+
+               OrderedLayout l = new OrderedLayout();
+
+               Label lab = new Label();
+               lab.setStyle("featurebrowser-none");
+               l.addComponent(lab);
+
+               // Properties
+               propertyPanel = null;
+
+               return l;
+       }
+
+       protected String getExampleSrc() {
+               return "";
+       }
+
+       /**
+        * @see com.itmill.toolkit.demo.features.Feature#getDescriptionXHTML()
+        */
+       protected String getDescriptionXHTML() {
+               return this.WELCOME_TEXT;
+       }
+
+       protected String getImage() {
+               return "";
+       }
+
+       protected String getTitle() {
+               return "Welcome to the IT Mill Toolkit feature tour!";
+       }
+
+}