}
+
+/* Sample grid styles */
+.v-app-SamplerApplication .v-csslayout-grid {
+ background: transparent url(grid-bg.png) 0 80px;
+ margin: 0 20px 50px;
+}
+
.v-app-SamplerApplication .v-label-section {
font-family: "Helvetica Neue", helvetica, arial, verdana, sans-serif;
font-size: 24px;
- font-weight: bold;
- border-bottom: 1px solid #eee;
- line-height: 35px;
- text-indent: 15px;
+ font-weight: normal;
+ line-height: normal;
text-shadow: 0 2px 1px #c0c1c2;
color: #1e2229;
-
+ padding: 30px 0 20px 0;
+ height: 30px;
+}
+
+.v-csslayout-grid .v-label-subsection {
+ font-size: 11px;
+ line-height: 16px;
+ color: #787b7e;
+ float: left;
+ width: 155px;
+ height: 131px;
+ padding: 15px 175px 0 15px;
+ margin-right: -175px;
+ background: transparent url(subsection-bg.png) no-repeat;
+ white-space: normal;
+}
+
+.v-csslayout-grid .v-label-subsection h3 {
+ font-size: 18px;
+ font-weight: bold;
+ text-shadow: 0 2px 1px #c0c1c2;
+ color: #292d30;
+ margin: 0 0 .5em;
+}
+
+.v-csslayout-grid .screenshot,
+.v-csslayout-grid .screenshot:focus,
+.v-csslayout-grid .screenshot:active {
+ float: left;
+ height: 132px;
+ width: 87px;
+ margin: 14px 15px 0;
+ position: relative;
+}
+
+.v-csslayout-grid .screenshot .v-icon {
+ display: block;
+ width: 75px;
+ margin: 3px 6px;
+ position: absolute;
+}
+
+.v-csslayout-grid .screenshot .v-button-caption {
+ display: block;
+ width: 87px;
+ text-align: center;
+ white-space: normal;
+ text-decoration: none;
+ font-size: 12px;
+ color: #212325;
+ font-family: arial, helvetica, sans-serif;
+ font-weight: bold;
+ line-height: normal;
+ position: absolute;
+ background: transparent url(screenshot-frame.png) no-repeat 4px 2px;
+ padding-top: 84px;
+ height: 30px;
}
+.v-csslayout-grid .screenshot:hover .v-button-caption {
+ background: transparent url(screenshot-frame-hover.png) no-repeat 1px 0px;
+}
+
+/*
.v-app-SamplerApplication .v-label-subsection {
font-family: helvetica, arial, verdana, sans-serif;
font-size: 16px;
color: #666666;
text-indent: 15px;
padding-right: 20px;
-}
-.v-app-SamplerApplication .v-nativebutton-screenshot {
- border: 3px solid #ccc;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- overflow: hidden;
-}
-.v-app-SamplerApplication .v-nativebutton-screenshot:hover {
- border-color: #abc;
-}
-.v-app-SamplerApplication .v-nativebutton-screenshot img.v-icon {
- margin: 0;
- margin-top: -2px;
- margin-left: -3px;
- width: auto;
- height: auto;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- overflow: hidden;
- position: static;
-}
+}*/
+
.v-app-SamplerApplication .v-table-featuretable tr.v-table-row,
.v-app-SamplerApplication .v-table-featuretable tr.v-table-row-odd {
public static class Components extends FeatureSet {
public Components() {
- super("Components", new Feature[] {
+ super("Vaadin Core Components", new Feature[] {
//
new Common(), //
new Accordions(), //
* FeatureSet implementation follows.
*/
- private String pathname;
+ private final String pathname;
- private String name;
+ private final String name;
- private String desc;
+ private final String desc;
- private String icon = "folder.gif";
+ private final String icon = "folder.gif";
- private Feature[] content;
+ private final Feature[] content;
private HierarchicalContainer container = null;
- private boolean containerRecursive = false;
+ private final boolean containerRecursive = false;
FeatureSet(String pathname, Feature[] content) {
this(pathname, pathname, "", content);
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Component;
+import com.vaadin.ui.CssLayout;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Embedded;
-import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.NativeButton;
private class FeatureGrid extends Panel implements FeatureList {
- GridLayout grid = new GridLayout(11, 1);
+ CssLayout grid = new CssLayout();
private final HashMap<Object, Resource> iconCache = new HashMap<Object, Resource>();
FeatureGrid() {
setSizeFull();
setContent(grid);
- grid.setSizeUndefined();
- grid.setSpacing(true);
setStyleName(Panel.STYLE_LIGHT);
+ grid.setStyleName("grid");
}
@SuppressWarnings("unchecked")
for (Iterator<Feature> it = features.iterator(); it.hasNext();) {
final Feature f = it.next();
if (f instanceof FeatureSet) {
- grid.newLine();
Label title = new Label(f.getName());
if (c.isRoot(f)) {
- title.setWidth("100%");
title.setStyleName("section");
- grid.setRows(grid.getCursorY() + 1);
- grid.addComponent(title, 0, grid.getCursorY(), grid
- .getColumns() - 1, grid.getCursorY());
- grid
- .setComponentAlignment(title,
- Alignment.MIDDLE_LEFT);
+ grid.addComponent(title);
} else {
+ String text = "<h3>" + f.getName() + "</h3>";
+ if (f.getDescription() != null
+ && f.getDescription() != "") {
+ text += f.getDescription().substring(0,
+ f.getDescription().indexOf(".") + 1);
+ }
+ title = new Label(text, Label.CONTENT_XHTML);
title.setStyleName("subsection");
+ title.setSizeUndefined();
grid.addComponent(title);
- grid
- .setComponentAlignment(title,
- Alignment.MIDDLE_LEFT);
}
} else {
- if (grid.getCursorX() == 0) {
- grid.space();
- }
- Button b = new NativeButton();
+ Button b = new Button(f.getName());
b.setStyleName(Button.STYLE_LINK);
b.addStyleName("screenshot");
String resId = "75-" + f.getIconName();
res = new ClassResource(f.getClass(), resId,
SamplerApplication.this);
iconCache.put(resId, res);
-
}
b.setIcon(res);
- b.setWidth("75px");
- b.setHeight("75px");
- b.setDescription("<h3>" + f.getName() + "</h3>");
b.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
((SamplerWindow) getWindow()).setFeature(f);