Home » Eclipse Projects » Remote Application Platform (RAP) » RAP 1.50.M3 Standalone
|
Re: RAP 1.50.M3 Standalone [message #756664 is a reply to message #756594] |
Mon, 14 November 2011 15:46 |
Rüdiger Herrmann Messages: 335 Registered: July 2009 |
Senior Member |
|
|
Edin,
there was a mistake in the FAQ entry which is now corrected. Remove the
event loop from the example entry point and it should work.
You can basically use RAP at three different levels
1. RWT Standalone as described in the FAQ, plus optionally Forms, JFace,
Databinding and everything else that doesn't require OSGi to run.
2. RWT + OSGi, like RWT Standalone but running on OSGi. See [1] for more
details.
3. RAP Workbench, this is the full RAP stack which allows
single-sourcing with RCP.
Regarding the plugin.xml, those extension points that control behavior
of RWT are naturally also available as Java API. The
ApplicationConfigurator (see the FAQ) is where such settings are now made.
HTH
Rüdiger
[1] http://www.codeaffine.com/2011/10/05/raprwt-osgi-integration-ii/
On 14.11.2011 14:16, dedagic wrote:
> Hello im trying to setup a standalone version of a RAP Application based
> upon this FAQ
> http://wiki.eclipse.org/RAP/FAQ#How_do_I_develop_an_RWT_standalone_application_with_RAP_.3E.3D_1.5
>
>
> My problems are the following:
> im getting java.lang.UnsupportedOperationException: The SimpleLifeCycle
> does not support Display#sleep() in my EntryPoint class with the
> following code:
>
> Display display = new Display();
> Shell shell = new Shell( display );
> Label label = new Label( shell, SWT.NONE );
> label.setText( "Hello RAP World" );
> label.setBounds(50, 50, 200, 30);
> shell.setSize( 500, 400 ); shell.open();
> while( !shell.isDisposed() ) {
> if( !display.readAndDispatch() )
> display.sleep();
> }
> display.dispose();
> return 0;
>
> The second one is the question, how to get the following code be loaded:
> public class HelloWorldConfigurator implements ApplicationConfigurator {
> public void configure( ApplicationConfiguration configuration ) {
> configuration.addEntryPoint( "default", ExampleEntryPoint.class );
> }
> }
>
> My ExampleEntryPoint is never get loaded when i start the application
> from the RAP Tooling, so my brandig is not loaded.
> Is it true that i even dont need OSGi anymore when startig RAP on this
> way? Is it then possible to define every plugin.xml setting with the
> Java classes?
>
> Greetings Edin
>
--
Rüdiger Herrmann
http://codeaffine.com
|
|
|
Re: RAP 1.50.M3 Standalone [message #756734 is a reply to message #756664] |
Mon, 14 November 2011 20:50 |
Edin Edin Messages: 101 Registered: January 2010 |
Senior Member |
|
|
Hi Rüdiger,
thanx for your replay. We want to take the first version, without osgi and with rwt, like it is described in the FAQ. Is such a standalone version usefull for multiuser rap application? Or are there some restrictions to expect? We also have an css file that we use in our Theme, mostly to load Button Images with aButton.getData(WidgetUtil.CUSTOM_VARIANT), or to format Labels, color table row background and so on. This Helper class seems not to work for standalone RAP application version, is it correct? If so, is there a possibility still to use it? My last question is, when i implement a example oriented on the FAQ and do provide my own ApplicationConfigurator class and then run the application only wit rap Tooling as described (choose UIEntriPoint class and then run as RWT), my MyApplicationConfigurator class methods that override the ApplicationConfigurator abstract class are never called. Which is the easiest way to realise a simple demo version running with rap tooling to be able to test ApplicationConfigurator functionalitites without OSGi?
Greetings Edin
|
|
|
Re: RAP 1.50.M3 Standalone [message #756901 is a reply to message #756734] |
Tue, 15 November 2011 13:26 |
Rüdiger Herrmann Messages: 335 Registered: July 2009 |
Senior Member |
|
|
Edin,
as long as you don't have an urgent need for the workbench, RWT
standalone is a good choice.
To contribute CSS files to a theme, use the addStyleSheet() method in
the ApplicationConfiguration. To contribute to the default theme,
specify ThemeManager#DEFAULT_THEME_ID in the themeId argument.
To launch an application with an ApplicationConfigurator you first need
a web.xml like the one from the FAQ [1]. Make sure the
org.eclipse.rwt.Configurator init param points to your implementation of
ApplicationConfigurator. Then create a new launch configuration, select
"Run from web.xml" and enter the path to the web.xml and the name of the
servlet path ("rap" if you follow the FAQ).
Regards,
Rüdiger
[1]
http://wiki.eclipse.org/RAP/FAQ#How_do_I_develop_an_RWT_standalone_application_with_RAP_.3E.3D_1.5
On 14.11.2011 21:50, dedagic wrote:
> Hi Rüdiger,
> thanx for your replay. We want to take the first version, without osgi
> and with rwt, like it is described in the FAQ. Is such a standalone
> version usefull for multiuser rap application? Or are there some
> restrictions to expect? We also have an css file that we use in our
> Theme, mostly to load Button Images with
> aButton.getData(WidgetUtil.CUSTOM_VARIANT), or to format Labels, color
> table row background and so on. This Helper class seems not to work for
> standalone RAP application version, is it correct? If so, is there a
> possibility still to use it? My last question is, when i implement a
> example oriented on the FAQ and do provide my own
> ApplicationConfigurator class and then run the application only wit rap
> Tooling as described (choose UIEntriPoint class and then run as RWT), my
> MyApplicationConfigurator class methods that override the
> ApplicationConfigurator abstract class are never called. Which is the
> easiest way to realise a simple demo version running with rap tooling to
> be able to test ApplicationConfigurator functionalitites without OSGi?
>
> Greetings Edin
--
Rüdiger Herrmann
http://codeaffine.com
|
|
|
Re: RAP 1.50.M3 Standalone [message #758690 is a reply to message #756901] |
Thu, 24 November 2011 09:34 |
Edin Edin Messages: 101 Registered: January 2010 |
Senior Member |
|
|
Hi Rüdiger,
thx for your help. Eveything works fine now. Only two small things, that are not important for running, but for me to easy develop and structure my project:
1) i cannot see javadoc of RAP classes in eclipse, i add rwt jars to my buildpath (including source jars). Do i have to make some other settings or add some other jars for that?
2) putting some ressources (like theme.css) into other folder than src folders is not working (theme.css will not be found, and im getting illegalargument exception on startup). As far as i make new folder to be a source folder, then it works. This is not so important to me, but runing rap earlier with osgi and setting rap runtime as target platform, didnt make no problems.
The second point is not really important, but i would ike to know why. The first one is more important, its annoying to read API somewhere else.
Best regards, Edin
|
|
|
Re: RAP 1.50.M3 Standalone [message #758876 is a reply to message #758690] |
Thu, 24 November 2011 21:47 |
Rüdiger Herrmann Messages: 335 Registered: July 2009 |
Senior Member |
|
|
Edin,
please see my comments below.
HTH,
Rüdiger
On 24.11.2011 10:34, dedagic wrote:
> Hi Rüdiger,
>
> thx for your help. Eveything works fine now. Only two small things, that
> are not important for running, but for me to easy develop and structure
> my project:
> 1) i cannot see javadoc of RAP classes in eclipse, i add rwt jars to my
> buildpath (including source jars). Do i have to make some other settings
> or add some other jars for that?
It is useless to add the source jars to you build path. Use the source
jars as a source attachment:
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fref-properties-source-attachment.htm
This will also bring you the JavaDoc.
> 2) putting some ressources (like theme.css) into other folder than src
> folders is not working (theme.css will not be found, and im getting
> illegalargument exception on startup). As far as i make new folder to be
> a source folder, then it works. This is not so important to me, but
> runing rap earlier with osgi and setting rap runtime as target platform,
> didnt make no problems.
Please make sure you understand the difference between running on OSGi
and running plain Java.
Basically, in OSGi you can access files that are not on the class path
but reside inside a bundle with methods like Bundle#getEntry(),
#findEntries(). This is how your theme.css is loaded in OSGi.
When running a plain Java application, only what is on the class path
can be accessed during runtime. Other artifacts from your project aren't
accessible.
> The second point is not really important, but i would ike to know why.
> The first one is more important, its annoying to read API somewhere
> else. :)
>
> Best regards, Edin
--
Rüdiger Herrmann
http://codeaffine.com
|
|
| | | | |
Re: RAP 1.50.M3 Standalone [message #759310 is a reply to message #758972] |
Mon, 28 November 2011 10:50 |
Rüdiger Herrmann Messages: 335 Registered: July 2009 |
Senior Member |
|
|
with the support for transparent session failover [1] in RAP 1.5 M1, we
implemented an alternative life cycle. This life cycle isn't fully
compatible with SWT. In particular, it hasn't a dedicated UI thread
which is necessary to support blocking dialogs.
You can now, either switch back to the SWT compatible life cycle or go
without blocking (JFace) dialogs.
To switch back to SWT compatibility, specify an ApplicationConfigurator
as explained in the FAQ [2] and call configuration.setOperationMode(
OperationMode.SWT_COMPATIBILITY ) in its configure() method.
Alternatively you can stay with the default operation mode and open
JFace dialogs in a non-blocking way (call Window.setBlockOnOpen( false
)). If you do not rely on having JFace to manage your dialogs, you can
also use plain SWT dialogs together with the
org.eclipse.rwt.widgets.DialogUtil helper class.
HTH
Rüdiger
[1] http://wiki.eclipse.org/RAP/RWT_Cluster
[2]
http://wiki.eclipse.org/RAP/FAQ#How_do_I_develop_an_RWT_standalone_application_with_RAP_.3E.3D_1.5
On 25.11.2011 13:39, dedagic wrote:
> Hello again,
>
> thnx for your help. Now i have another problem. I implemented a class
> called Login based upon jface Dialog class. Im calling it from the
> IEntrPoint#createUI metod:
> public int createUI() {
> Display display = new Display();
> Shell shell = new Shell(display, SWT.ON_TOP);
> shell.setSize(600, 400);
> //shell.setMaximized(true);
> new Login(shell).open();
> return 0;
> }
>
> But now im getting the infinity loop, throwing this exception:
>
> java.lang.UnsupportedOperationException: The SimpleLifeCycle does not
> support Display#sleep().
> at
> org.eclipse.rwt.internal.lifecycle.SimpleLifeCycle.sleep(SimpleLifeCycle.java:152)
>
> at org.eclipse.swt.widgets.Display.sleep(Display.java:1177)
> at org.eclipse.jface.window.Window.runEventLoop(Window.java:842)
> at org.eclipse.jface.window.Window.open(Window.java:817)
> at com.acarsoft.smartcomm.HelloWorld.createUI(HelloWorld.java:16)
> at
> org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:90)
>
> at
> org.eclipse.rwt.internal.lifecycle.PrepareUIRoot.createUI(PrepareUIRoot.java:43)
>
> at
> org.eclipse.rwt.internal.lifecycle.PrepareUIRoot.execute(PrepareUIRoot.java:34)
>
> at
> org.eclipse.rwt.internal.lifecycle.PhaseExecutor.execute(PhaseExecutor.java:34)
>
> at
> org.eclipse.rwt.internal.lifecycle.SimpleLifeCycle.execute(SimpleLifeCycle.java:132)
>
> at
> org.eclipse.rwt.internal.service.LifeCycleServiceHandler.runLifeCycle(LifeCycleServiceHandler.java:80)
>
> at
> org.eclipse.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(LifeCycleServiceHandler.java:58)
>
> at
> org.eclipse.rwt.internal.service.LifeCycleServiceHandler.service(LifeCycleServiceHandler.java:48)
>
> at
> org.eclipse.rwt.internal.service.ServiceManager$HandlerDispatcher.service(ServiceManager.java:34)
>
> at org.eclipse.rwt.engine.RWTServlet.handleValidRequest(RWTServlet.java:66)
> at org.eclipse.rwt.engine.RWTServlet.doPost(RWTServlet.java:45)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
> at
> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
> at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:326)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
>
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>
> at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>
>
> jFace Window class tries to put Display sleep but the SiplyCifeCycle
> does not support sleep method. Is probably the same problem as mentioned
> before. But how to solve it this time?
>
> Best regards, Edin
--
Rüdiger Herrmann
http://codeaffine.com
|
|
| | |
Re: RAP 1.50.M3 Standalone [message #760289 is a reply to message #760120] |
Thu, 01 December 2011 19:12 |
Rüdiger Herrmann Messages: 335 Registered: July 2009 |
Senior Member |
|
|
Edin,
with the alternative (aka JEE compatible) operation mode it is possible
to have modal dialogs, but not blocking dialogs.
If a dialog is modal, the user can only interact with controls in this
dialog. The rest of the application is inaccessible while a modal dialog
is active.
Whereas a blocking dialog halts the program flow, usually until the
dialogs is closed.
To create a modal dialog, just make sure that the Shell which represents
the dialog is created with one of the SWT.XXX_MODAL flags.
Modal behavior need not necessarily apply to the program flow. With the
JEE compatible operation mode, you can create modal dialogs but not
blocking dialogs. To continue the program flow after the dialogs was
closed, you'll have to add a close-listener and continue the program
flow from there. For SWT dialogs, we provide the DialogUtil helper class
to assist with this task.
Rest assured that the JEE compatible operation mode has no influence on
the session behavior. All multi-user/multi-session features stay the
same, whichever operation mode you choose.
Does that answer your questions?
Regards,
Rüdiger
On 01.12.2011 12:24, dedagic wrote:
> Hi Rüdiger,
> does it mean, with this new lifecycle alternative it will be not
> possible to block the application to force user to make a decision
> before continue using the rap application? Is there some other simple
> way to disable the rest of the application, till we get the user
> response, or do i have to disable all swt.controls in the application,
> until i get the answer? Moreover what do i have to consider in a
> multiuser rap application using this alternative lifecycle, when you
> say, there is no user specific UIThread? Are there still all features
> onboard that are user/session specific ?
> Best regards, Edin
--
Rüdiger Herrmann
http://codeaffine.com
|
|
| | | | | | | | | |
Goto Forum:
Current Time: Thu Sep 26 17:04:26 GMT 2024
Powered by FUDForum. Page generated in 0.06296 seconds
|