Revision afd3a0ef

b/build.xml
85 85
		<pathelement location="${jboss.common.lib.dir}/ejb3-persistence.jar"/>
86 86
		<pathelement location="${jboss.common.lib.dir}/jboss-javaee.jar"/>
87 87
		<pathelement location="${jboss.common.lib.dir}/jbosssx.jar"/>
88
		<pathelement location="${jboss.common.lib.dir}/hibernate-core.jar"/>
88 89
		<pathelement location="${jboss.lib.dir}/jboss-j2se.jar"/>
89 90
		<pathelement location="${jboss.lib.dir}/jboss-kernel.jar"/>
90 91
		<pathelement location="${jboss.lib.dir}/jboss-system-jmx.jar"/>
......
95 96
		<pathelement location="${war.lib.dir}/commons-fileupload-1.2.jar"/>
96 97
		<pathelement location="${ear.lib.dir}/commons-lang.jar"/>
97 98
		<pathelement location="${junit.path}/junit.jar"/>
98
		<pathelement location="${basedir}/lib/gwt-dnd-2.6.5.jar"/>
99
		<pathelement location="${basedir}/lib/gwt-dnd-3.0.0.jar"/>
99 100
		<pathelement location="${basedir}/lib/gwt-gears.jar"/>
100 101
	</path>
101 102

  
......
200 201
			<mergemapper to="${build.dir}/www/gr.ebs.gss.GSS.nocache.js"/>
201 202
		</uptodate>
202 203
	</target>
203

  
204
	
204 205
	<target name="gwt-compile" depends="check-gwt-compile" unless="compilation-not-needed" description="Compile client code to JavaScript">
205
		<!-- The following 3 conditions are for GWT 1.x -->
206
    	<condition property="gwt-dev-lib" value="${gwt.path}/gwt-dev-linux.jar">
207
	    	<available file="${gwt.path}/gwt-dev-linux.jar"/>
208
    	</condition>
209
    	<condition property="gwt-dev-lib" value="${gwt.path}/gwt-dev-mac.jar">
210
	    	<available file="${gwt.path}/gwt-dev-mac.jar" />
211
    	</condition>
212
    	<condition property="gwt-dev-lib" value="${gwt.path}/gwt-dev-windows.jar">
213
	    	<available file="${gwt.path}/gwt-dev-windows.jar" />
214
    	</condition>
215
		<!-- This condition is for GWT 2.x -->
216
    	<condition property="gwt-dev-lib" value="${gwt.path}/gwt-dev.jar">
217
	    	<available file="${gwt.path}/gwt-dev.jar" />
218
    	</condition>
219
		<java classname="com.google.gwt.dev.GWTCompiler" failonerror="true" fork="true">
220
			<!--arg value="-style"/>
221
			<arg value="DETAILED"/-->
222
			<arg value="-out"/>
223
			<arg value="${gwt.www.dir}"/>
224
			<arg value="${gwt.module}"/>
225
			<jvmarg value="-Xmx256m"/>
226
			<jvmarg value="-Xss512k"/>
227
		    <classpath>
228
		    	<pathelement location="dist/test.jar"/>
229
		        <pathelement path="${gwt-dev-lib}"/>
230
				<path refid="project.class.path" />
231
				<pathelement path="${src.dir}" />
232
		    </classpath>
233
		</java>
234
		<mkdir dir="${build.dir}/www"/>
235
		<copy todir="${build.dir}/www">
236
			<fileset dir="${gwt.www.dir}/${gwt.module}" excludes="**/${gwt.module.class}.html">
237
			</fileset>
238
		</copy>
239
		<copy file="${gwt.www.dir}/${gwt.module}/${gwt.module.class}.html" tofile="${build.dir}/www/index.html" />
240
	</target>
206
			
207
	    	<condition property="gwt-dev-lib" value="${gwt.path}/gwt-dev-linux.jar">
208
		    	<available file="${gwt.path}/gwt-dev-linux.jar"/>
209
	    	</condition>
210
	    	<condition property="gwt-dev-lib" value="${gwt.path}/gwt-dev-mac.jar">
211
		    	<available file="${gwt.path}/gwt-dev-mac.jar" />
212
	    	</condition>
213
	    	<condition property="gwt-dev-lib" value="${gwt.path}/gwt-dev-windows.jar">
214
		    	<available file="${gwt.path}/gwt-dev-windows.jar" />
215
	    	</condition>
216
			
217
	    	<condition property="gwt-dev-lib" value="${gwt.path}/gwt-dev.jar">
218
		    	<available file="${gwt.path}/gwt-dev.jar" />
219
	    	</condition>
220
			
221
			<java classname="com.google.gwt.dev.Compiler" failonerror="true" fork="true">
222
				
223
				<arg value="-localWorkers" />
224
				<arg value="2" />
225
				<arg value="-war"/>
226
				<arg value="${gwt.www.dir}"/>
227
				<arg value="${gwt.module}"/>
228
				
229
			    <classpath>
230
			    	<pathelement location="dist/test.jar"/>
231
			        <pathelement path="${gwt-dev-lib}"/>
232
					<path refid="project.class.path" />
233
					<pathelement path="${src.dir}" />
234
			    </classpath>
235
			</java>
236
			<mkdir dir="${build.dir}/www"/>
237
			<copy todir="${build.dir}/www">
238
				<fileset dir="${gwt.www.dir}/${gwt.module}" excludes="**/${gwt.module.class}.html">
239
				</fileset>
240
			</copy>
241
			<copy file="${gwt.www.dir}/${gwt.module}/${gwt.module.class}.html" tofile="${build.dir}/www/index.html" />
242
		</target>
241 243
	
242 244
	<target name="package-war" depends="gwt-compile, package-code" description="Package up the web part as a war">
243 245
		<jar destfile="${build.dir}/${dist.war}">
244
			<zipfileset dir="${war.dir}" />
245
			<zipfileset dir="${build.dir}/www" />
246
			<zipfileset dir="${war.dir}" >
247
				<exclude name="**/classes/**"/>
248
				</zipfileset>
249
			<zipfileset dir="${build.dir}/www">
250
				
251
			</zipfileset>
246 252
			<zipfileset dir="${build.dir}" prefix="WEB-INF/lib">
247 253
				<include name="${ant.project.name}.jar" />
248 254
			</zipfileset>
b/src/gr/ebs/gss/GSS.gwt.xml
11 11
	<!-- Specify the app entry point class.                   -->
12 12
	<entry-point class='gr.ebs.gss.client.GSS' />
13 13
	<stylesheet src='gss.css' />
14
	<!-- <set-property name="user.agent" value="gecko" /> --> 
14
	<!--<set-property name="user.agent" value="gecko" /> -->
15 15
	<!-- Rebind the file upload dialog if Gears is installed -->
16 16
	<replace-with class="gr.ebs.gss.client.FileUploadGearsDialog">
17 17
		<all>
b/src/gr/ebs/gss/client/AboutDialog.java
1 1
/*
2
 * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd.
3
 *
4
 * This file is part of GSS.
5
 *
6
 * GSS is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * GSS is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with GSS.  If not, see <http://www.gnu.org/licenses/>.
2
 * Copyright 2007, 2008, 2009 Electronic Business Systems Ltd. This file is part
3
 * of GSS. GSS is free software: you can redistribute it and/or modify it under
4
 * the terms of the GNU General Public License as published by the Free Software
5
 * Foundation, either version 3 of the License, or (at your option) any later
6
 * version. GSS is distributed in the hope that it will be useful, but WITHOUT
7
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
9
 * details. You should have received a copy of the GNU General Public License
10
 * along with GSS. If not, see <http://www.gnu.org/licenses/>.
18 11
 */
