Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 145933 Details for
Bug 281787
Bundle image resources exposed under changing context
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed fix
clipboard.txt (text/plain), 29.19 KB, created by
RĂ¼diger Herrmann
on 2009-08-28 09:27:32 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
RĂ¼diger Herrmann
Created:
2009-08-28 09:27:32 EDT
Size:
29.19 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/rwt/internal/theme/ThemeManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/theme/ThemeManager.java,v >retrieving revision 1.65 >diff -u -r1.65 ThemeManager.java >--- src/org/eclipse/rwt/internal/theme/ThemeManager.java 27 Aug 2009 11:19:52 -0000 1.65 >+++ src/org/eclipse/rwt/internal/theme/ThemeManager.java 28 Aug 2009 13:29:59 -0000 >@@ -114,10 +114,10 @@ > }; > > /** Where to load the default non-themeable images from */ >- private static final String WIDGET_RESOURCES_SRC = "resource/widget/rap"; >+ private static final String WIDGET_RESOURCES_SRC = "resource/widget/rap/"; > > /** Destination path for theme resources */ >- private static final String THEME_RESOURCE_DEST = "resource/themes"; >+ private static final String THEME_RESOURCE_DEST = "resources/themes"; > private static final String THEME_PREFIX = "org.eclipse.swt.theme."; > > private static final String PREDEFINED_THEME_ID = THEME_PREFIX + "Default"; >@@ -643,7 +643,7 @@ > log( " == register non-themeable images for theme " + themeId ); > for( int i = 0; i < WIDGET_NOTHEME_RESOURCES.length; i++ ) { > String imagePath = WIDGET_NOTHEME_RESOURCES[ i ]; >- String res = WIDGET_RESOURCES_SRC + "/" + imagePath; >+ String res = WIDGET_RESOURCES_SRC + imagePath; > InputStream inputStream = classLoader.getResourceAsStream( res ); > if( inputStream == null ) { > String mesg = "Resource not found: " + res; >Index: src/org/eclipse/rwt/internal/theme/QxImage.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/theme/QxImage.java,v >retrieving revision 1.9 >diff -u -r1.9 QxImage.java >--- src/org/eclipse/rwt/internal/theme/QxImage.java 4 Aug 2009 16:13:45 -0000 1.9 >+++ src/org/eclipse/rwt/internal/theme/QxImage.java 28 Aug 2009 13:29:59 -0000 >@@ -9,7 +9,6 @@ > * Innoopract Informationssysteme GmbH - initial API and implementation > * EclipseSource - ongoing development > ******************************************************************************/ >- > package org.eclipse.rwt.internal.theme; > > import java.io.IOException; >@@ -23,20 +22,15 @@ > > private static final String NONE_INPUT = "none"; > >- public static final QxImage NONE = new QxImage( true, null, null, null, null ); >+ public static final QxImage NONE >+ = new QxImage( true, null, null, null, null ); > > public final boolean none; >- > public final String path; >- > public final ResourceLoader loader; >- > public final String[] gradientColors; >- > public final float[] gradientPercents; >- > public final int width; >- > public final int height; > > /** >@@ -82,7 +76,8 @@ > } > } > >- public static QxImage valueOf( final String input, final ResourceLoader loader ) >+ public static QxImage valueOf( final String input, >+ final ResourceLoader loader ) > { > QxImage result; > if( NONE_INPUT.equals( input ) ) { >Index: src/org/eclipse/rwt/internal/resources/ResourceManagerImpl.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/resources/ResourceManagerImpl.java,v >retrieving revision 1.7 >diff -u -r1.7 ResourceManagerImpl.java >--- src/org/eclipse/rwt/internal/resources/ResourceManagerImpl.java 26 Aug 2009 10:01:52 -0000 1.7 >+++ src/org/eclipse/rwt/internal/resources/ResourceManagerImpl.java 28 Aug 2009 13:29:59 -0000 >@@ -37,6 +37,8 @@ > implements IResourceManager, Adaptable > { > >+ public static final String RESOURCES = "resources"; >+ > /** <p>The singleton instance of ResourceManager.</p> */ > private static IResourceManager _instance; > >@@ -364,6 +366,8 @@ > StringBuffer url = new StringBuffer(); > url.append( URLHelper.getContextURLString() ); > url.append( "/" ); >+ url.append( RESOURCES ); >+ url.append( "/" ); > String escapedFilename = escapeFilename( newFileName ); > url.append( versionedResourceName( escapedFilename, version ) ); > result = url.toString(); >@@ -504,6 +508,8 @@ > StringBuffer filename = new StringBuffer(); > filename.append( webAppRoot ); > filename.append( File.separator ); >+ filename.append( RESOURCES ); >+ filename.append( File.separator ); > filename.append( versionedResourceName( escapeFilename( name ), version ) ); > return new File( filename.toString() ); > } >Index: src/org/eclipse/swt/internal/graphics/ImageDataCache.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/graphics/ImageDataCache.java,v >retrieving revision 1.3 >diff -u -r1.3 ImageDataCache.java >--- src/org/eclipse/swt/internal/graphics/ImageDataCache.java 3 Apr 2008 09:39:50 -0000 1.3 >+++ src/org/eclipse/swt/internal/graphics/ImageDataCache.java 28 Aug 2009 13:29:59 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2008 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2008, 2009 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing development > ******************************************************************************/ > package org.eclipse.swt.internal.graphics; > >@@ -16,18 +17,15 @@ > import org.eclipse.swt.graphics.Image; > > >-public class ImageDataCache { >+final class ImageDataCache { > > /** Maximum size of image data that is being cached */ > private static final int MAX_DATA_SIZE = 1024; > >- /** Maximum number of elements to hold in the image data cache */ >- private static final int MAX_FILL_SIZE = 100; >- > private final Map cache; > >- public ImageDataCache() { >- cache = new HashMap( MAX_FILL_SIZE / 4 ); >+ ImageDataCache() { >+ cache = new HashMap( 25 ); > } > > /** >@@ -37,7 +35,7 @@ > * @return a secure copy of the cached image data, or <code>null</code> if > * no image data have been cached for the given image > */ >- public ImageData getImageData( final Image image ) { >+ ImageData getImageData( final Image image ) { > if( image == null ) { > throw new NullPointerException( "null argument" ); > } >@@ -54,18 +52,13 @@ > * @param image the image whose image data to store > * @param imageData the image data to be stored > */ >- public synchronized void putImageData( final Image image, >- final ImageData imageData ) >- { >+ void putImageData( final Image image, final ImageData imageData ) { > if( image == null || imageData == null ) { > throw new NullPointerException( "null argument" ); > } > if( imageData.data.length <= MAX_DATA_SIZE ) { >+ // TODO [rst] Implement replacement strategy (LRU or LFU) > synchronized( cache ) { >- if( cache.size() > MAX_FILL_SIZE ) { >- // TODO [rst] Implement replacement strategy (LRU or LFU) >-// cache.remove( key ); >- } > cache.put( image, imageData.clone() ); > } > } >Index: src/org/eclipse/swt/internal/graphics/ResourceFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/swt/internal/graphics/ResourceFactory.java,v >retrieving revision 1.18 >diff -u -r1.18 ResourceFactory.java >--- src/org/eclipse/swt/internal/graphics/ResourceFactory.java 4 Aug 2009 14:08:37 -0000 1.18 >+++ src/org/eclipse/swt/internal/graphics/ResourceFactory.java 28 Aug 2009 13:30:00 -0000 >@@ -174,15 +174,23 @@ > return result; > } > >- public static synchronized String getImagePath( final Image image ) { >+ public static String getImagePath( final Image image ) { >+ String result = getImageName( image ); >+ if( result != null ) { >+ result = ResourceManager.getInstance().getLocation( result ); >+ } >+ return result; >+ } >+ >+ private static synchronized String getImageName( final Image image ) { > String result = null; > Iterator it = images.entrySet().iterator(); >- boolean next = true; >- while( next && it.hasNext() ) { >+ boolean found = false; >+ while( !found && it.hasNext() ) { > Map.Entry entry = ( Map.Entry )it.next(); > if( entry.getValue().equals( image ) ) { > result = ( String )entry.getKey(); >- next = false; >+ found = true; > } > } > return result; >@@ -192,7 +200,7 @@ > ImageData result = imageDataCache.getImageData( image ); > if( result == null ) { > IResourceManager manager = ResourceManager.getInstance(); >- String imagePath = getImagePath( image ); >+ String imagePath = getImageName( image ); > if( imagePath != null ) { > try { > InputStream inputStream = manager.getRegisteredContent( imagePath ); >Index: src/org/eclipse/rwt/internal/service/rwt-index.html >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/service/rwt-index.html,v >retrieving revision 1.2 >diff -u -r1.2 rwt-index.html >--- src/org/eclipse/rwt/internal/service/rwt-index.html 8 Oct 2008 20:30:45 -0000 1.2 >+++ src/org/eclipse/rwt/internal/service/rwt-index.html 28 Aug 2009 13:29:59 -0000 >@@ -6,7 +6,7 @@ > ${headers} > </head> > >- <body background="resource/widget/rap/display/bg.gif"> >+ <body background="resources/resource/widget/rap/display/bg.gif"> > > <!-- body of branding --> > ${body} >#P org.eclipse.rap.rwt.q07.test >Index: src/org/eclipse/rwt/lifecycle/ControlLCAUtil_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.q07.test/src/org/eclipse/rwt/lifecycle/ControlLCAUtil_Test.java,v >retrieving revision 1.20 >diff -u -r1.20 ControlLCAUtil_Test.java >--- src/org/eclipse/rwt/lifecycle/ControlLCAUtil_Test.java 20 Aug 2009 10:05:16 -0000 1.20 >+++ src/org/eclipse/rwt/lifecycle/ControlLCAUtil_Test.java 28 Aug 2009 13:30:02 -0000 >@@ -574,9 +574,10 @@ > RWTFixture.markInitialized( control ); > control.setBackgroundImage( Graphics.getImage( RWTFixture.IMAGE1 ) ); > ControlLCAUtil.writeBackgroundImage( control ); >+ String imageLocation = "resources/" + RWTFixture.IMAGE1; > String expected = "var w = wm.findWidgetById( \"w2\" );" > + "w.setBackgroundImage( \"" >- + RWTFixture.IMAGE1 >+ + imageLocation > + "\" );"; > assertEquals( expected, Fixture.getAllMarkup() ); > >Index: src/org/eclipse/swt/internal/widgets/buttonkit/ButtonLCA_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.q07.test/src/org/eclipse/swt/internal/widgets/buttonkit/ButtonLCA_Test.java,v >retrieving revision 1.9 >diff -u -r1.9 ButtonLCA_Test.java >--- src/org/eclipse/swt/internal/widgets/buttonkit/ButtonLCA_Test.java 4 Aug 2009 14:04:14 -0000 1.9 >+++ src/org/eclipse/swt/internal/widgets/buttonkit/ButtonLCA_Test.java 28 Aug 2009 13:30:02 -0000 >@@ -506,7 +506,8 @@ > lca.renderChanges( button ); > String allMarkup = Fixture.getAllMarkup(); > assertTrue( allMarkup.indexOf( "w.setText( \"Test\" );" ) != -1 ); >- String expected = "w.setImage( \"" + RWTFixture.IMAGE1 + "\", 58, 12 );"; >+ String imageLocation = "resources/" + RWTFixture.IMAGE1; >+ String expected = "w.setImage( \"" + imageLocation + "\", 58, 12 );"; > assertTrue( allMarkup.indexOf( expected ) != -1 ); > Fixture.fakeResponseWriter(); > lca.preserveValues( button ); >#P org.eclipse.rap.rwt.testfixture >Index: src/org/eclipse/swt/RWTFixture.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.testfixture/src/org/eclipse/swt/RWTFixture.java,v >retrieving revision 1.6 >diff -u -r1.6 RWTFixture.java >--- src/org/eclipse/swt/RWTFixture.java 4 Aug 2009 14:08:38 -0000 1.6 >+++ src/org/eclipse/swt/RWTFixture.java 28 Aug 2009 13:30:03 -0000 >@@ -78,7 +78,7 @@ > } > > public String getLocation( final String name ) { >- return null; >+ return "resources/" + name; > } > > public URL getResource( final String name ) { >#P org.eclipse.rap.rwt.q07 >Index: js/org/eclipse/swt/theme/ThemeValues.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/js/org/eclipse/swt/theme/ThemeValues.js,v >retrieving revision 1.20 >diff -u -r1.20 ThemeValues.js >--- js/org/eclipse/swt/theme/ThemeValues.js 25 Aug 2009 12:55:40 -0000 1.20 >+++ js/org/eclipse/swt/theme/ThemeValues.js 28 Aug 2009 13:30:05 -0000 >@@ -108,7 +108,9 @@ > var result = values.images[ vkey ]; > this.__checkDefined( result, element, key ); > if( result != null ) { >- result = "resource/themes/images/" + result[ 0 ]; >+ // TODO [rh] remove hard-coded path (first segment is defined by >+ // resource-manager) >+ result = "resources/themes/images/" + result[ 0 ]; > } else { > // TODO [rst] Handle null values - currently, both null and the string > // "undefined" lead to a js error for icon property >@@ -119,13 +121,12 @@ > > getCssSizedImage : function( element, key ) { > var vkey = this._store.getCssValue( element, this._states, key ); >- var values = this._store.getThemeValues(); >- var result = values.images[ vkey ]; >+ var result = this._store.getThemeValues().images[ vkey ]; > this.__checkDefined( result, element, key ); > // TODO [tb] : Revise hardcoded path >- return result = [ "resource/themes/images/" + result[ 0 ], >- result[ 1 ], >- result[ 2 ] ]; >+ return [ "resources/themes/images/" + result[ 0 ], >+ result[ 1 ], >+ result[ 2 ] ]; > }, > > getCssGradient : function( element, key ) { >Index: js/org/eclipse/swt/theme/AppearancesBase.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/js/org/eclipse/swt/theme/AppearancesBase.js,v >retrieving revision 1.126 >diff -u -r1.126 AppearancesBase.js >--- js/org/eclipse/swt/theme/AppearancesBase.js 25 Aug 2009 12:55:40 -0000 1.126 >+++ js/org/eclipse/swt/theme/AppearancesBase.js 28 Aug 2009 13:30:05 -0000 >@@ -72,7 +72,7 @@ > textColor : "black", > backgroundColor : "white", > // TODO [rst] Eliminate absolute references >- backgroundImage : "./resource/widget/rap/display/bg.gif" >+ backgroundImage : "./resources/resource/widget/rap/display/bg.gif" > }; > } > }, >Index: src/org/eclipse/rwt/internal/lifecycle/JSConst.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/rwt/internal/lifecycle/JSConst.java,v >retrieving revision 1.8 >diff -u -r1.8 JSConst.java >--- src/org/eclipse/rwt/internal/lifecycle/JSConst.java 25 Aug 2009 12:55:42 -0000 1.8 >+++ src/org/eclipse/rwt/internal/lifecycle/JSConst.java 28 Aug 2009 13:30:05 -0000 >@@ -145,7 +145,6 @@ > public static final String QX_FIELD_FONT = "font"; > public static final String QX_FIELD_COLOR = "textColor"; > public static final String QX_FIELD_BG_COLOR = "backgroundColor"; >- public static final String QX_FIELD_BG_IMAGE = "backgroundImage"; > public static final String QX_FIELD_ORIENTATION = "orientation"; > public static final String QX_FIELD_CAPTION = "caption"; > public static final String QX_FIELD_ENABLED = "enabled"; >Index: src/org/eclipse/rwt/lifecycle/ControlLCAUtil.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/rwt/lifecycle/ControlLCAUtil.java,v >retrieving revision 1.13 >diff -u -r1.13 ControlLCAUtil.java >--- src/org/eclipse/rwt/lifecycle/ControlLCAUtil.java 20 Aug 2009 10:05:26 -0000 1.13 >+++ src/org/eclipse/rwt/lifecycle/ControlLCAUtil.java 28 Aug 2009 13:30:05 -0000 >@@ -431,9 +431,9 @@ > JSWriter writer = JSWriter.getWriterFor( control ); > if( image != null ) { > String imagePath = ResourceFactory.getImagePath( image ); >- writer.set( JSConst.QX_FIELD_BG_IMAGE, imagePath ); >+ writer.set( "backgroundImage", imagePath ); > } else { >- writer.reset( JSConst.QX_FIELD_BG_IMAGE ); >+ writer.reset( "backgroundImage" ); > } > } > } >Index: js/org/eclipse/swt/Application.js >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt.q07/js/org/eclipse/swt/Application.js,v >retrieving revision 1.12 >diff -u -r1.12 Application.js >--- js/org/eclipse/swt/Application.js 17 Aug 2009 20:17:07 -0000 1.12 >+++ js/org/eclipse/swt/Application.js 28 Aug 2009 13:30:04 -0000 >@@ -95,8 +95,8 @@ > qx.ui.basic.ScrollBar.EVENT_DELAY = 125; > // Overwrite the default mapping for internal images. This is necessary > // if the application is deployed under a root different from "/". >- qx.io.Alias.getInstance().add( "static", "./resource/static" ); >- qx.io.Alias.getInstance().add( "org.eclipse.swt", "./resource" ); >+ qx.io.Alias.getInstance().add( "static", "./resources/resource/static" ); >+ qx.io.Alias.getInstance().add( "org.eclipse.swt", "./resources/resource" ); > // Observe window size > var doc = qx.ui.core.ClientDocument.getInstance(); > doc.addEventListener( "windowresize", >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/rwt/internal/resources/ResourceManagerImpl_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/rwt/internal/resources/ResourceManagerImpl_Test.java,v >retrieving revision 1.7 >diff -u -r1.7 ResourceManagerImpl_Test.java >--- src/org/eclipse/rwt/internal/resources/ResourceManagerImpl_Test.java 26 Aug 2009 10:02:06 -0000 1.7 >+++ src/org/eclipse/rwt/internal/resources/ResourceManagerImpl_Test.java 28 Aug 2009 13:30:07 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2008 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2009 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,8 +7,8 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing development > ******************************************************************************/ >- > package org.eclipse.rwt.internal.resources; > > import java.io.*; >@@ -50,7 +50,7 @@ > private static final int TEST_PORT = 4711; > private static final String TEST_SERVER = "TestCase"; > private static final String TEST_SERVLET_PATH = "/W4TDelegate"; >- private static final String TEST_REQUEST_URI >+ private static final String TEST_REQUEST_URI > = TEST_CONTEXT + "/W4TDelegate?anyParam=true"; > private static final String TEST_CONTEXT_URL > = "http://" >@@ -60,11 +60,11 @@ > + TEST_CONTEXT; > private static final String TEST_LOCATION_DISK > = TEST_CONTEXT_URL >- + "/" >+ + "/resources/" > + TEST_RESOURCE_1; > private static final String TEST_LOCATION_VERSIONED_DISK > = TEST_CONTEXT_URL >- + "/" >+ + "/resources/" > + TEST_RESOURCE_1_VERSIONED; > private static final String TEST_LOCATION_SERVLET > = TEST_CONTEXT_URL >@@ -84,7 +84,7 @@ > + RequestParams.RESOURCE_VERSION > + "=" > + "1895582734"; >- >+ > ///////// > // fields > private String webAppRoot; >@@ -181,7 +181,7 @@ > } > > public void testRegistrationServletTempDir() throws Exception { >- IResourceManager manager >+ IResourceManager manager > = getManager( ResourceBase.DELIVER_BY_SERVLET_AND_TEMP_DIR ); > clearTempFile(); > // register only existing resources >@@ -451,7 +451,7 @@ > // expected > } > } >- >+ > public void testGetRegisteredContent() throws Exception { > IResourceManager manager = getManager( ResourceBase.DELIVER_FROM_DISK ); > InputStream is = openStream( TEST_RESOURCE_2 ); >@@ -462,7 +462,7 @@ > content.close(); > assertNull( manager.getRegisteredContent( "not-there" ) ); > } >- >+ > /* > * 280582: resource registration fails when using ImageDescriptor.createFromURL > * https://bugs.eclipse.org/bugs/show_bug.cgi?id=280582 >@@ -477,13 +477,14 @@ > manager.register( name, inputStream ); > inputStream.close(); > String location = manager.getLocation( name ); >- assertEquals( "http://TestCase:4711/test/http$1//host$1port/path$$1", >- location ); >+ String expected >+ = "http://TestCase:4711/test/resources/http$1//host$1port/path$$1"; >+ assertEquals( expected, location ); > } > > /////////////////// > // helping methods >- >+ > private static int[] read( final InputStream input ) throws IOException { > int[] result = null; > try { >@@ -518,7 +519,11 @@ > } > > private String getResourceCopyFile( final String resourceName ) { >- return webAppRoot + File.separator + resourceName; >+ return webAppRoot >+ + File.separator >+ + "resources" >+ + File.separator >+ + resourceName; > } > > private String getResourceCopyInTempFile( final String resourceName ) { >@@ -573,15 +578,15 @@ > return null; > } > >- public long getDateHeader( String arg0 ) { >+ public long getDateHeader( final String arg0 ) { > return 0; > } > >- public String getHeader( String arg0 ) { >+ public String getHeader( final String arg0 ) { > return null; > } > >- public Enumeration getHeaders( String arg0 ) { >+ public Enumeration getHeaders( final String arg0 ) { > return null; > } > >@@ -589,7 +594,7 @@ > return null; > } > >- public int getIntHeader( String arg0 ) { >+ public int getIntHeader( final String arg0 ) { > return 0; > } > >@@ -617,7 +622,7 @@ > return null; > } > >- public boolean isUserInRole( String arg0 ) { >+ public boolean isUserInRole( final String arg0 ) { > return false; > } > >@@ -641,7 +646,7 @@ > return TEST_SERVLET_PATH; > } > >- public HttpSession getSession( boolean arg0 ) { >+ public HttpSession getSession( final boolean arg0 ) { > return null; > } > >@@ -665,7 +670,7 @@ > return false; > } > >- public Object getAttribute( String arg0 ) { >+ public Object getAttribute( final String arg0 ) { > return null; > } > >@@ -677,7 +682,7 @@ > return null; > } > >- public void setCharacterEncoding( String arg0 ) >+ public void setCharacterEncoding( final String arg0 ) > throws UnsupportedEncodingException > { > } >@@ -694,7 +699,7 @@ > return null; > } > >- public String getParameter( String arg0 ) { >+ public String getParameter( final String arg0 ) { > return null; > } > >@@ -702,7 +707,7 @@ > return null; > } > >- public String[] getParameterValues( String arg0 ) { >+ public String[] getParameterValues( final String arg0 ) { > return null; > } > >@@ -738,10 +743,10 @@ > return null; > } > >- public void setAttribute( String arg0, Object arg1 ) { >+ public void setAttribute( final String arg0, final Object arg1 ) { > } > >- public void removeAttribute( String arg0 ) { >+ public void removeAttribute( final String arg0 ) { > } > > public Locale getLocale() { >@@ -756,11 +761,11 @@ > return false; > } > >- public RequestDispatcher getRequestDispatcher( String arg0 ) { >+ public RequestDispatcher getRequestDispatcher( final String arg0 ) { > return null; > } > >- public String getRealPath( String arg0 ) { >+ public String getRealPath( final String arg0 ) { > return null; > } > >@@ -782,60 +787,60 @@ > } > private class TestResponse implements HttpServletResponse { > >- public void addCookie( Cookie arg0 ) { >+ public void addCookie( final Cookie arg0 ) { > } > >- public boolean containsHeader( String arg0 ) { >+ public boolean containsHeader( final String arg0 ) { > return false; > } > >- public String encodeURL( String arg0 ) { >+ public String encodeURL( final String arg0 ) { > return arg0; > } > >- public String encodeRedirectURL( String arg0 ) { >+ public String encodeRedirectURL( final String arg0 ) { > return null; > } > >- public String encodeUrl( String arg0 ) { >+ public String encodeUrl( final String arg0 ) { > return arg0; > } > >- public String encodeRedirectUrl( String arg0 ) { >+ public String encodeRedirectUrl( final String arg0 ) { > return null; > } > >- public void sendError( int arg0, String arg1 ) throws IOException { >+ public void sendError( final int arg0, final String arg1 ) throws IOException { > } > >- public void sendError( int arg0 ) throws IOException { >+ public void sendError( final int arg0 ) throws IOException { > } > >- public void sendRedirect( String arg0 ) throws IOException { >+ public void sendRedirect( final String arg0 ) throws IOException { > } > >- public void setDateHeader( String arg0, long arg1 ) { >+ public void setDateHeader( final String arg0, final long arg1 ) { > } > >- public void addDateHeader( String arg0, long arg1 ) { >+ public void addDateHeader( final String arg0, final long arg1 ) { > } > >- public void setHeader( String arg0, String arg1 ) { >+ public void setHeader( final String arg0, final String arg1 ) { > } > >- public void addHeader( String arg0, String arg1 ) { >+ public void addHeader( final String arg0, final String arg1 ) { > } > >- public void setIntHeader( String arg0, int arg1 ) { >+ public void setIntHeader( final String arg0, final int arg1 ) { > } > >- public void addIntHeader( String arg0, int arg1 ) { >+ public void addIntHeader( final String arg0, final int arg1 ) { > } > >- public void setStatus( int arg0 ) { >+ public void setStatus( final int arg0 ) { > } > >- public void setStatus( int arg0, String arg1 ) { >+ public void setStatus( final int arg0, final String arg1 ) { > } > > public String getCharacterEncoding() { >@@ -850,13 +855,13 @@ > return null; > } > >- public void setContentLength( int arg0 ) { >+ public void setContentLength( final int arg0 ) { > } > >- public void setContentType( String arg0 ) { >+ public void setContentType( final String arg0 ) { > } > >- public void setBufferSize( int arg0 ) { >+ public void setBufferSize( final int arg0 ) { > } > > public int getBufferSize() { >@@ -876,7 +881,7 @@ > public void reset() { > } > >- public void setLocale( Locale arg0 ) { >+ public void setLocale( final Locale arg0 ) { > } > > public Locale getLocale() { >@@ -887,7 +892,7 @@ > throw new UnsupportedOperationException(); > } > >- public void setCharacterEncoding( String charset ) { >+ public void setCharacterEncoding( final String charset ) { > throw new UnsupportedOperationException(); > } > } >Index: src/org/eclipse/swt/graphics/Image_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/swt/graphics/Image_Test.java,v >retrieving revision 1.8 >diff -u -r1.8 Image_Test.java >--- src/org/eclipse/swt/graphics/Image_Test.java 26 Aug 2009 10:02:06 -0000 1.8 >+++ src/org/eclipse/swt/graphics/Image_Test.java 28 Aug 2009 13:30:07 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2007 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2009 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,8 +7,8 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing development > ******************************************************************************/ >- > package org.eclipse.swt.graphics; > > import java.io.*; >@@ -37,8 +37,8 @@ > // assertEquals( 0, Image.size() ); > Image image1 = Graphics.getImage( RWTFixture.IMAGE1 ); > assertTrue( manager.isRegistered( RWTFixture.IMAGE1 ) ); >- String contextPath = Fixture.CONTEXT_DIR.getPath(); >- assertTrue( new File( contextPath + "/" + RWTFixture.IMAGE1 ).exists() ); >+ String contextPath = Fixture.CONTEXT_DIR.getPath() + "/resources/"; >+ assertTrue( new File( contextPath + RWTFixture.IMAGE1 ).exists() ); > // assertEquals( 1, Image.size() ); > Image image2 = Graphics.getImage( RWTFixture.IMAGE1 ); > assertTrue( manager.isRegistered( RWTFixture.IMAGE1 ) );
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 281787
:
140325
|
144956
|
145933
|
145938