|
Re: How to execute a gmf CopyCommand [message #661462 is a reply to message #661407] |
Thu, 24 March 2011 18:02 |
Christophe Bouhier Messages: 937 Registered: July 2009 |
Senior Member |
|
|
I know of a bug, in ClipboardSupport. There is a workaround, I am not
sure your problem is related but you could have a look:
It broke in 2.2.2
https://bugs.eclipse.org/bugs/show_bug.cgi?id=306500
How to fix: (Let the internal clip-factory have a higher prio, medium).
<extension
point="org.eclipse.gmf.runtime.emf.clipboard.core.clipboardSupport ">
<factory
class=" org.eclipse.gmf.runtime.notation.providers.internal.copypast e.ClipboardSupportFactory "
nsURI="http://www.eclipse.org/gmf/runtime/1.0.2/notation"
priority="medium">
</factory>
On 24-03-11 07:34, Matthias Kloppenborg wrote:
> Hello everybody,
>
> i want to execute a copy command programmatically with the following code.
>
> CopyCommand copy = new CopyCommand(domain, "Copy",
> diagramWorkbenchPart.getDiagram(), views);
>
> CompositeCommand command = new CompositeCommand("",
> Arrays.asList(copy)); IWorkbenchPart wbPart = page.getActivePart();
> ActionManager manager = (ActionManager) wbPart
> .getAdapter(ActionManager.class);
> try {
> manager.getOperationHistory().execute(command,
> new NullProgressMonitor(),
> null);
> } catch (ExecutionException e) {
> e.printStackTrace();
> }
>
> After this i should be able to execute a paste command with the Ctrl + V
> in the Editor, but it seems that the CopyCommand doesn't work.
>
> Can somebody please give me a hint what i am doing wrong?
>
> Greetings
>
> Matthias
>
>
>
>
|
|
|
Re: How to execute a gmf CopyCommand [message #661542 is a reply to message #661462] |
Fri, 25 March 2011 08:14 |
Matthias Kloppenborg Messages: 17 Registered: April 2010 |
Junior Member |
|
|
I changed the priority, but this did not help. Anyway, thanks for your
suggestion.
Am 24.03.2011 19:02, schrieb Christophe Bouhier:
> I know of a bug, in ClipboardSupport. There is a workaround, I am not
> sure your problem is related but you could have a look:
> It broke in 2.2.2
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=306500
>
> How to fix: (Let the internal clip-factory have a higher prio, medium).
>
> <extension
>
> point="org.eclipse.gmf.runtime.emf.clipboard.core.clipboardSupport ">
> <factory
> class=" org.eclipse.gmf.runtime.notation.providers.internal.copypast e.ClipboardSupportFactory "
>
> nsURI="http://www.eclipse.org/gmf/runtime/1.0.2/notation"
> priority="medium">
> </factory>
>
>
> On 24-03-11 07:34, Matthias Kloppenborg wrote:
>> Hello everybody,
>>
>> i want to execute a copy command programmatically with the following
>> code.
>>
>> CopyCommand copy = new CopyCommand(domain, "Copy",
>> diagramWorkbenchPart.getDiagram(), views);
>>
>> CompositeCommand command = new CompositeCommand("",
>> Arrays.asList(copy)); IWorkbenchPart wbPart = page.getActivePart();
>> ActionManager manager = (ActionManager) wbPart
>> .getAdapter(ActionManager.class);
>> try {
>> manager.getOperationHistory().execute(command,
>> new NullProgressMonitor(),
>> null);
>> } catch (ExecutionException e) {
>> e.printStackTrace();
>> }
>>
>> After this i should be able to execute a paste command with the Ctrl + V
>> in the Editor, but it seems that the CopyCommand doesn't work.
>>
>> Can somebody please give me a hint what i am doing wrong?
>>
>> Greetings
>>
>> Matthias
>>
>>
>>
>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03040 seconds