diff 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
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java	Mon Nov 14 13:19:02 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java	Thu Nov 17 14:10:51 2011 +0000
@@ -67,9 +67,6 @@
     /** The message class that provides i18n strings. */
     protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class);
 
-    /** The interface that provides the image resources. */
-    private FLYSImages IMAGES = GWT.create(FLYSImages.class);
-
     /** The DistanceInfoService used to retrieve locations about rivers. */
     protected DistanceInfoServiceAsync distanceInfoService =
         GWT.create(DistanceInfoService.class);
@@ -202,6 +199,8 @@
      */
     protected void createDistanceTable() {
 
+        String baseUrl = GWT.getHostPageBaseURL();
+
         distanceTable.setWidth100();
         distanceTable.setShowRecordComponents(true);
         distanceTable.setShowRecordComponentsByCell(true);
@@ -272,7 +271,7 @@
                 }
             }
         });
-        addDistance.setCellIcon(IMAGES.markerGreen().getURL());
+        addDistance.setCellIcon(baseUrl + MESSAGES.markerGreen());
 
         ListGridField ddescr = new ListGridField("description",
                 MESSAGES.description());
@@ -314,6 +313,9 @@
      * This method creates a table that contains the location values.
      */
     protected void createLocationTable() {
+
+        String baseUrl = GWT.getHostPageBaseURL();
+
         locationsTable.setWidth100();
         locationsTable.setShowRecordComponents(true);
         locationsTable.setShowRecordComponentsByCell(true);
@@ -371,7 +373,7 @@
                 setLocationValues(selected);
             }
         });
-        addLocation.setCellIcon (IMAGES.markerGreen ().getURL ());
+        addLocation.setCellIcon (baseUrl + MESSAGES.markerGreen ());
 
         ListGridField ldescr = new ListGridField("description",
                 MESSAGES.description());
@@ -407,6 +409,9 @@
      * This method creates a table that contains the location values.
      */
     protected void createLocationTableDistance (){
+
+        String baseUrl = GWT.getHostPageBaseURL();
+
         locationDistanceTable.setWidth100();
         locationDistanceTable.setShowRecordComponents(true);
         locationDistanceTable.setShowRecordComponentsByCell(true);
@@ -435,12 +440,12 @@
         ListGridField addfrom = new ListGridField ("", "");
         addfrom.setType (ListGridFieldType.ICON);
         addfrom.setWidth (20);
-        addfrom.setCellIcon (IMAGES.markerGreen ().getURL ());
+        addfrom.setCellIcon(baseUrl + MESSAGES.markerGreen());
 
         ListGridField addto2 = new ListGridField ("", "");
         addto2.setType (ListGridFieldType.ICON);
         addto2.setWidth (20);
-        addto2.setCellIcon (IMAGES.markerRed ().getURL ());
+        addto2.setCellIcon(baseUrl + MESSAGES.markerRed());
 
         locationDistanceTable.addCellClickHandler (new CellClickHandler () {
             public void onCellClick (CellClickEvent e) {

http://dive4elements.wald.intevation.org