annotate gwt-client/src/main/java/org/dive4elements/river/client/client/ui/FLYSWorkspace.java @ 9801:1d7a72a50183 3.2.x tip

Assume Compose V2, consistently
author Tom Gottfried <tom@intevation.de>
date Thu, 23 Nov 2023 10:14:13 +0100
parents 7df65516ee8b
children
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 *
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5861
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
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
6 * documentation coming with Dive4Elements River for details.
5861
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.Label;
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.events.ClickEvent;
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.ClickHandler;
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.layout.HLayout;
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.VLayout;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
22
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
23 import org.dive4elements.river.client.client.FLYS;
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
24 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
25
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
26 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
27 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
28
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 /**
3549
6a8f83c538e3 Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3522
diff changeset
31 * "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
32 * @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
33 */
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 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
35
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
36 /** 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
37 * 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
38 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
39
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 /** 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
41 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
42
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
43 /** 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
44 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
45
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
46 /** 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
47 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
48
4980
e70ff0a600a3 flys-client: Whitespace and doc cosemtics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4657
diff changeset
49 /** Application instance. */
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
50 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
51
4980
e70ff0a600a3 flys-client: Whitespace and doc cosemtics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4657
diff changeset
52
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
53 /**
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 * 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
55 * 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
56 */
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
57 public FLYSWorkspace(FLYS flys) {
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
58 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
59 views = new HashMap<String, CollectionView>();
3522
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
60
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
61 setWidth("100%");
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
62 setHeight("100%");
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
63
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
64 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
65 }
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 * 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
70 * 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
71 *
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 * @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
73 */
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
74 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
75 collectionView.moveTo(0, 0);
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
76 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
77
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
78 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
79 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
80 }
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
81
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 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
84 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
85 }
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 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
89 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
90
4128
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
91 if (view != null) {
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
92 view.show();
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
93 view.restore();
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
94 }
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
95 else {
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
96 GWT.log("FLYSWorkspace.bringUp() failed!");
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
97 }
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
98 }
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
99
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 * 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
103 * 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
104 *
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 * @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
106 */
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 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
108 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
109
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 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
111 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
112 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
113 }
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 }
895
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
115
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 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
118 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
119 view.setTitle(title);
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
120 }
896
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
121
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 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
124 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
125 return true;
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
126 }
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
127 return false;
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
128 }
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
129
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
130 private void addBackgroundWorkspace() {
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
131 HLayout backgroundlayout = new HLayout();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
132 backgroundlayout.setHeight100();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
133 backgroundlayout.setWidth100();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
134 backgroundlayout.setDefaultLayoutAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
135 backgroundlayout.setDefaultLayoutAlign(VerticalAlignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
136
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
137 Canvas spacer = new Canvas();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
138 spacer.setWidth("33%");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
139
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
140 VLayout infobox = new VLayout();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
141 infobox.setHeight("*");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
142 infobox.setWidth("*");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
143 infobox.setDefaultLayoutAlign(Alignment.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 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
146 welcome.setAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
147 welcome.setStyleName("fontNormalBig");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
148
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
149 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
150 lcreate.setStyleName("welcomeCreateText");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
151 lcreate.setWidth100();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
152 lcreate.setAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
153
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
154 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
155 addbutton.setStyleName("projectsAddButton");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
156 addbutton.setAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
157 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
158 addbutton.setAutoFit(true);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
159 addbutton.addClickHandler(new ClickHandler() {
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
160
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
161 @Override
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
162 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
163 flys.newProject();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
164 }
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
165 });
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
166
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
167
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
168 infobox.addMember(welcome);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
169 infobox.addMember(lcreate);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
170 infobox.addMember(addbutton);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
171
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
172 backgroundlayout.addMember(spacer);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
173 backgroundlayout.addMember(infobox);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
174 backgroundlayout.addMember(spacer);
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 addChild(backgroundlayout);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
177 }
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
178 }
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
179 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org