comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java @ 1399:748e7c828d03

Issue312. Moved images and get image urls from constants to completly support IE7. flys-client/trunk@3284 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 17 Nov 2011 14:10:51 +0000
parents 819ce433243c
children 047a44270348
comparison
equal deleted inserted replaced
1398:3f6d2f18ee7b 1399:748e7c828d03
65 implements ChangeHandler, BlurHandler, FilterHandler 65 implements ChangeHandler, BlurHandler, FilterHandler
66 { 66 {
67 /** The message class that provides i18n strings. */ 67 /** The message class that provides i18n strings. */
68 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); 68 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class);
69 69
70 /** The interface that provides the image resources. */
71 private FLYSImages IMAGES = GWT.create(FLYSImages.class);
72
73 /** The DistanceInfoService used to retrieve locations about rivers. */ 70 /** The DistanceInfoService used to retrieve locations about rivers. */
74 protected DistanceInfoServiceAsync distanceInfoService = 71 protected DistanceInfoServiceAsync distanceInfoService =
75 GWT.create(DistanceInfoService.class); 72 GWT.create(DistanceInfoService.class);
76 73
77 public static final String FIELD_MODE = "mode"; 74 public static final String FIELD_MODE = "mode";
199 196
200 /** 197 /**
201 * This method creates a table that contains the distance values. 198 * This method creates a table that contains the distance values.
202 */ 199 */
203 protected void createDistanceTable() { 200 protected void createDistanceTable() {
201
202 String baseUrl = GWT.getHostPageBaseURL();
204 203
205 distanceTable.setWidth100(); 204 distanceTable.setWidth100();
206 distanceTable.setShowRecordComponents(true); 205 distanceTable.setShowRecordComponents(true);
207 distanceTable.setShowRecordComponentsByCell(true); 206 distanceTable.setShowRecordComponentsByCell(true);
208 distanceTable.setHeight100(); 207 distanceTable.setHeight100();
270 } 269 }
271 setLocationValues(selected); 270 setLocationValues(selected);
272 } 271 }
273 } 272 }
274 }); 273 });
275 addDistance.setCellIcon(IMAGES.markerGreen().getURL()); 274 addDistance.setCellIcon(baseUrl + MESSAGES.markerGreen());
276 275
277 ListGridField ddescr = new ListGridField("description", 276 ListGridField ddescr = new ListGridField("description",
278 MESSAGES.description()); 277 MESSAGES.description());
279 ddescr.setType(ListGridFieldType.TEXT); 278 ddescr.setType(ListGridFieldType.TEXT);
280 ddescr.setWidth("*"); 279 ddescr.setWidth("*");
312 311
313 /** 312 /**
314 * This method creates a table that contains the location values. 313 * This method creates a table that contains the location values.
315 */ 314 */
316 protected void createLocationTable() { 315 protected void createLocationTable() {
316
317 String baseUrl = GWT.getHostPageBaseURL();
318
317 locationsTable.setWidth100(); 319 locationsTable.setWidth100();
318 locationsTable.setShowRecordComponents(true); 320 locationsTable.setShowRecordComponents(true);
319 locationsTable.setShowRecordComponentsByCell(true); 321 locationsTable.setShowRecordComponentsByCell(true);
320 locationsTable.setHeight100(); 322 locationsTable.setHeight100();
321 locationsTable.setEmptyMessage(MESSAGES.empty_filter()); 323 locationsTable.setEmptyMessage(MESSAGES.empty_filter());
369 Double.parseDouble(record.getAttribute("from")); 371 Double.parseDouble(record.getAttribute("from"));
370 } 372 }
371 setLocationValues(selected); 373 setLocationValues(selected);
372 } 374 }
373 }); 375 });
374 addLocation.setCellIcon (IMAGES.markerGreen ().getURL ()); 376 addLocation.setCellIcon (baseUrl + MESSAGES.markerGreen ());
375 377
376 ListGridField ldescr = new ListGridField("description", 378 ListGridField ldescr = new ListGridField("description",
377 MESSAGES.description()); 379 MESSAGES.description());
378 ldescr.setType(ListGridFieldType.TEXT); 380 ldescr.setType(ListGridFieldType.TEXT);
379 ldescr.setWidth("*"); 381 ldescr.setWidth("*");
405 407
406 /** 408 /**
407 * This method creates a table that contains the location values. 409 * This method creates a table that contains the location values.
408 */ 410 */
409 protected void createLocationTableDistance (){ 411 protected void createLocationTableDistance (){
412
413 String baseUrl = GWT.getHostPageBaseURL();
414
410 locationDistanceTable.setWidth100(); 415 locationDistanceTable.setWidth100();
411 locationDistanceTable.setShowRecordComponents(true); 416 locationDistanceTable.setShowRecordComponents(true);
412 locationDistanceTable.setShowRecordComponentsByCell(true); 417 locationDistanceTable.setShowRecordComponentsByCell(true);
413 locationDistanceTable.setHeight100(); 418 locationDistanceTable.setHeight100();
414 locationDistanceTable.setEmptyMessage(MESSAGES.empty_filter()); 419 locationDistanceTable.setEmptyMessage(MESSAGES.empty_filter());
433 }; 438 };
434 439
435 ListGridField addfrom = new ListGridField ("", ""); 440 ListGridField addfrom = new ListGridField ("", "");
436 addfrom.setType (ListGridFieldType.ICON); 441 addfrom.setType (ListGridFieldType.ICON);
437 addfrom.setWidth (20); 442 addfrom.setWidth (20);
438 addfrom.setCellIcon (IMAGES.markerGreen ().getURL ()); 443 addfrom.setCellIcon(baseUrl + MESSAGES.markerGreen());
439 444
440 ListGridField addto2 = new ListGridField ("", ""); 445 ListGridField addto2 = new ListGridField ("", "");
441 addto2.setType (ListGridFieldType.ICON); 446 addto2.setType (ListGridFieldType.ICON);
442 addto2.setWidth (20); 447 addto2.setWidth (20);
443 addto2.setCellIcon (IMAGES.markerRed ().getURL ()); 448 addto2.setCellIcon(baseUrl + MESSAGES.markerRed());
444 449
445 locationDistanceTable.addCellClickHandler (new CellClickHandler () { 450 locationDistanceTable.addCellClickHandler (new CellClickHandler () {
446 public void onCellClick (CellClickEvent e) { 451 public void onCellClick (CellClickEvent e) {
447 if (e.getColNum() == 0) { 452 if (e.getColNum() == 0) {
448 Record r = e.getRecord (); 453 Record r = e.getRecord ();

http://dive4elements.wald.intevation.org