Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java @ 225:9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
flys-client/trunk@1670 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 12 Apr 2011 11:01:09 +0000 |
parents | 35094660f91a |
children | a13382876e5d |
comparison
equal
deleted
inserted
replaced
224:a4a68b4ee2a3 | 225:9040663aee01 |
---|---|
21 import de.intevation.flys.client.shared.model.Collection; | 21 import de.intevation.flys.client.shared.model.Collection; |
22 import de.intevation.flys.client.shared.model.CollectionRecord; | 22 import de.intevation.flys.client.shared.model.CollectionRecord; |
23 import de.intevation.flys.client.shared.model.User; | 23 import de.intevation.flys.client.shared.model.User; |
24 | 24 |
25 import de.intevation.flys.client.client.Config; | 25 import de.intevation.flys.client.client.Config; |
26 import de.intevation.flys.client.client.FLYS; | |
26 import de.intevation.flys.client.client.FLYSConstants; | 27 import de.intevation.flys.client.client.FLYSConstants; |
27 import de.intevation.flys.client.client.event.CollectionChangeEvent; | 28 import de.intevation.flys.client.client.event.CollectionChangeEvent; |
28 import de.intevation.flys.client.client.event.CollectionChangeHandler; | 29 import de.intevation.flys.client.client.event.CollectionChangeHandler; |
29 import de.intevation.flys.client.client.services.UserCollectionsService; | 30 import de.intevation.flys.client.client.services.UserCollectionsService; |
30 import de.intevation.flys.client.client.services.UserCollectionsServiceAsync; | 31 import de.intevation.flys.client.client.services.UserCollectionsServiceAsync; |
44 | 45 |
45 /** The UserService used to retrieve information about the current user. */ | 46 /** The UserService used to retrieve information about the current user. */ |
46 protected UserCollectionsServiceAsync userCollectionsService = | 47 protected UserCollectionsServiceAsync userCollectionsService = |
47 GWT.create(UserCollectionsService.class); | 48 GWT.create(UserCollectionsService.class); |
48 | 49 |
50 /** A pointer to the FLYS instance.*/ | |
51 protected FLYS flys; | |
52 | |
49 /** The user whose projects should be displayed.*/ | 53 /** The user whose projects should be displayed.*/ |
50 protected User user; | 54 protected User user; |
51 | 55 |
52 /** The grid that contains the project rows.*/ | 56 /** The grid that contains the project rows.*/ |
53 protected ListGrid grid; | 57 protected ListGrid grid; |
56 * The default constructor that creates a new ProjectList for a specific | 60 * The default constructor that creates a new ProjectList for a specific |
57 * user. | 61 * user. |
58 * | 62 * |
59 * @param user The user. | 63 * @param user The user. |
60 */ | 64 */ |
61 public ProjectList(User user) { | 65 public ProjectList(FLYS flys, User user) { |
66 this.flys = flys; | |
62 this.user = user; | 67 this.user = user; |
63 | 68 |
64 grid = new CollectionGrid(); | 69 grid = new CollectionGrid(); |
65 initGrid(); | 70 initGrid(); |
66 init(); | 71 init(); |
96 menu.showContextMenu(); | 101 menu.showContextMenu(); |
97 | 102 |
98 event.cancel(); | 103 event.cancel(); |
99 } | 104 } |
100 }); | 105 }); |
106 } | |
107 | |
108 | |
109 public FLYS getFlys() { | |
110 return flys; | |
101 } | 111 } |
102 | 112 |
103 | 113 |
104 /** | 114 /** |
105 * Creates a new context menu that interacts with a CollectionRecord. | 115 * Creates a new context menu that interacts with a CollectionRecord. |
113 Menu menu = new Menu(); | 123 Menu menu = new Menu(); |
114 | 124 |
115 MenuItem open = new MenuItem(messages.open_project()); | 125 MenuItem open = new MenuItem(messages.open_project()); |
116 open.addClickHandler(new ClickHandler() { | 126 open.addClickHandler(new ClickHandler() { |
117 public void onClick(MenuItemClickEvent evt) { | 127 public void onClick(MenuItemClickEvent evt) { |
118 SC.say("Open project: " + record.getName()); | 128 getFlys().openProject(record.getCollection().identifier()); |
119 } | 129 } |
120 }); | 130 }); |
121 | 131 |
122 MenuItem del = new MenuItem(messages.delete_project()); | 132 MenuItem del = new MenuItem(messages.delete_project()); |
123 del.addClickHandler(new ClickHandler() { | 133 del.addClickHandler(new ClickHandler() { |