How to create a figure from clipboard data [message #147691] |
Fri, 24 August 2007 00:55  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.12263 seconds