19 12
package gr.ebs.gss.client;
20 13

  
21 14
import com.google.gwt.core.client.GWT;
15
import com.google.gwt.dom.client.NativeEvent;
16
import com.google.gwt.event.dom.client.ClickEvent;
17
import com.google.gwt.event.dom.client.ClickHandler;
18
import com.google.gwt.event.dom.client.KeyCodes;
19
import com.google.gwt.user.client.Event.NativePreviewEvent;
22 20
import com.google.gwt.user.client.ui.Button;
23
import com.google.gwt.user.client.ui.ClickListener;
24 21
import com.google.gwt.user.client.ui.DialogBox;
25 22
import com.google.gwt.user.client.ui.HTML;
26 23
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
27
import com.google.gwt.user.client.ui.KeyboardListener;
28 24
import com.google.gwt.user.client.ui.VerticalPanel;
29
import com.google.gwt.user.client.ui.Widget;
30 25

  
31 26
/**
32 27
 * The 'about' dialog box.
......
46 41
		// button.
47 42
		final VerticalPanel outer = new VerticalPanel();
48 43

  
49
		// Create the 'about' text and set a style name so we can style it with CSS.
50
		final HTML text = new HTML("This is the Web client for the " + service + " service. You " +
51
					"can use it to store, retrieve and share files in the " + service + " server " +
52
					"grid. <p>Design and implementation: <a href='http://www.ebs.gr' target='about'>EBS</a></p>");
44
		// Create the 'about' text and set a style name so we can style it with
45
		// CSS.
46
		final HTML text = new HTML("This is the Web client for the " + service + " service. You " + "can use it to store, retrieve and share files in the " + service + " server " + "grid. <p>Design and implementation: <a href='http://www.ebs.gr' target='about'>EBS</a></p>");
53 47
		text.setStyleName("gss-AboutText");
54 48
		outer.add(text);
55 49

  
56 50
		// Create the 'OK' button, along with a listener that hides the dialog
57 51
		// when the button is clicked.
58
		final Button confirm = new Button("Close", new ClickListener() {
52
		final Button confirm = new Button("Close", new ClickHandler() {
59 53

  
60
			public void onClick(Widget sender) {
54
			@Override
55
			public void onClick(ClickEvent event) {
61 56
				hide();
62 57
			}
63 58
		});
......
68 63
	}
69 64

  
70 65
	@Override
71
	public boolean onKeyDownPreview(final char key, final int modifiers) {
72
		// Use the popup's key preview hooks to close the dialog when either
73
		// enter or escape is pressed.
74
		switch (key) {
75
			case KeyboardListener.KEY_ENTER:
76
			case KeyboardListener.KEY_ESCAPE:
77
				hide();
78
				break;
79
		}
66
	protected void onPreviewNativeEvent(NativePreviewEvent preview) {
67
		super.onPreviewNativeEvent(preview);
80 68

  
81
		return true;
69
		NativeEvent evt = preview.getNativeEvent();
70
		if (evt.getType().equals("keydown"))
71
			// Use the popup's key preview hooks to close the dialog when either
72
			// enter or escape is pressed.
73
			switch (evt.getKeyCode()) {
74
				case KeyCodes.KEY_ENTER:
75
				case KeyCodes.KEY_ESCAPE:
76
					hide();
77
					break;
78
			}
82 79
	}
83 80

  
84 81
}
b/src/gr/ebs/gss/client/AbstractPropertiesDialog.java
25 25
import java.util.List;
26 26

  
27 27
import com.google.gwt.core.client.GWT;
28
import com.google.gwt.dom.client.NativeEvent;
29
import com.google.gwt.event.dom.client.ClickEvent;
30
import com.google.gwt.event.dom.client.ClickHandler;
31
import com.google.gwt.event.dom.client.KeyCodes;
28 32
import com.google.gwt.user.client.DeferredCommand;
33
import com.google.gwt.user.client.Event.NativePreviewEvent;
29 34
import com.google.gwt.user.client.ui.Button;
30
import com.google.gwt.user.client.ui.ClickListener;
31 35
import com.google.gwt.user.client.ui.DialogBox;
32 36
import com.google.gwt.user.client.ui.FlowPanel;
33
import com.google.gwt.user.client.ui.KeyboardListener;
34 37
import com.google.gwt.user.client.ui.TabPanel;
35 38
import com.google.gwt.user.client.ui.TextBox;
36
import com.google.gwt.user.client.ui.Widget;
37 39

  
38 40
/**
39 41
 * Abstract class, parent of all 'File properties' dialog boxes.
......
87 89
				List<String> userTags = tagr.getTags();
88 90
				Iterator t = userTags.iterator();
89 91
				while (t.hasNext()) {
90
					final Button tag = new Button((String) t.next(), new ClickListener() {
92
					final Button tag = new Button((String) t.next(), new ClickHandler() {
91 93

  
92
						public void onClick(Widget sender) {
94
						@Override
95
						public void onClick(ClickEvent event) {
93 96
							String existing = tags.getText();
94 97
							if (MULTIPLE_VALUES_TEXT.equals(existing)) existing = "";
95
							String newTag = ((Button) sender).getText().trim();
98
							String newTag = ((Button) event.getSource()).getText().trim();
96 99
							// insert the new tag only if it is not in the list
97 100
							// already
98 101
							if (existing.indexOf(newTag + ",") == -1 && !existing.trim().endsWith(newTag))
......
121 124

  
122 125
	@Override
123 126
	@SuppressWarnings("fallthrough")
124
	public boolean onKeyDownPreview(char key, int modifiers) {
125
		// Use the popup's key preview hooks to close the dialog when either
126
		// enter or escape is pressed.
127
		switch (key) {
128
			case KeyboardListener.KEY_ENTER:
129
				accept();
130
			case KeyboardListener.KEY_ESCAPE:
131
				closeDialog();
132
				break;
133
		}
134

  
135
		return true;
136
	}
127
	protected void onPreviewNativeEvent(NativePreviewEvent preview) {
128
	    super.onPreviewNativeEvent(preview);
129

  
130
	    NativeEvent evt = preview.getNativeEvent();
131
	    if (evt.getType().equals("keydown"))
132
			// Use the popup's key preview hooks to close the dialog when either
133
			  // enter or escape is pressed.
134
			  switch (evt.getKeyCode()) {
135
			    case KeyCodes.KEY_ENTER:
136
			    	accept();
137
			    case KeyCodes.KEY_ESCAPE:
138
			      closeDialog();
139
			      break;
140
			  }
141
	  }
142

  
137 143

  
138 144

  
139 145
	public void selectTab(int _tab) {
b/src/gr/ebs/gss/client/ConfirmationDialog.java
18 18
 */
