2 * Copyright (C) 2011 Openismus GmbH
4 * This file is part of GWT-Glom.
6 * GWT-Glom is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
11 * GWT-Glom is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with GWT-Glom. If not, see <http://www.gnu.org/licenses/>.
20 package org.glom.web.shared;
22 import org.glom.web.shared.layout.LayoutItemField.GlomFieldType;
25 * This specialisation of DataItem is used to hold can a primary key item.
27 * @author Ben Konrath <ben@bagu.org>
29 @SuppressWarnings("serial")
30 public class TypedDataItem extends DataItem {
31 private boolean empty = true;
32 private GlomFieldType type = GlomFieldType.TYPE_INVALID;
34 public TypedDataItem() {
37 public boolean isEmpty() {
44 * @see org.glom.web.shared.DataItem#setBoolean(boolean)
47 public void setBoolean(boolean bool) {
49 this.type = GlomFieldType.TYPE_BOOLEAN;
50 super.setBoolean(bool);
56 * @see org.glom.web.shared.DataItem#setNumber(double)
59 public void setNumber(double number) {
61 this.type = GlomFieldType.TYPE_NUMERIC;
62 super.setNumber(number);
68 * @see org.glom.web.shared.DataItem#setText(java.lang.String)
71 public void setText(String text) {
73 this.type = GlomFieldType.TYPE_TEXT;
80 * @see org.glom.web.shared.DataItem#setText(java.lang.String)
82 public void setUnknown(String value) {
84 this.type = GlomFieldType.TYPE_INVALID;
88 public GlomFieldType getType() {