aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/client/view/StateView.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-02-16 16:55:44 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-02-16 16:55:44 +1300
commit6d48729efb4bd1ac34bba003a8a4313a70a02cce (patch)
treeb834c03b8aeb3302bedb949a63f6b6d0ed4f2600 /src/org/traccar/web/client/view/StateView.java
parent11b7037755c08654fba3b3781f83445244582d59 (diff)
downloadtrackermap-web-6d48729efb4bd1ac34bba003a8a4313a70a02cce.tar.gz
trackermap-web-6d48729efb4bd1ac34bba003a8a4313a70a02cce.tar.bz2
trackermap-web-6d48729efb4bd1ac34bba003a8a4313a70a02cce.zip
Handle clicks on markers (fix #8)
Diffstat (limited to 'src/org/traccar/web/client/view/StateView.java')
-rw-r--r--src/org/traccar/web/client/view/StateView.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/org/traccar/web/client/view/StateView.java b/src/org/traccar/web/client/view/StateView.java
new file mode 100644
index 00000000..700d55a6
--- /dev/null
+++ b/src/org/traccar/web/client/view/StateView.java
@@ -0,0 +1,58 @@
+package org.traccar.web.client.view;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.traccar.web.client.model.StateItem;
+import org.traccar.web.client.model.StateItemProperties;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.Widget;
+import com.sencha.gxt.data.shared.ListStore;
+import com.sencha.gxt.widget.core.client.ContentPanel;
+import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
+import com.sencha.gxt.widget.core.client.grid.ColumnModel;
+import com.sencha.gxt.widget.core.client.grid.Grid;
+
+public class StateView {
+
+ private static StateViewUiBinder uiBinder = GWT.create(StateViewUiBinder.class);
+
+ interface StateViewUiBinder extends UiBinder<Widget, StateView> {
+ }
+
+ @UiField
+ ContentPanel contentPanel;
+
+ public ContentPanel getView() {
+ return contentPanel;
+ }
+
+ @UiField(provided = true)
+ ColumnModel<StateItem> columnModel;
+
+ @UiField(provided = true)
+ ListStore<StateItem> stateStore;
+
+ @UiField
+ Grid<StateItem> grid;
+
+ public StateView(ListStore<StateItem> stateStore) {
+ this.stateStore = stateStore;
+
+ StateItemProperties stateItemProperties = GWT.create(StateItemProperties.class);
+
+ List<ColumnConfig<StateItem, ?>> columnConfigList = new LinkedList<ColumnConfig<StateItem, ?>>();
+ columnConfigList.add(new ColumnConfig<StateItem, String>(stateItemProperties.name(), 0, "Attribute"));
+ columnConfigList.add(new ColumnConfig<StateItem, String>(stateItemProperties.value(), 0, "Value"));
+ columnModel = new ColumnModel<StateItem>(columnConfigList);
+
+ uiBinder.createAndBindUi(this);
+
+ grid.getSelectionModel().setLocked(true);
+ }
+
+}
+