Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSWorkspace.java @ 5462:f2371f3aaf03
Show top level folder icons only if node has no factory
If you have an empty folder the folder icon is still shown.
This makes it possible to add functional "Top Level" entries
in the Datacage
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Tue, 26 Mar 2013 18:29:13 +0100 |
parents | e70ff0a600a3 |
children |
rev | line source |
---|---|
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
|
1 package de.intevation.flys.client.client.ui; |
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
|
2 |
4128
11c589d68f13
Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents:
3549
diff
changeset
|
3 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
|
4 |
4607
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
5 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
|
6 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
|
7 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
|
8 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
|
9 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
|
10 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
|
11 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
|
12 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
|
13 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
|
14 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
|
15 |
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
16 import de.intevation.flys.client.client.FLYS; |
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
17 import de.intevation.flys.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
|
18 |
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
|
19 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
|
20 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
|
21 |
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
|
22 |
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
|
23 /** |
3549
6a8f83c538e3
Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3522
diff
changeset
|
24 * "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
|
25 * @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
|
26 */ |
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
|
27 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
|
28 |
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
|
29 /** 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
|
30 * 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
|
31 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
|
32 |
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
|
33 /** 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
|
34 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
|
35 |
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
|
36 /** 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
|
37 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
|
38 |
4607
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
39 /** 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
|
40 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
|
41 |
4980
e70ff0a600a3
flys-client: Whitespace and doc cosemtics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4657
diff
changeset
|
42 /** Application instance. */ |
4607
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
43 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
|
44 |
4980
e70ff0a600a3
flys-client: Whitespace and doc cosemtics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4657
diff
changeset
|
45 |
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 /** |
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
|
47 * 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
|
48 * 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
|
49 */ |
4607
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
50 public FLYSWorkspace(FLYS flys) { |
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
51 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
|
52 views = new HashMap<String, CollectionView>(); |
3522
6eeacd0bbe26
New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents:
896
diff
changeset
|
53 |
6eeacd0bbe26
New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents:
896
diff
changeset
|
54 setWidth("100%"); |
6eeacd0bbe26
New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents:
896
diff
changeset
|
55 setHeight("100%"); |
4607
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
56 |
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
57 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
|
58 } |
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
|
59 |
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
|
60 |
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
|
61 /** |
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
|
62 * 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
|
63 * 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
|
64 * |
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 * @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
|
66 */ |
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
|
67 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
|
68 collectionView.moveTo(0, 0); |
6eeacd0bbe26
New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents:
896
diff
changeset
|
69 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
|
70 |
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
|
71 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
|
72 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
|
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 |
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 |
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
|
76 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
|
77 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
|
78 } |
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 |
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
|
80 |
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 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
|
82 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
|
83 |
4128
11c589d68f13
Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents:
3549
diff
changeset
|
84 if (view != null) { |
11c589d68f13
Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents:
3549
diff
changeset
|
85 view.show(); |
11c589d68f13
Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents:
3549
diff
changeset
|
86 view.restore(); |
11c589d68f13
Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents:
3549
diff
changeset
|
87 } |
11c589d68f13
Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents:
3549
diff
changeset
|
88 else { |
11c589d68f13
Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents:
3549
diff
changeset
|
89 GWT.log("FLYSWorkspace.bringUp() failed!"); |
11c589d68f13
Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents:
3549
diff
changeset
|
90 } |
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
|
91 } |
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
|
92 |
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
|
93 |
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
|
94 /** |
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
|
95 * 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
|
96 * 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
|
97 * |
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
|
98 * @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
|
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 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
|
101 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
|
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 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
|
104 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
|
105 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
|
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 } |
895
9acbd3f98262
Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
600
diff
changeset
|
108 |
9acbd3f98262
Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
600
diff
changeset
|
109 |
9acbd3f98262
Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
600
diff
changeset
|
110 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
|
111 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
|
112 view.setTitle(title); |
9acbd3f98262
Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
600
diff
changeset
|
113 } |
896
fe23bbf0ea11
Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
895
diff
changeset
|
114 |
fe23bbf0ea11
Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
895
diff
changeset
|
115 |
fe23bbf0ea11
Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
895
diff
changeset
|
116 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
|
117 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
|
118 return true; |
fe23bbf0ea11
Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
895
diff
changeset
|
119 } |
fe23bbf0ea11
Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
895
diff
changeset
|
120 return false; |
fe23bbf0ea11
Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
895
diff
changeset
|
121 } |
4607
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
122 |
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
123 private void addBackgroundWorkspace() { |
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
124 String baseUrl = GWT.getHostPageBaseURL(); |
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
125 Img bfg = new Img( |
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
126 baseUrl + MESSAGES.bfgLogo()); |
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
127 bfg.setWidth(150); |
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
128 bfg.setHeight(100); |
c0a275c581fb
Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4128
diff
changeset
|
129 bfg.setLayoutAlign(Alignment.RIGHT); |
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 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 : |