Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 305988 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/rap/internal/ui/templates/XmlNames.java (-3 / +6 lines)
Lines 12-27 Link Here
12
  public static final String ATT_ICON = "icon"; //$NON-NLS-1$
12
  public static final String ATT_ICON = "icon"; //$NON-NLS-1$
13
  public static final String ATT_ID = "id"; //$NON-NLS-1$
13
  public static final String ATT_ID = "id"; //$NON-NLS-1$
14
  public static final String ATT_NAME = "name"; //$NON-NLS-1$
14
  public static final String ATT_NAME = "name"; //$NON-NLS-1$
15
  public static final String ATT_PARAMETER = "parameter"; //$NON-NLS-1$
16
  public static final String ATT_SERVLET = "servletName"; //$NON-NLS-1$
15
  public static final String ATT_SERVLET = "servletName"; //$NON-NLS-1$
17
  public static final String ATT_DEFAULT_ENTRYPOINT = "defaultEntrypointId"; //$NON-NLS-1$
16
  public static final String ATT_DEFAULT_ENTRYPOINT = "defaultEntrypointId"; //$NON-NLS-1$
18
  public static final String ATT_THEME_ID = "themeId"; //$NON-NLS-1$
17
  public static final String ATT_THEME_ID = "themeId"; //$NON-NLS-1$
19
  public static final String ATT_TITLE = "title"; //$NON-NLS-1$
18
  public static final String ATT_TITLE = "title"; //$NON-NLS-1$
20
  public static final String ATT_DEFAULT_LAYOUT = "defaultLayoutId"; //$NON-NLS-1$
19
  public static final String ATT_DEFAULT_LAYOUT = "defaultLayoutId"; //$NON-NLS-1$
20
  public static final String ATT_CARDINALITY = "cardinality"; //$NON-NLS-1$
21
  public static final String ATT_THREAD = "thread"; //$NON-NLS-1$
22
  public static final String ATT_VISIBLE = "visible"; //$NON-NLS-1$
21
  
23
  
24
  public static final String ELEM_APPLICATION = "application"; //$NON-NLS-1$ 
25
  public static final String ELEM_RUN = "run";
22
  public static final String ELEM_CATEGORY = "category"; //$NON-NLS-1$
26
  public static final String ELEM_CATEGORY = "category"; //$NON-NLS-1$
23
  public static final String ELEM_COMMAND = "command"; //$NON-NLS-1$
27
  public static final String ELEM_COMMAND = "command"; //$NON-NLS-1$
24
  public static final String ELEM_ENTRYPOINT = "entrypoint"; //$NON-NLS-1$
25
  public static final String ELEM_PERSPECTIVE = "perspective"; //$NON-NLS-1$
28
  public static final String ELEM_PERSPECTIVE = "perspective"; //$NON-NLS-1$
26
  public static final String ELEM_VIEW = "view"; //$NON-NLS-1$
29
  public static final String ELEM_VIEW = "view"; //$NON-NLS-1$
27
  public static final String ELEM_BRANDING = "branding"; //$NON-NLS-1$
30
  public static final String ELEM_BRANDING = "branding"; //$NON-NLS-1$
Lines 30-36 Link Here
30
    = "defaultStackPresentation"; //$NON-NLS-1$
33
    = "defaultStackPresentation"; //$NON-NLS-1$
31
  
34
  
32
  public static final String XID_COMMANDS = "org.eclipse.ui.commands"; //$NON-NLS-1$
35
  public static final String XID_COMMANDS = "org.eclipse.ui.commands"; //$NON-NLS-1$
33
  public static final String XID_ENTRYPOINT = "org.eclipse.rap.ui.entrypoint"; //$NON-NLS-1$
36
  public static final String XID_APPLICATION = "org.eclipse.core.runtime.applications"; //$NON-NLS-1$
34
  public static final String XID_PERSPECTIVES = "org.eclipse.ui.perspectives"; //$NON-NLS-1$
37
  public static final String XID_PERSPECTIVES = "org.eclipse.ui.perspectives"; //$NON-NLS-1$