19 19
package gr.ebs.gss.client;
20 20

  
21
import com.google.gwt.dom.client.NativeEvent;
22
import com.google.gwt.event.dom.client.ClickEvent;
23
import com.google.gwt.event.dom.client.ClickHandler;
24
import com.google.gwt.event.dom.client.KeyCodes;
25
import com.google.gwt.user.client.Event.NativePreviewEvent;
26
import com.google.gwt.user.client.ui.AbstractImagePrototype;
21 27
import com.google.gwt.user.client.ui.Button;
22
import com.google.gwt.user.client.ui.ClickListener;
23 28
import com.google.gwt.user.client.ui.DialogBox;
24 29
import com.google.gwt.user.client.ui.HTML;
25 30
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
26 31
import com.google.gwt.user.client.ui.HorizontalPanel;
27
import com.google.gwt.user.client.ui.KeyboardListener;
28 32
import com.google.gwt.user.client.ui.VerticalPanel;
29
import com.google.gwt.user.client.ui.Widget;
30 33

  
31 34

  
32 35
/**
......
50 53
		VerticalPanel outer = new VerticalPanel();
51 54
		HorizontalPanel buttons = new HorizontalPanel();
52 55

  
53
		HTML text = new HTML("<table><tr><td rowspan='2'>" + MessagePanel.images.warn().getHTML() +
56
		HTML text = new HTML("<table><tr><td rowspan='2'>" + AbstractImagePrototype.create(MessagePanel.images.warn()).getHTML() +
54 57
					"</td><td>" + message + "</td></tr></table>");
55 58
		text.setStyleName("gss-warnMessage");
56 59
		outer.add(text);
57 60

  
58 61
		// Create the 'Update' button, along with a listener that hides the dialog
59 62
		// when the button is clicked and renames the file.
60
		Button ok = new Button(buttonLabel, new ClickListener() {
63
		Button ok = new Button(buttonLabel, new ClickHandler() {
61 64

  
62
			public void onClick(Widget sender) {
65
			@Override
66
			public void onClick(ClickEvent event) {
63 67
				confirm();
64 68
				hide();
65 69
			}
......
68 72
		buttons.setCellHorizontalAlignment(ok, HasHorizontalAlignment.ALIGN_CENTER);
69 73
		// Create the 'Cancel' button, along with a listener that hides the
70 74
		// dialog when the button is clicked.
71
		Button cancel = new Button("Cancel", new ClickListener() {
75
		Button cancel = new Button("Cancel", new ClickHandler() {
72 76

  
73
			public void onClick(Widget sender) {
77
			@Override
78
			public void onClick(ClickEvent event) {
74 79
				hide();
75 80
				cancel();
76 81
			}
......
87 92
	}
88 93

  
89 94
	@Override
90
	public boolean onKeyDownPreview(final char key, final int modifiers) {
91
		// Use the popup's key preview hooks to close the dialog when either
92
		// enter or escape is pressed.
93
		switch (key) {
94
			case KeyboardListener.KEY_ENTER:
95
				hide();
96
				confirm();
97
				break;
98
			case KeyboardListener.KEY_ESCAPE:
99
				hide();
100
				cancel();
101
				break;
102
		}
103
		return true;
95
	protected void onPreviewNativeEvent(NativePreviewEvent preview) {
96
		super.onPreviewNativeEvent(preview);
97

  
98
		NativeEvent evt = preview.getNativeEvent();
99
		if (evt.getType().equals("keydown"))
100
			// Use the popup's key preview hooks to close the dialog when either
101
			// enter or escape is pressed.
102
			switch (evt.getKeyCode()) {
103
				case KeyCodes.KEY_ENTER:
104
					hide();
105
					confirm();
106
					break;
107
				case KeyCodes.KEY_ESCAPE:
108
					hide();
109
					cancel();
110
					break;
111
			}
104 112
	}
105 113

  
106 114
	public abstract void confirm();
b/src/gr/ebs/gss/client/CredentialsDialog.java
22 22
import gr.ebs.gss.client.rest.RestException;
23 23

  
24 24
import com.google.gwt.core.client.GWT;
25
import com.google.gwt.dom.client.NativeEvent;
26
import com.google.gwt.event.dom.client.ClickEvent;
27
import com.google.gwt.event.dom.client.ClickHandler;
28
import com.google.gwt.event.dom.client.KeyCodes;
25 29
import com.google.gwt.user.client.DeferredCommand;
30
import com.google.gwt.user.client.Event.NativePreviewEvent;
31
import com.google.gwt.user.client.ui.AbstractImagePrototype;
26 32
import com.google.gwt.user.client.ui.Button;
27
import com.google.gwt.user.client.ui.ClickListener;
28 33
import com.google.gwt.user.client.ui.DialogBox;
29 34
import com.google.gwt.user.client.ui.FlexTable;
30 35
import com.google.gwt.user.client.ui.HTML;
31 36
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
32 37
import com.google.gwt.user.client.ui.HorizontalPanel;
33
import com.google.gwt.user.client.ui.KeyboardListener;
34 38
import com.google.gwt.user.client.ui.TextBox;
35 39
import com.google.gwt.user.client.ui.VerticalPanel;
36
import com.google.gwt.user.client.ui.Widget;
37 40

  
38 41

  
39 42
/**
......
68 71
			HorizontalPanel buttons = new HorizontalPanel();
69 72

  
70 73
			HTML text;
71
			text = new HTML("<table><tr><td>" + images.warn().getHTML() + "</td><td>" + "Are you sure you want to create a new WebDAV password?</td></tr></table>");
74
			text = new HTML("<table><tr><td>" + AbstractImagePrototype.create(images.warn()).getHTML() + "</td><td>" + "Are you sure you want to create a new WebDAV password?</td></tr></table>");
72 75
			text.setStyleName("gss-warnMessage");
73 76
			outer.add(text);
74 77

  
75 78
			// Create the 'Yes' button, along with a listener that hides the dialog
76 79
			// when the button is clicked and resets the password.
77
			Button ok = new Button("Yes", new ClickListener() {
78
				public void onClick(Widget sender) {
80
			Button ok = new Button("Yes", new ClickHandler() {
81
				@Override
82
				public void onClick(ClickEvent event) {
79 83
					resetPassword(GSS.get().getCurrentUserResource().getUri());
80 84
					hide();
81 85
				}
......
84 88
			buttons.setCellHorizontalAlignment(ok, HasHorizontalAlignment.ALIGN_CENTER);
85 89
			// Create the 'No' button, along with a listener that hides the
86 90
			// dialog when the button is clicked.
87
			Button cancel = new Button("No", new ClickListener() {
88
				public void onClick(Widget sender) {
91
			Button cancel = new Button("No", new ClickHandler() {
92
				@Override
93
				public void onClick(ClickEvent event) {
89 94
					hide();
90 95
				}
91 96
			});
......
100 105
			setWidget(outer);
101 106
		}
102 107

  
103

  
104 108
		@Override
105
		public boolean onKeyDownPreview(final char key, final int modifiers) {
106
			// Use the popup's key preview hooks to close the dialog when
107
			// escape is pressed.
108
			switch (key) {
109
				case KeyboardListener.KEY_ESCAPE:
110
					hide();
111
					break;
112
			}
113

  
114
			return true;
109
		protected void onPreviewNativeEvent(NativePreviewEvent preview) {
110
			super.onPreviewNativeEvent(preview);
111

  
112
			NativeEvent evt = preview.getNativeEvent();
113
			if (evt.getType().equals("keydown"))
114
				// Use the popup's key preview hooks to close the dialog when either
115
				// enter or escape is pressed.
116
				switch (evt.getKeyCode()) {
117
					case KeyCodes.KEY_ENTER:
118
					case KeyCodes.KEY_ESCAPE:
119
						hide();
120
						break;
121
				}
115 122
		}
116 123

  
117 124
	}
......
135 142

  
136 143
			// Create the 'OK' button, along with a listener that hides the dialog
137 144
			// when the button is clicked.
138
			Button confirm = new Button("Proceed", new ClickListener() {
139

  
140
				public void onClick(Widget sender) {
145
			Button confirm = new Button("Proceed", new ClickHandler() {
146
				@Override
147
				public void onClick(ClickEvent event) {
141 148
					GSS.get().authenticateUser();
142 149
					hide();
143 150
				}
......
149 156
		}
150 157

  
151 158
		@Override
152
		public boolean onKeyDownPreview(char key, int modifiers) {
153
			// Use the popup's key preview hooks to close the dialog when either
154
			// enter or escape is pressed.
155
			switch (key) {
156
				case KeyboardListener.KEY_ENTER:
157
					GSS.get().authenticateUser();
158
					hide();
159
					break;
160
				case KeyboardListener.KEY_ESCAPE:
161
					hide();
162
					break;
163
			}
164
			return true;
159
		protected void onPreviewNativeEvent(NativePreviewEvent preview) {
160
			super.onPreviewNativeEvent(preview);
161

  
162
			NativeEvent evt = preview.getNativeEvent();
163
			if (evt.getType().equals("keydown"))
164
				// Use the popup's key preview hooks to close the dialog when either
165
				// enter or escape is pressed.
166
				switch (evt.getKeyCode()) {
167
					case KeyCodes.KEY_ENTER:
168
						GSS.get().authenticateUser();
169
						hide();
170
						break;
171
					case KeyCodes.KEY_ESCAPE:
172
						hide();
173
						break;
174
				}
165 175
		}
176

  
166 177
	}
167 178

  
168 179
	/**
......
198 209
		username.setText(app.getCurrentUserResource().getUsername());
199 210
		username.setReadOnly(true);
200 211
		username.setWidth(WIDTH_FIELD);
201
		username.addClickListener(new ClickListener () {
202

  
203
			public void onClick(Widget sender) {
212
		username.addClickHandler(new ClickHandler() {
213
			@Override
214
			public void onClick(ClickEvent event) {
204 215
				GSS.enableIESelection();
205
				((TextBox) sender).selectAll();
216
				((TextBox) event.getSource()).selectAll();
206 217
				GSS.preventIESelection();
207 218
			}
208 219

  
......
212 223
		passwordBox.setText(app.getWebDAVPassword());
213 224
		passwordBox.setReadOnly(true);
214 225
		passwordBox.setWidth(WIDTH_FIELD);
215
		passwordBox.addClickListener(new ClickListener () {
216

  
217
			public void onClick(Widget sender) {
226
		passwordBox.addClickHandler(new  ClickHandler() {
227
			@Override
228
			public void onClick(ClickEvent event) {
218 229
				GSS.enableIESelection();
219
				((TextBox) sender).selectAll();
230
				((TextBox) event.getSource()).selectAll();
220 231
				GSS.preventIESelection();
221 232
			}
222 233

  
......
227 238
		tokenBox.setText(app.getToken());
228 239
		tokenBox.setReadOnly(true);
229 240
		tokenBox.setWidth(WIDTH_FIELD);
230
		tokenBox.addClickListener(new ClickListener () {
231

  
232
			public void onClick(Widget sender) {
241
		tokenBox.addClickHandler(new ClickHandler() {
242
			@Override
243
			public void onClick(ClickEvent event) {
233 244
				GSS.enableIESelection();
234
				((TextBox) sender).selectAll();
245
				((TextBox) event.getSource()).selectAll();
235 246
				GSS.preventIESelection();
236 247
			}
237 248

  
......
248 259

  
249 260
		// Create the 'OK' button, along with a listener that hides the dialog
250 261
		// when the button is clicked.
251
		Button confirm = new Button("Close", new ClickListener() {
252

  
253
			public void onClick(Widget sender) {
262
		Button confirm = new Button("Close", new ClickHandler() {
263
			@Override
264
			public void onClick(ClickEvent event) {
254 265
				hide();
255 266
			}
256 267
		});
......
259 270

  
260 271
		// Create the 'Reset password' button, along with a listener that hides the dialog
261 272
		// when the button is clicked.
262
		Button resetPassword = new Button("Reset Password", new ClickListener() {
263

  
264
			public void onClick(Widget sender) {
273
		Button resetPassword = new Button("Reset Password", new ClickHandler() {
274
			@Override
275
			public void onClick(ClickEvent event) {
265 276
				ConfirmResetPasswordDialog dlg = new ConfirmResetPasswordDialog(images);
266 277
				dlg.center();
267 278
			}
......
274 285
	}
275 286

  
276 287
	@Override
277
	public boolean onKeyDownPreview(char key, int modifiers) {
278
		// Use the popup's key preview hooks to close the dialog when either
279
		// enter or escape is pressed.
280
		switch (key) {
281
			case KeyboardListener.KEY_ENTER:
282
			case KeyboardListener.KEY_ESCAPE:
283
				hide();
284
				break;
285
		}
286
		return true;
288
	protected void onPreviewNativeEvent(NativePreviewEvent preview) {
289
		super.onPreviewNativeEvent(preview);
290

  
291
		NativeEvent evt = preview.getNativeEvent();
292
		if (evt.getType().equals("keydown"))
293
			// Use the popup's key preview hooks to close the dialog when either
294
			// enter or escape is pressed.
295
			switch (evt.getKeyCode()) {
296
				case KeyCodes.KEY_ENTER:
297
				case KeyCodes.KEY_ESCAPE:
298
					hide();
299
					break;
300
			}
287 301
	}
288 302

  
289 303

  
b/src/gr/ebs/gss/client/DeleteFileDialog.java
28 28
import java.util.List;
29 29

  
30 30
import com.google.gwt.core.client.GWT;
31
import com.google.gwt.dom.client.NativeEvent;
32
import com.google.gwt.event.dom.client.ClickEvent;
33
import com.google.gwt.event.dom.client.ClickHandler;
34
import com.google.gwt.event.dom.client.KeyCodes;
31 35
import com.google.gwt.user.client.DeferredCommand;
36
import com.google.gwt.user.client.Event.NativePreviewEvent;
37
import com.google.gwt.user.client.ui.AbstractImagePrototype;
32 38
import com.google.gwt.user.client.ui.Button;
33
import com.google.gwt.user.client.ui.ClickListener;
34 39
import com.google.gwt.user.client.ui.DialogBox;
35 40
import com.google.gwt.user.client.ui.HTML;
36 41
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
37 42
import com.google.gwt.user.client.ui.HorizontalPanel;
38
import com.google.gwt.user.client.ui.KeyboardListener;
39 43
import com.google.gwt.user.client.ui.VerticalPanel;
40
import com.google.gwt.user.client.ui.Widget;
41 44

  
42 45
/**
43 46
 * The 'delete file' dialog box.
......
60 63

  
61 64
		HTML text;
62 65
		if (selection instanceof FileResource)
63
			text = new HTML("<table><tr><td>" + images.warn().getHTML() + "</td><td>" + "Are you sure you want to <b>permanently</b> delete file '" + ((FileResource) selection).getName() + "'?</td></tr></table>");
66
			text = new HTML("<table><tr><td>" + AbstractImagePrototype.create(images.warn()).getHTML() + "</td><td>" + "Are you sure you want to <b>permanently</b> delete file '" + ((FileResource) selection).getName() + "'?</td></tr></table>");
64 67
		else
65
			text = new HTML("<table><tr><td>" + images.warn().getHTML() + "</td><td>" + "Are you sure you want to <b>permanently</b> delete the selected files?</td></tr></table>");
68
			text = new HTML("<table><tr><td>" + AbstractImagePrototype.create(images.warn()).getHTML() + "</td><td>" + "Are you sure you want to <b>permanently</b> delete the selected files?</td></tr></table>");
66 69
		text.setStyleName("gss-warnMessage");
67 70
		outer.add(text);
68 71

  
69 72
		// Create the 'Delete' button, along with a listener that hides the dialog
70 73
		// when the button is clicked and deletes the file.
71
		Button ok = new Button("Delete", new ClickListener() {
72

  
73
			public void onClick(Widget sender) {
74
		Button ok = new Button("Delete", new ClickHandler() {
75
			@Override
76
			public void onClick(ClickEvent event) {
74 77
				deleteFile();
75 78
				hide();
76 79
			}
......
79 82
		buttons.setCellHorizontalAlignment(ok, HasHorizontalAlignment.ALIGN_CENTER);
80 83
		// Create the 'Cancel' button, along with a listener that hides the
81 84
		// dialog when the button is clicked.
82
		Button cancel = new Button("Cancel", new ClickListener() {
83

  
84
			public void onClick(Widget sender) {
85
		Button cancel = new Button("Cancel", new ClickHandler() {
86
			@Override
87
			public void onClick(ClickEvent event) {
85 88
				hide();
86 89
			}
87 90
		});
......
179 182
	}
180 183

  
181 184
	@Override
182
	public boolean onKeyDownPreview(final char key, final int modifiers) {
183
		// Use the popup's key preview hooks to close the dialog when either
184
		// enter or escape is pressed.
185
		switch (key) {
186
			case KeyboardListener.KEY_ENTER:
187
				hide();
188
				deleteFile();
189
				break;
190
			case KeyboardListener.KEY_ESCAPE:
191
				hide();
192
				break;
193
		}
194

  
195
		return true;
185
	protected void onPreviewNativeEvent(NativePreviewEvent preview) {
186
		super.onPreviewNativeEvent(preview);
187

  
188
		NativeEvent evt = preview.getNativeEvent();
189
		if (evt.getType().equals("keydown"))
190
			// Use the popup's key preview hooks to close the dialog when either
191
			// enter or escape is pressed.
192
			switch (evt.getKeyCode()) {
193
				case KeyCodes.KEY_ENTER:
194
					hide();
195
					deleteFile();
196
					break;
197
				case KeyCodes.KEY_ESCAPE:
198
					hide();
199
					break;
200
			}
196 201
	}
197 202

  
203

  
204

  
198 205
}
b/src/gr/ebs/gss/client/DeleteFolderDialog.java
25 25
import gr.ebs.gss.client.rest.resource.FolderResource;
26 26

  
27 27
import com.google.gwt.core.client.GWT;
28
import com.google.gwt.dom.client.NativeEvent;
29
import com.google.gwt.event.dom.client.ClickEvent;
30
import com.google.gwt.event.dom.client.ClickHandler;
31
import com.google.gwt.event.dom.client.KeyCodes;
28 32
import com.google.gwt.user.client.DeferredCommand;
33
import com.google.gwt.user.client.Event.NativePreviewEvent;
34
import com.google.gwt.user.client.ui.AbstractImagePrototype;
29 35
import com.google.gwt.user.client.ui.Button;
30
import com.google.gwt.user.client.ui.ClickListener;
31 36
import com.google.gwt.user.client.ui.DialogBox;
32 37
import com.google.gwt.user.client.ui.HTML;
33 38
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
34 39
import com.google.gwt.user.client.ui.HorizontalPanel;
35
import com.google.gwt.user.client.ui.KeyboardListener;
36 40
import com.google.gwt.user.client.ui.TreeItem;
37 41
import com.google.gwt.user.client.ui.VerticalPanel;
38
import com.google.gwt.user.client.ui.Widget;
39 42

  
40 43
/**
41 44
 * The 'delete folder' dialog box.
......
55 58
		VerticalPanel outer = new VerticalPanel();
56 59
		HorizontalPanel buttons = new HorizontalPanel();
57 60

  
58
		HTML text = new HTML("<table><tr><td rowspan='2'>" + images.warn().getHTML() +
61
		HTML text = new HTML("<table><tr><td rowspan='2'>" + AbstractImagePrototype.create(images.warn()).getHTML() +
59 62
					"</td><td>" + "Are you sure you want to <b>permanently</b> delete folder '" + folder.getName() +
60 63
					"'?</td></tr></table>");
61 64
		text.setStyleName("gss-warnMessage");
......
63 66

  
64 67
		// Create the 'Delete' button, along with a listener that hides the dialog
65 68
		// when the button is clicked and deletes the folder.
66
		Button ok = new Button("Delete", new ClickListener() {
67

  
68
			public void onClick(Widget sender) {
69
		Button ok = new Button("Delete", new ClickHandler() {
70
			@Override
71
			public void onClick(ClickEvent event) {
69 72
				deleteFolder();
70 73
				hide();
71 74
			}
......
74 77
		buttons.setCellHorizontalAlignment(ok, HasHorizontalAlignment.ALIGN_CENTER);
75 78
		// Create the 'Cancel' button, along with a listener that hides the
76 79
		// dialog when the button is clicked.
77
		Button cancel = new Button("Cancel", new ClickListener() {
78

  
79
			public void onClick(Widget sender) {
80
		Button cancel = new Button("Cancel", new ClickHandler() {
81
			@Override
82
			public void onClick(ClickEvent event) {
80 83
				hide();
81 84
			}
82 85
		});
......
140 143
	}
141 144

  
142 145
	@Override
143
	public boolean onKeyDownPreview(final char key, final int modifiers) {
144
		// Use the popup's key preview hooks to close the dialog when either
145
		// enter or escape is pressed.
146
		switch (key) {
147
			case KeyboardListener.KEY_ENTER:
148
				hide();
149
				deleteFolder();
150
				break;
151
			case KeyboardListener.KEY_ESCAPE:
152
				hide();
153
				break;
154
		}
155
		return true;
146
	protected void onPreviewNativeEvent(NativePreviewEvent preview) {
147
		super.onPreviewNativeEvent(preview);
148

  
149
		NativeEvent evt = preview.getNativeEvent();
150
		if (evt.getType().equals("keydown"))
151
			// Use the popup's key preview hooks to close the dialog when either
152
			// enter or escape is pressed.
153
			switch (evt.getKeyCode()) {
154
				case KeyCodes.KEY_ENTER:
155
					hide();
156
					deleteFolder();
157
					break;
158
				case KeyCodes.KEY_ESCAPE:
159
					hide();
160
					break;
161
			}
156 162
	}
157 163

  
158 164
}
b/src/gr/ebs/gss/client/DeleteGroupDialog.java
24 24
import gr.ebs.gss.client.rest.resource.GroupResource;
25 25

  
26 26
import com.google.gwt.core.client.GWT;
27
import com.google.gwt.dom.client.NativeEvent;
28
import com.google.gwt.event.dom.client.ClickEvent;
29
import com.google.gwt.event.dom.client.ClickHandler;
30
import com.google.gwt.event.dom.client.KeyCodes;
27 31
import com.google.gwt.user.client.DeferredCommand;
32
import com.google.gwt.user.client.Event.NativePreviewEvent;
33
import com.google.gwt.user.client.ui.AbstractImagePrototype;
28 34
import com.google.gwt.user.client.ui.Button;
29
import com.google.gwt.user.client.ui.ClickListener;
30 35
import com.google.gwt.user.client.ui.DialogBox;
31 36
import com.google.gwt.user.client.ui.HTML;
32 37
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
33 38
import com.google.gwt.user.client.ui.HorizontalPanel;
34
import com.google.gwt.user.client.ui.KeyboardListener;
35 39
import com.google.gwt.user.client.ui.TreeItem;
36 40
import com.google.gwt.user.client.ui.VerticalPanel;
37
import com.google.gwt.user.client.ui.Widget;
38 41

  
39 42
/**
40 43
 * The 'delete group' dialog box.
......
57 60

  
58 61
		// Create the 'about' text and set a style name so we can style it with
59 62
		// CSS.
60
		final HTML text = new HTML("<table><tr><td>" + images.warn().getHTML() + "</td><td>" + "Are you sure you want to delete group '" + group.getName() + "'?</td></tr></table>");
63
		final HTML text = new HTML("<table><tr><td>" + AbstractImagePrototype.create(images.warn()).getHTML() + "</td><td>" + "Are you sure you want to delete group '" + group.getName() + "'?</td></tr></table>");
61 64
		text.setStyleName("gss-warnMessage");
62 65
		outer.add(text);
63 66

  
64 67
		// Create the 'Quit' button, along with a listener that hides the dialog
65 68
		// when the button is clicked and quits the application.
66
		final Button ok = new Button("OK", new ClickListener() {
67

  
68
			public void onClick(Widget sender) {
69
		final Button ok = new Button("OK", new ClickHandler() {
70
			@Override
71
			public void onClick(ClickEvent event) {
69 72
				deleteGroup();
70 73
				hide();
71 74
			}
......
75 78
		// Create the 'Cancel' button, along with a listener that hides the
76 79
		// dialog
77 80
		// when the button is clicked.
78
		final Button cancel = new Button("Cancel", new ClickListener() {
79

  
80
			public void onClick(Widget sender) {
81
		final Button cancel = new Button("Cancel", new ClickHandler() {
82
			@Override
83
			public void onClick(ClickEvent event) {
81 84
				hide();
82 85
			}
83 86
		});
......
128 131
		DeferredCommand.addCommand(dg);
129 132
	}
130 133

  
134

  
131 135
	@Override
132
	public boolean onKeyDownPreview(final char key, final int modifiers) {
133
		// Use the popup's key preview hooks to close the dialog when either
134
		// enter or escape is pressed.
135
		switch (key) {
136
			case KeyboardListener.KEY_ENTER:
137
				hide();
138
				deleteGroup();
139
				break;
140
			case KeyboardListener.KEY_ESCAPE:
141
				hide();
142
				break;
143
		}
136
	protected void onPreviewNativeEvent(NativePreviewEvent preview) {
137
		super.onPreviewNativeEvent(preview);
144 138

  
145
		return true;
139
		NativeEvent evt = preview.getNativeEvent();
140
		if (evt.getType().equals("keydown"))
141
			// Use the popup's key preview hooks to close the dialog when either
142
			// enter or escape is pressed.
143
			switch (evt.getKeyCode()) {
144
				case KeyCodes.KEY_ENTER:
145
					hide();
146
					deleteGroup();
147
					break;
148
				case KeyCodes.KEY_ESCAPE:
149
					hide();
150
					break;
151
			}
146 152
	}
147 153

  
148 154
}
b/src/gr/ebs/gss/client/DeleteUserDialog.java
24 24
import gr.ebs.gss.client.rest.resource.GroupUserResource;
25 25

  
26 26
import com.google.gwt.core.client.GWT;
27
import com.google.gwt.dom.client.NativeEvent;
28
import com.google.gwt.event.dom.client.ClickEvent;
29
import com.google.gwt.event.dom.client.ClickHandler;
30
import com.google.gwt.event.dom.client.KeyCodes;
27 31
import com.google.gwt.user.client.DeferredCommand;
32
import com.google.gwt.user.client.Event.NativePreviewEvent;
33
import com.google.gwt.user.client.ui.AbstractImagePrototype;
28 34
import com.google.gwt.user.client.ui.Button;
29
import com.google.gwt.user.client.ui.ClickListener;
30 35
import com.google.gwt.user.client.ui.DialogBox;
31 36
import com.google.gwt.user.client.ui.HTML;
32 37
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
33 38
import com.google.gwt.user.client.ui.HorizontalPanel;
34
import com.google.gwt.user.client.ui.KeyboardListener;
35 39
import com.google.gwt.user.client.ui.TreeItem;
36 40
import com.google.gwt.user.client.ui.VerticalPanel;
37
import com.google.gwt.user.client.ui.Widget;
38 41

  
39 42

  
40 43
/**
......
59 62

  
60 63
		// Create the 'about' text and set a style name so we can style it with
61 64
		// CSS.
62
		final HTML text = new HTML("<table><tr><td>" + images.warn().getHTML() + "</td><td>" + "Are you sure you want to remove user '" + group.getName() + "'?</td></tr></table>");
65
		final HTML text = new HTML("<table><tr><td>" + AbstractImagePrototype.create(images.warn()).getHTML() + "</td><td>" + "Are you sure you want to remove user '" + group.getName() + "'?</td></tr></table>");
63 66
		text.setStyleName("gss-warnMessage");
64 67
		outer.add(text);
65 68

  
66 69
		// Create the 'Quit' button, along with a listener that hides the dialog
67 70
		// when the button is clicked and quits the application.
68
		final Button ok = new Button("OK", new ClickListener() {
69

  
70
			public void onClick(Widget sender) {
71
		final Button ok = new Button("OK", new ClickHandler() {
72
			@Override
73
			public void onClick(ClickEvent event) {
71 74
				deleteUser();
72 75
				hide();
73 76
			}
......
77 80
		// Create the 'Cancel' button, along with a listener that hides the
78 81
		// dialog
79 82
		// when the button is clicked.
80
		final Button cancel = new Button("Cancel", new ClickListener() {
81

  
82
			public void onClick(Widget sender) {
83
		final Button cancel = new Button("Cancel", new ClickHandler() {
84
			@Override
85
			public void onClick(ClickEvent event) {
83 86
				hide();
84 87
			}
85 88
		});
......
135 138
	}
136 139

  
137 140
	@Override
138
	public boolean onKeyDownPreview(final char key, final int modifiers) {
141
	protected void onPreviewNativeEvent(NativePreviewEvent preview) {
142
		super.onPreviewNativeEvent(preview);
143

  
144
		NativeEvent evt = preview.getNativeEvent();
145
		if (evt.getType().equals("keydown"))
139 146
		// Use the popup's key preview hooks to close the dialog when either
140 147
		// enter or escape is pressed.
141
		switch (key) {
142
			case KeyboardListener.KEY_ENTER:
148
		switch (evt.getKeyCode()) {
149
			case KeyCodes.KEY_ENTER:
143 150
				hide();
144 151
				deleteUser();
145 152
				break;
146
			case KeyboardListener.KEY_ESCAPE:
153
			case KeyCodes.KEY_ESCAPE:
147 154
				hide();
148 155
				break;
149 156
		}
150

  
151
		return true;
152 157
	}
153 158

  
154 159
}
b/src/gr/ebs/gss/client/EditMenu.java
29 29

  
30 30
import java.util.List;
31 31

  
32
import com.google.gwt.event.dom.client.ClickEvent;
33
import com.google.gwt.event.dom.client.ClickHandler;
34
import com.google.gwt.resources.client.ClientBundle;
35
import com.google.gwt.resources.client.ImageResource;
32 36
import com.google.gwt.user.client.Command;
33 37
import com.google.gwt.user.client.ui.AbstractImagePrototype;
34
import com.google.gwt.user.client.ui.ClickListener;
35 38
import com.google.gwt.user.client.ui.MenuBar;
36 39
import com.google.gwt.user.client.ui.PopupPanel;
37
import com.google.gwt.user.client.ui.Widget;
38 40

  
39 41
/**
40 42
 * The 'Edit' menu implementation.
41 43
 */
