Branding with RAP 1.5 [message #992379] |
Fri, 21 December 2012 09:04  |
Eclipse User |
|
|
|
Hi
we wanted to migrate a RAP 1.4 application and planned to go to RAP 1.5.
But we did not manage to register the FAVICON resource in the configuration application.
So we tried with RAP 2.0 M3 and managed to register the ICON with the code shown below.
But how to we do that with RAP 1.5?
Particularly, i do not know how to create the IRESOURCE that must be passed to application.addResource().
Thanks
Andrej
public class KabeMainConfiguration implements ApplicationConfiguration {
private INIFileHandler iniFileHandler = new INIFileHandler(RAPConstants.rapIniFileName); // INI-Filehandler-Object
@Override
public void configure( Application application ) {
try
{
String favIcon = "file://localhost"+iniFileHandler.getEntry("imagePath") + "favIcon.ico";
Map<String, String> properties = new HashMap<String, String>();
properties.put(WebClient.PAGE_TITLE, "Produktecenter");
properties.put( WebClient.FAVICON, favIcon);
ResourceLoader rl = createResourceLoader(favIcon);
application.addResource(favIcon, rl);
application.addEntryPoint("/kabe", KabeMain.class, properties);
} catch (Exception ex)
{
System.out.println(ex.getMessage());
}
}
private ResourceLoader createResourceLoader(final String resourceName)
{
return new ResourceLoader()
{
@Override
public InputStream getResourceAsStream(String resourceName) throws IOException{
URL url = new URL(resourceName);
return (InputStream) url.getContent();
}
};
}
}
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03030 seconds