EntryPoint

Identifier:
org.eclipse.rap.ui.entrypoint

Since:
RAP 1.0

Description:
For every RAP application, an entry point class must be registered with the framework. The framework will create a separate instance of this entry point for every user session. Entry points must implement the interface IEntryPoint.

An application can register several entrypoints, each at a different URL path. To access an entry point, the path that it is registered at must be appended to the context path of the application.

As an alternative to registering an entrypoint, Eclipse applications can also use the interface IApplication.

Configuration Markup:

<!ELEMENT extension (entrypoint+)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED

>


<!ELEMENT entrypoint EMPTY>

<!ATTLIST entrypoint

id        CDATA #REQUIRED

class     CDATA #REQUIRED

path      CDATA #IMPLIED

parameter CDATA #IMPLIED

>


Examples:

<extension
    id="org.eclipse.rap.demo.demoentrypoint"
    point="org.eclipse.rap.ui.entrypoint">
  <entrypoint
      id="org.eclipse.rap.demo.entrypoint"
      class="org.eclipse.rap.demo.MyEntrypoint"
      path="/myapp"/>
  </extension>

API Information:
Each entrypoint has to implement the IEntryPoint interface. In the createUI() method the user interface of the application is created. An entrypoint for a simple RAP application could look like this:

public class MyEntryPoint implements IEntryPoint {

  public int createUI() {
    Display display = new Display();
    Shell shell = new Shell( display );
    shell.setLayout( new GridLayout() );

    Label label = new Label( shell, SWT.NONE );
    label.setText( "Hello World!" );

    shell.layout();
    shell.open();
    return 0;
  }
}


Copyright (c) 2007, 2012 Innoopract Informationssysteme GmbH and others.
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 http://www.eclipse.org/legal/epl-v10.html