Skip to main content



      Home
Home » Eclipse Projects » GEF » Enabling keys in Graph Editor
Enabling keys in Graph Editor [message #179665] Fri, 29 April 2005 05:15 Go to next message
Eclipse UserFriend
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 #179855 is a reply to message #179665] Sun, 01 May 2005 18:27 Go to previous messageGo to next message
Eclipse UserFriend
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 #179970 is a reply to message #179855] Mon, 02 May 2005 08:08 Go to previous messageGo to next message
Eclipse UserFriend
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 #180039 is a reply to message #179970] Mon, 02 May 2005 14:09 Go to previous messageGo to next message
Eclipse UserFriend
"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
> > >
> > >
> > >
> > >
> >
> >
>
>
Re: Enabling keys in Graph Editor [message #180071 is a reply to message #180039] Tue, 03 May 2005 01:47 Go to previous message
Eclipse UserFriend
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
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Previous Topic:How the save the swt picture
Next Topic:Connections and Anchors
Goto Forum:
  


Current Time: Wed Jul 23 15:55:24 EDT 2025

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

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

Back to the top