Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » GMF on RAP
GMF on RAP [message #658096] Sun, 06 March 2011 11:27 Go to next message
Sudesh Bulathsinhala is currently offline Sudesh BulathsinhalaFriend
Messages: 193
Registered: October 2010
Senior Member
Hello,

We're developing RAP product which gives flexibility for the end-users to extend / create new forms(editors) at RUN-TIME, using designers.

All the editors are created at DESIGN-TIME using the following code snippet.

  	@Override
	public void createPartControl(final Composite parent) {
		parent.setBackgroundMode(SWT.INHERIT_DEFAULT);
		final FormLayout layout = new FormLayout();
		layout.marginWidth = 0;
		layout.marginHeight = 0;
		layout.marginLeft = 5;
		layout.marginRight = 5;
		layout.marginTop = 5;
		layout.marginBottom = 5;
		parent.setLayout(layout);
		CustomDecoratorPropertyProvider.getInstance()
				.setCompositeBackgroundGradient(parent);
		try {
			PlatformUI
					.getWorkbench()
					.getProgressService()
					.runInUI(PlatformUI.getWorkbench().getProgressService(),
							new IRunnableWithProgress() {
								@Override
								public void run(final IProgressMonitor monitor) {
									monitor.beginTask(
											"Opening Editor in progress, please wait..",
											IProgressMonitor.UNKNOWN);
									
									DatasetCompositeFactory
											.getInstance()
											.initComposite(
													parent,
													_userInterfaceRender
															.getCompositePanelModel(),
													_datasetControllerArray);

									monitor.done();
								}
							}, null);
		} catch (final InvocationTargetException e) {
			e.printStackTrace();
		} catch (final InterruptedException e) {
			e.printStackTrace();
		}
	}
   


As you can see from the above snippet, the createPartControl method does not implement the actual SWT logic, but rather a factory method called DatasetCompositeFactory.getInstance().initComposite(parent, _userInterfaceRender.getCompositePanelModel(), _datasetControllerArray). This method indeed delegates it's corresponding Java object (_userInterfaceRender.getCompositePanelModel - POJO) at runtime to the factory and hence will render the necessary SWT code from the factory methods at RUN-TIME.

The concept works 100% and the _userInferfaceRender object can be manipulated at RUN-TIME and hence the UI of the corresponding editor gets updated accordingly when loaded.

My question is, what would be the ideal MODELING TOOL to integrate with this, instead of using POJO's ?
Ex. GMF/EMF ?

My requirement is at RUN-TIME load the designer for a specific editor, and hence that loading instance's corresponding EditorInput will provide the dataset's, data-widgets and their relations that gets exposed to the designer. (ex. What components are visible from the underling table and their relations). I would prefer to use the palette to drag 'n drop objects to the designer. (currently i've implemented a custom palette designer which is part of the designer editor, but not using standard eclipse pallet API, i.e we're using palette like containers with labels and images representing widgets and other controls that can be dragged to the designer editor - tree viewer). I would prefer to standardize this approach using eclipse modeling framework and using pallets.

How should we approach this ?
Thanks in advance.

Regards,
sudesh

[Updated on: Sun, 06 March 2011 11:44]

Report message to a moderator

Re: GMF on RAP [message #658468 is a reply to message #658096] Tue, 08 March 2011 15:13 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Sudesh,

Commet

Sudesh Bulathsinhala wrote:
> Hello,
>
> We're developing RAP product which gives flexibility for the end-users
> to extend / create new forms(editors) at RUN-TIME, using designers.
>
> All the editors are created at DESIGN-TIME using the following code
> snippet.
>
>
> @Override
> public void createPartControl(final Composite parent) {
> parent.setBackgroundMode(SWT.INHERIT_DEFAULT);
> final FormLayout layout = new FormLayout();
> layout.marginWidth = 0;
> layout.marginHeight = 0;
> layout.marginLeft = 5;
> layout.marginRight = 5;
> layout.marginTop = 5;
> layout.marginBottom = 5;
> parent.setLayout(layout);
> CustomDecoratorPropertyProvider.getInstance()
> .setCompositeBackgroundGradient(parent);
> try {
> PlatformUI
> .getWorkbench()
> .getProgressService()
>
> .runInUI(PlatformUI.getWorkbench().getProgressService(),
> new IRunnableWithProgress() {
> @Override
> public void run(final IProgressMonitor
> monitor) {
> monitor.beginTask(
> "Opening Editor in
> progress, please wait..",
> IProgressMonitor.UNKNOWN);
>
> DatasetCompositeFactory
> .getInstance()
> .initComposite(
> parent,
> _userInterfaceRender
>
> .getCompositePanelModel(),
>
> _datasetControllerArray);

>
> monitor.done();
> }
> }, null);
> } catch (final InvocationTargetException e) {
> e.printStackTrace();
> } catch (final InterruptedException e) {
> e.printStackTrace();
> }
> }
>
> As you can see from the above snippet, the createPartControl method
> does not implement the actual SWT logic, but rather a factory method
> called DatasetCompositeFactory.getInstance().initComposite(parent,
> _userInterfaceRender.getCompositePanelModel(),
> _datasetControllerArray). This method indeed delegates it's
> corresponding Java object (_userInterfaceRender.getCompositePanelModel
> - POJO) at runtime which was designed using designer to the method and
> hence the factory will render the necessary SWT code from the factory
> methods at RUN-TIME.
>
> The concept works 100% and hence the _userInferfaceRender object can
> be manipulated at RUN-TIME and hence the UI of the corresponding
> editor gets updated accordingly when loaded.
>
> My question is, what would be the ideal MODELING TOOL to integrate
> with this, instead of using POJO's ? Ex. GMF/EMF ?
EMF provides support for RAP. You can even generate a RAP editor
starting with only a model. GMF depends on GEF and that doesn't yet
support RAP...
>
> My requirement is at RUN-TIME load the designer for a specific editor,
> and hence that loading instance's corresponding EditorInput will
> provide the dataset's, data-widgets and their relations that gets
> exposed to the designer. (ex. What components are visible from the
> underling table and their relations). I would prefer to use the
> palette to drag 'n drop objects to the designer. (currently i've
> implemented a custom palette designer which is part of the designer
> editor, but not using eclipse pallet, ie palette like containers with
> labels with images representing widgets and tables that can be dragged
> to the designer editor's tree viewer). I would prefer to standardize
> this approach using eclipse modeling framework and using pallets.
>
> How should we approach this ?
I think there were previous discussions about porting draw2d to RAP
(something GEF needs), but I'm not sure anyone has done that...
> Thanks in advance.
>
> Regards,
> sudesh
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: GMF on RAP [message #658548 is a reply to message #658468] Tue, 08 March 2011 21:33 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi,

> I think there were previous discussions about porting draw2d to RAP
> (something GEF needs), but I'm not sure anyone has done that...

Austin Riddle created an experimental port in the RAP Incubator, but
that's not yet productive. We have some ideas for improvements, chances
are that this port will evolve over time, but currently there is no
working Draw2D or GEF for RAP - sorry.

Regards, Ralf

--
Ralf Sternberg

Twitter: @ralfstx
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: GMF on RAP [message #658555 is a reply to message #658548] Tue, 08 March 2011 23:27 Go to previous messageGo to next message
Austin Riddle is currently offline Austin RiddleFriend
Messages: 128
Registered: July 2009
Senior Member
Here is the bug if you would like to see the current status:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=285397
Re: GMF on RAP [message #658753 is a reply to message #658555] Wed, 09 March 2011 16:52 Go to previous message
Sudesh Bulathsinhala is currently offline Sudesh BulathsinhalaFriend
Messages: 193
Registered: October 2010
Senior Member
Hello,

Hopefully RAP will support GEF & Draw2D soon.

Thanks,
SUDSH
Previous Topic:Problem when deploying RAP Demo on VIRGO
Next Topic:rap file dialog
Goto Forum:
  


Current Time: Fri Mar 29 10:09:48 GMT 2024

Powered by FUDForum. Page generated in 0.02263 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top