About Action [message #143729] |
Wed, 21 July 2004 04:29  |
Eclipse User |
|
|
|
Hello everyone:
We build a project based on the GEF(Graphical Editing Framework), and
now we met a problem during the development.
By the requirement, we need a popup menu in our graphical editor. We
make the popup menu through using org.eclipse.gef.ContextMenuProvider.
And then, we need some actions(extends
org.eclipse.gef.ui.actions.SelectionAction) in this popup menu, and we
also need these actions to appear at the Eclipses tool bar & menu, but we
do not want to rewrite the same code for almost same action, and we
strongly need these actions which appears at tool bar, menu and popup menu
own same status at the same time, so we are going to reuse these actions,
but there is a question?
We use a class(extends org.eclipse.gef.ui.actions.ActionBarContributor)
for tool bar and menu associated with a specified editor, but how can we
get the object of these actions in method contributeToToolBar and
contributeToMenu, because they need the instance of
org.eclipse.ui.part.IWorkbenchPart for their creation.
Many thanks!
|
|
|
|
Re: About Action [message #143868 is a reply to message #143845] |
Thu, 22 July 2004 01:15  |
Eclipse User |
|
|
|
Pratik Shah wrote:
> How about using RetargetActions? The logic example does the same with
> incrementing and decrementing the value of an LED.
> "Wei Zhang" <zhang-wei@sinocom.cn> wrote in message
> news:cdl9gt$f2f$1@eclipse.org...
> > Hello everyone:
> >
> > We build a project based on the GEF(Graphical Editing Framework), and
> > now we met a problem during the development.
> >
> > By the requirement, we need a popup menu in our graphical editor. We
> > make the popup menu through using org.eclipse.gef.ContextMenuProvider.
> >
> > And then, we need some actions(extends
> > org.eclipse.gef.ui.actions.SelectionAction) in this popup menu, and we
> > also need these actions to appear at the Eclipses tool bar & menu, but we
> > do not want to rewrite the same code for almost same action, and we
> > strongly need these actions which appears at tool bar, menu and popup menu
> > own same status at the same time, so we are going to reuse these actions,
> > but there is a question?
> >
> > We use a class(extends org.eclipse.gef.ui.actions.ActionBarContributor)
> > for tool bar and menu associated with a specified editor, but how can we
> > get the object of these actions in method contributeToToolBar and
> > contributeToMenu, because they need the instance of
> > org.eclipse.ui.part.IWorkbenchPart for their creation.
> >
> > Many thanks!
> >
thanks
|
|
|
Powered by
FUDForum. Page generated in 0.04315 seconds