35
  public static final String XID_VIEWS = "org.eclipse.ui.views"; //$NON-NLS-1$
38
  public static final String XID_VIEWS = "org.eclipse.ui.views"; //$NON-NLS-1$
36
  public static final String XID_BRANDING = "org.eclipse.rap.ui.branding"; //$NON-NLS-1$
39
  public static final String XID_BRANDING = "org.eclipse.rap.ui.branding"; //$NON-NLS-1$
(-)src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPTemplate.java (-11 / +29 lines)
Lines 37-65 Link Here
37
  protected void updateModel( final IProgressMonitor monitor )
37
  protected void updateModel( final IProgressMonitor monitor )
38
    throws CoreException
38
    throws CoreException
39
  {
39
  {
40
    createEntryPointsExtension();
40
    createApplicationExtension();
41
    createPerspectivesExtension();
41
    createPerspectivesExtension();
42
  }
42
  }
43
43
44
  // helping methods
44
  // helping methods
45
  // ////////////////
45
  // ////////////////
46
  private void createEntryPointsExtension() throws CoreException {
46
  private void createApplicationExtension() throws CoreException {
47
    IPluginExtension extension = createExtension( XmlNames.XID_ENTRYPOINT,
47
    IPluginExtension extension = createExtension( XmlNames.XID_APPLICATION,
48
                                                  true );
48
                                                  true );
49
    IPluginElement element = createElement( extension );
49
    extension.setId( "hello" );
50
    element.setName( XmlNames.ELEM_ENTRYPOINT );
50
    IPluginElement applicationElement = createElement( extension );
51
    element.setAttribute( XmlNames.ATT_CLASS, 
51
    applicationElement.setName( XmlNames.ELEM_APPLICATION );
52
                          getEntrypointId() ); //$NON-NLS-1$
52
    applicationElement.setAttribute( XmlNames.ATT_VISIBLE, 
53
    element.setAttribute( XmlNames.ATT_ID,
53
                          getVisibility() ); //$NON-NLS-1$
54
                          getEntrypointId() ); //$NON-NLS-1$
54
    applicationElement.setAttribute( XmlNames.ATT_CARDINALITY,
55
    element.setAttribute( XmlNames.ATT_PARAMETER, "hello" ); //$NON-NLS-1$
55
                          getCardinality() ); //$NON-NLS-1$
56
    extension.add( element );
56
    applicationElement.setAttribute( XmlNames.ATT_THREAD, 
57
                                     getThread() ); //$NON-NLS-1$
58
    extension.add( applicationElement );
59
    IPluginElement runElement = createElement( extension );
60
    runElement.setName( XmlNames.ELEM_RUN ); //$NON-NLS-1$
61
    runElement.setAttribute( XmlNames.ATT_CLASS, getEntrypointId() ); //$NON-NLS-1$
62
    applicationElement.add( runElement );
57
    addExtensionToPlugin( extension );
63
    addExtensionToPlugin( extension );
58
  }
64
  }
59
65
60
  private String getEntrypointId() {
66
  private String getEntrypointId() {
61
    return getPackageName() + "." + getApplicationName();
67
    return getPackageName() + "." + getApplicationName();
62
  }
68
  }
69
  
70
  private String getThread() {
71
    return "main"; //$NON-NLS-1$
72
  }
73
74
  private String getCardinality() {
75
    return "singleton-global"; //$NON-NLS-1$
76
  }
77
78
  private String getVisibility() {
79
    return "true"; //$NON-NLS-1$
80
  }
