Mittwoch, 27. März 2013
Geoff: Visualizing geographical maps in Eclipse RCP/RAP applications
Its main focus is on
- Storage and processing of massive data volume
- Model driven design
- Desktop, Web, and mobile mapping
- Real time analysis of business critical data
With geoff (geo fast forward), I have proposed a new project that aims at providing a solution to be used for existing (or maybe new ones, too) Eclipse RCP applications to enable visualization of geographical (geo spatial) maps. It uses model driven design (EMF) to provide a declarative configuration of a layered map that can be rendered via the JavaScript framework called OpenLayers 2.12.
EclipseSource's Ralf Sternberg was very cooperative to host an RAP version of the current state on their demo server - Thanks a lot!
Geoff RAP Demo Application
You can follow the progress on GitHub: Geoff on GitHub
Freitag, 28. Mai 2010
Chained Commands Execution
Chained Commands Execution
What are commands?
- create a command definition
- create a handler or handlers (which are conditionally enabled upon a specific expression)
- define a menu contribution to be shown in the UI which the user can use to trigger the execution of the command
What are chained commands?
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="chain:chains.demo.login">
<command
commandId="myapp.login"
id="command.login"
style="push">
</command>
<command
commandId="ui.showMessage"
style="push">
<parameter
name="type"
value="error">
</parameter>
<parameter
name="message"
value="Login denied using: user={login.user}">
</parameter>
<visibleWhen
checkEnabled="false">
<with
variable="previous">
<equals
value="false">
</equals>
</with>
</visibleWhen>
</command>
<command
commandId="org.eclipse.ui.perspectives.showPerspective"
style="push">
<parameter
name="org.eclipse.ui.perspectives.showPerspective.perspectiveId"
value="myapp.myHomePerspective">
</parameter>
<visibleWhen
checkEnabled="false">
<with
variable="command.login">
<equals
value="true">
</equals>
</with>
</visibleWhen>
</command>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
allPopups="false"
locationURI="toolbar:org.eclipse.ui.main.toolbar">
<command
commandId="platform.executeChain"
style="push">
<parameter
name="chainID"
value="chains.demo.login">
</parameter>
</command>
</menuContribution>
</extension>
Source
https://erdalkaraca.googlecode.com/svn/trunk/org.eclipselabs.chains
Links
Dienstag, 12. Januar 2010
Single Sourcing RAP/RCP apps
Scenario
You read about RAP [1] to be able to do pretty much that is possible with RCP, and thus, decided to provide a web version of your eclipse plugin.So, you install and setup the RAP tooling [2]. You change your target platform to compile against the RAP runtime. Several compile errors arise. After some research you read about RAP not being fully compatible with its RCP counterpart and that you will have to apply single sourcing techniques to get your plugin work on RAP.
A bit more of your research reveals the following approaches used for single sourcing:
- use reflection to determine whether a specific functionality is available
- swap non-working code into a bundle fragment
- use osgi services for each functionality to be single sourced
- use byte code weaving to patch non-working code at runtime
- etc. (Are there any more to be listed here?)
This approach
This approach is based on a central single sourcing service (think OSGi). It provides an interface for registering and executing wrapped code by a user defined id:
Let us explain this by a simple example: In your RCP you are adding a mouse move listener to a control:
Composite comp = new Composite( parent, SWT.None );
comp.addMouseMoveListener( new MouseMoveListener() {
public void mouseMove( MouseEvent e ) {
System.out.println( "mouse location: "
+ e.x + ", " + e.y );
}
} );
As you might know, RAP does not support mouse move events, and thus, this has to be single sourced.
We, first, have to register the wrapped code, i.e. the part that is not runnable on RAP:
ISingleSourcingService service = ISingleSourcingService.INSTANCE.get();
service.registerExec( "my.execs.addMouseMoveListenerToComposite",
new IExec() {
public Object run( Object... params ) {
Composite comp = (Composite) params[ 0 ];
comp.addMouseMoveListener( new MouseMoveListener() {
public void mouseMove( MouseEvent e ) {
System.out.println( "mouse location: "
+ e.x + ", " + e.y );
}
} );
return null;
}
} );
}
Then, we can call the single sourcing service to execute the wrapped code:
Composite comp = new Composite( parent, SWT.None ); service.execute( "my.execs.addMouseMoveListenerToComposite", null, comp );
This code can be used on both of the platforms, since it does not cause any errors anymore.
Missing clues
Where to register wrapped code?The preferred way is a separate plugin to host the code. When running on RCP, you will have to make sure that this plugin has been started. On RAP, you would just exclude that plugin from deployment. The other way around is valid as well.
Where to find the sources?
You can checkout the sources from http://erdalkaraca.googlecode.com/svn/trunk/org.eclipse.labs.singlesrc.
[1] http://eclipse.org/rap/introduction.php
[2] http://eclipse.org/rap/gettingstarted.php