42
public class EditMenu extends PopupPanel implements ClickListener {
44
public class EditMenu extends PopupPanel implements ClickHandler {
43 45

  
44 46
	/**
45 47
	 * The widget's images.
......
51 53
	/**
52 54
	 * An image bundle for this widget's images.
53 55
	 */
54
	public interface Images extends FileMenu.Images, MessagePanel.Images {
56
	public interface Images extends ClientBundle, FileMenu.Images, MessagePanel.Images {
55 57

  
56 58
		/**
57 59
		 * Will bundle the file 'editcut.png' residing in the package
......
59 61
		 *
60 62
		 * @return the image prototype
61 63
		 */
62
		@Resource("gr/ebs/gss/resources/editcut.png")
63
		AbstractImagePrototype cut();
64
		@Source("gr/ebs/gss/resources/editcut.png")
65
		ImageResource cut();
64 66

  
65 67
		/**
66 68
		 * Will bundle the file 'editcopy.png' residing in the package
......
68 70
		 *
69 71
		 * @return the image prototype
70 72
		 */
71
		@Resource("gr/ebs/gss/resources/editcopy.png")
72
		AbstractImagePrototype copy();
73
		@Source("gr/ebs/gss/resources/editcopy.png")
74
		ImageResource copy();
73 75

  
74 76
		/**
75 77
		 * Will bundle the file 'editpaste.png' residing in the package
......
77 79
		 *
78 80
		 * @return the image prototype
79 81
		 */
80
		@Resource("gr/ebs/gss/resources/editpaste.png")
81
		AbstractImagePrototype paste();
82
		@Source("gr/ebs/gss/resources/editpaste.png")
83
		ImageResource paste();
82 84

  
83 85
		/**
84 86
		 * Will bundle the file 'editdelete.png' residing in the package
......
86 88
		 *
87 89
		 * @return the image prototype
88 90
		 */
89
		@Resource("gr/ebs/gss/resources/editdelete.png")
90
		AbstractImagePrototype delete();
91
		@Source("gr/ebs/gss/resources/editdelete.png")
92
		ImageResource delete();
91 93

  
92 94
		/**
93 95
		 * Will bundle the file 'translate.png' residing in the package
......
95 97
		 *
96 98
		 * @return the image prototype
97 99
		 */
98
		@Resource("gr/ebs/gss/resources/translate.png")
99
		AbstractImagePrototype selectAll();
100
		@Source("gr/ebs/gss/resources/translate.png")
101
		ImageResource selectAll();
100 102

  
101 103
		/**
102 104
		 * Will bundle the file 'border_remove.png' residing in the package
......
104 106
		 *
105 107
		 * @return the image prototype
106 108
		 */
107
		@Resource("gr/ebs/gss/resources/border_remove.png")
108
		AbstractImagePrototype unselectAll();
109
		@Source("gr/ebs/gss/resources/border_remove.png")
110
		ImageResource unselectAll();
109 111
	}
110 112

  
111 113
	/**
......
123 125
		add(contextMenu);
124 126
	}
125 127

  
126
	/*
127
	 * (non-Javadoc)
128
	 *
129
	 * @see com.google.gwt.user.client.ui.ClickListener#onClick(com.google.gwt.user.client.ui.Widget)
130
	 */
131
	public void onClick(final Widget sender) {
128
	@Override
129
	public void onClick(ClickEvent event) {
132 130
		final EditMenu menu = new EditMenu(images);
133
		final int left = sender.getAbsoluteLeft();
134
		final int top = sender.getAbsoluteTop() + sender.getOffsetHeight();
131
		final int left = event.getRelativeElement().getAbsoluteLeft();
132
		final int top = event.getRelativeElement().getAbsoluteTop() + event.getRelativeElement().getOffsetHeight();
135 133
		menu.setPopupPosition(left, top);
136

  
137 134
		menu.show();
138 135
	}
139 136

  
......
187 184
				pasteLabel = "Paste Files";
188 185
			else if(GSS.get().getClipboard().getItem().getFolderResource() != null)
189 186
				pasteLabel = "Paste Folder";
190
		contextMenu.addItem("<span>" + images.cut().getHTML() + "&nbsp;"+cutLabel+"</span>", true, new CutCommand(this)).setVisible(cutcopyVisible);
191
		contextMenu.addItem("<span>" + images.copy().getHTML() + "&nbsp;"+copyLabel+"</span>", true, new CopyCommand(this)).setVisible(cutcopyVisible);
187
		contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.cut()).getHTML() + "&nbsp;"+cutLabel+"</span>", true, new CutCommand(this)).setVisible(cutcopyVisible);
188
		contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.copy()).getHTML() + "&nbsp;"+copyLabel+"</span>", true, new CopyCommand(this)).setVisible(cutcopyVisible);
