Mercurial > hg > STI-GWT
annotate src/econnect/wp3_3/client/widgets/table/DynamicStiTable.java @ 77:e8f0780b1b6d trimmed_data
This is abstract enough for now.
author | Sebastian Kruse <skruse@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 16 Jan 2013 14:36:47 +0100 |
parents | 731a2f32978c |
children | 692df235a177 |
rev | line source |
---|---|
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
1 package econnect.wp3_3.client.widgets.table; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
2 |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
3 import java.util.ArrayList; |
59
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
4 import java.util.Comparator; |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
5 import java.util.List; |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
6 |
69
ea856995abac
Allow HTML in Description field
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
7 import com.google.gwt.safehtml.shared.SafeHtml; |
ea856995abac
Allow HTML in Description field
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
8 import com.google.gwt.safehtml.shared.SafeHtmlBuilder; |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
9 import com.google.gwt.user.cellview.client.CellTable; |
69
ea856995abac
Allow HTML in Description field
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
10 import com.google.gwt.user.cellview.client.Column; |
59
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
11 import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
12 import com.google.gwt.user.cellview.client.SimplePager; |
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
13 import com.google.gwt.user.cellview.client.TextColumn; |
76
731a2f32978c
Alert on KML export failure
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
74
diff
changeset
|
14 import com.google.gwt.user.client.Window; |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
15 import com.google.gwt.user.client.rpc.AsyncCallback; |
27
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
16 import com.google.gwt.user.client.ui.Anchor; |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
17 import com.google.gwt.user.client.ui.Button; |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
18 import com.google.gwt.user.client.ui.FormPanel; |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
19 import com.google.gwt.user.client.ui.Grid; |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
20 import com.google.gwt.user.client.ui.Hidden; |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
21 import com.google.gwt.user.client.ui.Image; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
22 import com.google.gwt.user.client.ui.Label; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
23 import com.google.gwt.user.client.ui.HTML; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
24 import com.google.gwt.user.client.ui.HasHorizontalAlignment; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
25 import com.google.gwt.user.client.ui.TextBox; |
52
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
26 import com.google.gwt.view.client.CellPreviewEvent; |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
27 import com.google.gwt.view.client.CellPreviewEvent.Handler; |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
28 import com.google.gwt.view.client.ListDataProvider; |
44
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
29 import com.google.gwt.view.client.Range; |
54
5c51a488c822
fix: add missing refresh of highlights on range change of table
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
53
diff
changeset
|
30 import com.google.gwt.view.client.RangeChangeEvent; |
69
ea856995abac
Allow HTML in Description field
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
31 import com.google.gwt.cell.client.SafeHtmlCell; |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
32 import com.google.gwt.core.client.GWT; |
68
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
33 import com.google.gwt.core.client.JsArrayString; |
44
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
34 import com.google.gwt.dom.client.NodeList; |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
35 import com.google.gwt.dom.client.Style.BorderStyle; |
64
aa1808d94d80
Make table always take 100% width, so page switches don't alter the layout
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
36 import com.google.gwt.dom.client.Style.Unit; |
44
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
37 import com.google.gwt.dom.client.TableCellElement; |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
38 import com.google.gwt.event.dom.client.ClickHandler; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
39 import com.google.gwt.event.dom.client.ClickEvent; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
40 import com.google.gwt.event.dom.client.MouseOutEvent; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
41 import com.google.gwt.event.dom.client.MouseOverEvent; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
42 import com.google.gwt.event.dom.client.MouseOverHandler; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
43 import com.google.gwt.event.dom.client.MouseOutHandler; |
27
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
44 import com.google.gwt.http.client.URL; |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
45 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
46 import econnect.wp3_3.client.core.ApplicationConstants; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
47 import econnect.wp3_3.client.core.DataObject; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
48 import econnect.wp3_3.client.core.DataSet; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
49 import econnect.wp3_3.client.core.StiConstants; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
50 import econnect.wp3_3.client.core.StiCore; |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
51 import econnect.wp3_3.client.services.ExportWriterInterface; |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
52 import econnect.wp3_3.client.services.ExportWriterInterfaceAsync; |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
53 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
54 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
55 * Implementation of a dynamic table for one dataset |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
56 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
57 public class DynamicStiTable extends Grid { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
58 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
59 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
60 * The maximum number of rows of the table |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
61 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
62 private int maxRows = 10; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
63 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
64 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
65 * The sti core component |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
66 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
67 private StiCore core; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
68 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
69 /** |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
70 * The index of the dataset |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
71 */ |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
72 private int index; |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
73 |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
74 /** |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
75 * The dataset of this dynamic table |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
76 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
77 private DataSet dataSet; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
78 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
79 /** |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
80 * ArrayList that holds all elements that can be shown |
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
81 * (smaller than "dataSet" if showSelected) |
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
82 */ |
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
83 private ArrayList<DataObject> actualObjectSet; |
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
84 |
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
85 /** |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
86 * Provider that hands the data to the table |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
87 */ |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
88 private ListDataProvider<DataObject> dataProvider; |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
89 |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
90 /** |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
91 * CellTable which displays the data |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
92 */ |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
93 private CellTable<DataObject> elementsTable; |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
94 |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
95 /** |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
96 * This class is used for the Lists of Columns that |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
97 * represent the different "views" of the CellTable |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
98 */ |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
99 class ColumnAndName { |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
100 public Column<DataObject,?> column; |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
101 public String name; |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
102 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
103 public ColumnAndName(Column<DataObject,?> column, String name) { |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
104 this.column = column; |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
105 this.name = name; |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
106 } |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
107 } |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
108 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
109 /** |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
110 * "Views" of columns of the celltable |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
111 */ |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
112 private ArrayList<ArrayList<ColumnAndName>> columns; |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
113 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
114 /** |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
115 * Thie index of the "View" that is currently visible |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
116 * (translates to an index of the columns ArrayList) |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
117 */ |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
118 private int currentlyVisibleView; |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
119 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
120 /** |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
121 * The dataobjects, which are presented at the actual page |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
122 */ |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
123 //private DataObject[][] displayedObjects; |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
124 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
125 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
126 * The number-of-results label |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
127 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
128 private Label results; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
129 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
130 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
131 * The image for show selected elements |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
132 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
133 private Image showSelected; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
134 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
135 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
136 * The image for show all elements |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
137 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
138 private Image showAll; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
139 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
140 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
141 * This value tells the view status: 1 for showAll, -1 for showSelected, 0 otherwise |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
142 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
143 private int viewAll = 1; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
144 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
145 /** |
27
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
146 * Anchor that holds the URL for the KML download |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
147 */ |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
148 private Anchor aDownloadKML; |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
149 |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
150 /** |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
151 * RPC Interface for writing the KML file |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
152 */ |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
153 private ExportWriterInterfaceAsync exportWriter; |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
154 |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
155 /** |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
156 * Constructor for initialization of the dynamic table |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
157 * |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
158 * @param core object to allow interaction with all javascript components |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
159 * @param id id of the dataset |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
160 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
161 public DynamicStiTable( StiCore stiCore, final int id ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
162 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
163 final ApplicationConstants constants = (ApplicationConstants) GWT.create(ApplicationConstants.class); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
164 final StiConstants textConstants = (StiConstants) GWT.create(StiConstants.class); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
165 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
166 this.resize(2,1); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
167 this.addStyleName("dataTable"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
168 this.addStyleName("center"); |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
169 |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
170 this.index = id; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
171 this.core = stiCore; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
172 this.dataSet = core.getDataSets().get(index); |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
173 this.actualObjectSet = new ArrayList<DataObject>(); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
174 setActualObjectSet(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
175 |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
176 this.columns = new ArrayList<ArrayList<ColumnAndName>>(); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
177 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
178 //should be Name + Place |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
179 currentlyVisibleView = 0; |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
180 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
181 Image switchTableLayout = new Image(constants.playEnabled()); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
182 switchTableLayout.addClickHandler(new ClickHandler() { |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
183 public void onClick(ClickEvent event) { |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
184 //switch the layout of the table |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
185 switchTableLayout(); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
186 } |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
187 }); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
188 |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
189 showAll = new Image("images/viewAll"+(core.getColorId(index))+".png"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
190 showAll.setTitle(textConstants.showAll()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
191 showSelected = new Image("images/viewSelected"+(core.getColorId(index))+".png"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
192 showSelected.setTitle(textConstants.showSelected()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
193 showAll.addStyleName("selectedView"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
194 showAll.addStyleName("view"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
195 showSelected.addStyleName("view"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
196 showAll.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
197 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
198 if( viewAll != 1 ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
199 showSelected.removeStyleName("selectedView"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
200 showAll.addStyleName("selectedView"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
201 viewAll = 1; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
202 setActualObjectSet(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
203 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
204 } |
30
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
205 }); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
206 showSelected.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
207 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
208 if( viewAll != -1 ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
209 viewAll = -1; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
210 if( setActualObjectSet() ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
211 showAll.removeStyleName("selectedView"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
212 showSelected.addStyleName("selectedView"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
213 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
214 else { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
215 viewAll = 1; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
216 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
217 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
218 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
219 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
220 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
221 Image storeSelected = new Image("images/storeSelected"+(core.getColorId(index))+".png"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
222 storeSelected.setTitle(textConstants.storeSelected()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
223 storeSelected.addStyleName("view"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
224 storeSelected.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
225 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
226 core.storeSelected(id); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
227 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
228 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
229 |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
230 Grid showOptions = new Grid(1,4); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
231 showOptions.setWidget(0,0,switchTableLayout); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
232 showOptions.setWidget(0,1,showAll); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
233 showOptions.setWidget(0,2,showSelected); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
234 showOptions.setWidget(0,3,storeSelected); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
235 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
236 final TextBox textualSearch = new TextBox(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
237 final Button search = new Button("go"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
238 final Image cancelImage = new Image(constants.cancelImage()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
239 final Image refineImage = new Image(constants.refineImage()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
240 final Grid buttons = new Grid(1,2); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
241 buttons.setWidget(0, 0, refineImage); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
242 buttons.setWidget(0, 1, cancelImage); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
243 final Grid refine = new Grid(1,3); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
244 refine.setWidget(0,0,textualSearch); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
245 refine.setWidget(0,1,search); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
246 search.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
247 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
248 if( !textualSearch.getText().equals("") ){ |
30
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
249 refineByText(textualSearch.getText()); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
250 textualSearch.setEnabled(false); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
251 refine.setWidget(0, 1, buttons); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
252 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
253 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
254 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
255 refineImage.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
256 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
257 core.refine(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
258 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
259 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
260 cancelImage.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
261 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
262 textualSearch.setEnabled(true); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
263 core.reset(); |
30
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
264 |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
265 //TODO: das gibt es nun mehrfach im Code, sollte also in eine Funktion |
46
a8741feea7c6
fixed comment (charset issue)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
45
diff
changeset
|
266 //überfuhrt werden |
30
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
267 showSelected.removeStyleName("selectedView"); |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
268 showAll.addStyleName("selectedView"); |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
269 viewAll = 1; |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
270 setActualObjectSet(); |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
271 |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
272 refine.setWidget(0, 1, search); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
273 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
274 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
275 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
276 this.results = new Label(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
277 this.results.setStyleName("resultsLabel"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
278 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
279 Label page = new Label(textConstants.page()+":"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
280 page.setStyleName("pageLabel"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
281 |
27
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
282 //This anchor will hold the URL of the export-file |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
283 //for download from the ExportServlet |
27
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
284 aDownloadKML = new Anchor("download KML"); |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
285 aDownloadKML.setVisible(false); |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
286 aDownloadKML.addClickHandler(new ClickHandler() { |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
287 public void onClick(ClickEvent event) { |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
288 aDownloadKML.setVisible(false); |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
289 } |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
290 }); |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
291 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
292 Image export = new Image(constants.exportImage()); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
293 export.addClickHandler(new ClickHandler() { |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
294 public void onClick(ClickEvent event) { |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
295 //create KML file |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
296 createKMLFile(); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
297 } |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
298 }); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
299 export.addStyleName("export"); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
300 export.setTitle(textConstants.exportDataSet()); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
301 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
302 Image delete = new Image(constants.deleteImage()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
303 delete.addClickHandler(new ClickHandler() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
304 public void onClick(ClickEvent event) { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
305 core.deleteDataSet(index); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
306 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
307 }); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
308 delete.addStyleName("delete"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
309 delete.setTitle(textConstants.deleteDataSet()); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
310 |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
311 Grid func = new Grid(1,3); |
27
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
312 |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
313 func.setWidget(0, 0, aDownloadKML); |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
314 func.setWidget(0, 1, export); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
315 func.setWidget(0, 2, delete); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
316 func.addStyleName("center"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
317 |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
318 this.elementsTable = new CellTable<DataObject>(); |
64
aa1808d94d80
Make table always take 100% width, so page switches don't alter the layout
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
59
diff
changeset
|
319 elementsTable.getElement().getStyle().setWidth(100, Unit.PCT); |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
320 dataProvider = new ListDataProvider<DataObject>(); |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
321 dataProvider.addDataDisplay(this.elementsTable); |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
322 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
323 ArrayList<ColumnAndName> nameplaceColumnList = new ArrayList<ColumnAndName>(); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
324 |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
325 TextColumn<DataObject> nameColumn = new TextColumn<DataObject>() { |
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
326 @Override |
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
327 public String getValue(DataObject object) { |
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
328 return object.getName(); |
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
329 } |
59
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
330 }; |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
331 nameColumn.setSortable(true); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
332 nameplaceColumnList.add(new ColumnAndName(nameColumn, "Name")); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
333 |
51
5d401f5c6433
Added place and description column
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
334 TextColumn<DataObject> placeColumn = new TextColumn<DataObject>() { |
5d401f5c6433
Added place and description column
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
335 @Override |
5d401f5c6433
Added place and description column
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
336 public String getValue(DataObject object) { |
5d401f5c6433
Added place and description column
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
337 return object.getPlace(); |
5d401f5c6433
Added place and description column
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
338 } |
59
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
339 }; |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
340 placeColumn.setSortable(true); |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
341 nameplaceColumnList.add(new ColumnAndName(placeColumn, "Place")); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
342 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
343 columns.add(nameplaceColumnList); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
344 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
345 ArrayList<ColumnAndName> descriptionColumnList = new ArrayList<ColumnAndName>(); |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
346 |
69
ea856995abac
Allow HTML in Description field
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
347 SafeHtmlCell descriptionCell = new SafeHtmlCell(); |
ea856995abac
Allow HTML in Description field
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
348 |
ea856995abac
Allow HTML in Description field
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
349 Column<DataObject, SafeHtml> descriptionColumn = new Column<DataObject, SafeHtml>(descriptionCell) { |
51
5d401f5c6433
Added place and description column
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
350 @Override |
69
ea856995abac
Allow HTML in Description field
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
351 public SafeHtml getValue(DataObject object) { |
ea856995abac
Allow HTML in Description field
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
352 SafeHtmlBuilder sb = new SafeHtmlBuilder(); |
ea856995abac
Allow HTML in Description field
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
353 sb.appendHtmlConstant(object.getDescription()); |
ea856995abac
Allow HTML in Description field
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
68
diff
changeset
|
354 return sb.toSafeHtml(); |
51
5d401f5c6433
Added place and description column
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
48
diff
changeset
|
355 } |
59
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
356 }; |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
357 descriptionColumn.setSortable(true); |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
358 descriptionColumnList.add(new ColumnAndName(descriptionColumn, "Description")); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
359 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
360 columns.add(descriptionColumnList); |
68
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
361 |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
362 SimplePager pager = new SimplePager(); |
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
363 pager.setDisplay(this.elementsTable); |
54
5c51a488c822
fix: add missing refresh of highlights on range change of table
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
53
diff
changeset
|
364 |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
365 dataProvider.setList(this.actualObjectSet); |
58
39b4d5d590ba
Add comment for page change handler. (Redrawing of colors)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
57
diff
changeset
|
366 |
59
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
367 //The actual (at this time lexicographical) sorting routine. |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
368 ListHandler<DataObject> columnSortHandler = new ListHandler<econnect.wp3_3.client.core.DataObject>(dataProvider.getList()); |
68
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
369 |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
370 ArrayList<ColumnAndName> descriptionDataColumnList = new ArrayList<ColumnAndName>(); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
371 |
68
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
372 JsArrayString descriptionDataColumns = this.dataSet.getDescriptionDataColumns(); |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
373 for (int i = 0; i < descriptionDataColumns.length(); i++) { |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
374 final String columnName = descriptionDataColumns.get(i); |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
375 |
71
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
69
diff
changeset
|
376 SafeHtmlCell htmlCell = new SafeHtmlCell(); |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
69
diff
changeset
|
377 |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
69
diff
changeset
|
378 Column<DataObject, SafeHtml> column = new Column<DataObject, SafeHtml>(htmlCell) { |
68
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
379 @Override |
71
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
69
diff
changeset
|
380 public SafeHtml getValue(DataObject object) { |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
69
diff
changeset
|
381 SafeHtmlBuilder sb = new SafeHtmlBuilder(); |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
69
diff
changeset
|
382 sb.appendHtmlConstant(object.getDescriptionData(columnName)); |
a610b45d0f90
Allow HTML in all Cells
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
69
diff
changeset
|
383 return sb.toSafeHtml(); |
68
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
384 } |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
385 }; |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
386 |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
387 column.setSortable(true); |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
388 |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
389 columnSortHandler.setComparator(column, |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
390 new Comparator<econnect.wp3_3.client.core.DataObject>() { |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
391 public int compare(econnect.wp3_3.client.core.DataObject o1, econnect.wp3_3.client.core.DataObject o2) { |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
392 if (o1 == o2) |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
393 return 0; |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
394 |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
395 if (o1 != null) |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
396 return (o2 != null) ? o1.getDescriptionData(columnName).compareTo(o2.getDescriptionData(columnName)) : 1; |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
397 |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
398 return -1; |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
399 } |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
400 }); |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
401 |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
402 descriptionDataColumnList.add(new ColumnAndName(column, columnName)); |
68
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
403 } |
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
404 |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
405 columns.add(descriptionDataColumnList); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
406 |
59
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
407 columnSortHandler.setComparator(nameColumn, |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
408 new Comparator<econnect.wp3_3.client.core.DataObject>() { |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
409 public int compare(econnect.wp3_3.client.core.DataObject o1, econnect.wp3_3.client.core.DataObject o2) { |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
410 if (o1 == o2) |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
411 return 0; |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
412 |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
413 if (o1 != null) |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
414 return (o2 != null) ? o1.getName().compareTo(o2.getName()) : 1; |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
415 |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
416 return -1; |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
417 } |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
418 }); |
68
8b58d9bc0bb6
add functionality for additional tabular data from the description field (work in progress)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
64
diff
changeset
|
419 |
59
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
420 columnSortHandler.setComparator(placeColumn, |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
421 new Comparator<econnect.wp3_3.client.core.DataObject>() { |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
422 public int compare(econnect.wp3_3.client.core.DataObject o1, econnect.wp3_3.client.core.DataObject o2) { |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
423 if (o1 == o2) |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
424 return 0; |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
425 |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
426 if (o1 != null) |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
427 return (o2 != null) ? o1.getPlace().compareTo(o2.getPlace()) : 1; |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
428 |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
429 return -1; |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
430 } |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
431 }); |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
432 columnSortHandler.setComparator(descriptionColumn, |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
433 new Comparator<econnect.wp3_3.client.core.DataObject>() { |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
434 public int compare(econnect.wp3_3.client.core.DataObject o1, econnect.wp3_3.client.core.DataObject o2) { |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
435 if (o1 == o2) |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
436 return 0; |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
437 |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
438 if (o1 != null) |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
439 return (o2 != null) ? o1.getDescription().compareTo(o2.getDescription()) : 1; |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
440 |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
441 return -1; |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
442 } |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
443 }); |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
444 this.elementsTable.addColumnSortHandler(columnSortHandler); |
3a7691d29566
Sorting of the columns in the CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
58
diff
changeset
|
445 |
58
39b4d5d590ba
Add comment for page change handler. (Redrawing of colors)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
57
diff
changeset
|
446 //Redraw row colors on page change |
54
5c51a488c822
fix: add missing refresh of highlights on range change of table
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
53
diff
changeset
|
447 this.elementsTable.addRangeChangeHandler(new RangeChangeEvent.Handler(){ |
5c51a488c822
fix: add missing refresh of highlights on range change of table
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
53
diff
changeset
|
448 public void onRangeChange(RangeChangeEvent event){ |
5c51a488c822
fix: add missing refresh of highlights on range change of table
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
53
diff
changeset
|
449 updateView(false); |
5c51a488c822
fix: add missing refresh of highlights on range change of table
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
53
diff
changeset
|
450 } |
5c51a488c822
fix: add missing refresh of highlights on range change of table
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
53
diff
changeset
|
451 }); |
40
20eb7596d466
Preparation for a switch to a CellTable.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
30
diff
changeset
|
452 |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
453 //this variable is set to 0 at the top |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
454 //so it (should) show name + place column |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
455 switchTableLayout(currentlyVisibleView); |
55
08ae8b6d627f
Set column width of CellTable. So they always fill up 100% and page changes dont alter the layout.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
54
diff
changeset
|
456 |
57
cd79dc467688
Add comment for highlighting code
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
457 //This handler adds the hover-functionality to the table, |
cd79dc467688
Add comment for highlighting code
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
55
diff
changeset
|
458 //basically highlighting of rows (and in the map/timeplot) |
52
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
459 this.elementsTable.addCellPreviewHandler(new Handler<DataObject>() |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
460 { |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
461 //@Override |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
462 public void onCellPreview( |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
463 CellPreviewEvent<DataObject> event) |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
464 { |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
465 boolean wasChanged = false; |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
466 |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
467 if ("mouseover".equals(event.getNativeEvent().getType())) { |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
468 DataObject hoveredObject = event.getValue(); |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
469 |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
470 if (!hoveredObject.getHover()){ |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
471 hoveredObject.setHover(true); |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
472 |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
473 wasChanged = true; |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
474 } |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
475 } |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
476 else if ("mouseout".equals(event.getNativeEvent().getType())) { |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
477 DataObject hoveredObject = event.getValue(); |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
478 |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
479 if (hoveredObject.getHover()){ |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
480 hoveredObject.setHover(false); |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
481 |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
482 wasChanged = true; |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
483 } |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
484 } |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
485 else if ("click".equals(event.getNativeEvent().getType())) { |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
486 DataObject clickedObject = event.getValue(); |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
487 |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
488 if (clickedObject.getPercentage() > 0){ |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
489 clickedObject.setPercentage(0); |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
490 |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
491 } else { |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
492 clickedObject.setPercentage(1); |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
493 } |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
494 |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
495 wasChanged = true; |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
496 } |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
497 |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
498 if (wasChanged) { |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
499 updateView(true); |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
500 core.updateTimeAndMap(); |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
501 } |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
502 } |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
503 }); |
cde4a01e9fa8
mouse events (over/out/click) for table rows
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
51
diff
changeset
|
504 |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
505 this.setWidget(1, 0, this.elementsTable); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
506 |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
507 Grid tableControls = new Grid(1,5); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
508 tableControls.setWidget(0,0,showOptions); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
509 tableControls.setWidget(0,1,refine); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
510 tableControls.setWidget(0,2,this.results); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
511 tableControls.setWidget(0,3,pager); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
512 tableControls.setWidget(0,4,func); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
513 tableControls.setStyleName("tableControls"); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
514 |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
515 this.setWidget(0, 0, tableControls); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
516 |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
517 tableControls.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
518 |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
519 this.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
520 this.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_CENTER); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
521 this.getCellFormatter().setWidth(1, 0, "100%"); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
522 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
523 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
524 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
525 * Sets the actual object set; depends on the showAll and showSelected selection |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
526 * |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
527 * @return boolean value, if there are selected objects |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
528 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
529 private boolean setActualObjectSet(){ |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
530 |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
531 boolean dataSetWasEmpty = false; |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
532 |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
533 if( viewAll == -1 ){ |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
534 |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
535 this.actualObjectSet.clear(); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
536 |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
537 for( int i=0; i<this.dataSet.getObjects().length(); i++){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
538 DataObject object = this.dataSet.getObjects().get(i); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
539 if( object.isSelected() ){ |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
540 this.actualObjectSet.add(object); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
541 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
542 } |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
543 if( this.actualObjectSet.size() == 0 ){ |
30
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
544 //TODO: Wenn die derzeitige Auswahl _keine_ Elemente |
46
a8741feea7c6
fixed comment (charset issue)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
45
diff
changeset
|
545 //enthält, werden _alle_ angezeigt. Ist das sinnvoll? |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
546 dataSetWasEmpty = true; |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
547 this.viewAll = 1; |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
548 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
549 } |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
550 if( this.viewAll == 1 ){ |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
551 this.actualObjectSet.clear(); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
552 for( int i=0; i<this.dataSet.getObjects().length(); i++){ |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
553 this.actualObjectSet.add(this.dataSet.getObjects().get(i)); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
554 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
555 } |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
556 |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
557 //if the dataProvider already exists, refresh the |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
558 //displayed data |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
559 if (this.dataProvider != null) { |
44
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
560 |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
561 //refresh data |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
562 this.dataProvider.refresh(); |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
563 this.elementsTable.setRowCount(this.actualObjectSet.size()); |
44
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
564 |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
565 this.updateView(false); |
43
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
566 } |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
567 |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
568 if (dataSetWasEmpty) |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
569 return false; |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
570 else |
fad6fb60a2db
refining of data in CellTable
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
40
diff
changeset
|
571 return true; |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
572 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
573 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
574 /** |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
575 * Creates a (preliminary) KML file from the data in the current data set |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
576 */ |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
577 private void createKMLFile(){ |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
578 String kmlContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><kml xmlns=\"http://www.opengis.net/kml/2.2\"><Document>"; |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
579 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
580 for( int i=0; i<this.dataSet.getObjects().length(); i++){ |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
581 DataObject currentDataObject = this.dataSet.getObjects().get(i); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
582 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
583 String name = currentDataObject.getName(); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
584 String description = currentDataObject.getDescription(); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
585 String place = currentDataObject.getPlace(); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
586 String lat = currentDataObject.getLat(); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
587 String lon = currentDataObject.getLon(); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
588 String timeStamp = currentDataObject.getTimeStamp(); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
589 String timeSpanStart = currentDataObject.getTimeSpanStart(); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
590 String timeSpanEnd = currentDataObject.getTimeSpanEnd(); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
591 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
592 String kmlEntry = "<Placemark>"; |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
593 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
594 kmlEntry += "<name><![CDATA[" + name + "]]></name>"; |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
595 kmlEntry += "<address><![CDATA[" + place + "]]></address>"; |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
596 kmlEntry += "<description><![CDATA[" + description + "]]></description>"; |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
597 kmlEntry += "<Point><coordinates>" + lon + "," + lat + "</coordinates></Point>"; |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
598 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
599 if ( (timeStamp != null) && (timeStamp != "undefined") ) { |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
600 kmlEntry += "<TimeStamp><when>" + timeStamp + "</when></TimeStamp>"; |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
601 } else { |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
602 kmlEntry += "<TimeSpan><begin>" + timeSpanStart + "</begin><end>" + timeSpanEnd + "</end></TimeSpan>"; |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
603 } |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
604 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
605 kmlEntry += "</Placemark>"; |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
606 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
607 kmlContent += kmlEntry; |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
608 } |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
609 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
610 kmlContent += "</Document></kml>"; |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
611 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
612 exportWriter = GWT.create(ExportWriterInterface.class); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
613 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
614 exportWriter.writeKMLFile(kmlContent, |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
615 new AsyncCallback<String>() { |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
616 public void onFailure(Throwable caught) { |
76
731a2f32978c
Alert on KML export failure
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
74
diff
changeset
|
617 Window.alert("KML creation failed."); |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
618 } |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
619 public void onSuccess(String exportFileName) { |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
620 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
621 String url = GWT.getModuleBaseURL(); |
27
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
622 url = url + "ExportServlet?ExportedFilename=" + URL.encode(exportFileName); |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
623 |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
624 aDownloadKML.setHref(url); |
3184e8faa5c0
Anchor for KML download. This is a preliminiary work-around.
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
15
diff
changeset
|
625 aDownloadKML.setVisible(true); |
15
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
626 } |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
627 } |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
628 ); |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
629 } |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
630 |
175c1eecaf84
added export kml feature (not finished)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
3
diff
changeset
|
631 /** |
30
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
632 * Refines the currently selected dataset (table) by the search term entered. |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
633 * |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
634 */ |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
635 private void refineByText(String searchString){ |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
636 |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
637 String lowerCaseSearchString = searchString.toLowerCase(); |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
638 |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
639 for( int i=0; i<this.dataSet.getObjects().length(); i++){ |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
640 DataObject currentDataObject = this.dataSet.getObjects().get(i); |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
641 |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
642 String name = currentDataObject.getName(); |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
643 String description = currentDataObject.getDescription(); |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
644 String place = currentDataObject.getPlace(); |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
645 |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
646 if ( name.toLowerCase().contains(lowerCaseSearchString) || |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
647 description.toLowerCase().contains(lowerCaseSearchString) || |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
648 place.toLowerCase().contains(lowerCaseSearchString) ) |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
649 currentDataObject.setPercentage(1); |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
650 else |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
651 currentDataObject.setPercentage(0); |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
652 } |
1e95995ddbb2
re-added the ability to refine the dataset by a (very simple) text search
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
27
diff
changeset
|
653 |
44
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
654 updateView(false); |
53
0a3dca94458c
fix: add missing update of map and timeplot widget at refineText
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
52
diff
changeset
|
655 core.updateTimeAndMap(); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
656 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
657 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
658 /** |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
659 * Updates all cells of the actual page |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
660 * |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
661 * @param hover if there was a hover selection which caused to trigger this function |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
662 */ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
663 public void updateView(boolean hover){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
664 if( !hover && this.viewAll == -1 ){ |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
665 showSelected.removeStyleName("selectedView"); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
666 this.viewAll = 0; |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
667 } |
44
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
668 |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
669 //redraw colors of elements (selected/unselected) |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
670 int start = this.elementsTable.getVisibleRange().getStart(); |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
671 for (int i=0; i<this.elementsTable.getPageSize(); i++) { |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
672 |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
673 if ((start+i) >= dataProvider.getList().size()) |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
674 break; |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
675 |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
676 DataObject object = dataProvider.getList().get(start+i); |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
677 |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
678 boolean selected = object.isSelected(); |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
679 if (hover) |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
680 selected = object.getHover(); |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
681 |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
682 double percentage = (new Double(object.getPercentage()).doubleValue()); |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
683 String borderColor = StiCore.getBorderColor(this.index,selected); |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
684 String cellColor = StiCore.getCellColor(this.index,percentage); |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
685 |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
686 //TODO: das RowElement ist ein TR. Das hat kein Border, weswegen es |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
687 //auch keine Farbe bekommt. Erst einmal allen sub-Elementen die |
47
e86fc5c5d386
comment: added explanation
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
46
diff
changeset
|
688 //border-Color geben. Das sollte verbessert werden, da DOM-Iterieren |
e86fc5c5d386
comment: added explanation
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
46
diff
changeset
|
689 //langsam ist. |
44
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
690 |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
691 NodeList<TableCellElement> cells = this.elementsTable.getRowElement(i).getCells(); |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
692 |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
693 for (int cellIndex=0; cellIndex < cells.getLength(); cellIndex++){ |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
694 cells.getItem(cellIndex).getStyle().setBorderColor(borderColor); |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
695 } |
44
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
696 |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
697 this.elementsTable.getRowElement(i).getStyle().setBorderColor(borderColor); |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
698 this.elementsTable.getRowElement(i).getStyle().setBackgroundColor(cellColor); |
5db587ba4b0f
background and border color of CellTable for selection and hover
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
43
diff
changeset
|
699 } |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
700 } |
74
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
701 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
702 /** |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
703 * Switches between the different "kinds" of table layouts |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
704 * This function will cycle through the available layouts |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
705 */ |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
706 public void switchTableLayout() { |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
707 this.currentlyVisibleView++; |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
708 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
709 if (this.currentlyVisibleView >= this.columns.size()) |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
710 currentlyVisibleView = 0; |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
711 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
712 switchTableLayout(this.currentlyVisibleView); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
713 } |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
714 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
715 /** |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
716 * Switches to a certain "kind" of table layout |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
717 * @layputType hover if there was a hover selection which caused to trigger this function |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
718 */ |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
719 public void switchTableLayout(int layputType) { |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
720 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
721 while (this.elementsTable.getColumnCount() > 0 ) { |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
722 this.elementsTable.removeColumn(0); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
723 } |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
724 |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
725 for ( ColumnAndName column : this.columns.get(layputType)) { |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
726 this.elementsTable.addColumn(column.column, column.name); |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
727 } |
caca95f925cc
Add switchable "views" to the CellTable (sets of Columns)
Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
parents:
71
diff
changeset
|
728 } |
3
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
729 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
730 public String getTermIdentifier() { |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
731 return this.dataSet.getTermIdentifier(); |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
732 } |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
733 |
cf06b77a8bbd
Committed branch of the e4D repos sti-gwt branch 16384.
StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
parents:
diff
changeset
|
734 } |