comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/PanelHelper.java @ 9079:aafae1ab25f0

epoch-panels, single-input-panels
author gernotbelger
date Wed, 23 May 2018 17:30:24 +0200
parents b5d7a9d79837
children 41f4bc83aa7a
comparison
equal deleted inserted replaced
9078:fc02833dbcc1 9079:aafae1ab25f0
8 * documentation coming with Dive4Elements River for details. 8 * documentation coming with Dive4Elements River for details.
9 */ 9 */
10 package org.dive4elements.river.client.client.ui; 10 package org.dive4elements.river.client.client.ui;
11 11
12 import com.smartgwt.client.widgets.form.fields.TextItem; 12 import com.smartgwt.client.widgets.form.fields.TextItem;
13 import com.smartgwt.client.widgets.form.validator.IsIntegerValidator;
13 import com.smartgwt.client.widgets.form.validator.Validator; 14 import com.smartgwt.client.widgets.form.validator.Validator;
14 import com.smartgwt.client.widgets.layout.VLayout; 15 import com.smartgwt.client.widgets.layout.VLayout;
15 16
16 /** 17 /**
17 * @author Domenico Nardi Tironi 18 * @author Domenico Nardi Tironi
34 public static VLayout getSpacer(final int height) { 35 public static VLayout getSpacer(final int height) {
35 final VLayout spacer = new VLayout(); 36 final VLayout spacer = new VLayout();
36 spacer.setHeight(height); 37 spacer.setHeight(height);
37 return spacer; 38 return spacer;
38 } 39 }
40
41 public static TextItem createItem(final String title) {
42 final TextItem inputItem = new TextItem(title);
43
44 final boolean hideTitle = title == null || title.isEmpty();
45 inputItem.setShowTitle(!hideTitle);
46 // final CustomValidator validator = new CustomValidator() {
47 // @Override
48 // protected boolean condition(final Object value) {
49 // return validate().size() > 0 ? false : true;
50 // }
51 // };
52 inputItem.setValidators(new IsIntegerValidator()); // Validator hat keinen sichtbaren Effekt.
53 inputItem.setWidth(60);
54 return inputItem;
55
56 }
39 } 57 }

http://dive4elements.wald.intevation.org