192 189
		if (GSS.get().getClipboard().getItem() != null)
193 190
			if(GSS.get().isUserListVisible() && GSS.get().getClipboard().getItem().getUser() == null)
194
				contextMenu.addItem("<span>" + images.paste().getHTML() + "&nbsp;"+pasteLabel+"</span>", true, new PasteCommand(this));
191
				contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.paste()).getHTML() + "&nbsp;"+pasteLabel+"</span>", true, new PasteCommand(this));
195 192
			else if(!GSS.get().isUserListVisible() && GSS.get().getClipboard().getItem().getUser() != null){
196 193
				//do not show paste
197 194
			}
198 195
			else if (GSS.get().getFolders().getCurrent().getUserObject() instanceof FolderResource)
199
				contextMenu.addItem("<span>" + images.paste().getHTML() + "&nbsp;"+pasteLabel+"</span>", true, new PasteCommand(this));
200
		contextMenu	.addItem("<span>" + images.emptyTrash().getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(this))
196
				contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.paste()).getHTML() + "&nbsp;"+pasteLabel+"</span>", true, new PasteCommand(this));
197
		contextMenu	.addItem("<span>" + AbstractImagePrototype.create(images.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(this))
201 198
					.setVisible(cutcopyVisible);
202
		contextMenu	.addItem("<span>" + images.delete().getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, images))
