From be376e9d33384042daa4192712563eae603de6c2 Mon Sep 17 00:00:00 2001 From: Jani Laakso Date: Sat, 10 Mar 2007 07:34:23 +0000 Subject: [PATCH] Fixed 391 (Featurebrowser: Move propertytable to tabsheet). svn changeset:841/svn branch:trunk --- .../itmill/toolkit/demo/features/Feature.java | 5 ++++- .../toolkit/demo/features/PropertyPanel.java | 21 +++++++------------ 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/com/itmill/toolkit/demo/features/Feature.java b/src/com/itmill/toolkit/demo/features/Feature.java index 235ca6366e..dd4cfeae79 100644 --- a/src/com/itmill/toolkit/demo/features/Feature.java +++ b/src/com/itmill/toolkit/demo/features/Feature.java @@ -117,6 +117,9 @@ public abstract class Feature extends CustomComponent { ts.addTab(mainLayout, "Description", null); } + + // Properties table tab + ts.addTab(getPropertyPanel().getAllProperties(), "Properties", null); // Javadoc tab if (!javadoc.getValue().equals("")) @@ -134,7 +137,7 @@ public abstract class Feature extends CustomComponent { Label.CONTENT_PREFORMATTED)); ts.addTab(l, "Code Sample", null); } - + layout.addComponent(ts); } diff --git a/src/com/itmill/toolkit/demo/features/PropertyPanel.java b/src/com/itmill/toolkit/demo/features/PropertyPanel.java index e59f838f5d..759d30de0e 100644 --- a/src/com/itmill/toolkit/demo/features/PropertyPanel.java +++ b/src/com/itmill/toolkit/demo/features/PropertyPanel.java @@ -55,10 +55,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, private Button setButton = new Button("Set", this); private Button discardButton = new Button("Discard changes", this); - - private Button showAllProperties = new Button("List of All Properties", - this); - + private Table allProperties = new Table(); private Object objectToConfigure; @@ -79,7 +76,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, // Control buttons OrderedLayout buttons = new OrderedLayout( - OrderedLayout.ORIENTATION_VERTICAL); + OrderedLayout.ORIENTATION_HORIZONTAL); buttons.addComponent(setButton); buttons.addComponent(discardButton); addComponent(buttons); @@ -96,9 +93,6 @@ public class PropertyPanel extends Panel implements Button.ClickListener, addComponentContainerProperties(); // The list of all properties - addComponent(showAllProperties); - showAllProperties.setSwitchMode(true); - allProperties.setVisible(false); allProperties.addContainerProperty("Name", String.class, ""); allProperties.addContainerProperty("Type", String.class, ""); allProperties.addContainerProperty("R/W", String.class, ""); @@ -106,8 +100,8 @@ public class PropertyPanel extends Panel implements Button.ClickListener, allProperties.setColumnAlignments(new String[] { Table.ALIGN_LEFT, Table.ALIGN_LEFT, Table.ALIGN_CENTER, Table.ALIGN_CENTER }); allProperties.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_ID); + allProperties.setPageLength(0); updatePropertyList(); - addComponent(allProperties); } /** Add a formful of properties to property panel */ @@ -146,11 +140,6 @@ public class PropertyPanel extends Panel implements Button.ClickListener, ((Form) i.next()).discard(); } - // Show property list - if (event.getButton() == showAllProperties) { - allProperties.setVisible(((Boolean) showAllProperties.getValue()) - .booleanValue()); - } } /** Recreate property list contents */ @@ -464,4 +453,8 @@ public class PropertyPanel extends Panel implements Button.ClickListener, } return null; } + + public Table getAllProperties() { + return allProperties; + } } -- 2.39.5