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 177609 Details for
Bug 305988
[Tooling] Templates: support IApplication
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]
Patch to support IApplication
patch_305988.txt (text/plain), 16.69 KB, created by
Artur Kronenberg
on 2010-08-27 08:08:27 EDT
(
hide
)
Description:
Patch to support IApplication
Filename:
MIME Type:
Creator:
Artur Kronenberg
Created:
2010-08-27 08:08:27 EDT
Size:
16.69 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.ui.templates >Index: src/org/eclipse/rap/internal/ui/templates/XmlNames.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/tooling/org.eclipse.rap.ui.templates/src/org/eclipse/rap/internal/ui/templates/XmlNames.java,v >retrieving revision 1.2 >diff -u -r1.2 XmlNames.java >--- src/org/eclipse/rap/internal/ui/templates/XmlNames.java 16 Mar 2010 10:29:19 -0000 1.2 >+++ src/org/eclipse/rap/internal/ui/templates/XmlNames.java 27 Aug 2010 12:06:34 -0000 >@@ -12,16 +12,19 @@ > public static final String ATT_ICON = "icon"; //$NON-NLS-1$ > public static final String ATT_ID = "id"; //$NON-NLS-1$ > public static final String ATT_NAME = "name"; //$NON-NLS-1$ >- public static final String ATT_PARAMETER = "parameter"; //$NON-NLS-1$ > public static final String ATT_SERVLET = "servletName"; //$NON-NLS-1$ > public static final String ATT_DEFAULT_ENTRYPOINT = "defaultEntrypointId"; //$NON-NLS-1$ > public static final String ATT_THEME_ID = "themeId"; //$NON-NLS-1$ > public static final String ATT_TITLE = "title"; //$NON-NLS-1$ > public static final String ATT_DEFAULT_LAYOUT = "defaultLayoutId"; //$NON-NLS-1$ >+ public static final String ATT_CARDINALITY = "cardinality"; //$NON-NLS-1$ >+ public static final String ATT_THREAD = "thread"; //$NON-NLS-1$ >+ public static final String ATT_VISIBLE = "visible"; //$NON-NLS-1$ > >+ public static final String ELEM_APPLICATION = "application"; //$NON-NLS-1$ >+ public static final String ELEM_RUN = "run"; > public static final String ELEM_CATEGORY = "category"; //$NON-NLS-1$ > public static final String ELEM_COMMAND = "command"; //$NON-NLS-1$ >- public static final String ELEM_ENTRYPOINT = "entrypoint"; //$NON-NLS-1$ > public static final String ELEM_PERSPECTIVE = "perspective"; //$NON-NLS-1$ > public static final String ELEM_VIEW = "view"; //$NON-NLS-1$ > public static final String ELEM_BRANDING = "branding"; //$NON-NLS-1$ >@@ -30,7 +33,7 @@ > = "defaultStackPresentation"; //$NON-NLS-1$ > > public static final String XID_COMMANDS = "org.eclipse.ui.commands"; //$NON-NLS-1$ >- public static final String XID_ENTRYPOINT = "org.eclipse.rap.ui.entrypoint"; //$NON-NLS-1$ >+ public static final String XID_APPLICATION = "org.eclipse.core.runtime.applications"; //$NON-NLS-1$ > public static final String XID_PERSPECTIVES = "org.eclipse.ui.perspectives"; //$NON-NLS-1$ > public static final String XID_VIEWS = "org.eclipse.ui.views"; //$NON-NLS-1$ > public static final String XID_BRANDING = "org.eclipse.rap.ui.branding"; //$NON-NLS-1$ >Index: src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPTemplate.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/tooling/org.eclipse.rap.ui.templates/src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPTemplate.java,v >retrieving revision 1.3 >diff -u -r1.3 HelloRAPTemplate.java >--- src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPTemplate.java 16 Mar 2010 10:29:19 -0000 1.3 >+++ src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPTemplate.java 27 Aug 2010 12:06:34 -0000 >@@ -37,29 +37,47 @@ > protected void updateModel( final IProgressMonitor monitor ) > throws CoreException > { >- createEntryPointsExtension(); >+ createApplicationExtension(); > createPerspectivesExtension(); > } > > // helping methods > // //////////////// >- private void createEntryPointsExtension() throws CoreException { >- IPluginExtension extension = createExtension( XmlNames.XID_ENTRYPOINT, >+ private void createApplicationExtension() throws CoreException { >+ IPluginExtension extension = createExtension( XmlNames.XID_APPLICATION, > true ); >- IPluginElement element = createElement( extension ); >- element.setName( XmlNames.ELEM_ENTRYPOINT ); >- element.setAttribute( XmlNames.ATT_CLASS, >- getEntrypointId() ); //$NON-NLS-1$ >- element.setAttribute( XmlNames.ATT_ID, >- getEntrypointId() ); //$NON-NLS-1$ >- element.setAttribute( XmlNames.ATT_PARAMETER, "hello" ); //$NON-NLS-1$ >- extension.add( element ); >+ extension.setId( "hello" ); >+ IPluginElement applicationElement = createElement( extension ); >+ applicationElement.setName( XmlNames.ELEM_APPLICATION ); >+ applicationElement.setAttribute( XmlNames.ATT_VISIBLE, >+ getVisibility() ); //$NON-NLS-1$ >+ applicationElement.setAttribute( XmlNames.ATT_CARDINALITY, >+ getCardinality() ); //$NON-NLS-1$ >+ applicationElement.setAttribute( XmlNames.ATT_THREAD, >+ getThread() ); //$NON-NLS-1$ >+ extension.add( applicationElement ); >+ IPluginElement runElement = createElement( extension ); >+ runElement.setName( XmlNames.ELEM_RUN ); //$NON-NLS-1$ >+ runElement.setAttribute( XmlNames.ATT_CLASS, getEntrypointId() ); //$NON-NLS-1$ >+ applicationElement.add( runElement ); > addExtensionToPlugin( extension ); > } > > private String getEntrypointId() { > return getPackageName() + "." + getApplicationName(); > } >+ >+ private String getThread() { >+ return "main"; //$NON-NLS-1$ >+ } >+ >+ private String getCardinality() { >+ return "singleton-global"; //$NON-NLS-1$ >+ } >+ >+ private String getVisibility() { >+ return "true"; //$NON-NLS-1$ >+ } > > private void createPerspectivesExtension() throws CoreException { > IPluginExtension extension >Index: src/org/eclipse/rap/internal/ui/templates/rap/MailRAPTemplate.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/tooling/org.eclipse.rap.ui.templates/src/org/eclipse/rap/internal/ui/templates/rap/MailRAPTemplate.java,v >retrieving revision 1.4 >diff -u -r1.4 MailRAPTemplate.java >--- src/org/eclipse/rap/internal/ui/templates/rap/MailRAPTemplate.java 16 Mar 2010 10:29:19 -0000 1.4 >+++ src/org/eclipse/rap/internal/ui/templates/rap/MailRAPTemplate.java 27 Aug 2010 12:06:34 -0000 >@@ -44,7 +44,7 @@ > protected void updateModel( final IProgressMonitor monitor ) > throws CoreException > { >- createEntryPointsExtension(); >+ createApplicationExtension(); > createPerspectivesExtension(); > createViewsExtension(); > createCommandsExtension(); >@@ -91,20 +91,38 @@ > extension.add( element ); > } > >- private void createEntryPointsExtension() throws CoreException { >- IPluginExtension extension = createExtension( XmlNames.XID_ENTRYPOINT, >+ private void createApplicationExtension() throws CoreException { >+ IPluginExtension extension = createExtension( XmlNames.XID_APPLICATION, > true ); >- IPluginElement element = createElement( extension ); >- element.setName( XmlNames.ELEM_ENTRYPOINT ); >- element.setAttribute( XmlNames.ATT_CLASS, >- getEntrypointId() ); //$NON-NLS-1$ >- element.setAttribute( XmlNames.ATT_ID, >- getEntrypointId() ); //$NON-NLS-1$ >- element.setAttribute( XmlNames.ATT_PARAMETER, "mail" ); //$NON-NLS-1$ >- extension.add( element ); >+ extension.setId( "mail" ); >+ IPluginElement applicationElement = createElement( extension ); >+ applicationElement.setName( XmlNames.ELEM_APPLICATION ); >+ applicationElement.setAttribute( XmlNames.ATT_VISIBLE, >+ getVisibility() ); //$NON-NLS-1$ >+ applicationElement.setAttribute( XmlNames.ATT_CARDINALITY, >+ getCardinality() ); //$NON-NLS-1$ >+ applicationElement.setAttribute( XmlNames.ATT_THREAD, >+ getThread() ); //$NON-NLS-1$ >+ extension.add( applicationElement ); >+ IPluginElement runElement = createElement( extension ); >+ runElement.setName( XmlNames.ELEM_RUN ); //$NON-NLS-1$ >+ runElement.setAttribute( XmlNames.ATT_CLASS, getEntrypointId() ); //$NON-NLS-1$ >+ applicationElement.add( runElement ); > addExtensionToPlugin( extension ); > } > >+ private String getThread() { >+ return "main"; //$NON-NLS-1$ >+ } >+ >+ private String getCardinality() { >+ return "singleton-global"; //$NON-NLS-1$ >+ } >+ >+ private String getVisibility() { >+ return "true"; //$NON-NLS-1$ >+ } >+ > private String getEntrypointId() { > return getPackageName() + "." + getApplicationName(); > } >Index: src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPTemplate.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/tooling/org.eclipse.rap.ui.templates/src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPTemplate.java,v >retrieving revision 1.3 >diff -u -r1.3 ViewRAPTemplate.java >--- src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPTemplate.java 16 Mar 2010 10:29:19 -0000 1.3 >+++ src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPTemplate.java 27 Aug 2010 12:06:34 -0000 >@@ -38,7 +38,7 @@ > protected void updateModel( final IProgressMonitor monitor ) > throws CoreException > { >- createEntryPointsExtension(); >+ createApplicationExtension(); > createPerspectivesExtension(); > createViewsExtension(); > createBrandingExtension(); >@@ -46,20 +46,37 @@ > > // helping methods > // //////////////// >- private void createEntryPointsExtension() throws CoreException { >- IPluginExtension extension = createExtension( XmlNames.XID_ENTRYPOINT, >+ private void createApplicationExtension() throws CoreException { >+ IPluginExtension extension = createExtension( XmlNames.XID_APPLICATION, > true ); >- IPluginElement element = createElement( extension ); >- element.setName( XmlNames.ELEM_ENTRYPOINT ); >- element.setAttribute( XmlNames.ATT_CLASS, >- getEntrypointId() ); //$NON-NLS-1$ >- element.setAttribute( XmlNames.ATT_ID, >- getEntrypointId() ); //$NON-NLS-1$ >- element.setAttribute( XmlNames.ATT_PARAMETER, "view" ); //$NON-NLS-1$ >- extension.add( element ); >+ extension.setId( "view" ); >+ IPluginElement applicationElement = createElement( extension ); >+ applicationElement.setName( XmlNames.ELEM_APPLICATION ); >+ applicationElement.setAttribute( XmlNames.ATT_VISIBLE, >+ getVisibility() ); //$NON-NLS-1$ >+ applicationElement.setAttribute( XmlNames.ATT_CARDINALITY, >+ getCardinality() ); //$NON-NLS-1$ >+ applicationElement.setAttribute( XmlNames.ATT_THREAD, >+ getThread() ); //$NON-NLS-1$ >+ extension.add( applicationElement ); >+ IPluginElement runElement = createElement( extension ); >+ runElement.setName( XmlNames.ELEM_RUN ); //$NON-NLS-1$ >+ runElement.setAttribute( XmlNames.ATT_CLASS, getEntrypointId() ); //$NON-NLS-1$ >+ applicationElement.add( runElement ); > addExtensionToPlugin( extension ); > } > >+ private String getThread() { >+ return "main"; //$NON-NLS-1$ >+ } >+ >+ private String getCardinality() { >+ return "singleton-global"; //$NON-NLS-1$ >+ } >+ >+ private String getVisibility() { >+ return "true"; //$NON-NLS-1$ >+ } > private String getEntrypointId() { > return getPackageName() + "." + getApplicationName(); > } >Index: src/org/eclipse/rap/internal/ui/templates/rap/launch.template >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/tooling/org.eclipse.rap.ui.templates/src/org/eclipse/rap/internal/ui/templates/rap/launch.template,v >retrieving revision 1.11 >diff -u -r1.11 launch.template >--- src/org/eclipse/rap/internal/ui/templates/rap/launch.template 16 Mar 2010 10:29:19 -0000 1.11 >+++ src/org/eclipse/rap/internal/ui/templates/rap/launch.template 27 Aug 2010 12:06:34 -0000 >@@ -15,7 +15,7 @@ > <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> > <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"/> > <stringAttribute key="org.eclipse.rap.launch.browserMode" value="INTERNAL"/> >-<stringAttribute key="org.eclipse.rap.launch.entryPoint" value="${entryPoint}"/> >+<stringAttribute key="org.eclipse.rap.launch.entryPoint" value="${pluginId}.${entryPoint}"/> > <stringAttribute key="org.eclipse.rap.launch.libraryVariant" value="STANDARD"/> > <stringAttribute key="org.eclipse.rap.launch.logLevel" value="OFF"/> > <intAttribute key="org.eclipse.rap.launch.port" value="10080"/> >Index: templates/helloRAP/java/$applicationClass$.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/tooling/org.eclipse.rap.ui.templates/templates/helloRAP/java/$applicationClass$.java,v >retrieving revision 1.1 >diff -u -r1.1 $applicationClass$.java >--- templates/helloRAP/java/$applicationClass$.java 12 Feb 2009 19:24:50 -0000 1.1 >+++ templates/helloRAP/java/$applicationClass$.java 27 Aug 2010 12:06:34 -0000 >@@ -1,6 +1,7 @@ > package $packageName$; > >-import org.eclipse.rwt.lifecycle.IEntryPoint; >+import org.eclipse.equinox.app.IApplication; >+import org.eclipse.equinox.app.IApplicationContext; > import org.eclipse.swt.widgets.Display; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.application.WorkbenchAdvisor; >@@ -9,11 +10,17 @@ > * This class controls all aspects of the application's execution > * and is contributed through the plugin.xml. > */ >-public class $applicationClass$ implements IEntryPoint { >+public class Application implements IApplication { > >- public int createUI() { >- Display display = PlatformUI.createDisplay(); >- WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor(); >- return PlatformUI.createAndRunWorkbench( display, advisor ); >- } >+ @Override >+ public Object start( final IApplicationContext context ) throws Exception { >+ Display display = PlatformUI.createDisplay(); >+ WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor(); >+ return PlatformUI.createAndRunWorkbench( display, advisor ); >+ } >+ >+ @Override >+ public void stop() { >+ // Do nothing >+ } > } >Index: templates/mailRAP/java/$applicationClass$.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/tooling/org.eclipse.rap.ui.templates/templates/mailRAP/java/$applicationClass$.java,v >retrieving revision 1.1 >diff -u -r1.1 $applicationClass$.java >--- templates/mailRAP/java/$applicationClass$.java 12 Feb 2009 19:24:49 -0000 1.1 >+++ templates/mailRAP/java/$applicationClass$.java 27 Aug 2010 12:06:34 -0000 >@@ -1,6 +1,7 @@ > package $packageName$; > >-import org.eclipse.rwt.lifecycle.IEntryPoint; >+import org.eclipse.equinox.app.IApplication; >+import org.eclipse.equinox.app.IApplicationContext; > import org.eclipse.swt.widgets.Display; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.application.WorkbenchAdvisor; >@@ -9,11 +10,17 @@ > * This class controls all aspects of the application's execution > * and is contributed through the plugin.xml. > */ >-public class $applicationClass$ implements IEntryPoint { >+public class Application implements IApplication { > >- public int createUI() { >+ @Override >+ public Object start( final IApplicationContext context ) throws Exception { > Display display = PlatformUI.createDisplay(); > WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor(); > return PlatformUI.createAndRunWorkbench( display, advisor ); > } >+ >+ @Override >+ public void stop() { >+ // Do nothing >+ } > } >Index: templates/viewRAP/java/$applicationClass$.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/tooling/org.eclipse.rap.ui.templates/templates/viewRAP/java/$applicationClass$.java,v >retrieving revision 1.1 >diff -u -r1.1 $applicationClass$.java >--- templates/viewRAP/java/$applicationClass$.java 12 Feb 2009 19:24:50 -0000 1.1 >+++ templates/viewRAP/java/$applicationClass$.java 27 Aug 2010 12:06:34 -0000 >@@ -1,6 +1,7 @@ > package $packageName$; > >-import org.eclipse.rwt.lifecycle.IEntryPoint; >+import org.eclipse.equinox.app.IApplication; >+import org.eclipse.equinox.app.IApplicationContext; > import org.eclipse.swt.widgets.Display; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.application.WorkbenchAdvisor; >@@ -9,11 +10,17 @@ > * This class controls all aspects of the application's execution > * and is contributed through the plugin.xml. > */ >-public class $applicationClass$ implements IEntryPoint { >+public class Application implements IApplication { > >- public int createUI() { >+ @Override >+ public Object start( final IApplicationContext context ) throws Exception { > Display display = PlatformUI.createDisplay(); > WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor(); > return PlatformUI.createAndRunWorkbench( display, advisor ); > } >-} >+ >+ @Override >+ public void stop() { >+ // Do nothing >+ } >+} >\ No newline at end of file
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 305988
:
177609
|
178402
|
178413
|
186722