199
		contextMenu	.addItem("<span>" + AbstractImagePrototype.create(images.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, images))
203 200
					.setVisible(cutcopyVisible);
204
		contextMenu.addItem("<span>" + images.selectAll().getHTML() + "&nbsp;Select All</span>", true, selectAllCommand);
205
		contextMenu.addItem("<span>" + images.unselectAll().getHTML() + "&nbsp;Unselect All</span>", true, unselectAllCommand);
201
		contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.selectAll()).getHTML() + "&nbsp;Select All</span>", true, selectAllCommand);
202
		contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.unselectAll()).getHTML() + "&nbsp;Unselect All</span>", true, unselectAllCommand);
206 203
		return contextMenu;
207 204
	}
208 205

  
206

  
207

  
209 208
}
b/src/gr/ebs/gss/client/FileContextMenu.java
33 33

  
34 34
import java.util.List;
35 35

  
36
import com.google.gwt.event.dom.client.ClickEvent;
37
import com.google.gwt.event.dom.client.ClickHandler;
38
import com.google.gwt.resources.client.ClientBundle;
39
import com.google.gwt.resources.client.ImageResource;
36 40
import com.google.gwt.user.client.Command;
37 41
import com.google.gwt.user.client.Event;
38 42
import com.google.gwt.user.client.ui.AbstractImagePrototype;
39
import com.google.gwt.user.client.ui.ClickListener;
40 43
import com.google.gwt.user.client.ui.MenuBar;
41 44
import com.google.gwt.user.client.ui.MenuItem;
42 45
import com.google.gwt.user.client.ui.PopupPanel;
43 46
import com.google.gwt.user.client.ui.TreeItem;
44
import com.google.gwt.user.client.ui.Widget;
45 47

  
46 48
/**
47 49
 * The 'File Context' menu implementation.
48 50
 */