63
81
64
  private void createPerspectivesExtension() throws CoreException {
82
  private void createPerspectivesExtension() throws CoreException {
65
    IPluginExtension extension 
83
    IPluginExtension extension 
(-)src/org/eclipse/rap/internal/ui/templates/rap/MailRAPTemplate.java (-11 / +29 lines)
Lines 44-50 Link Here
44
  protected void updateModel( final IProgressMonitor monitor )
44
  protected void updateModel( final IProgressMonitor monitor )
45
    throws CoreException
45
    throws CoreException
46
  {
46
  {
47
    createEntryPointsExtension();
47
    createApplicationExtension();
48
    createPerspectivesExtension();
48
    createPerspectivesExtension();
49
    createViewsExtension();
49
    createViewsExtension();
50
    createCommandsExtension();
50
    createCommandsExtension();
Lines 91-110 Link Here
91
    extension.add( element );
91
    extension.add( element );
92
  }
92
  }
93
93
94
  private void createEntryPointsExtension() throws CoreException {
94
  private void createApplicationExtension() throws CoreException {
95
    IPluginExtension extension = createExtension( XmlNames.XID_ENTRYPOINT,
95
    IPluginExtension extension = createExtension( XmlNames.XID_APPLICATION,
96
                                                  true );
96
                                                  true );
97
    IPluginElement element = createElement( extension );
97
    extension.setId( "mail" );
98
    element.setName( XmlNames.ELEM_ENTRYPOINT );
98
    IPluginElement applicationElement = createElement( extension );
99
    element.setAttribute( XmlNames.ATT_CLASS,
99
    applicationElement.setName( XmlNames.ELEM_APPLICATION );
100
                          getEntrypointId() ); //$NON-NLS-1$
100
    applicationElement.setAttribute( XmlNames.ATT_VISIBLE, 
101
    element.setAttribute( XmlNames.ATT_ID,
101
                          getVisibility() ); //$NON-NLS-1$
102
                          getEntrypointId() ); //$NON-NLS-1$
102
    applicationElement.setAttribute( XmlNames.ATT_CARDINALITY,
103
    element.setAttribute( XmlNames.ATT_PARAMETER, "mail" ); //$NON-NLS-1$
103
                          getCardinality() ); //$NON-NLS-1$
104
    extension.add( element );
104
    applicationElement.setAttribute( XmlNames.ATT_THREAD, 
105
                                     getThread() ); //$NON-NLS-1$
106
    extension.add( applicationElement );
107
    IPluginElement runElement = createElement( extension );
108
    runElement.setName( XmlNames.ELEM_RUN ); //$NON-NLS-1$
109
    runElement.setAttribute( XmlNames.ATT_CLASS, getEntrypointId() ); //$NON-NLS-1$
110
    applicationElement.add( runElement );
105
    addExtensionToPlugin( extension );
111
    addExtensionToPlugin( extension );
106
  }
112
  }
107
113
114
  private String getThread() {
115
    return "main"; //$NON-NLS-1$
116
  }
117
118
  private String getCardinality() {
119
    return "singleton-global"; //$NON-NLS-1$
120
  }
121
122
  private String getVisibility() {
123
    return "true"; //$NON-NLS-1$
124
  }
125
108
  private String getEntrypointId() {
126
  private String getEntrypointId() {
109
    return getPackageName() + "." + getApplicationName();
127
    return getPackageName() + "." + getApplicationName();
110
  }
128
  }
(-)src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPTemplate.java (-11 / +28 lines)
Lines 38-44 Link Here
38
  protected void updateModel( final IProgressMonitor monitor )
38
  protected void updateModel( final IProgressMonitor monitor )
39
    throws CoreException
39
    throws CoreException
40
  {
40
  {
41
    createEntryPointsExtension();
41
    createApplicationExtension();
42
    createPerspectivesExtension();
42
    createPerspectivesExtension();
43
    createViewsExtension();
43
    createViewsExtension();
44
    createBrandingExtension();
44
    createBrandingExtension();
Lines 46-65 Link Here
46
46
47
  // helping methods
47
  // helping methods
48
  // ////////////////
48
  // ////////////////
49
  private void createEntryPointsExtension() throws CoreException {
49
  private void createApplicationExtension() throws CoreException {
50
    IPluginExtension extension = createExtension( XmlNames.XID_ENTRYPOINT,
50
    IPluginExtension extension = createExtension( XmlNames.XID_APPLICATION,
51
                                                  true );
51
                                                  true );
52
    IPluginElement element = createElement( extension );
52
    extension.setId( "view" );
53
    element.setName( XmlNames.ELEM_ENTRYPOINT );
53
    IPluginElement applicationElement = createElement( extension );
54
    element.setAttribute( XmlNames.ATT_CLASS, 
54
    applicationElement.setName( XmlNames.ELEM_APPLICATION );
55
                          getEntrypointId() ); //$NON-NLS-1$
55
    applicationElement.setAttribute( XmlNames.ATT_VISIBLE, 
56
    element.setAttribute( XmlNames.ATT_ID,
56
                          getVisibility() ); //$NON-NLS-1$
57
                          getEntrypointId() ); //$NON-NLS-1$
57
    applicationElement.setAttribute( XmlNames.ATT_CARDINALITY,
58
    element.setAttribute( XmlNames.ATT_PARAMETER, "view" ); //$NON-NLS-1$
58
                          getCardinality() ); //$NON-NLS-1$
59
    extension.add( element );
59
    applicationElement.setAttribute( XmlNames.ATT_THREAD, 
60
                                     getThread() ); //$NON-NLS-1$
61
    extension.add( applicationElement );
62
    IPluginElement runElement = createElement( extension );
63
    runElement.setName( XmlNames.ELEM_RUN ); //$NON-NLS-1$
64
    runElement.setAttribute( XmlNames.ATT_CLASS, getEntrypointId() ); //$NON-NLS-1$
65
    applicationElement.add( runElement );
60
    addExtensionToPlugin( extension );
66
    addExtensionToPlugin( extension );
61
  }
67
  }
62
68
69
  private String getThread() {
70
    return "main"; //$NON-NLS-1$
71
  }
72
73
  private String getCardinality() {
74
    return "singleton-global"; //$NON-NLS-1$
75
  }
76
77
  private String getVisibility() {
78
    return "true"; //$NON-NLS-1$
79
  }
63
  private String getEntrypointId() {
80
  private String getEntrypointId() {
64
    return getPackageName() + "." + getApplicationName();
81
    return getPackageName() + "." + getApplicationName();
65
  }
82
  }
(-)src/org/eclipse/rap/internal/ui/templates/rap/launch.template (-1 / +1 lines)
Lines 15-21 Link Here
15
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
15
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
16
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dorg.eclipse.rwt.compression=true -Dorg.eclipse.equinox.http.jetty.log.stderr.threshold=info"/>
16
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dorg.eclipse.rwt.compression=true -Dorg.eclipse.equinox.http.jetty.log.stderr.threshold=info"/>
17
<stringAttribute key="org.eclipse.rap.launch.browserMode" value="INTERNAL"/>
17
<stringAttribute key="org.eclipse.rap.launch.browserMode" value="INTERNAL"/>
18
<stringAttribute key="org.eclipse.rap.launch.entryPoint" value="${entryPoint}"/>
18
<stringAttribute key="org.eclipse.rap.launch.entryPoint" value="${pluginId}.${entryPoint}"/>
19
<stringAttribute key="org.eclipse.rap.launch.libraryVariant" value="STANDARD"/>
19
<stringAttribute key="org.eclipse.rap.launch.libraryVariant" value="STANDARD"/>
20
<stringAttribute key="org.eclipse.rap.launch.logLevel" value="OFF"/>
20
<stringAttribute key="org.eclipse.rap.launch.logLevel" value="OFF"/>
21
<intAttribute key="org.eclipse.rap.launch.port" value="10080"/>
21
<intAttribute key="org.eclipse.rap.launch.port" value="10080"/>
(-)templates/helloRAP/java/$applicationClass$.java (-7 / +14 lines)
Lines 1-6 Link Here
1
package $packageName$;
1
package $packageName$;
2
2
3
import org.eclipse.rwt.lifecycle.IEntryPoint;
3
import org.eclipse.equinox.app.IApplication;
4
import org.eclipse.equinox.app.IApplicationContext;
4
import org.eclipse.swt.widgets.Display;
5
import org.eclipse.swt.widgets.Display;
5
import org.eclipse.ui.PlatformUI;
6
import org.eclipse.ui.PlatformUI;
6
import org.eclipse.ui.application.WorkbenchAdvisor;
7
import org.eclipse.ui.application.WorkbenchAdvisor;
Lines 9-19 Link Here
9
 * This class controls all aspects of the application's execution
10
 * This class controls all aspects of the application's execution
10
 * and is contributed through the plugin.xml.
11
 * and is contributed through the plugin.xml.
11
 */
12
 */
12
public class $applicationClass$ implements IEntryPoint {
13
public class Application implements IApplication {
13
14
14
	public int createUI() {
15
  @Override
15
		Display display = PlatformUI.createDisplay();
16
  public Object start( final IApplicationContext context ) throws Exception {
16
		WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
17
    Display display = PlatformUI.createDisplay();
17
		return PlatformUI.createAndRunWorkbench( display, advisor );
18
    WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
18
	}
19
    return PlatformUI.createAndRunWorkbench( display, advisor );
20
  }
21
22
  @Override
23
  public void stop() {
24
    // Do nothing
25
  }
19
}
26
}
(-)templates/mailRAP/java/$applicationClass$.java (-3 / +10 lines)
Lines 1-6 Link Here
1
package $packageName$;
1
package $packageName$;
2
2
3
import org.eclipse.rwt.lifecycle.IEntryPoint;
3
import org.eclipse.equinox.app.IApplication;
4
import org.eclipse.equinox.app.IApplicationContext;
4
import org.eclipse.swt.widgets.Display;
5
import org.eclipse.swt.widgets.Display;
5
import org.eclipse.ui.PlatformUI;
6
import org.eclipse.ui.PlatformUI;
6
import org.eclipse.ui.application.WorkbenchAdvisor;
7
import org.eclipse.ui.application.WorkbenchAdvisor;
Lines 9-19 Link Here
9
 * This class controls all aspects of the application's execution
10
 * This class controls all aspects of the application's execution
10
 * and is contributed through the plugin.xml.
11
 * and is contributed through the plugin.xml.
11
 */
12
 */
12
public class $applicationClass$ implements IEntryPoint {
13
public class Application implements IApplication {
13
14
14
  public int createUI() {
15
  @Override
16
  public Object start( final IApplicationContext context ) throws Exception {
15
    Display display = PlatformUI.createDisplay();
17
    Display display = PlatformUI.createDisplay();
16
    WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
18
    WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
17
    return PlatformUI.createAndRunWorkbench( display, advisor );
19
    return PlatformUI.createAndRunWorkbench( display, advisor );
18
  }
20
  }
21
22
  @Override
23
  public void stop() {
24
    // Do nothing
25
  }
19
}
26
}
(-)templates/viewRAP/java/$applicationClass$.java (-4 / +11 lines)
Lines 1-6 Link Here
1
package $packageName$;
1
package $packageName$;
2
2
3
import org.eclipse.rwt.lifecycle.IEntryPoint;
3
import org.eclipse.equinox.app.IApplication;
4
import org.eclipse.equinox.app.IApplicationContext;
4
import org.eclipse.swt.widgets.Display;
5
import org.eclipse.swt.widgets.Display;
5
import org.eclipse.ui.PlatformUI;
6
import org.eclipse.ui.PlatformUI;
6
import org.eclipse.ui.application.WorkbenchAdvisor;
7
import org.eclipse.ui.application.WorkbenchAdvisor;
Lines 9-19 Link Here
9
 * This class controls all aspects of the application's execution
10
 * This class controls all aspects of the application's execution
10
 * and is contributed through the plugin.xml.
11
 * and is contributed through the plugin.xml.
11
 */
12
 */
12
public class $applicationClass$ implements IEntryPoint {
13
public class Application implements IApplication {
13
14
14
  public int createUI() {
15
  @Override
16
  public Object start( final IApplicationContext context ) throws Exception {
15
    Display display = PlatformUI.createDisplay();
17
    Display display = PlatformUI.createDisplay();
16
    WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
18
    WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
17
    return PlatformUI.createAndRunWorkbench( display, advisor );
19
    return PlatformUI.createAndRunWorkbench( display, advisor );
18
  }
20
  }
19
}
21
22
  @Override
23
  public void stop() {
24
    // Do nothing
25
  }
26
}

Return to bug 305988