diff options
author | Jani Laakso <jani.laakso@itmill.com> | 2007-02-02 18:48:28 +0000 |
---|---|---|
committer | Jani Laakso <jani.laakso@itmill.com> | 2007-02-02 18:48:28 +0000 |
commit | 341e214a316ee55bb481f6c86cb1d8981cc025b5 (patch) | |
tree | 620b57bde9fbd716e1999a20eb1d47f729a20dbb /src/com/itmill/toolkit/demo/features/Feature.java | |
parent | 334ca73c3ce83bf58188005a59683fbc6824e251 (diff) | |
download | vaadin-framework-341e214a316ee55bb481f6c86cb1d8981cc025b5.tar.gz vaadin-framework-341e214a316ee55bb481f6c86cb1d8981cc025b5.zip |
Indentation changes.
Layout changed.
svn changeset:426/svn branch:toolkit
Diffstat (limited to 'src/com/itmill/toolkit/demo/features/Feature.java')
-rw-r--r-- | src/com/itmill/toolkit/demo/features/Feature.java | 111 |
1 files changed, 65 insertions, 46 deletions
diff --git a/src/com/itmill/toolkit/demo/features/Feature.java b/src/com/itmill/toolkit/demo/features/Feature.java index 8d5a612196..68da501548 100644 --- a/src/com/itmill/toolkit/demo/features/Feature.java +++ b/src/com/itmill/toolkit/demo/features/Feature.java @@ -1,30 +1,30 @@ /* ************************************************************************* - IT Mill Toolkit + IT Mill Toolkit - Development of Browser User Interfaces Made Easy + Development of Browser User Interfaces Made Easy - Copyright (C) 2000-2006 IT Mill Ltd - - ************************************************************************* + 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 + 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 + ************************************************************************* + + 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; @@ -34,58 +34,72 @@ import com.itmill.toolkit.ui.*; public class Feature extends CustomComponent { + private OrderedLayout layout; + private TabSheet ts; private boolean initialized = false; private static Resource sampleIcon; - + + protected PropertyPanel propertyPanel; + /** Constuctor for the feature component */ public Feature() { - ts = new TabSheet(); - setCompositionRoot(ts); + layout = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL); + setCompositionRoot(layout); } - /** Feature component initialization is lazily done when the - * feature is attached to application */ + /** + * Feature component initialization is lazily done when the feature is + * attached to application + */ public void attach() { // Check if the feature is already initialized - if (initialized) return; + if (initialized) + return; initialized = true; - // Optional description with image + // Demo + Component demo = getDemoComponent(); + if (demo != null) + layout.addComponent(demo); + + ts = new TabSheet(); + layout.addComponent(ts); + + // Description String desc = getDescriptionXHTML(); String title = getTitle(); if (desc != null && title != null) { GridLayout gl = new GridLayout(2, 1); if (getImage() != null) - gl.addComponent( - new Embedded( - "", new ClassResource(getImage(), this.getApplication()))); - gl.addComponent( - new Label( - "<h2>" + title + "</h2>" + desc, + gl.addComponent(new Embedded("", new ClassResource(getImage(), + this.getApplication()))); + gl.addComponent(new Label("<h2>" + title + "</h2>" + desc, Label.CONTENT_XHTML)); ts.addTab(gl, "Description", null); } - // Demo - Component demo = getDemoComponent(); - if (demo != null) - ts.addTab(demo, "Demo", null); - - // Example source + // Code Sample String example = getExampleSrc(); if (example != null) { OrderedLayout l = new OrderedLayout(); - l.addComponent( - new Label( - "<h2>" + getTitle() + " example</h2>", + l.addComponent(new Label("<h2>" + getTitle() + " example</h2>", Label.CONTENT_XHTML)); l.addComponent(new Label(example, Label.CONTENT_PREFORMATTED)); ts.addTab(l, "Code Sample", null); } + + // Javadoc + Label javadocPlaceholder = new Label( + "This is a placeholder for Javadoc"); + ts.addTab(javadocPlaceholder, "Javadoc", null); + + // Properties tab + // if (properties != null) + // ts.addTab(properties, "Properties", null); } /** Get the desctiption of the feature as XHTML fragment */ @@ -110,13 +124,18 @@ public class Feature extends CustomComponent { /** Get the feature demo component */ protected Component getDemoComponent() { - return null; + return null; } - + /** Get sample icon resource */ protected Resource getSampleIcon() { - if (sampleIcon == null) sampleIcon = new ClassResource("m.gif",this.getApplication()); - return sampleIcon; + if (sampleIcon == null) + sampleIcon = new ClassResource("m.gif", this.getApplication()); + return sampleIcon; + } + + public PropertyPanel getPropertyPanel() { + return propertyPanel; } }
\ No newline at end of file |