Fixed #336 (FeatureBrowser: Javadoc tabs are empty) svn changeset:618/svn branch:toolkittags/6.7.0.beta1
@@ -44,11 +44,21 @@ public abstract class Feature extends CustomComponent { | |||
protected PropertyPanel propertyPanel; | |||
private Label javadoc; | |||
/** Constuctor for the feature component */ | |||
public Feature() { | |||
layout = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL); | |||
setCompositionRoot(layout); | |||
} | |||
/** | |||
* Actual URL consists of "/doc/api/com/itmill/toolkit/"+url | |||
* @param url | |||
*/ | |||
public void setJavadocURL(String url) { | |||
javadoc.setValue("<iframe width=\"100%\" src=\"/doc/api/com/itmill/toolkit/"+url+"\"></iframe>"); | |||
} | |||
/** | |||
* Feature component initialization is lazily done when the feature is | |||
@@ -62,6 +72,10 @@ public abstract class Feature extends CustomComponent { | |||
if (initialized) | |||
return; | |||
initialized = true; | |||
// Javadoc | |||
javadoc = new Label(); | |||
javadoc.setContentMode(Label.CONTENT_RAW); | |||
// Demo | |||
Component demo = getDemoComponent(); | |||
@@ -71,7 +85,7 @@ public abstract class Feature extends CustomComponent { | |||
ts = new TabSheet(); | |||
layout.addComponent(ts); | |||
// Description | |||
// Description tab | |||
String desc = getDescriptionXHTML(); | |||
String title = getTitle(); | |||
if (desc != null && title != null) { | |||
@@ -84,7 +98,7 @@ public abstract class Feature extends CustomComponent { | |||
ts.addTab(gl, "Description", null); | |||
} | |||
// Code Sample | |||
// Code Sample tab | |||
String example = getExampleSrc(); | |||
if (example != null) { | |||
OrderedLayout l = new OrderedLayout(); | |||
@@ -93,11 +107,9 @@ public abstract class Feature extends CustomComponent { | |||
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); | |||
// Javadoc tab | |||
ts.addTab(javadoc, "Javadoc", null); | |||
// Properties tab | |||
// if (properties != null) |
@@ -49,6 +49,8 @@ public class FeatureBuffering extends Feature { | |||
// Properties | |||
propertyPanel = null; | |||
setJavadocURL("data/Buffered.html"); | |||
return l; | |||
} | |||
@@ -52,6 +52,8 @@ public class FeatureButton extends Feature { | |||
.createBeanPropertySet(new String[] { "switchMode" }); | |||
propertyPanel.addProperties("Button Properties", ap); | |||
setJavadocURL("ui/Button.html"); | |||
return l; | |||
} | |||
@@ -49,6 +49,8 @@ public class FeatureContainers extends Feature { | |||
// Properties | |||
propertyPanel = null; | |||
setJavadocURL("data/Container.html"); | |||
return l; | |||
} | |||
@@ -70,6 +70,8 @@ public class FeatureCustomLayout extends Feature { | |||
// Properties | |||
propertyPanel = null; | |||
setJavadocURL("ui/CustomLayout.html"); | |||
return l; | |||
} |
@@ -92,6 +92,8 @@ public class FeatureDateField extends Feature { | |||
themes.addItem("calendar").getItemProperty( | |||
themes.getItemCaptionPropertyId()).setValue("calendar"); | |||
propertyPanel.addProperties("DateField Properties", ap); | |||
setJavadocURL("ui/DateField"); | |||
return l; | |||
} |
@@ -89,6 +89,8 @@ public class FeatureEmbedded extends Feature { | |||
.setDescription( | |||
"Unique object id. This can be used for example to identify windows components."); | |||
setJavadocURL("ui/Embedded.html"); | |||
return l; | |||
} | |||
@@ -52,6 +52,8 @@ public class FeatureForm extends Feature implements | |||
demo = new OrderedLayout(); | |||
createDemo(); | |||
} | |||
setJavadocURL("ui/Form.html"); | |||
return demo; | |||
} |
@@ -70,6 +70,8 @@ public class FeatureFrameWindow extends Feature implements Button.ClickListener | |||
"None", "Minimal" }); | |||
propertyPanel.addProperties("FrameWindow Properties", ap); | |||
setJavadocURL("ui/FrameWindow.html"); | |||
return l; | |||
} |
@@ -59,6 +59,8 @@ public class FeatureGridLayout extends Feature { | |||
propertyPanel.addProperties("GridLayout Features", ap); | |||
propertyPanel.getField("height").dependsOn( | |||
propertyPanel.getField("add component")); | |||
setJavadocURL("ui/GridLayout.html"); | |||
return l; | |||
} |
@@ -49,6 +49,8 @@ public class FeatureItems extends Feature { | |||
// Properties | |||
propertyPanel = null; | |||
setJavadocURL("data/Items.html"); | |||
return l; | |||
} | |||
@@ -58,6 +58,8 @@ public class FeatureLabel extends Feature { | |||
"XML (Subtree with namespace)" }); | |||
propertyPanel.addProperties("Label Properties", ap); | |||
setJavadocURL("ui/Label.html"); | |||
return l; | |||
} | |||
@@ -56,6 +56,8 @@ public class FeatureLink extends Feature { | |||
"Default", "Minimal", "None" }); | |||
propertyPanel.addProperties("Link Properties", ap); | |||
setJavadocURL("ui/Link.html"); | |||
return l; | |||
} | |||
@@ -58,6 +58,8 @@ public class FeatureOrderedLayout extends Feature { | |||
themes.getItemCaptionPropertyId()).setValue("form"); | |||
propertyPanel.addProperties("OrderedLayout Properties", ap); | |||
setJavadocURL("ui/OrderedLayout.html"); | |||
return l; | |||
} | |||
@@ -56,6 +56,8 @@ public class FeaturePanel extends Feature { | |||
themes.getItemCaptionPropertyId()).setValue("strong"); | |||
propertyPanel.addProperties("Panel Properties", ap); | |||
setJavadocURL("ui/Panel.html"); | |||
return l; | |||
} | |||
@@ -49,6 +49,8 @@ public class FeatureProperties extends Feature { | |||
// Properties | |||
propertyPanel = null; | |||
setJavadocURL("ui/package-summary.html"); | |||
return l; | |||
} | |||
@@ -65,6 +65,8 @@ public class FeatureSelect extends Feature { | |||
themes.getItemCaptionPropertyId()).setValue("optiongroup"); | |||
themes.addItem("twincol").getItemProperty( | |||
themes.getItemCaptionPropertyId()).setValue("twincol"); | |||
setJavadocURL("ui/Select.html"); | |||
return l; | |||
} |
@@ -48,6 +48,8 @@ public class FeatureTabSheet extends Feature { | |||
// Properties | |||
propertyPanel = new PropertyPanel(ts); | |||
setJavadocURL("ui/TabSheet.html"); | |||
return l; | |||
} |
@@ -32,6 +32,7 @@ import com.itmill.toolkit.event.Action; | |||
import com.itmill.toolkit.ui.Button; | |||
import com.itmill.toolkit.ui.Component; | |||
import com.itmill.toolkit.ui.Form; | |||
import com.itmill.toolkit.ui.Label; | |||
import com.itmill.toolkit.ui.OrderedLayout; | |||
import com.itmill.toolkit.ui.Select; | |||
import com.itmill.toolkit.ui.Table; | |||
@@ -140,6 +141,8 @@ public class FeatureTable extends Feature implements Action.Handler { | |||
t.setColumnReorderingAllowed(true); | |||
t.setSelectable(true); | |||
setJavadocURL("ui/Table.html"); | |||
return l; | |||
} | |||
@@ -51,7 +51,9 @@ public class FeatureTextField extends Feature { | |||
"rows", "wordwrap", "writeThrough", "readThrough", | |||
"nullRepresentation", "nullSettingAllowed", "secret" }); | |||
propertyPanel.addProperties("Text field properties", f); | |||
setJavadocURL("ui/TextField.html"); | |||
return l; | |||
} | |||
@@ -118,7 +118,9 @@ public class FeatureTree extends Feature implements Action.Handler { | |||
themes.addItem("menu").getItemProperty( | |||
themes.getItemCaptionPropertyId()).setValue("menu"); | |||
propertyPanel.addProperties("Tree Properties", ap); | |||
setJavadocURL("ui/Tree.html"); | |||
return l; | |||
} | |||
@@ -65,6 +65,8 @@ public class FeatureUpload extends Feature implements Upload.FinishedListener { | |||
// Properties | |||
propertyPanel = new PropertyPanel(up); | |||
setJavadocURL("ui/Upload.html"); | |||
return l; | |||
} |
@@ -49,6 +49,8 @@ public class FeatureValidators extends Feature { | |||
// Properties | |||
propertyPanel = null; | |||
setJavadocURL("data/Validator.html"); | |||
return l; | |||
} | |||
@@ -65,7 +65,9 @@ public class FeatureWindow extends Feature { | |||
new Integer(Window.BORDER_MINIMAL) }, new Object[] { "Default", | |||
"None", "Minimal" }); | |||
propertyPanel.addProperties("Window Properties", windowProperties); | |||
setJavadocURL("ui/Window.html"); | |||
return l; | |||
} | |||
@@ -45,10 +45,12 @@ public class IntroBasic extends Feature { | |||
Label lab = new Label(); | |||
lab.setStyle("featurebrowser-none"); | |||
l.addComponent(lab); | |||
// Properties | |||
propertyPanel = null; | |||
setJavadocURL("ui/package-summary.html"); | |||
return l; | |||
} | |||
@@ -48,7 +48,9 @@ public class IntroComponents extends Feature { | |||
// Properties | |||
propertyPanel = null; | |||
setJavadocURL("ui/package-summary.html"); | |||
return l; | |||
} | |||
@@ -60,7 +60,9 @@ public class IntroWelcome extends Feature { | |||
// Properties | |||
propertyPanel = null; | |||
setJavadocURL("package-summary.html"); | |||
return l; | |||
} | |||