49
public class FileContextMenu extends PopupPanel implements ClickListener {
51
public class FileContextMenu extends PopupPanel implements ClickHandler {
50 52

  
51 53
	/**
52 54
	 * The widget's images.
......
77 79
	 * The image bundle for this widget's images that reuses images defined in
78 80
	 * other menus.
79 81
	 */
80
	public interface Images extends FileMenu.Images, EditMenu.Images {
82
	public interface Images extends ClientBundle,FileMenu.Images, EditMenu.Images {
81 83

  
82
		@Resource("gr/ebs/gss/resources/mimetypes/document.png")
83
		AbstractImagePrototype fileContextMenu();
84
		@Source("gr/ebs/gss/resources/mimetypes/document.png")
85
		ImageResource fileContextMenu();
84 86

  
85
		@Resource("gr/ebs/gss/resources/doc_versions.png")
86
		AbstractImagePrototype versions();
87
		@Source("gr/ebs/gss/resources/doc_versions.png")
88
		ImageResource versions();
87 89

  
88
		@Resource("gr/ebs/gss/resources/group.png")
89
		AbstractImagePrototype sharing();
90
		@Source("gr/ebs/gss/resources/group.png")
91
		ImageResource sharing();
90 92

  
91
		@Resource("gr/ebs/gss/resources/border_remove.png")
92
		AbstractImagePrototype unselectAll();
93
		@Source("gr/ebs/gss/resources/border_remove.png")
94
		ImageResource unselectAll();
93 95

  
94
		@Resource("gr/ebs/gss/resources/demo.png")
95
		AbstractImagePrototype viewImage();
96
		@Source("gr/ebs/gss/resources/demo.png")
97
		ImageResource viewImage();
96 98
}
97 99

  
98 100
	public static native String getDate()/*-{
......
121 123
			}
122 124
		};
123 125

  
124
		pasteItem = new MenuItem("<span>" + newImages.paste().getHTML() + "&nbsp;Paste</span>", true, new PasteCommand(this));
126
		pasteItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.paste()).getHTML() + "&nbsp;Paste</span>", true, new PasteCommand(this));
125 127

  
126 128
		MenuBar contextMenu = new MenuBar(true);
127 129
		if (isEmpty) {
128 130
			contextMenu.addItem(pasteItem);
129 131
			if (GSS.get().getFolders().getCurrent() != null)
130 132
				if (GSS.get().getFolders().isFileItem(GSS.get().getFolders().getCurrent()))
131
					contextMenu.addItem("<span>" + newImages.fileUpdate().getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(this));
133
					contextMenu.addItem("<span>" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(this));
132 134
				else if (GSS.get().getFolders().isMySharedItem(GSS.get().getFolders().getCurrent()) || GSS	.get()
133 135
																											.getFolders()
134 136
																											.isOthersSharedItem(GSS	.get()
135 137
																																	.getFolders()
136 138
																																	.getCurrent()))
137 139
					if(GSS.get().getFolders().getCurrent().getUserObject() instanceof FolderResource)
138
						contextMenu.addItem("<span>" + newImages.fileUpdate().getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(this));
139
			contextMenu.addItem("<span>" + images.refresh().getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
140
						contextMenu.addItem("<span>" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(this));
141
			contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
140 142
		} else if (isTrash) {
141
			contextMenu.addItem("<span>" + newImages.versions().getHTML() + "&nbsp;Restore</span>", true, new RestoreTrashCommand(this));
142
			contextMenu.addItem("<span>" + newImages.delete().getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, images));
143
			contextMenu.addItem("<span>" + AbstractImagePrototype.create(newImages.versions()).getHTML() + "&nbsp;Restore</span>", true, new RestoreTrashCommand(this));
144
			contextMenu.addItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, images));
143 145
		} else {
144 146
			final Command unselectAllCommand = new Command() {
145 147

  
......
151 153
						GSS.get().getSearchResults().clearSelectedRows();
152 154
				}
153 155
			};
154
			cutItem = new MenuItem("<span>" + newImages.cut().getHTML() + "&nbsp;Cut</span>", true, new CutCommand(this));
155
			copyItem = new MenuItem("<span>" + newImages.copy().getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(this));
156
			cutItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut</span>", true, new CutCommand(this));
157
			copyItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(this));
156 158

  
157
			updateItem = new MenuItem("<span>" + newImages.fileUpdate().getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(this));
159
			updateItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(this));
158 160

  
159
			trashItem = new MenuItem("<span>" + newImages.emptyTrash().getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(this));
160
			deleteItem = new MenuItem("<span>" + newImages.delete().getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, images));
161
			trashItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(this));
162
			deleteItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, images));
161 163

  
162
			sharingItem = new MenuItem("<span>" + newImages.sharing().getHTML() + "&nbsp;Sharing</span>", true, new PropertiesCommand(this, images, 1));
163
			propItem = new MenuItem("<span>" + newImages.viewText().getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(this, images, 0));
164
			sharingItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + "&nbsp;Sharing</span>", true, new PropertiesCommand(this, images, 1));
165
			propItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(this, images, 0));
164 166

  
165 167
			TreeItem currentFolder = gss.getFolders().getCurrent();
166 168
			if(currentFolder!=null && currentFolder.getUserObject() instanceof FolderResource)
167 169
				contextMenu.addItem(updateItem);
168 170
			String[] link = {"", ""};
169 171
			gss.getTopPanel().getFileMenu().createDownloadLink(link, false);
170
			downloadItem = new MenuItem("<span>" + link[0] + newImages.download().getHTML() + " Download" + link[1] + "</span>", true, downloadCmd);
172
			downloadItem = new MenuItem("<span>" + link[0] + AbstractImagePrototype.create(newImages.download()).getHTML() + " Download" + link[1] + "</span>", true, downloadCmd);
171 173
			contextMenu.addItem(downloadItem);
172 174
			gss.getTopPanel().getFileMenu().createDownloadLink(link, true);
173
			saveAsItem = new MenuItem("<span>" + link[0] + newImages.download().getHTML() + " Save As" + link[1] + "</span>", true, downloadCmd);
175
			saveAsItem = new MenuItem("<span>" + link[0] + AbstractImagePrototype.create(newImages.download()).getHTML() + " Save As" + link[1] + "</span>", true, downloadCmd);
174 176
			contextMenu.addItem(saveAsItem);
175 177
			contextMenu.addItem(cutItem);
176 178
			contextMenu.addItem(copyItem);
177 179
			if(currentFolder!=null && currentFolder.getUserObject() instanceof FolderResource)
178 180
				contextMenu.addItem(pasteItem);
179
			contextMenu.addItem("<span>" + images.unselectAll().getHTML() + "&nbsp;Unselect</span>", true, unselectAllCommand);
181
			contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.unselectAll()).getHTML() + "&nbsp;Unselect</span>", true, unselectAllCommand);
180 182
			contextMenu.addItem(trashItem);
181 183
			contextMenu.addItem(deleteItem);
182
			contextMenu.addItem("<span>" + images.refresh().getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
184
			contextMenu.addItem("<span>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
183 185
			contextMenu.addItem(sharingItem);
184 186
			contextMenu.addItem(propItem);
185 187
		}
......
196 198
		saveAsItem.setVisible(false);
197 199
		sharingItem.setVisible(false);
198 200
	}
199

  
200
	public void onClick(Widget sender) {
201
	@Override
202
	public void onClick(ClickEvent event) {
201 203
		if (GSS.get().getCurrentSelection() != null)
202 204
			if (GSS.get().getCurrentSelection() instanceof FileResource) {
203 205
				FileResource res = (FileResource) GSS.get().getCurrentSelection();
......
206 208
					menu = new FileContextMenu(images, true, false);
207 209
				else
208 210
					menu = new FileContextMenu(images, false, false);
209
				int left = sender.getAbsoluteLeft();
210
				int top = sender.getAbsoluteTop() + sender.getOffsetHeight();
211
				int left = event.getRelativeElement().getAbsoluteLeft();
212
				int top = event.getRelativeElement().getAbsoluteTop() + event.getRelativeElement().getOffsetHeight();
211 213
				menu.setPopupPosition(left, top);
212 214
				menu.show();
213 215
			} else if (GSS.get().getCurrentSelection() instanceof List) {
......
218 220
					menu = new FileContextMenu(images, false, false);
219 221
					menu.onMultipleSelection();
220 222
				}
221
				int left = sender.getAbsoluteLeft();
222
				int top = sender.getAbsoluteTop() + sender.getOffsetHeight();
223
				int left = event.getRelativeElement().getAbsoluteLeft();
224
				int top = event.getRelativeElement().getAbsoluteTop() + event.getRelativeElement().getOffsetHeight();
223 225
				menu.setPopupPosition(left, top);
224 226
				menu.show();
225 227
			}
......
265 267
		menu.setPopupPosition(left, top);
266 268
		menu.show();
267 269
	}
270

  
271

  
268 272
}
b/src/gr/ebs/gss/client/FileList.java
37 37
import java.util.List;
38 38

  
39 39
import com.google.gwt.core.client.GWT;
40
import com.google.gwt.event.dom.client.ClickEvent;
41
import com.google.gwt.event.dom.client.ClickHandler;
40 42
import com.google.gwt.http.client.URL;
41 43
import com.google.gwt.i18n.client.DateTimeFormat;
44
import com.google.gwt.resources.client.ClientBundle;
45
import com.google.gwt.resources.client.ImageResource;
42 46
import com.google.gwt.user.client.DOM;
43 47
import com.google.gwt.user.client.DeferredCommand;
44 48
import com.google.gwt.user.client.Event;
45 49
import com.google.gwt.user.client.IncrementalCommand;
46 50
import com.google.gwt.user.client.Window;
47 51
import com.google.gwt.user.client.ui.AbstractImagePrototype;
48
import com.google.gwt.user.client.ui.ClickListener;
49 52
import com.google.gwt.user.client.ui.Composite;
50 53
import com.google.gwt.user.client.ui.Grid;
51 54
import com.google.gwt.user.client.ui.HTML;
52 55
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
53 56
import com.google.gwt.user.client.ui.HorizontalPanel;
54
import com.google.gwt.user.client.ui.SourcesTableEvents;
55
import com.google.gwt.user.client.ui.TableListener;
56 57
import com.google.gwt.user.client.ui.TreeItem;
57 58
import com.google.gwt.user.client.ui.Widget;
59
import com.google.gwt.user.client.ui.HTMLTable.Cell;
58 60

  
59 61
/**
60 62
 * A composite that displays the list of files in a particular folder.
61 63
 */
62
public class FileList extends Composite implements TableListener, ClickListener {
64
public class FileList extends Composite implements ClickHandler {
63 65

  
64 66
	private HTML prevButton = new HTML("<a href='javascript:;'>&lt; Previous</a>", true);
65 67

  
......
91 93
	 * Specifies that the images available for this composite will be the ones
92 94
	 * available in FileContextMenu.
93 95
	 */
94
	public interface Images extends FileContextMenu.Images, Folders.Images {
96
	public interface Images extends ClientBundle,FileContextMenu.Images, Folders.Images {
95 97

  
96
		@Resource("gr/ebs/gss/resources/blank.gif")
97
		AbstractImagePrototype blank();
98
		@Source("gr/ebs/gss/resources/blank.gif")
99
		ImageResource blank();
98 100

  
99
		@Resource("gr/ebs/gss/resources/asc.png")
100
		AbstractImagePrototype asc();
101
		@Source("gr/ebs/gss/resources/asc.png")
102
		ImageResource asc();
101 103

  
102
		@Resource("gr/ebs/gss/resources/desc.png")
103
		AbstractImagePrototype desc();
104
		@Source("gr/ebs/gss/resources/desc.png")
105
		ImageResource desc();
104 106

  
105
		@Resource("gr/ebs/gss/resources/mimetypes/document_shared.png")
106
		AbstractImagePrototype documentShared();
107
		@Source("gr/ebs/gss/resources/mimetypes/document_shared.png")
108
		ImageResource documentShared();
107 109

  
108
		@Resource("gr/ebs/gss/resources/mimetypes/kcmfontinst.png")
109
		AbstractImagePrototype wordprocessor();
110
		@Source("gr/ebs/gss/resources/mimetypes/kcmfontinst.png")
111
		ImageResource wordprocessor();
110 112

  
111
		@Resource("gr/ebs/gss/resources/mimetypes/log.png")
112
		AbstractImagePrototype spreadsheet();
113
		@Source("gr/ebs/gss/resources/mimetypes/log.png")
114
		ImageResource spreadsheet();
113 115

  
114
		@Resource("gr/ebs/gss/resources/mimetypes/kpresenter_kpr.png")
115
		AbstractImagePrototype presentation();
116
		@Source("gr/ebs/gss/resources/mimetypes/kpresenter_kpr.png")
117
		ImageResource presentation();
116 118

  
117
		@Resource("gr/ebs/gss/resources/mimetypes/acroread.png")
118
		AbstractImagePrototype pdf();
119
		@Source("gr/ebs/gss/resources/mimetypes/acroread.png")
120
		ImageResource pdf();
119 121

  
120
		@Resource("gr/ebs/gss/resources/mimetypes/image.png")
121
		AbstractImagePrototype image();
122
		@Source("gr/ebs/gss/resources/mimetypes/image.png")
123
		ImageResource image();
122 124

  
123
		@Resource("gr/ebs/gss/resources/mimetypes/video2.png")
124
		AbstractImagePrototype video();
125
		@Source("gr/ebs/gss/resources/mimetypes/video2.png")
126
		ImageResource video();
125 127

  
126
		@Resource("gr/ebs/gss/resources/mimetypes/knotify.png")
127
		AbstractImagePrototype audio();
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff