Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Class-Path: lib/swt.jar lib/org.eclipse.jface_3.2.0.I20060605-1400.jar
lib/org.eclipse.osgi_3.2.0.v20060601.jar
private void createSShell()
{
resource = Resource.getInstance();
...
import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
public class Resource
{
// For a singleton instance
private static Resource instance = null;
public ColorRegistry colorRegistry = null;
public ImageRegistry imageRegistry = null;
protected Resource()
{
colorRegistry = new ColorRegistry();
imageRegistry = new ImageRegistry();
addImages();
addColors();
}
public static Resource getInstance()
{
if (instance == null)
{
instance = new Resource();
}
return instance;
}
private void addImages()
{
Display display = Display.getDefault();
imageRegistry.put("Bild", new Image(display, getClass().getResourceAsStream("/images/blue.ico")));
}
private void addColors()
{
colorRegistry.put("blue", new RGB(0,39,159));
colorRegistry.put("green", new RGB(102,204,51));
colorRegistry.put("orange", new RGB(0253,153,0));
}
}
getClass().getResourceAsStream("/images/blue.ico")
Resource.class.getResourceAsStream("/images/blue.ico")