From: Marc Englund Date: Fri, 30 Nov 2007 13:41:57 +0000 (+0000) Subject: "Viewed" -checkbox added X-Git-Tag: 6.7.0.beta1~5359 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=78937e3726633c53f7a9e82144037421ccb8ea67;p=vaadin-framework.git "Viewed" -checkbox added svn changeset:3075/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java b/src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java index d8081ebce7..02d5689d5e 100644 --- a/src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java +++ b/src/com/itmill/toolkit/demo/featurebrowser/FeatureBrowser.java @@ -155,6 +155,9 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements } catch (Exception e) { e.printStackTrace(System.err); } + // Hide some columns + table.setVisibleColumns(new Object[] { PROPERTY_ID_CATEGORY, + PROPERTY_ID_NAME, PROPERTY_ID_DESC, PROPERTY_ID_VIEWED }); table.addListener(this); table.setImmediate(true); split2.addComponent(table); @@ -251,7 +254,9 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements prop = item.getItemProperty(PROPERTY_ID_CLASS); prop.setValue(data[p++]); prop = item.getItemProperty(PROPERTY_ID_VIEWED); - prop.setValue(data[p++]); + Button b = new Button("", false); + b.setEnabled(false); + prop.setValue(b); } private HierarchicalContainer createContainer() { @@ -259,10 +264,9 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements c.addContainerProperty(PROPERTY_ID_CATEGORY, String.class, null); c.addContainerProperty(PROPERTY_ID_NAME, String.class, ""); c.addContainerProperty(PROPERTY_ID_DESC, String.class, ""); - c.addContainerProperty(PROPERTY_ID_CLASS, Class.class, Button.class); - c - .addContainerProperty(PROPERTY_ID_VIEWED, Boolean.class, - Boolean.FALSE); + c.addContainerProperty(PROPERTY_ID_CLASS, Class.class, null); + c.addContainerProperty(PROPERTY_ID_VIEWED, Button.class, new Button("", + false)); return c; } @@ -270,6 +274,7 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements if (event.getProperty() == tree) { Object id = tree.getValue(); Item item = tree.getItem(id); + // String section; if (tree.isRoot(id)) { section = ""; // show all sections @@ -291,6 +296,8 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements false, true); } if (!tree.hasChildren(id)) { + // Example, not section + // update table selection table.setValue(id); } @@ -309,6 +316,13 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements ts.removeAllComponents(); ts.addTab(component, caption, null); } + // update "viewed" state + Button b = (Button) item.getItemProperty(PROPERTY_ID_VIEWED) + .getValue(); + if (b != null) { + b.setValue(Boolean.TRUE); + } + table.requestRepaint(); } } @@ -326,9 +340,4 @@ public class FeatureBrowser extends com.itmill.toolkit.Application implements return (Component) components.get(componentClass); } - public class Dummy extends Label { - public Dummy() { - super("Dummy component"); - } - } } diff --git a/src/com/itmill/toolkit/demo/featurebrowser/LabelsExample.java b/src/com/itmill/toolkit/demo/featurebrowser/LabelsExample.java index 25fb189437..04e3352767 100644 --- a/src/com/itmill/toolkit/demo/featurebrowser/LabelsExample.java +++ b/src/com/itmill/toolkit/demo/featurebrowser/LabelsExample.java @@ -20,8 +20,8 @@ public class LabelsExample extends CustomComponent { private static final String pre = "This text has linebreaks.\n\n" + "They will show up in a preformatted Label,\n" - + "but not in a \"plain\" Label.\n\n" + " Indented row. \n" - + " Same indentation."; + + "but not in a \"plain\" Label.\n\n" + + " This is an indented row. \n Same indentation here."; public LabelsExample() {