annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java @ 1295:d9cb362b8b34

Removed superfluous imports. flys-client/trunk@2910 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 10 Oct 2011 06:42:28 +0000
parents bdc270ea6195
children a95e82d6bcc1
rev   line source
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.client.ui.chart;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import com.google.gwt.core.client.GWT;
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
4 import com.google.gwt.user.client.rpc.AsyncCallback;
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 import com.smartgwt.client.types.ListGridFieldType;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import com.smartgwt.client.widgets.grid.ListGridField;
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import com.smartgwt.client.widgets.layout.VLayout;
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
9 import com.smartgwt.client.widgets.grid.events.RowContextClickEvent;
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
10 import com.smartgwt.client.widgets.grid.events.RowContextClickHandler;
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
11 import com.smartgwt.client.widgets.menu.Menu;
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
12 import com.smartgwt.client.widgets.menu.MenuItem;
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
13 import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
14 import com.smartgwt.client.widgets.menu.events.ClickHandler;
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import de.intevation.flys.client.shared.model.Collection;
524
ba238f917b94 The theme list information stored in the attribute of a collection is read and added in form of Themes and ThemeLists to the Collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 523
diff changeset
17 import de.intevation.flys.client.shared.model.Theme;
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 804
diff changeset
18 import de.intevation.flys.client.shared.model.OutputMode;
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
19 import de.intevation.flys.client.shared.model.FacetRecord;
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
20 import de.intevation.flys.client.shared.model.CollectionItemAttribute;
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 import de.intevation.flys.client.client.FLYSConstants;
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 804
diff changeset
23 import de.intevation.flys.client.client.ui.ThemePanel;
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
24 import de.intevation.flys.client.client.Config;
1287
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
25 import de.intevation.flys.client.client.ui.CollectionView;
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26
854
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
27 import de.intevation.flys.client.client.services.FeedService;
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
28 import de.intevation.flys.client.client.services.FeedServiceAsync;
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
29 import de.intevation.flys.client.client.services.CollectionItemAttributeService;
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
30 import de.intevation.flys.client.client.services.CollectionItemAttributeServiceAsync;
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 /**
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 */
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 804
diff changeset
35 public class ChartThemePanel extends ThemePanel {
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 804
diff changeset
36
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 /** The interface that provides i18n messages. */
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
38 protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
526
96e60e0a4345 Added a service stub to update/modify the attribute of a collection (used in the theme control panel).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 524
diff changeset
39
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
40 /** The collection */
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
41 protected Collection collection;
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
42
1287
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
43 /** The collection view*/
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
44 protected CollectionView view;
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
45
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
46 /** The service used to get collection item attributes. */
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
47 protected CollectionItemAttributeServiceAsync itemAttributeService =
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
48 GWT.create(CollectionItemAttributeService.class);
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
49
854
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
50 public static final String GRID_FIELD_ACTIVE = "active";
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
51 public static final String GRID_FIELD_NAME = "name";
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
52 public static final String GRID_FIELD_ACTIONS = "actions";
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53
854
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
54 FeedServiceAsync feedService = GWT.create(
67c678903280 Refactored to allow specialized controls within the ChartThemePanel, stubby
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 805
diff changeset
55 de.intevation.flys.client.client.services.FeedService.class);
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 public ChartThemePanel(Collection collection, OutputMode mode) {
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 804
diff changeset
58 super(collection, mode);
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
59 this.collection = collection;
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 initGrid();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 initLayout();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 updateGrid();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 }
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 /**
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 * Initializes the layout of this panel.
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 */
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 protected void initLayout() {
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 setWidth100();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 setHeight100();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 VLayout layout = new VLayout();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76 layout.setWidth100();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 layout.setHeight100();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 layout.addMember(list);
527
902609b5cc79 Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 526
diff changeset
80 layout.addMember(navigation);
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 addChild(layout);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 }
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 /**
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87 * Initializes the components (columns) of the theme grid.
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 */
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 protected void initGrid() {
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 list.setCanEdit(true);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 list.setCanSort(false);
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
92 list.setShowRecordComponents(false);
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93 list.setShowRecordComponentsByCell(true);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94 list.setShowHeader(true);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 list.setShowHeaderContextMenu(false);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96 list.setWidth100();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 list.setHeight100();
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99 list.addEditCompleteHandler(this);
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
100 list.addRowContextClickHandler(new RowContextClickHandler() {
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
101 public void onRowContextClick(RowContextClickEvent event) {
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
102 FacetRecord record = (FacetRecord) event.getRecord();
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
103
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
104 Menu menu = createContextMenu(record);
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
105 list.setContextMenu(menu);
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
106 menu.showContextMenu();
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
107
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
108 event.cancel();
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
109 }
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
110 });
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111
1288
17bff7b27052 Bugfix: #357 Removed header title of selection column.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1287
diff changeset
112 ListGridField active = new ListGridField(GRID_FIELD_ACTIVE, " ", 20);
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 active.setType(ListGridFieldType.BOOLEAN);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115 ListGridField name = new ListGridField(
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116 GRID_FIELD_NAME, MSG.chart_themepanel_header_themes());
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117 name.setType(ListGridFieldType.TEXT);
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118
858
9f07f67f60a5 Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 854
diff changeset
119 list.setFields(active, name);
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120 }
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
123 protected Menu createContextMenu(final FacetRecord record) {
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
124 Menu menu = new Menu();
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
125
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
126 MenuItem properties = new MenuItem(MSG.properties());
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
127 properties.addClickHandler(new ClickHandler() {
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
128 public void onClick(MenuItemClickEvent evt) {
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
129 GWT.log("clicked properties");
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
130 getItemAttributes(record);
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
131 }
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
132 });
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
133 menu.addItem(properties);
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
134 return menu;
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
135 }
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
136
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
137
805
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 804
diff changeset
138 @Override
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 804
diff changeset
139 public void activateTheme(Theme theme, boolean active) {
f43d06d6a4a2 Refactored code of theme panel and added a MapThemePanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 804
diff changeset
140 theme.setActive(active ? 1 : 0);
527
902609b5cc79 Added a navigation panel to the bottom of the theme control panel to move themes up/down (function not implemented yet).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 526
diff changeset
141 }
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
142
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
143
1292
bdc270ea6195 Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1288
diff changeset
144 protected void getItemAttributes(final FacetRecord record) {
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
145 Config config = Config.getInstance();
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
146 String url = config.getServerUrl();
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
147 String locale = config.getLocale();
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
148
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
149 String artifact = record.getTheme().getArtifact();
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
150
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
151 itemAttributeService.getCollectionItemAttribute(
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
152 this.collection,
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
153 artifact,
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
154 url,
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
155 locale,
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
156 new AsyncCallback<CollectionItemAttribute>() {
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
157 public void onFailure (Throwable caught) {
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
158 GWT.log("Could not get Collection item attributes.");
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
159 }
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
160 public void onSuccess(CollectionItemAttribute cia) {
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
161 GWT.log("Successfully loaded collectionitem attributes.");
1287
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
162 StyleEditorWindow win = new StyleEditorWindow(
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
163 collection,
1292
bdc270ea6195 Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1288
diff changeset
164 cia,
bdc270ea6195 Edited item attributes are saved and send to the server on accept.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1288
diff changeset
165 record);
1287
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
166 win.setCollectionView(view);
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
167 win.show();
1286
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
168 }
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
169 });
b643622d77fe Added context menu to themes list.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 891
diff changeset
170 }
1287
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
171
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
172
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
173 public void setCollectionView (CollectionView view) {
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
174 this.view = view;
95ecb98c6015 Added skeleton for editor window.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 1286
diff changeset
175 }
523
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
176 }
0785a8ba5e6d Implemented the first step of a theme control panel for charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
177 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org