Enabling keys in Graph Editor [message #179665] |
Fri, 29 April 2005 09:15 |
Eclipse User |
|
|
|
Originally posted by: ayesha.ltp.soft.net
Hi,
I am building a Graph Editor, to represent network elements.
Accelerator keys dont seem to be working for the edit operations specified
in the Editor's ActionBarContribution class.
I dont know if there is any thing specific that needs to be done to enable
the keys. The copy and paste actions extend WorkbenchPartAction. The
accelerator has been set for the actions.
Thanks in advance
Regards
Ayesha
|
|
|
|
Re: Enabling keys in Graph Editor [message #179970 is a reply to message #179855] |
Mon, 02 May 2005 12:08 |
Eclipse User |
|
|
|
Originally posted by: ayesha.ltp.soft.net
Yes, I have added RetargetActions in buildActions in the
ActionBarContributor.
RetargetAction copy = new
RetargetAction(ActionFactory.COPY.getId(),GEFMessages.CopyAc tion_Label);
copy.setImageDescriptor(WorkbenchImages.getImageDescriptor(I SharedImages.IMG
_TOOL_COPY));
copy.setDisabledImageDescriptor(WorkbenchImages.getImageDesc riptor(ISharedIm
ages.IMG_TOOL_COPY_DISABLED));
copy.setToolTipText(GEFMessages.CopyAction_Tooltip);
In the fillActionBars method in the class extending WorkbenchAdvisor, to the
editMenu I have added the line,
editMenu.add(ActionFactory.COPY.create(window));
In the editor class I have added the following lines :
getActionRegistry().registerAction(copy);
getActionRegistry().registerAction(paste);
The keys are not enabled yet.
Ayesha
"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:d53n7t$1gk$5@news.eclipse.org...
> You need to add RetargetActions in buildActions() in the
> ActionBarContributor. ActionFactory.COPY/PASTE.create(). Your copy and
> paste actions should be in your editor's ActionRegistry.
>
> "Ayesha" <ayesha@ltp.soft.net> wrote in message
> news:d4su4d$md9$1@news.eclipse.org...
> > Hi,
> > I am building a Graph Editor, to represent network elements.
> > Accelerator keys dont seem to be working for the edit operations
specified
> > in the Editor's ActionBarContribution class.
> > I dont know if there is any thing specific that needs to be done to
enable
> > the keys. The copy and paste actions extend WorkbenchPartAction. The
> > accelerator has been set for the actions.
> >
> > Thanks in advance
> >
> > Regards
> > Ayesha
> >
> >
> >
> >
>
>
|
|
|
|
Re: Enabling keys in Graph Editor [message #180071 is a reply to message #180039] |
Tue, 03 May 2005 05:47 |
Eclipse User |
|
|
|
Originally posted by: ayesha.ltp.soft.net
Thanks for your help. I realised that while creating the edit actions, I
have not added the line to
register the action globally. After doing this, the keys are enabled.
IAction undoAction = ActionFactory.UNDO.create(window);
editMenu.add(undoAction);
configurer.registerGlobalAction(undoAction);
Ayesha
"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:d55qlv$g4r$1@news.eclipse.org...
>
> "Ayesha" <ayesha@ltp.soft.net> wrote in message
> news:d555fs$fud$1@news.eclipse.org...
> > Yes, I have added RetargetActions in buildActions in the
> > ActionBarContributor.
> >
> > RetargetAction copy = new
> > RetargetAction(ActionFactory.COPY.getId(),GEFMessages.CopyAc tion_Label);
> >
> >
>
copy.setImageDescriptor(WorkbenchImages.getImageDescriptor(I SharedImages.IMG
> > _TOOL_COPY));
> >
> >
>
copy.setDisabledImageDescriptor(WorkbenchImages.getImageDesc riptor(ISharedIm
> > ages.IMG_TOOL_COPY_DISABLED));
> > copy.setToolTipText(GEFMessages.CopyAction_Tooltip);
>
> Although this seems fine, you should probably use
> ActionFactory.COPY.create().
>
> >
> >
> > In the fillActionBars method in the class extending WorkbenchAdvisor, to
> the
> > editMenu I have added the line,
> >
> > editMenu.add(ActionFactory.COPY.create(window));
>
> You shouldn't be doing this. The copy action's already in the edit menu.
>
> >
> > In the editor class I have added the following lines :
> > getActionRegistry().registerAction(copy);
> > getActionRegistry().registerAction(paste);
> >
>
> I hope these are the actual copy/paste actions and not the retarget
actions.
>
> > The keys are not enabled yet.
> >
> > Ayesha
> >
> >
> > "Pratik Shah" <ppshah@us.ibm.com> wrote in message
> > news:d53n7t$1gk$5@news.eclipse.org...
> > > You need to add RetargetActions in buildActions() in the
> > > ActionBarContributor. ActionFactory.COPY/PASTE.create(). Your copy
and
> > > paste actions should be in your editor's ActionRegistry.
> > >
> > > "Ayesha" <ayesha@ltp.soft.net> wrote in message
> > > news:d4su4d$md9$1@news.eclipse.org...
> > > > Hi,
> > > > I am building a Graph Editor, to represent network elements.
> > > > Accelerator keys dont seem to be working for the edit operations
> > specified
> > > > in the Editor's ActionBarContribution class.
> > > > I dont know if there is any thing specific that needs to be done to
> > enable
> > > > the keys. The copy and paste actions extend WorkbenchPartAction. The
> > > > accelerator has been set for the actions.
> > > >
> > > > Thanks in advance
> > > >
> > > > Regards
> > > > Ayesha
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03063 seconds