Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to create a figure from clipboard data
How to create a figure from clipboard data [message #147691] Fri, 24 August 2007 00:55 Go to next message
Eclipse UserFriend
Hi,

I am playing around with a templates view for editors.

Have a look at the screenshot from here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=69581#c59

I was able to save the CustomData[] from the Transfer into the template
and able to paste the data back to editor on Ctl-V. Similarly with a Ctl-V
into the templatesview I was able to save the CustomData[] into the
template. I am facing two problems:

1. When the paste happens into the editor, the pasted objects are not
selected. I am constructing a PasteViewRequest and using getCommand() like
follows:

PasteViewRequest pvr = new PasteViewRequest(getData(template));
Command command = fEditor.getDiagramEditPart().getCommand(pvr);
command.execute();

2. I also need to construct a thumbnail to display in the preview from the
custom data. I need to write a function like:

IFigure createFigure(DiagramEditor editor, CustomData[]
data)

then whenever a template is selected in the view, I can just call the
above function. I am not finding it easy to follow the paste logic :(

Can someone please help me?

TIA

-- KD
Re: How to create a figure from clipboard data [message #148045 is a reply to message #147691] Tue, 28 August 2007 05:41 Go to previous message
Eclipse UserFriend
A small clarification. Pasted objects are not selected when doubleclick on
a template is used to insert the template - not when ^V is used to paste.

Can anyone point me in the right direction?

-- KD

Dakshinamurthy Karra wrote:

> Hi,

> I am playing around with a templates view for editors.

> Have a look at the screenshot from here:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=69581#c59

> I was able to save the CustomData[] from the Transfer into the template
> and able to paste the data back to editor on Ctl-V. Similarly with a Ctl-V
> into the templatesview I was able to save the CustomData[] into the
> template. I am facing two problems:

> 1. When the paste happens into the editor, the pasted objects are not
> selected. I am constructing a PasteViewRequest and using getCommand() like
> follows:

> PasteViewRequest pvr = new PasteViewRequest(getData(template));
> Command command = fEditor.getDiagramEditPart().getCommand(pvr);
> command.execute();

> 2. I also need to construct a thumbnail to display in the preview from the
> custom data. I need to write a function like:

> IFigure createFigure(DiagramEditor editor, CustomData[]
> data)

> then whenever a template is selected in the view, I can just call the
> above function. I am not finding it easy to follow the paste logic :(

> Can someone please help me?

> TIA

> -- KD
Previous Topic:give me some suggestions about change the connections
Next Topic:Create child element on parent creation ...
Goto Forum:
  


Current Time: Fri Jul 18 09:28:51 EDT 2025

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

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

Back to the top