Copy and paste in gef [message #228727] |
Mon, 08 January 2007 16:22 |
Eclipse User |
|
|
|
Originally posted by: tom.delorenzi.intervoice.com
Having trouble with copy and paste in gef. I found a thread where somebody
was having the same problem as me, but the resolution he was helped with
doesn't make sense or work for me. Here is what he and I have
In our GraphicalEditor...
public void init(IEditorSite site, IEditorInput input)
throws PartInitException
{
super.init(site, input);
ActionRegistry registry = getActionRegistry();
IActionBars bars = site.getActionBars();
String id = ActionFactory.COPY.getId();
bars.setGlobalActionHandler(id, registry
.getAction("copy"));
}
public void createActions()
{
super.createActions();
SCEGefCopyAction copy=new SCEGefCopyAction(this);
ActionRegistry registry = getActionRegistry();
registry.registerAction(copy);
//getSite().getPage().addPartListener(copy);
getSelectionActions().add(copy.getId());
}
The commented out line is the one they told him to add and it fixed his
problem. I made my action extend IPartListener and just make anything in
there cause it to setEnabled(true) but I cannot get the copy menu to turn
from being greyed out to enabled. Also my calculateEnabled function never
even gets called so I know I am doing something wrong here. Does anyone
know what i am missing?
|
|
|
Re: Copy and paste in gef [message #228734 is a reply to message #228727] |
Mon, 08 January 2007 16:25 |
Eclipse User |
|
|
|
Originally posted by: tom.delorenzi.intervoice.com
Oh I meant to mention, I am using a Multi page editor with a text editor
as another tab which might be related since it also has a copy action.
|
|
|
Powered by
FUDForum. Page generated in 0.03082 seconds