annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/FLYSWorkspace.java @ 5861:172338b1407f

GWT client: Added copyright header.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 28 Apr 2013 14:30:15 +0200
parents 5aa05a7a34b7
children ea9eef426962
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
6 * documentation coming with Dive4Elements River for details.
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.client.ui;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
4128
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
11 import com.google.gwt.core.client.GWT;
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
12
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
13 import com.smartgwt.client.types.Alignment;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
14 import com.smartgwt.client.types.VerticalAlignment;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
15 import com.smartgwt.client.widgets.Button;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import com.smartgwt.client.widgets.Canvas;
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
17 import com.smartgwt.client.widgets.Img;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
18 import com.smartgwt.client.widgets.Label;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
19 import com.smartgwt.client.widgets.events.ClickEvent;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
20 import com.smartgwt.client.widgets.events.ClickHandler;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
21 import com.smartgwt.client.widgets.layout.HLayout;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
22 import com.smartgwt.client.widgets.layout.VLayout;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
23
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
24 import org.dive4elements.river.client.client.FLYS;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
25 import org.dive4elements.river.client.client.FLYSConstants;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
27 import java.util.HashMap;
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
28 import java.util.Map;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31 /**
3549
6a8f83c538e3 Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3522
diff changeset
32 * "Workspace" canvas showing the CollectionViews (subwindows).
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 */
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 public class FLYSWorkspace extends Canvas {
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
279
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
37 /** The maximal number of windows that fit into the browser view when an
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
38 * offset is used to move windows initially.*/
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
39 public static int MAX_WINDOWS = 10;
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
40
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
41 /** The number of pixels used to move windows.*/
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
42 public static int WINDOW_OFFSET = 20;
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
43
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 /** A map that contains the open CollectionViews. */
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
45 protected Map<String, CollectionView> views;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
47 /** The interface that provides the message resources. */
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
48 private FLYSConstants MESSAGES = GWT.create(FLYSConstants.class);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
49
4980
e70ff0a600a3 flys-client: Whitespace and doc cosemtics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4657
diff changeset
50 /** Application instance. */
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
51 private FLYS flys;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52
4980
e70ff0a600a3 flys-client: Whitespace and doc cosemtics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4657
diff changeset
53
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 /**
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 * The default constructor creates an empty FLYSWorkspace with no
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 * CollectionViews opened.
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 */
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
58 public FLYSWorkspace(FLYS flys) {
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
59 this.flys = flys;
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
60 views = new HashMap<String, CollectionView>();
3522
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
61
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
62 setWidth("100%");
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
63 setHeight("100%");
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
64
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
65 addBackgroundWorkspace();
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 }
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 /**
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 * This method adds a new CollectionView to this workspace and stores a
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 * reference in {@link views}.
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 *
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 * @param collectionView A new CollectionView.
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 */
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
75 public void addView(String uuid, CollectionView collectionView) {
3522
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
76 collectionView.moveTo(0, 0);
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
77 collectionView.setMaximized(true);
279
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
78
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
79 views.put(uuid, collectionView);
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 addChild(collectionView);
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 }
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
82
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
83
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
84 public void removeProject(String uuid) {
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
85 views.remove(uuid);
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
86 }
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
87
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
88
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
89 public void bringUp(String uuid) {
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
90 CollectionView view = views.get(uuid);
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
91
4128
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
92 if (view != null) {
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
93 view.show();
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
94 view.restore();
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
95 }
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
96 else {
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
97 GWT.log("FLYSWorkspace.bringUp() failed!");
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
98 }
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
99 }
600
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
100
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
101
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
102 /**
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
103 * Removes a project from workspace (view) and clears its reference from
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
104 * hash map.
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
105 *
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
106 * @param uuid The project's uuid.
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
107 */
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
108 public void destroyProject(String uuid) {
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
109 CollectionView project = views.get(uuid);
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
110
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
111 if (project != null) {
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
112 removeProject(uuid);
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
113 project.destroy();
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
114 }
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
115 }
895
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
116
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
117
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
118 public void updateTitle(String uuid, String title) {
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
119 CollectionView view = views.get(uuid);
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
120 view.setTitle(title);
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
121 }
896
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
122
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
123
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
124 public boolean hasView(String uuid) {
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
125 if(views.get(uuid) != null) {
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
126 return true;
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
127 }
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
128 return false;
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
129 }
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
130
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
131 private void addBackgroundWorkspace() {
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
132 String baseUrl = GWT.getHostPageBaseURL();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
133 Img bfg = new Img(
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
134 baseUrl + MESSAGES.bfgLogo());
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
135 bfg.setWidth(150);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
136 bfg.setHeight(100);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
137 bfg.setLayoutAlign(Alignment.RIGHT);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
138
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
139 HLayout backgroundlayout = new HLayout();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
140 backgroundlayout.setHeight100();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
141 backgroundlayout.setWidth100();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
142 backgroundlayout.setDefaultLayoutAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
143 backgroundlayout.setDefaultLayoutAlign(VerticalAlignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
144
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
145 Canvas spacer = new Canvas();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
146 spacer.setWidth("33%");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
147
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
148 VLayout infobox = new VLayout();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
149 infobox.setHeight("*");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
150 infobox.setWidth("*");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
151 infobox.setDefaultLayoutAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
152
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
153 Label welcome = new Label(MESSAGES.welcome());
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
154 welcome.setAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
155 welcome.setStyleName("fontNormalBig");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
156
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
157 Label lcreate = new Label(MESSAGES.welcome_open_or_create());
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
158 lcreate.setStyleName("welcomeCreateText");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
159 lcreate.setWidth100();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
160 lcreate.setAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
161
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
162 Button addbutton = new Button(MESSAGES.new_project());
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
163 addbutton.setStyleName("projectsAddButton");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
164 addbutton.setAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
165 addbutton.setTitle(MESSAGES.new_project());
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
166 addbutton.setAutoFit(true);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
167 addbutton.addClickHandler(new ClickHandler() {
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
168
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
169 @Override
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
170 public void onClick(ClickEvent event) {
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
171 flys.newProject();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
172 }
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
173 });
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
174
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
175
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
176 infobox.addMember(welcome);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
177 infobox.addMember(lcreate);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
178 infobox.addMember(addbutton);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
179
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
180 backgroundlayout.addMember(spacer);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
181 backgroundlayout.addMember(infobox);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
182 backgroundlayout.addMember(spacer);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
183
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
184 addChild(backgroundlayout);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
185 }
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
186 }
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
187 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org