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 225572 Details for
Bug 398068
[Tools] RWT-Style hello world template
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 fixing this issue (and 398073)
bug_398068.patch (text/plain), 49.44 KB, created by
Elias Volanakis
on 2013-01-14 10:53:29 EST
(
hide
)
Description:
Patch fixing this issue (and 398073)
Filename:
MIME Type:
Creator:
Elias Volanakis
Created:
2013-01-14 10:53:29 EST
Size:
49.44 KB
patch
obsolete
>From a82b360b6e550175bc2f53490365e424c5353c20 Mon Sep 17 00:00:00 2001 >From: Elias Volanakis <elias@eclipsesource.com> >Date: Mon, 14 Jan 2013 14:16:03 +0100 >Subject: [PATCH 1/2] 398073: [Tools] Remove 'RAP Application with a View' > template > https://bugs.eclipse.org/bugs/show_bug.cgi?id=398073 > >--- > .../plugin.properties | 10 -- > bundles/org.eclipse.rap.tools.templates/plugin.xml | 12 -- > .../rap/internal/ui/templates/rap/Messages.java | 10 -- > .../internal/ui/templates/rap/ViewRAPTemplate.java | 138 -------------------- > .../internal/ui/templates/rap/ViewRAPWizard.java | 41 ------ > .../internal/ui/templates/rap/messages.properties | 12 +-- > .../templates/viewRAP/java/$applicationClass$.java | 24 ---- > .../viewRAP/java/ApplicationActionBarAdvisor.java | 41 ------ > .../viewRAP/java/ApplicationWorkbenchAdvisor.java | 22 --- > .../java/ApplicationWorkbenchWindowAdvisor.java | 31 ----- > .../templates/viewRAP/java/Perspective.java | 20 --- > .../templates/viewRAP/java/View.java | 73 ---------- > 12 files changed, 1 insertions(+), 433 deletions(-) > delete mode 100644 bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPTemplate.java > delete mode 100644 bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPWizard.java > delete mode 100644 bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/$applicationClass$.java > delete mode 100644 bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/ApplicationActionBarAdvisor.java > delete mode 100644 bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/ApplicationWorkbenchAdvisor.java > delete mode 100644 bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/ApplicationWorkbenchWindowAdvisor.java > delete mode 100644 bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/Perspective.java > delete mode 100644 bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/View.java > >diff --git a/bundles/org.eclipse.rap.tools.templates/plugin.properties b/bundles/org.eclipse.rap.tools.templates/plugin.properties >index 90d20e6..307322f 100644 >--- a/bundles/org.eclipse.rap.tools.templates/plugin.properties >+++ b/bundles/org.eclipse.rap.tools.templates/plugin.properties >@@ -22,16 +22,6 @@ helloRAP.description = \ > <li>org.eclipse.ui.perspectives</li>\ > <p>This code will need the <b>RAP target</b> to compile.</p> > >-viewRAP.name = RAP Application with a view >-viewRAP.description = \ >-<p>This wizard creates a RAP application that consists of an application window with a single view.</p>\ >-<p><b>Extensions Used</b></p>\ >-<li>org.eclipse.core.runtime.applications</li>\ >-<li>org.eclipse.ui.perspectives</li>\ >-<li>org.eclipse.ui.views</li>\ >-<li>org.eclipse.rap.ui.branding</li>\ >-<p>This code will need the <b>RAP target</b> to compile.</p> >- > mailRAP.name = RAP Mail Template > mailRAP.description = \ > <p>This wizard creates a RAP application that shows how to:</p>\ >diff --git a/bundles/org.eclipse.rap.tools.templates/plugin.xml b/bundles/org.eclipse.rap.tools.templates/plugin.xml >index e633ac4..045804a 100644 >--- a/bundles/org.eclipse.rap.tools.templates/plugin.xml >+++ b/bundles/org.eclipse.rap.tools.templates/plugin.xml >@@ -17,18 +17,6 @@ > </description> > </wizard> > <wizard >- class="org.eclipse.rap.internal.ui.templates.rap.ViewRAPWizard" >- icon="$nl$/icons/etool16/newexprj_wiz.gif" >- id="org.eclipse.rap.internal.ui.templates.rap.ViewRAPWizard" >- java="true" >- rcp="false" >- name="%viewRAP.name" >- ui-content="true"> >- <description> >- %viewRAP.description >- </description> >- </wizard> >- <wizard > class="org.eclipse.rap.internal.ui.templates.rap.MailRAPWizard" > icon="$nl$/icons/etool16/newexprj_wiz.gif" > id="org.eclipse.rap.internal.ui.templates.rap.MailRAPWizard" >diff --git a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/Messages.java b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/Messages.java >index 16f6b45..6889443 100644 >--- a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/Messages.java >+++ b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/Messages.java >@@ -43,16 +43,6 @@ public class Messages extends NLS { > public static String mailRAPTemplate_windowTitle; > public static String mailRAPWizard_windowTitle; > >- public static String viewRAPTemplate_appClass; >- public static String viewRAPTemplate_appWindowTitle; >- public static String viewRAPTemplate_packageName; >- public static String viewRAPTemplate_pageDescr; >- public static String viewRAPTemplate_pageTitle; >- public static String viewRAPTemplate_perspectiveName; >- public static String viewRAPTemplate_viewName; >- public static String viewRAPTemplate_windowTitle; >- public static String viewRAPWizard_windowTitle; >- > private static final String BUNDLE_NAME > = "org.eclipse.rap.internal.ui.templates.rap.messages"; //$NON-NLS-1$ > >diff --git a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPTemplate.java b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPTemplate.java >deleted file mode 100644 >index e480c16..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPTemplate.java >+++ /dev/null >@@ -1,138 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007, 2012 EclipseSource 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 >- * >- * Contributors: >- * Innoopract Informationssysteme GmbH - initial API and implementation >- * EclipseSource - ongoing development >- ******************************************************************************/ >-package org.eclipse.rap.internal.ui.templates.rap; >- >-import org.eclipse.core.runtime.CoreException; >-import org.eclipse.core.runtime.IProgressMonitor; >-import org.eclipse.jface.wizard.Wizard; >-import org.eclipse.jface.wizard.WizardPage; >-import org.eclipse.pde.core.plugin.IPluginElement; >-import org.eclipse.pde.core.plugin.IPluginExtension; >-import org.eclipse.rap.internal.ui.templates.TemplateUtil; >-import org.eclipse.rap.internal.ui.templates.XmlNames; >- >-class ViewRAPTemplate extends AbstractRAPTemplate { >- >- ViewRAPTemplate() { >- setPageCount( 1 ); >- createTemplateOptions(); >- } >- >- public void addPages( Wizard wizard ) { >- WizardPage page = createPage( 0 ); >- page.setTitle( Messages.viewRAPTemplate_pageTitle ); >- page.setDescription( Messages.viewRAPTemplate_pageDescr ); >- wizard.addPage( page ); >- markPagesAdded(); >- } >- >- public String getSectionId() { >- return "viewRAP"; //$NON-NLS-1$ >- } >- >- public String getApplicationId() { >- return "viewapp"; >- } >- >- public String getServletPath() { >- return "/view"; >- } >- >- protected void updateModel( IProgressMonitor monitor ) throws CoreException { >- createEntryPointExtension(); >- createApplicationExtension(); >- createPerspectivesExtension(); >- createViewsExtension(); >- createBrandingExtension(); >- } >- >- ////////////////// >- // helping methods >- >- private void createEntryPointExtension() throws CoreException { >- IPluginExtension extension = createExtension( XmlNames.XID_ENTRYPOINT, true ); >- extension.setId( getApplicationId() + ".entrypoints" ); >- IPluginElement entryPointElement = createElement( extension ); >- entryPointElement.setName( XmlNames.ELEM_ENTRYPOINT ); >- entryPointElement.setAttribute( XmlNames.ATT_ID, getApplicationId() + ".entrypoint" ); >- entryPointElement.setAttribute( XmlNames.ATT_SERVLET_PATH, getServletPath() ); >- entryPointElement.setAttribute( XmlNames.ATT_APPLICATION_ID, getFullApplicationId() ); >- entryPointElement.setAttribute( XmlNames.ATT_BRANDING_ID, getPackageName() + ".branding" ); >- extension.add( entryPointElement ); >- addExtensionToPlugin( extension ); >- } >- >- private void createApplicationExtension() throws CoreException { >- IPluginExtension extension = createExtension( XmlNames.XID_APPLICATION, true ); >- extension.setId( getFullApplicationId() ); >- IPluginElement applicationElement = createElement( extension ); >- applicationElement.setName( XmlNames.ELEM_APPLICATION ); >- applicationElement.setAttribute( XmlNames.ATT_VISIBLE, "true" ); //$NON-NLS-1$ >- applicationElement.setAttribute( XmlNames.ATT_CARDINALITY, "singleton-global" ); //$NON-NLS-1$ >- applicationElement.setAttribute( XmlNames.ATT_THREAD, "main" ); //$NON-NLS-1$ >- extension.add( applicationElement ); >- IPluginElement runElement = createElement( extension ); >- runElement.setName( XmlNames.ELEM_RUN ); >- runElement.setAttribute( XmlNames.ATT_CLASS, getApplicationClass() ); >- applicationElement.add( runElement ); >- addExtensionToPlugin( extension ); >- } >- >- private void createPerspectivesExtension() throws CoreException { >- IPluginExtension extension = createExtension( XmlNames.XID_PERSPECTIVES, true ); >- IPluginElement element = createElement( extension ); >- element.setName( XmlNames.ELEM_PERSPECTIVE ); >- element.setAttribute( XmlNames.ATT_CLASS, getPackageName() + ".Perspective" ); //$NON-NLS-1$ >- element.setAttribute( XmlNames.ATT_NAME, Messages.viewRAPTemplate_perspectiveName ); >- element.setAttribute( XmlNames.ATT_ID, getPluginId() + ".perspective" ); //$NON-NLS-1$ >- extension.add( element ); >- addExtensionToPlugin( extension ); >- } >- >- private void createViewsExtension() throws CoreException { >- IPluginExtension extension = createExtension( XmlNames.XID_VIEWS, true ); >- IPluginElement element = createElement( extension ); >- element.setName( XmlNames.ELEM_VIEW ); >- element.setAttribute( XmlNames.ATT_CLASS, getPackageName() + ".View" ); //$NON-NLS-1$ >- element.setAttribute( XmlNames.ATT_NAME, Messages.viewRAPTemplate_viewName ); >- element.setAttribute( XmlNames.ATT_ID, getPluginId() + ".view" ); //$NON-NLS-1$ >- extension.add( element ); >- addExtensionToPlugin( extension ); >- } >- >- private void createBrandingExtension() throws CoreException { >- IPluginExtension extension = createExtension( XmlNames.XID_BRANDING, true ); >- IPluginElement brandingElement = createElement( extension ); >- // create branding >- brandingElement.setName( XmlNames.ELEM_BRANDING ); >- String brandingId = getPackageName() + ".branding"; //$NON-NLS-1$ >- brandingElement.setAttribute( XmlNames.ATT_ID, brandingId ); >- brandingElement.setAttribute( XmlNames.ATT_THEME_ID, TemplateUtil.FANCY_THEME_ID ); >- brandingElement.setAttribute( XmlNames.ATT_TITLE, "RAP Single View" ); >- // write extension >- extension.add( brandingElement ); >- addExtensionToPlugin( extension ); >- } >- >- private void createTemplateOptions() { >- addOption( KEY_WINDOW_TITLE, >- Messages.viewRAPTemplate_windowTitle, >- Messages.viewRAPTemplate_appWindowTitle, >- 0 ); >- addOption( KEY_PACKAGE_NAME, Messages.viewRAPTemplate_packageName, null, 0 ); >- addOption( KEY_APPLICATION_CLASS, >- Messages.viewRAPTemplate_appClass, >- "Application", //$NON-NLS-1$ >- 0 ); >- } >- >-} >diff --git a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPWizard.java b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPWizard.java >deleted file mode 100644 >index 9f0f27b..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/ViewRAPWizard.java >+++ /dev/null >@@ -1,41 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007, 2011 EclipseSource >- * 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 >- * >- * Contributors: >- * Innoopract Informationssysteme GmbH - initial API and implementation >- * EclipseSource - ongoing development >- ******************************************************************************/ >-package org.eclipse.rap.internal.ui.templates.rap; >- >-import org.eclipse.pde.ui.IFieldData; >-import org.eclipse.pde.ui.templates.ITemplateSection; >- >-public class ViewRAPWizard extends AbstractRAPWizard { >- >- private AbstractRAPTemplate template; >- >- public void init( final IFieldData data ) { >- super.init( data ); >- setWindowTitle( Messages.viewRAPWizard_windowTitle ); >- } >- >- public ITemplateSection[] createTemplateSections() { >- template = new ViewRAPTemplate(); >- return new ITemplateSection[] { >- template >- }; >- } >- >- protected String getEntryPointName() { >- return template.getFullApplicationId(); >- } >- >- protected String getServletPath() { >- return template.getServletPath(); >- } >- >-} >diff --git a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/messages.properties b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/messages.properties >index 0142d2f..114da12 100644 >--- a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/messages.properties >+++ b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/messages.properties >@@ -11,17 +11,7 @@ > > AbstractRAPWizard_targetQuestionDialogTitle=Install RAP Target Platform > AbstractRAPWizard_targetQuestionDialogMessage=RAP projects need to be compiled against a RAP target platform. Do you want to install a RAP target platform now? >-AbstractRAPWizard_Modifying=Modifing {0} >- >-viewRAPTemplate_pageTitle=Single View RAP Application >-viewRAPTemplate_pageDescr=This wizard creates a RAP application that consists of an application window with a single view. >-viewRAPWizard_windowTitle=New RAP Project with a view >-viewRAPTemplate_perspectiveName=RAP Perspective >-viewRAPTemplate_viewName=View >-viewRAPTemplate_windowTitle=Application window &title\: >-viewRAPTemplate_appWindowTitle=RAP with a View >-viewRAPTemplate_packageName=Pa&ckage name\: >-viewRAPTemplate_appClass=App&lication class\: >+AbstractRAPWizard_Modifying=Modifying {0} > > mailRAPWizard_windowTitle=New Project with a RAP Mail Template > >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/$applicationClass$.java b/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/$applicationClass$.java >deleted file mode 100644 >index 1974a68..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/$applicationClass$.java >+++ /dev/null >@@ -1,24 +0,0 @@ >-package $packageName$; >- >-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; >- >-/** >- * This class controls all aspects of the application's execution >- * and is contributed through the plugin.xml. >- */ >-public class $applicationClass$ implements IApplication { >- >- public Object start(IApplicationContext context) throws Exception { >- Display display = PlatformUI.createDisplay(); >- WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor(); >- return PlatformUI.createAndRunWorkbench(display, advisor); >- } >- >- public void stop() { >- // Do nothing >- } >-} >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/ApplicationActionBarAdvisor.java b/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/ApplicationActionBarAdvisor.java >deleted file mode 100644 >index fd3e0fb..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/ApplicationActionBarAdvisor.java >+++ /dev/null >@@ -1,41 +0,0 @@ >-package $packageName$; >- >-import org.eclipse.jface.action.IMenuManager; >-import org.eclipse.jface.action.MenuManager; >-import org.eclipse.ui.IWorkbenchActionConstants; >-import org.eclipse.ui.IWorkbenchWindow; >-import org.eclipse.ui.actions.ActionFactory; >-import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction; >-import org.eclipse.ui.application.ActionBarAdvisor; >-import org.eclipse.ui.application.IActionBarConfigurer; >- >-/** >- * Creates, adds and disposes actions for the menus and action bars of >- * each workbench window. >- */ >-public class ApplicationActionBarAdvisor extends ActionBarAdvisor { >- >- public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) { >- super(configurer); >- } >- >- // Actions - important to allocate these only in makeActions, and then use >- // them in the fill methods. This ensures that the actions aren't recreated >- // in the fill methods. >- private IWorkbenchAction exitAction; >- >- protected void makeActions(IWorkbenchWindow window) { >- // Creates the actions and registers them. Registering also >- // provides automatic disposal of the actions when the window is closed. >- exitAction = ActionFactory.QUIT.create(window); >- register(exitAction); >- } >- >- protected void fillMenuBar(IMenuManager menuBar) { >- MenuManager fileMenu >- = new MenuManager("&File",IWorkbenchActionConstants.M_FILE); >- menuBar.add(fileMenu); >- fileMenu.add(exitAction); >- } >- >-} >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/ApplicationWorkbenchAdvisor.java b/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/ApplicationWorkbenchAdvisor.java >deleted file mode 100644 >index 2515319..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/ApplicationWorkbenchAdvisor.java >+++ /dev/null >@@ -1,22 +0,0 @@ >-package $packageName$; >- >-import org.eclipse.ui.application.IWorkbenchWindowConfigurer; >-import org.eclipse.ui.application.WorkbenchAdvisor; >-import org.eclipse.ui.application.WorkbenchWindowAdvisor; >- >-/** >- * This workbench advisor creates the window advisor, and specifies >- * the perspective id for the initial window. >- */ >-public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor { >- >- private static final String PERSPECTIVE_ID = "$pluginId$.perspective"; >- >- public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { >- return new ApplicationWorkbenchWindowAdvisor(configurer); >- } >- >- public String getInitialWindowPerspectiveId() { >- return PERSPECTIVE_ID; >- } >-} >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/ApplicationWorkbenchWindowAdvisor.java b/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/ApplicationWorkbenchWindowAdvisor.java >deleted file mode 100644 >index 6648cf5..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/ApplicationWorkbenchWindowAdvisor.java >+++ /dev/null >@@ -1,31 +0,0 @@ >-package $packageName$; >- >-import org.eclipse.swt.SWT; >-import org.eclipse.swt.graphics.Point; >-import org.eclipse.ui.application.ActionBarAdvisor; >-import org.eclipse.ui.application.IActionBarConfigurer; >-import org.eclipse.ui.application.IWorkbenchWindowConfigurer; >-import org.eclipse.ui.application.WorkbenchWindowAdvisor; >- >-/** >- * Configures the initial size and appearance of a workbench window. >- */ >-public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { >- >- public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { >- super(configurer); >- } >- >- public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) { >- return new ApplicationActionBarAdvisor(configurer); >- } >- >- public void preWindowOpen() { >- IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); >- configurer.setInitialSize(new Point(400, 300)); >- configurer.setShowCoolBar(false); >- configurer.setShowStatusLine(false); >- configurer.setTitle("$windowTitle$"); >- configurer.setShellStyle(SWT.TITLE | SWT.RESIZE); >- } >-} >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/Perspective.java b/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/Perspective.java >deleted file mode 100644 >index 3d0d73f..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/Perspective.java >+++ /dev/null >@@ -1,20 +0,0 @@ >-package $packageName$; >- >-import org.eclipse.ui.IPageLayout; >-import org.eclipse.ui.IPerspectiveFactory; >- >-/** >- * Configures the perspective layout. This class is contributed through the >- * plugin.xml. >- */ >-public class Perspective implements IPerspectiveFactory { >- >- public void createInitialLayout(IPageLayout layout) { >- String editorArea = layout.getEditorArea(); >- layout.setEditorAreaVisible(false); >- layout.setFixed(true); >- >- layout.addStandaloneView(View.ID, false, IPageLayout.LEFT, 1.0f, >- editorArea); >- } >-} >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/View.java b/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/View.java >deleted file mode 100644 >index 0e14247..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/templates/viewRAP/java/View.java >+++ /dev/null >@@ -1,73 +0,0 @@ >-package $packageName$; >- >-import org.eclipse.jface.viewers.IStructuredContentProvider; >-import org.eclipse.jface.viewers.ITableLabelProvider; >-import org.eclipse.jface.viewers.LabelProvider; >-import org.eclipse.jface.viewers.TableViewer; >-import org.eclipse.jface.viewers.Viewer; >-import org.eclipse.swt.SWT; >-import org.eclipse.swt.graphics.Image; >-import org.eclipse.swt.widgets.Composite; >-import org.eclipse.ui.ISharedImages; >-import org.eclipse.ui.PlatformUI; >-import org.eclipse.ui.part.ViewPart; >- >-public class View extends ViewPart { >- public static final String ID = "$pluginId$.view"; >- >- private TableViewer viewer; >- >- /** >- * The content provider class is responsible for providing objects to the >- * view. It can wrap existing objects in adapters or simply return objects >- * as-is. These objects may be sensitive to the current input of the view, >- * or ignore it and always show the same content (like Task List, for >- * example). >- */ >- class ViewContentProvider implements IStructuredContentProvider { >- public void inputChanged(Viewer v, Object oldInput, Object newInput) { >- } >- >- public void dispose() { >- } >- >- public Object[] getElements(Object parent) { >- return new String[] { "One", "Two", "Three" }; >- } >- } >- >- class ViewLabelProvider extends LabelProvider implements >- ITableLabelProvider { >- public String getColumnText(Object obj, int index) { >- return getText(obj); >- } >- >- public Image getColumnImage(Object obj, int index) { >- return getImage(obj); >- } >- >- public Image getImage(Object obj) { >- return PlatformUI.getWorkbench().getSharedImages().getImage( >- ISharedImages.IMG_OBJ_ELEMENT); >- } >- } >- >- /** >- * This is a callback that will allow us to create the viewer and initialize >- * it. >- */ >- public void createPartControl(Composite parent) { >- int style = SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL; >- viewer = new TableViewer(parent, style); >- viewer.setContentProvider(new ViewContentProvider()); >- viewer.setLabelProvider(new ViewLabelProvider()); >- viewer.setInput(getViewSite()); >- } >- >- /** >- * Passing the focus request to the viewer's control. >- */ >- public void setFocus() { >- viewer.getControl().setFocus(); >- } >-} >\ No newline at end of file >-- >1.7.5.4 > > >From c03abe7d04a98e748cb29b8ad618609d317b6ebd Mon Sep 17 00:00:00 2001 >From: Elias Volanakis <elias@eclipsesource.com> >Date: Mon, 14 Jan 2013 16:51:27 +0100 >Subject: [PATCH 2/2] 398068: [Tools] RWT-style hello world template > https://bugs.eclipse.org/bugs/show_bug.cgi?id=398068 > >--- > .../plugin.properties | 12 ++-- > .../ui/templates/rap/AbstractRAPWizard.java | 45 +++++++++++++----- > .../ui/templates/rap/HelloRAPTemplate.java | 51 +------------------- > .../internal/ui/templates/rap/HelloRAPWizard.java | 4 ++ > .../internal/ui/templates/rap/MailRAPWizard.java | 6 +- > .../rap/internal/ui/templates/rap/Messages.java | 3 +- > .../internal/ui/templates/rap/messages.properties | 11 ++--- > .../helloRAP/java/$applicationClass$.java | 24 --------- > .../templates/helloRAP/java/AppComposite.java | 38 +++++++++++++++ > .../templates/helloRAP/java/AppConfig.java | 13 +++++ > .../templates/helloRAP/java/AppEntryPoint.java | 24 +++++++++ > .../helloRAP/java/ApplicationActionBarAdvisor.java | 23 --------- > .../helloRAP/java/ApplicationWorkbenchAdvisor.java | 22 -------- > .../java/ApplicationWorkbenchWindowAdvisor.java | 31 ------------ > .../templates/helloRAP/java/Perspective.java | 14 ----- > 15 files changed, 127 insertions(+), 194 deletions(-) > delete mode 100644 bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/$applicationClass$.java > create mode 100644 bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/AppComposite.java > create mode 100644 bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/AppConfig.java > create mode 100644 bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/AppEntryPoint.java > delete mode 100644 bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/ApplicationActionBarAdvisor.java > delete mode 100644 bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/ApplicationWorkbenchAdvisor.java > delete mode 100644 bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/ApplicationWorkbenchWindowAdvisor.java > delete mode 100644 bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/Perspective.java > >diff --git a/bundles/org.eclipse.rap.tools.templates/plugin.properties b/bundles/org.eclipse.rap.tools.templates/plugin.properties >index 307322f..040c24c 100644 >--- a/bundles/org.eclipse.rap.tools.templates/plugin.properties >+++ b/bundles/org.eclipse.rap.tools.templates/plugin.properties >@@ -16,19 +16,19 @@ bundleProvider = Eclipse.org - RAP > # plugin.xml > helloRAP.name = RAP Hello World > helloRAP.description = \ >-<p>This wizard creates a minimal RAP application that consists of an application window with a title.</p>\ >-<p><b>Extensions Used</b></p>\ >-<li>org.eclipse.core.runtime.applications</li>\ >-<li>org.eclipse.ui.perspectives</li>\ >+<p>This example creates a basic RAP application using a few widgets (Shell, Label, Text, Button).</p>\ >+<p>The template is most appropriate for web or mobile applications that don't need an Eclipse-like user interface.</p>\ > <p>This code will need the <b>RAP target</b> to compile.</p> > > mailRAP.name = RAP Mail Template > mailRAP.description = \ >-<p>This wizard creates a RAP application that shows how to:</p>\ >-<li>add top-level menu and toolbar with actions</li>\ >+<p>This example creates a RAP application that shows how to:</p>\ >+<li>add a top-level menu and toolbar</li>\ > <li>create views that can't be closed and multiple instances of the same view</li>\ > <li>create perspectives with placeholders for new views</li>\ > <li>open modal dialogs</li>\ >+<p>The template is appropriate for web applications that need an Eclipse-like \ >+user interface, or are also run as RCP applications.</p>\ > <p><b>Extensions Used</b></p>\ > <li>org.eclipse.core.runtime.applications</li>\ > <li>org.eclipse.ui.perspectives</li>\ >diff --git a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/AbstractRAPWizard.java b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/AbstractRAPWizard.java >index 79b477e..fcdfd70 100644 >--- a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/AbstractRAPWizard.java >+++ b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/AbstractRAPWizard.java >@@ -40,7 +40,7 @@ import org.eclipse.ui.handlers.IHandlerService; > * {@link #createTemplateSections()}. > * </p> > * <p> >- * This class is responsible for modying the MANIFEST.MF after it has been >+ * This class is responsible for modifying the MANIFEST.MF after it has been > * created, in order to make it work for RAP. > * </p> > */ >@@ -50,16 +50,18 @@ abstract class AbstractRAPWizard extends NewPluginTemplateWizard { > private static final String CHARSET = "ISO-8859-1"; //$NON-NLS-1$ > private static final String PREFERENCE_INSTALL_TARGET = "installTarget"; //$NON-NLS-1$ > >+ private static final String TAG_PACKAGE_NAME = "${packageName}"; //$NON-NLS-1$ > private static final String TAG_SERVLET_PATH = "${servletPath}"; //$NON-NLS-1$ > private static final String TAG_PLUGIN_ID = "${pluginId}"; //$NON-NLS-1$ > private static final String TAG_PROJECT_NAME = "${projectName}"; //$NON-NLS-1$ >- >+ > public boolean performFinish( final IProject project, > final IPluginModelBase model, > final IProgressMonitor monitor ) > { > boolean result = super.performFinish( project, model, monitor ); > if( result ) { >+ copyAppConfig( project, model ); > copyLaunchConfig( project, model ); > IResourceChangeListener listener = new ManifestListener(); > ResourcesPlugin.getWorkspace().addResourceChangeListener( listener ); >@@ -67,6 +69,20 @@ abstract class AbstractRAPWizard extends NewPluginTemplateWizard { > } > return result; > } >+ >+ private void copyAppConfig( final IProject project, >+ final IPluginModelBase model ) { >+ IFile appConfig = project.getFile( "META-INF/appconfig.xml" ); >+ if ( appConfig.exists() ) { >+ try { >+ String pluginId = model.getPluginBase().getId(); >+ InputStream stream = readFile( appConfig.getContents(), project.getName(), pluginId ); >+ appConfig.setContents( stream, true, false, null ); >+ } catch( final CoreException ce ) { >+ TemplateUtil.log( ce.getStatus() ); >+ } >+ } >+ } > > private void copyLaunchConfig( final IProject project, > final IPluginModelBase model ) >@@ -75,7 +91,10 @@ abstract class AbstractRAPWizard extends NewPluginTemplateWizard { > IFile launchConfig = project.getFile( name ); > if( !launchConfig.exists() ) { > try { >- InputStream stream = readLaunchConfig( project, model ); >+ InputStream template >+ = AbstractRAPWizard.class.getResourceAsStream( LAUNCH_TEMPLATE ); >+ String pluginId = model.getPluginBase().getId(); >+ InputStream stream = readFile( template, project.getName(), pluginId ); > launchConfig.create( stream, true, new NullProgressMonitor() ); > } catch( final CoreException ce ) { > TemplateUtil.log( ce.getStatus() ); >@@ -83,15 +102,12 @@ abstract class AbstractRAPWizard extends NewPluginTemplateWizard { > } > } > >- private InputStream readLaunchConfig( final IProject project, >- final IPluginModelBase model ) >+ private InputStream readFile( final InputStream iStream, String projectName, String pluginId ) > throws CoreException > { >- InputStream template >- = AbstractRAPWizard.class.getResourceAsStream( LAUNCH_TEMPLATE ); > StringBuffer buffer = new StringBuffer(); > try { >- InputStreamReader reader = new InputStreamReader( template, CHARSET ); >+ InputStreamReader reader = new InputStreamReader( iStream, CHARSET ); > BufferedReader br = new BufferedReader( reader ); > try { > int character = br.read(); >@@ -103,18 +119,19 @@ abstract class AbstractRAPWizard extends NewPluginTemplateWizard { > br.close(); > } > } catch( final Exception ex ) { >- String pluginId = TemplateUtil.PLUGIN_ID; > String msg = "Could not read launch template"; //$NON-NLS-1$ >- throw new CoreException( new Status( IStatus.ERROR, pluginId, msg, ex ) ); >+ throw new CoreException( new Status( IStatus.ERROR, TemplateUtil.PLUGIN_ID, msg, ex ) ); > } > // Replace $-placeholder with actual values >- replacePlaceholder( buffer, TAG_PROJECT_NAME, project.getName() ); >- String pluginId = model.getPluginBase().getId(); >+ replacePlaceholder( buffer, TAG_PACKAGE_NAME, getPackageName() ); >+ replacePlaceholder( buffer, TAG_PROJECT_NAME, projectName ); > replacePlaceholder( buffer, TAG_PLUGIN_ID, pluginId ); > replacePlaceholder( buffer, TAG_SERVLET_PATH, getServletPath() ); > return new ByteArrayInputStream( buffer.toString().getBytes() ); > } > >+ protected abstract String getPackageName(); >+ > protected abstract String getServletPath(); > > private static void replacePlaceholder( final StringBuffer buffer, >@@ -263,6 +280,10 @@ abstract class AbstractRAPWizard extends NewPluginTemplateWizard { > } > writer.write( "Import-Package: javax.servlet;version=\"2.4.0\"," + NL ); //$NON-NLS-1$ > writer.write( " javax.servlet.http;version=\"2.4.0\"" + NL ); //$NON-NLS-1$ >+ IFile appconfigXml = file.getParent().getFile( new Path( "appconfig.xml" ) ); >+ if ( appconfigXml.exists() ) { >+ writer.write( "Service-Component: META-INF/appconfig.xml" + NL ); >+ } > } finally { > writer.close(); > } >diff --git a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPTemplate.java b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPTemplate.java >index ce4f439..1d0037d 100644 >--- a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPTemplate.java >+++ b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPTemplate.java >@@ -15,9 +15,6 @@ import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.jface.wizard.Wizard; > import org.eclipse.jface.wizard.WizardPage; >-import org.eclipse.pde.core.plugin.IPluginElement; >-import org.eclipse.pde.core.plugin.IPluginExtension; >-import org.eclipse.rap.internal.ui.templates.XmlNames; > > class HelloRAPTemplate extends AbstractRAPTemplate { > >@@ -47,63 +44,17 @@ class HelloRAPTemplate extends AbstractRAPTemplate { > } > > protected void updateModel( IProgressMonitor monitor ) throws CoreException { >- createEntryPointExtension(); >- createApplicationExtension(); >- createPerspectivesExtension(); > } > > ////////////////// > // helping methods > >- private void createEntryPointExtension() throws CoreException { >- IPluginExtension extension = createExtension( XmlNames.XID_ENTRYPOINT, true ); >- extension.setId( getApplicationId() + ".entrypoints" ); >- IPluginElement entryPointElement = createElement( extension ); >- entryPointElement.setName( XmlNames.ELEM_ENTRYPOINT ); >- entryPointElement.setAttribute( XmlNames.ATT_ID, getApplicationId() + ".entrypoint" ); >- entryPointElement.setAttribute( XmlNames.ATT_SERVLET_PATH, getServletPath() ); >- entryPointElement.setAttribute( XmlNames.ATT_APPLICATION_ID, getFullApplicationId() ); >- extension.add( entryPointElement ); >- addExtensionToPlugin( extension ); >- } >- >- private void createApplicationExtension() throws CoreException { >- IPluginExtension extension = createExtension( XmlNames.XID_APPLICATION, true ); >- extension.setId( getFullApplicationId() ); >- IPluginElement applicationElement = createElement( extension ); >- applicationElement.setName( XmlNames.ELEM_APPLICATION ); >- applicationElement.setAttribute( XmlNames.ATT_VISIBLE, "true" ); //$NON-NLS-1$ >- applicationElement.setAttribute( XmlNames.ATT_CARDINALITY, "singleton-global" ); //$NON-NLS-1$ >- applicationElement.setAttribute( XmlNames.ATT_THREAD, "main" ); //$NON-NLS-1$ >- extension.add( applicationElement ); >- IPluginElement runElement = createElement( extension ); >- runElement.setName( XmlNames.ELEM_RUN ); //$NON-NLS-1$ >- runElement.setAttribute( XmlNames.ATT_CLASS, getApplicationClass() ); >- applicationElement.add( runElement ); >- addExtensionToPlugin( extension ); >- } >- >- private void createPerspectivesExtension() throws CoreException { >- IPluginExtension extension = createExtension( XmlNames.XID_PERSPECTIVES, true ); >- IPluginElement element = createElement( extension ); >- element.setName( XmlNames.ELEM_PERSPECTIVE ); >- element.setAttribute( XmlNames.ATT_CLASS, getPackageName() + ".Perspective" ); //$NON-NLS-1$ >- element.setAttribute( XmlNames.ATT_NAME, Messages.helloRAPTemplate_perspectiveName ); >- element.setAttribute( XmlNames.ATT_ID, getPluginId() + ".perspective" ); //$NON-NLS-1$ >- extension.add( element ); >- addExtensionToPlugin( extension ); >- } >- > private void createTemplateOptions() { > addOption( KEY_WINDOW_TITLE, > Messages.helloRAPTemplate_windowTitle, > Messages.helloRAPTemplate_appWindowTitle, > 0 ); >- addOption( KEY_PACKAGE_NAME, Messages.helloRAPTemplate_packageNmae, null, 0 ); >- addOption( KEY_APPLICATION_CLASS, >- Messages.helloRAPTemplate_appClass, >- "Application", //$NON-NLS-1$ >- 0 ); >+ addOption( KEY_PACKAGE_NAME, Messages.helloRAPTemplate_packageName, null, 0 ); > } > > } >diff --git a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPWizard.java b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPWizard.java >index d2d9c37..be1030d 100644 >--- a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPWizard.java >+++ b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/HelloRAPWizard.java >@@ -29,6 +29,10 @@ public class HelloRAPWizard extends AbstractRAPWizard { > template > }; > } >+ >+ protected String getPackageName() { >+ return template.getPackageName(); >+ } > > protected String getServletPath() { > return template.getServletPath(); >diff --git a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/MailRAPWizard.java b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/MailRAPWizard.java >index 5f19d60..4c5266b 100644 >--- a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/MailRAPWizard.java >+++ b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/MailRAPWizard.java >@@ -29,9 +29,9 @@ public class MailRAPWizard extends AbstractRAPWizard { > template > }; > } >- >- protected String getEntryPointName() { >- return template.getFullApplicationId(); >+ >+ protected String getPackageName() { >+ return template.getPackageName(); > } > > protected String getServletPath() { >diff --git a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/Messages.java b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/Messages.java >index 6889443..b41776c 100644 >--- a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/Messages.java >+++ b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/Messages.java >@@ -19,9 +19,8 @@ public class Messages extends NLS { > public static String AbstractRAPWizard_targetQuestionDialogTitle; > public static String AbstractRAPWizard_Modifying; > >- public static String helloRAPTemplate_appClass; > public static String helloRAPTemplate_appWindowTitle; >- public static String helloRAPTemplate_packageNmae; >+ public static String helloRAPTemplate_packageName; > public static String helloRAPTemplate_pageDescr; > public static String helloRAPTemplate_pageTitle; > public static String helloRAPTemplate_perspectiveName; >diff --git a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/messages.properties b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/messages.properties >index 114da12..5f8723f 100644 >--- a/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/messages.properties >+++ b/bundles/org.eclipse.rap.tools.templates/src/org/eclipse/rap/internal/ui/templates/rap/messages.properties >@@ -14,9 +14,8 @@ AbstractRAPWizard_targetQuestionDialogMessage=RAP projects need to be compiled a > AbstractRAPWizard_Modifying=Modifying {0} > > mailRAPWizard_windowTitle=New Project with a RAP Mail Template >- > mailRAPTemplate_pageTitle=RAP Mail Template >-mailRAPTemplate_pageDescr=This template generates a RAP application with views, menu and toolbar actions and a perspective. >+mailRAPTemplate_pageDescr=Creates a RAP workbench application with views, menu and toolbar actions and a perspective. > mailRAPTemplate_categoryName=Mail > mailRAPTemplate_mailboxCmdDescr=Opens a mailbox > mailRAPTemplate_mailboxCmdName=Open Mailbox >@@ -29,11 +28,9 @@ mailRAPTemplate_appWindowTitle=RAP Mail Template > mailRAPTemplate_packageName=Pa&ckage name: > mailRAPTemplate_appClass=App&lication class: > >-helloRAPWizard_windowTitle=New Hello RAP Project >+helloRAPWizard_windowTitle=New Basic RAP Project > helloRAPTemplate_pageTitle=Basic RAP Application >-helloRAPTemplate_pageDescr=This wizard creates a minimal RAP application that consists of an application window with a title. >-helloRAPTemplate_perspectiveName=RAP Perspective >+helloRAPTemplate_pageDescr=Creates a basic RAP application using a few RWT widgets (Shell, Label, Text, Button). > helloRAPTemplate_windowTitle=Application window &title: > helloRAPTemplate_appWindowTitle=Hello RAP >-helloRAPTemplate_packageNmae=Pa&ckage name: >-helloRAPTemplate_appClass=App&lication class: >+helloRAPTemplate_packageName=Pa&ckage name: >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/$applicationClass$.java b/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/$applicationClass$.java >deleted file mode 100644 >index 1974a68..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/$applicationClass$.java >+++ /dev/null >@@ -1,24 +0,0 @@ >-package $packageName$; >- >-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; >- >-/** >- * This class controls all aspects of the application's execution >- * and is contributed through the plugin.xml. >- */ >-public class $applicationClass$ implements IApplication { >- >- public Object start(IApplicationContext context) throws Exception { >- Display display = PlatformUI.createDisplay(); >- WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor(); >- return PlatformUI.createAndRunWorkbench(display, advisor); >- } >- >- public void stop() { >- // Do nothing >- } >-} >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/AppComposite.java b/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/AppComposite.java >new file mode 100644 >index 0000000..cfc9657 >--- /dev/null >+++ b/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/AppComposite.java >@@ -0,0 +1,38 @@ >+package $packageName$; >+ >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.SelectionAdapter; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.Text; >+ >+@SuppressWarnings("serial") >+public class AppComposite extends Composite { >+ >+ public AppComposite(Composite parent) { >+ super(parent, SWT.NONE); >+ setLayout(new GridLayout(1, false)); >+ >+ Label lblName = new Label(this, SWT.NONE); >+ lblName.setText("Name:"); >+ >+ final Text txtName = new Text(this, SWT.BORDER); >+ txtName.setText("M. Max"); >+ txtName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); >+ >+ final Button btnGreet = new Button(this, SWT.PUSH); >+ btnGreet.setText("Greet"); >+ btnGreet.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); >+ >+ btnGreet.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ btnGreet.setText(String.format("Hello, %s!", txtName.getText())); >+ } >+ }); >+ } >+} >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/AppConfig.java b/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/AppConfig.java >new file mode 100644 >index 0000000..a94a526 >--- /dev/null >+++ b/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/AppConfig.java >@@ -0,0 +1,13 @@ >+package $packageName$; >+ >+import org.eclipse.rap.rwt.application.Application; >+import org.eclipse.rap.rwt.application.ApplicationConfiguration; >+ >+public class AppConfig implements ApplicationConfiguration { >+ >+ @Override >+ public void configure(Application application) { >+ application.addEntryPoint("/hello", AppEntryPoint.class, null); >+ } >+ >+} >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/AppEntryPoint.java b/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/AppEntryPoint.java >new file mode 100644 >index 0000000..9487ff6 >--- /dev/null >+++ b/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/AppEntryPoint.java >@@ -0,0 +1,24 @@ >+package $packageName$; >+ >+import org.eclipse.rap.rwt.application.EntryPoint; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.layout.FillLayout; >+import org.eclipse.swt.widgets.Shell; >+ >+public class AppEntryPoint implements EntryPoint { >+ >+ @Override >+ public int createUI() { >+ Shell shell = new Shell(SWT.TITLE); >+ shell.setText("$windowTitle$"); >+ shell.setMaximized(true); >+ shell.setLayout(new FillLayout()); >+ >+ new AppComposite(shell); >+ >+ shell.open(); >+ >+ return 0; >+ } >+ >+} >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/ApplicationActionBarAdvisor.java b/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/ApplicationActionBarAdvisor.java >deleted file mode 100644 >index 4b24376..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/ApplicationActionBarAdvisor.java >+++ /dev/null >@@ -1,23 +0,0 @@ >-package $packageName$; >- >-import org.eclipse.jface.action.IMenuManager; >-import org.eclipse.ui.IWorkbenchWindow; >-import org.eclipse.ui.application.ActionBarAdvisor; >-import org.eclipse.ui.application.IActionBarConfigurer; >- >-/** >- * Creates, adds and disposes actions for the menus and action bars of >- * each workbench window. >- */ >-public class ApplicationActionBarAdvisor extends ActionBarAdvisor { >- >- public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) { >- super(configurer); >- } >- >- protected void makeActions(IWorkbenchWindow window) { >- } >- >- protected void fillMenuBar(IMenuManager menuBar) { >- } >-} >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/ApplicationWorkbenchAdvisor.java b/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/ApplicationWorkbenchAdvisor.java >deleted file mode 100644 >index 2515319..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/ApplicationWorkbenchAdvisor.java >+++ /dev/null >@@ -1,22 +0,0 @@ >-package $packageName$; >- >-import org.eclipse.ui.application.IWorkbenchWindowConfigurer; >-import org.eclipse.ui.application.WorkbenchAdvisor; >-import org.eclipse.ui.application.WorkbenchWindowAdvisor; >- >-/** >- * This workbench advisor creates the window advisor, and specifies >- * the perspective id for the initial window. >- */ >-public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor { >- >- private static final String PERSPECTIVE_ID = "$pluginId$.perspective"; >- >- public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { >- return new ApplicationWorkbenchWindowAdvisor(configurer); >- } >- >- public String getInitialWindowPerspectiveId() { >- return PERSPECTIVE_ID; >- } >-} >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/ApplicationWorkbenchWindowAdvisor.java b/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/ApplicationWorkbenchWindowAdvisor.java >deleted file mode 100644 >index 6648cf5..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/ApplicationWorkbenchWindowAdvisor.java >+++ /dev/null >@@ -1,31 +0,0 @@ >-package $packageName$; >- >-import org.eclipse.swt.SWT; >-import org.eclipse.swt.graphics.Point; >-import org.eclipse.ui.application.ActionBarAdvisor; >-import org.eclipse.ui.application.IActionBarConfigurer; >-import org.eclipse.ui.application.IWorkbenchWindowConfigurer; >-import org.eclipse.ui.application.WorkbenchWindowAdvisor; >- >-/** >- * Configures the initial size and appearance of a workbench window. >- */ >-public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor { >- >- public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) { >- super(configurer); >- } >- >- public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) { >- return new ApplicationActionBarAdvisor(configurer); >- } >- >- public void preWindowOpen() { >- IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); >- configurer.setInitialSize(new Point(400, 300)); >- configurer.setShowCoolBar(false); >- configurer.setShowStatusLine(false); >- configurer.setTitle("$windowTitle$"); >- configurer.setShellStyle(SWT.TITLE | SWT.RESIZE); >- } >-} >diff --git a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/Perspective.java b/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/Perspective.java >deleted file mode 100644 >index 2963f80..0000000 >--- a/bundles/org.eclipse.rap.tools.templates/templates/helloRAP/java/Perspective.java >+++ /dev/null >@@ -1,14 +0,0 @@ >-package $packageName$; >- >-import org.eclipse.ui.IPageLayout; >-import org.eclipse.ui.IPerspectiveFactory; >- >-/** >- * Configures the perspective layout. This class is contributed >- * through the plugin.xml. >- */ >-public class Perspective implements IPerspectiveFactory { >- >- public void createInitialLayout(IPageLayout layout) { >- } >-} >-- >1.7.5.4 >
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 398068
:
225572
|
225575