]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed 391 (Featurebrowser: Move propertytable to tabsheet).
authorJani Laakso <jani.laakso@itmill.com>
Sat, 10 Mar 2007 07:34:23 +0000 (07:34 +0000)
committerJani Laakso <jani.laakso@itmill.com>
Sat, 10 Mar 2007 07:34:23 +0000 (07:34 +0000)
svn changeset:841/svn branch:trunk

src/com/itmill/toolkit/demo/features/Feature.java
src/com/itmill/toolkit/demo/features/PropertyPanel.java

index 235ca6366e4f7e657307f0ddec60e3d084834297..dd4cfeae7921936008cc5fbeab8a4d14060ea091 100644 (file)
@@ -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);
 
        }
index e59f838f5d66745e4166f8f33e8b481260bd931c..759d30de0ebf8253cf21971bf627d85977c55eb5 100644 (file)
@@ -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;
+       }
 }