Home » Eclipse Projects » Eclipse Platform » Clarification needed - Copy menu item and tool bar button - Global Actions
Clarification needed - Copy menu item and tool bar button - Global Actions [message #116542] |
Tue, 26 August 2003 06:37  |
Eclipse User |
|
|
|
All,
I have a "Copy" menu item and i used setGlobalActionHandler api to register
my action for the
same. This works fine for the menu items. I need the same to work for tool
bar icons.
I assumed that, copy/paste/cut tool bar icons will be provided by default
and the
programmers needs to register their actions, so that based on the editor,
relevant actions will be fired.
I searched the eclipse documentations, and concluded that
setGlobalActionHandler api is with respect
to MENU ITEMS, what should we do for tool bar buttons.??
Does eclipse provides api's similar to setGlobalActionHandler api for
registering the actions related
to tool bar buttons.
Could anyone help me in this regard?
Also you can mail the replies to vamirthalingam@selectica.com
Regards,
venkat
|
|
|
Re: Clarification needed - Copy menu item and tool bar button - Global Actions [message #116683 is a reply to message #116542] |
Tue, 26 August 2003 14:05   |
Eclipse User |
|
|
|
What documentation did you consult?
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
sv/doc/reference/api/org/eclipse/ui/IActionBars.html
states this:
Used by a part to access its menu, toolbar, and status line managers.
Within the workbench each part, editor or view, has a private set of action
bars. This set, which contains a menu, toolbar, and status line, appears in
the local toolbar for a view and in the window for an editor. The view may
provide an implementation for pre-existing actions or add new actions to the
action bars.
In a workbench window there a number of actions which are applicable to all
parts. Some common examples are CUT, COPY and PASTE. These actions, known as
"global actions", are contributed to the workbench window by the window
itself and shared by all parts. The presentation is owned by the window. The
implementation is delegated to the active part.
To participate in the global action design an IWorkbenchPart should register
a handler for each global action which is implemented by the part. This can
be done by calling setGlobalActionHandler. For convenience, the standard
global actions are defined in org.eclipse.ui.IWorkbenchActionConstants.
"venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
news:bifd3f$p46$1@eclipse.org...
> All,
>
> I have a "Copy" menu item and i used setGlobalActionHandler api to
register
> my action for the
> same. This works fine for the menu items. I need the same to work for tool
> bar icons.
>
> I assumed that, copy/paste/cut tool bar icons will be provided by default
> and the
> programmers needs to register their actions, so that based on the editor,
> relevant actions will be fired.
> I searched the eclipse documentations, and concluded that
> setGlobalActionHandler api is with respect
> to MENU ITEMS, what should we do for tool bar buttons.??
>
> Does eclipse provides api's similar to setGlobalActionHandler api for
> registering the actions related
> to tool bar buttons.
>
> Could anyone help me in this regard?
>
> Also you can mail the replies to vamirthalingam@selectica.com
>
> Regards,
> venkat
>
>
>
|
|
|
Re: Clarification needed - Copy menu item and tool bar button - Global Actions [message #117096 is a reply to message #116683] |
Wed, 27 August 2003 02:34   |
Eclipse User |
|
|
|
Already , i read this documentation and my question is simple,
setGlobalActionHandler api
is with respect to menu items only, what should we do for tool bar buttons?
Hope you got my question.
When is used JDT, i couldn't see copy,cut,paste icons in the tool bar. Why
is it so? Does eclipse provide
global tool bar buttons for copy,paste,cut, etc...?
-venkat
"Chris Laffra" <Chris_Laffra@oti.com> wrote in message
news:big7gd$l7v$1@eclipse.org...
> What documentation did you consult?
>
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> sv/doc/reference/api/org/eclipse/ui/IActionBars.html
> states this:
>
>
> Used by a part to access its menu, toolbar, and status line managers.
>
> Within the workbench each part, editor or view, has a private set of
action
> bars. This set, which contains a menu, toolbar, and status line, appears
in
> the local toolbar for a view and in the window for an editor. The view may
> provide an implementation for pre-existing actions or add new actions to
the
> action bars.
>
> In a workbench window there a number of actions which are applicable to
all
> parts. Some common examples are CUT, COPY and PASTE. These actions, known
as
> "global actions", are contributed to the workbench window by the window
> itself and shared by all parts. The presentation is owned by the window.
The
> implementation is delegated to the active part.
>
> To participate in the global action design an IWorkbenchPart should
register
> a handler for each global action which is implemented by the part. This
can
> be done by calling setGlobalActionHandler. For convenience, the standard
> global actions are defined in org.eclipse.ui.IWorkbenchActionConstants.
>
>
>
>
>
> "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> news:bifd3f$p46$1@eclipse.org...
> > All,
> >
> > I have a "Copy" menu item and i used setGlobalActionHandler api to
> register
> > my action for the
> > same. This works fine for the menu items. I need the same to work for
tool
> > bar icons.
> >
> > I assumed that, copy/paste/cut tool bar icons will be provided by
default
> > and the
> > programmers needs to register their actions, so that based on the
editor,
> > relevant actions will be fired.
> > I searched the eclipse documentations, and concluded that
> > setGlobalActionHandler api is with respect
> > to MENU ITEMS, what should we do for tool bar buttons.??
> >
> > Does eclipse provides api's similar to setGlobalActionHandler api for
> > registering the actions related
> > to tool bar buttons.
> >
> > Could anyone help me in this regard?
> >
> > Also you can mail the replies to vamirthalingam@selectica.com
> >
> > Regards,
> > venkat
> >
> >
> >
>
>
|
|
|
Re: Clarification needed - Copy menu item and tool bar button - Global Actions [message #117390 is a reply to message #117096] |
Wed, 27 August 2003 11:55   |
Eclipse User |
|
|
|
Originally posted by: simon.ibm.oti.lab
The eclipse IDE does not place the cut/copy/paste actions on the toolbar
Simon :-)
"venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
news:bihj7l$oj4$1@eclipse.org...
> Already , i read this documentation and my question is simple,
> setGlobalActionHandler api
> is with respect to menu items only, what should we do for tool bar
buttons?
> Hope you got my question.
>
> When is used JDT, i couldn't see copy,cut,paste icons in the tool bar. Why
> is it so? Does eclipse provide
> global tool bar buttons for copy,paste,cut, etc...?
>
> -venkat
>
>
>
> "Chris Laffra" <Chris_Laffra@oti.com> wrote in message
> news:big7gd$l7v$1@eclipse.org...
> > What documentation did you consult?
> >
>
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> > sv/doc/reference/api/org/eclipse/ui/IActionBars.html
> > states this:
> >
> >
> > Used by a part to access its menu, toolbar, and status line managers.
> >
> > Within the workbench each part, editor or view, has a private set of
> action
> > bars. This set, which contains a menu, toolbar, and status line, appears
> in
> > the local toolbar for a view and in the window for an editor. The view
may
> > provide an implementation for pre-existing actions or add new actions to
> the
> > action bars.
> >
> > In a workbench window there a number of actions which are applicable to
> all
> > parts. Some common examples are CUT, COPY and PASTE. These actions,
known
> as
> > "global actions", are contributed to the workbench window by the window
> > itself and shared by all parts. The presentation is owned by the window.
> The
> > implementation is delegated to the active part.
> >
> > To participate in the global action design an IWorkbenchPart should
> register
> > a handler for each global action which is implemented by the part. This
> can
> > be done by calling setGlobalActionHandler. For convenience, the standard
> > global actions are defined in org.eclipse.ui.IWorkbenchActionConstants.
> >
> >
> >
> >
> >
> > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> > news:bifd3f$p46$1@eclipse.org...
> > > All,
> > >
> > > I have a "Copy" menu item and i used setGlobalActionHandler api to
> > register
> > > my action for the
> > > same. This works fine for the menu items. I need the same to work for
> tool
> > > bar icons.
> > >
> > > I assumed that, copy/paste/cut tool bar icons will be provided by
> default
> > > and the
> > > programmers needs to register their actions, so that based on the
> editor,
> > > relevant actions will be fired.
> > > I searched the eclipse documentations, and concluded that
> > > setGlobalActionHandler api is with respect
> > > to MENU ITEMS, what should we do for tool bar buttons.??
> > >
> > > Does eclipse provides api's similar to setGlobalActionHandler api for
> > > registering the actions related
> > > to tool bar buttons.
> > >
> > > Could anyone help me in this regard?
> > >
> > > Also you can mail the replies to vamirthalingam@selectica.com
> > >
> > > Regards,
> > > venkat
> > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Clarification needed - Copy menu item and tool bar button - Global Actions [message #117733 is a reply to message #117390] |
Wed, 27 August 2003 23:08   |
Eclipse User |
|
|
|
So, what should we do, if we need the same action to be registered for tool
bar buttons?
Another Question: As per your answer, if there are different editors, having
their own actions
for copy/cut/paste, the menu item will be common, but tool bar buttons can
differ. Is this the
understanding?
-venkat
"Simon Arsenault" <simon@ibm.oti.lab> wrote in message
news:biik91$r67$1@eclipse.org...
> The eclipse IDE does not place the cut/copy/paste actions on the toolbar
>
> Simon :-)
>
> "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> news:bihj7l$oj4$1@eclipse.org...
> > Already , i read this documentation and my question is simple,
> > setGlobalActionHandler api
> > is with respect to menu items only, what should we do for tool bar
> buttons?
> > Hope you got my question.
> >
> > When is used JDT, i couldn't see copy,cut,paste icons in the tool bar.
Why
> > is it so? Does eclipse provide
> > global tool bar buttons for copy,paste,cut, etc...?
> >
> > -venkat
> >
> >
> >
> > "Chris Laffra" <Chris_Laffra@oti.com> wrote in message
> > news:big7gd$l7v$1@eclipse.org...
> > > What documentation did you consult?
> > >
> >
>
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> > > sv/doc/reference/api/org/eclipse/ui/IActionBars.html
> > > states this:
> > >
> > >
> > > Used by a part to access its menu, toolbar, and status line managers.
> > >
> > > Within the workbench each part, editor or view, has a private set of
> > action
> > > bars. This set, which contains a menu, toolbar, and status line,
appears
> > in
> > > the local toolbar for a view and in the window for an editor. The view
> may
> > > provide an implementation for pre-existing actions or add new actions
to
> > the
> > > action bars.
> > >
> > > In a workbench window there a number of actions which are applicable
to
> > all
> > > parts. Some common examples are CUT, COPY and PASTE. These actions,
> known
> > as
> > > "global actions", are contributed to the workbench window by the
window
> > > itself and shared by all parts. The presentation is owned by the
window.
> > The
> > > implementation is delegated to the active part.
> > >
> > > To participate in the global action design an IWorkbenchPart should
> > register
> > > a handler for each global action which is implemented by the part.
This
> > can
> > > be done by calling setGlobalActionHandler. For convenience, the
standard
> > > global actions are defined in
org.eclipse.ui.IWorkbenchActionConstants.
> > >
> > >
> > >
> > >
> > >
> > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> > > news:bifd3f$p46$1@eclipse.org...
> > > > All,
> > > >
> > > > I have a "Copy" menu item and i used setGlobalActionHandler api to
> > > register
> > > > my action for the
> > > > same. This works fine for the menu items. I need the same to work
for
> > tool
> > > > bar icons.
> > > >
> > > > I assumed that, copy/paste/cut tool bar icons will be provided by
> > default
> > > > and the
> > > > programmers needs to register their actions, so that based on the
> > editor,
> > > > relevant actions will be fired.
> > > > I searched the eclipse documentations, and concluded that
> > > > setGlobalActionHandler api is with respect
> > > > to MENU ITEMS, what should we do for tool bar buttons.??
> > > >
> > > > Does eclipse provides api's similar to setGlobalActionHandler api
for
> > > > registering the actions related
> > > > to tool bar buttons.
> > > >
> > > > Could anyone help me in this regard?
> > > >
> > > > Also you can mail the replies to vamirthalingam@selectica.com
> > > >
> > > > Regards,
> > > > venkat
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Clarification needed - Copy menu item and tool bar button - Global Actions [message #118920 is a reply to message #117733] |
Thu, 28 August 2003 14:06   |
Eclipse User |
|
|
|
Originally posted by: simon.ibm.oti.lab
The code for setGlobalActionHandler is not menu specific, it works for tool
bar also. The eclipse ide just does not add the cut/copy/paste retarget
actions to the tool bar. You could provide an action set that added these
retarget actions. Just need to make sure the "actionDefinitionId" matches
the one used for the menu items (i.e. org.eclipse.ui.edit.copy for the copy
retarget action, etc)
This whole story will become much easier to understand and use with the new
"command" work that is going on.
Simon :-)
"venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
news:bijrgs$1oa$1@eclipse.org...
> So, what should we do, if we need the same action to be registered for
tool
> bar buttons?
>
> Another Question: As per your answer, if there are different editors,
having
> their own actions
> for copy/cut/paste, the menu item will be common, but tool bar buttons can
> differ. Is this the
> understanding?
>
> -venkat
>
> "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> news:biik91$r67$1@eclipse.org...
> > The eclipse IDE does not place the cut/copy/paste actions on the toolbar
> >
> > Simon :-)
> >
> > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> > news:bihj7l$oj4$1@eclipse.org...
> > > Already , i read this documentation and my question is simple,
> > > setGlobalActionHandler api
> > > is with respect to menu items only, what should we do for tool bar
> > buttons?
> > > Hope you got my question.
> > >
> > > When is used JDT, i couldn't see copy,cut,paste icons in the tool bar.
> Why
> > > is it so? Does eclipse provide
> > > global tool bar buttons for copy,paste,cut, etc...?
> > >
> > > -venkat
> > >
> > >
> > >
> > > "Chris Laffra" <Chris_Laffra@oti.com> wrote in message
> > > news:big7gd$l7v$1@eclipse.org...
> > > > What documentation did you consult?
> > > >
> > >
> >
>
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> > > > sv/doc/reference/api/org/eclipse/ui/IActionBars.html
> > > > states this:
> > > >
> > > >
> > > > Used by a part to access its menu, toolbar, and status line
managers.
> > > >
> > > > Within the workbench each part, editor or view, has a private set of
> > > action
> > > > bars. This set, which contains a menu, toolbar, and status line,
> appears
> > > in
> > > > the local toolbar for a view and in the window for an editor. The
view
> > may
> > > > provide an implementation for pre-existing actions or add new
actions
> to
> > > the
> > > > action bars.
> > > >
> > > > In a workbench window there a number of actions which are applicable
> to
> > > all
> > > > parts. Some common examples are CUT, COPY and PASTE. These actions,
> > known
> > > as
> > > > "global actions", are contributed to the workbench window by the
> window
> > > > itself and shared by all parts. The presentation is owned by the
> window.
> > > The
> > > > implementation is delegated to the active part.
> > > >
> > > > To participate in the global action design an IWorkbenchPart should
> > > register
> > > > a handler for each global action which is implemented by the part.
> This
> > > can
> > > > be done by calling setGlobalActionHandler. For convenience, the
> standard
> > > > global actions are defined in
> org.eclipse.ui.IWorkbenchActionConstants.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
message
> > > > news:bifd3f$p46$1@eclipse.org...
> > > > > All,
> > > > >
> > > > > I have a "Copy" menu item and i used setGlobalActionHandler api to
> > > > register
> > > > > my action for the
> > > > > same. This works fine for the menu items. I need the same to work
> for
> > > tool
> > > > > bar icons.
> > > > >
> > > > > I assumed that, copy/paste/cut tool bar icons will be provided by
> > > default
> > > > > and the
> > > > > programmers needs to register their actions, so that based on the
> > > editor,
> > > > > relevant actions will be fired.
> > > > > I searched the eclipse documentations, and concluded that
> > > > > setGlobalActionHandler api is with respect
> > > > > to MENU ITEMS, what should we do for tool bar buttons.??
> > > > >
> > > > > Does eclipse provides api's similar to setGlobalActionHandler api
> for
> > > > > registering the actions related
> > > > > to tool bar buttons.
> > > > >
> > > > > Could anyone help me in this regard?
> > > > >
> > > > > Also you can mail the replies to vamirthalingam@selectica.com
> > > > >
> > > > > Regards,
> > > > > venkat
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Clarification needed - Copy menu item and tool bar button - Global Actions [message #120201 is a reply to message #118920] |
Mon, 01 September 2003 22:56   |
Eclipse User |
|
|
|
Simon,
Instead, can i override getImageDescriptor method in Action class? This way,
i need not create
a retarget actions, and still i can get the tool bar button placed in the
tool bar.
Please clarify this.
-venkat
"Simon Arsenault" <simon@ibm.oti.lab> wrote in message
news:bilga3$q1v$1@eclipse.org...
> The code for setGlobalActionHandler is not menu specific, it works for
tool
> bar also. The eclipse ide just does not add the cut/copy/paste retarget
> actions to the tool bar. You could provide an action set that added these
> retarget actions. Just need to make sure the "actionDefinitionId" matches
> the one used for the menu items (i.e. org.eclipse.ui.edit.copy for the
copy
> retarget action, etc)
>
> This whole story will become much easier to understand and use with the
new
> "command" work that is going on.
>
> Simon :-)
>
> "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> news:bijrgs$1oa$1@eclipse.org...
> > So, what should we do, if we need the same action to be registered for
> tool
> > bar buttons?
> >
> > Another Question: As per your answer, if there are different editors,
> having
> > their own actions
> > for copy/cut/paste, the menu item will be common, but tool bar buttons
can
> > differ. Is this the
> > understanding?
> >
> > -venkat
> >
> > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > news:biik91$r67$1@eclipse.org...
> > > The eclipse IDE does not place the cut/copy/paste actions on the
toolbar
> > >
> > > Simon :-)
> > >
> > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> > > news:bihj7l$oj4$1@eclipse.org...
> > > > Already , i read this documentation and my question is simple,
> > > > setGlobalActionHandler api
> > > > is with respect to menu items only, what should we do for tool bar
> > > buttons?
> > > > Hope you got my question.
> > > >
> > > > When is used JDT, i couldn't see copy,cut,paste icons in the tool
bar.
> > Why
> > > > is it so? Does eclipse provide
> > > > global tool bar buttons for copy,paste,cut, etc...?
> > > >
> > > > -venkat
> > > >
> > > >
> > > >
> > > > "Chris Laffra" <Chris_Laffra@oti.com> wrote in message
> > > > news:big7gd$l7v$1@eclipse.org...
> > > > > What documentation did you consult?
> > > > >
> > > >
> > >
> >
>
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> > > > > sv/doc/reference/api/org/eclipse/ui/IActionBars.html
> > > > > states this:
> > > > >
> > > > >
> > > > > Used by a part to access its menu, toolbar, and status line
> managers.
> > > > >
> > > > > Within the workbench each part, editor or view, has a private set
of
> > > > action
> > > > > bars. This set, which contains a menu, toolbar, and status line,
> > appears
> > > > in
> > > > > the local toolbar for a view and in the window for an editor. The
> view
> > > may
> > > > > provide an implementation for pre-existing actions or add new
> actions
> > to
> > > > the
> > > > > action bars.
> > > > >
> > > > > In a workbench window there a number of actions which are
applicable
> > to
> > > > all
> > > > > parts. Some common examples are CUT, COPY and PASTE. These
actions,
> > > known
> > > > as
> > > > > "global actions", are contributed to the workbench window by the
> > window
> > > > > itself and shared by all parts. The presentation is owned by the
> > window.
> > > > The
> > > > > implementation is delegated to the active part.
> > > > >
> > > > > To participate in the global action design an IWorkbenchPart
should
> > > > register
> > > > > a handler for each global action which is implemented by the part.
> > This
> > > > can
> > > > > be done by calling setGlobalActionHandler. For convenience, the
> > standard
> > > > > global actions are defined in
> > org.eclipse.ui.IWorkbenchActionConstants.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
> message
> > > > > news:bifd3f$p46$1@eclipse.org...
> > > > > > All,
> > > > > >
> > > > > > I have a "Copy" menu item and i used setGlobalActionHandler api
to
> > > > > register
> > > > > > my action for the
> > > > > > same. This works fine for the menu items. I need the same to
work
> > for
> > > > tool
> > > > > > bar icons.
> > > > > >
> > > > > > I assumed that, copy/paste/cut tool bar icons will be provided
by
> > > > default
> > > > > > and the
> > > > > > programmers needs to register their actions, so that based on
the
> > > > editor,
> > > > > > relevant actions will be fired.
> > > > > > I searched the eclipse documentations, and concluded that
> > > > > > setGlobalActionHandler api is with respect
> > > > > > to MENU ITEMS, what should we do for tool bar buttons.??
> > > > > >
> > > > > > Does eclipse provides api's similar to setGlobalActionHandler
api
> > for
> > > > > > registering the actions related
> > > > > > to tool bar buttons.
> > > > > >
> > > > > > Could anyone help me in this regard?
> > > > > >
> > > > > > Also you can mail the replies to vamirthalingam@selectica.com
> > > > > >
> > > > > > Regards,
> > > > > > venkat
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Clarification needed - Copy menu item and tool bar button - Global Actions [message #120532 is a reply to message #120201] |
Tue, 02 September 2003 13:06   |
Eclipse User |
|
|
|
Originally posted by: simon.ibm.oti.lab
Sorry, I do not understand what you mean. How can overriding
getImageDescriptor() solve your problem of having the cut/copy/paste actions
on the toolbar?
Simon :-)
"venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
news:bj10m2$lcn$1@eclipse.org...
> Simon,
>
> Instead, can i override getImageDescriptor method in Action class? This
way,
> i need not create
> a retarget actions, and still i can get the tool bar button placed in the
> tool bar.
>
> Please clarify this.
>
> -venkat
>
> "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> news:bilga3$q1v$1@eclipse.org...
> > The code for setGlobalActionHandler is not menu specific, it works for
> tool
> > bar also. The eclipse ide just does not add the cut/copy/paste retarget
> > actions to the tool bar. You could provide an action set that added
these
> > retarget actions. Just need to make sure the "actionDefinitionId"
matches
> > the one used for the menu items (i.e. org.eclipse.ui.edit.copy for the
> copy
> > retarget action, etc)
> >
> > This whole story will become much easier to understand and use with the
> new
> > "command" work that is going on.
> >
> > Simon :-)
> >
> > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> > news:bijrgs$1oa$1@eclipse.org...
> > > So, what should we do, if we need the same action to be registered for
> > tool
> > > bar buttons?
> > >
> > > Another Question: As per your answer, if there are different editors,
> > having
> > > their own actions
> > > for copy/cut/paste, the menu item will be common, but tool bar buttons
> can
> > > differ. Is this the
> > > understanding?
> > >
> > > -venkat
> > >
> > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > news:biik91$r67$1@eclipse.org...
> > > > The eclipse IDE does not place the cut/copy/paste actions on the
> toolbar
> > > >
> > > > Simon :-)
> > > >
> > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
message
> > > > news:bihj7l$oj4$1@eclipse.org...
> > > > > Already , i read this documentation and my question is simple,
> > > > > setGlobalActionHandler api
> > > > > is with respect to menu items only, what should we do for tool bar
> > > > buttons?
> > > > > Hope you got my question.
> > > > >
> > > > > When is used JDT, i couldn't see copy,cut,paste icons in the tool
> bar.
> > > Why
> > > > > is it so? Does eclipse provide
> > > > > global tool bar buttons for copy,paste,cut, etc...?
> > > > >
> > > > > -venkat
> > > > >
> > > > >
> > > > >
> > > > > "Chris Laffra" <Chris_Laffra@oti.com> wrote in message
> > > > > news:big7gd$l7v$1@eclipse.org...
> > > > > > What documentation did you consult?
> > > > > >
> > > > >
> > > >
> > >
> >
>
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> > > > > > sv/doc/reference/api/org/eclipse/ui/IActionBars.html
> > > > > > states this:
> > > > > >
> > > > > >
> > > > > > Used by a part to access its menu, toolbar, and status line
> > managers.
> > > > > >
> > > > > > Within the workbench each part, editor or view, has a private
set
> of
> > > > > action
> > > > > > bars. This set, which contains a menu, toolbar, and status line,
> > > appears
> > > > > in
> > > > > > the local toolbar for a view and in the window for an editor.
The
> > view
> > > > may
> > > > > > provide an implementation for pre-existing actions or add new
> > actions
> > > to
> > > > > the
> > > > > > action bars.
> > > > > >
> > > > > > In a workbench window there a number of actions which are
> applicable
> > > to
> > > > > all
> > > > > > parts. Some common examples are CUT, COPY and PASTE. These
> actions,
> > > > known
> > > > > as
> > > > > > "global actions", are contributed to the workbench window by the
> > > window
> > > > > > itself and shared by all parts. The presentation is owned by the
> > > window.
> > > > > The
> > > > > > implementation is delegated to the active part.
> > > > > >
> > > > > > To participate in the global action design an IWorkbenchPart
> should
> > > > > register
> > > > > > a handler for each global action which is implemented by the
part.
> > > This
> > > > > can
> > > > > > be done by calling setGlobalActionHandler. For convenience, the
> > > standard
> > > > > > global actions are defined in
> > > org.eclipse.ui.IWorkbenchActionConstants.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
> > message
> > > > > > news:bifd3f$p46$1@eclipse.org...
> > > > > > > All,
> > > > > > >
> > > > > > > I have a "Copy" menu item and i used setGlobalActionHandler
api
> to
> > > > > > register
> > > > > > > my action for the
> > > > > > > same. This works fine for the menu items. I need the same to
> work
> > > for
> > > > > tool
> > > > > > > bar icons.
> > > > > > >
> > > > > > > I assumed that, copy/paste/cut tool bar icons will be provided
> by
> > > > > default
> > > > > > > and the
> > > > > > > programmers needs to register their actions, so that based on
> the
> > > > > editor,
> > > > > > > relevant actions will be fired.
> > > > > > > I searched the eclipse documentations, and concluded that
> > > > > > > setGlobalActionHandler api is with respect
> > > > > > > to MENU ITEMS, what should we do for tool bar buttons.??
> > > > > > >
> > > > > > > Does eclipse provides api's similar to setGlobalActionHandler
> api
> > > for
> > > > > > > registering the actions related
> > > > > > > to tool bar buttons.
> > > > > > >
> > > > > > > Could anyone help me in this regard?
> > > > > > >
> > > > > > > Also you can mail the replies to vamirthalingam@selectica.com
> > > > > > >
> > > > > > > Regards,
> > > > > > > venkat
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Clarification needed - Copy menu item and tool bar button - Global Actions [message #121643 is a reply to message #120532] |
Tue, 02 September 2003 23:16   |
Eclipse User |
|
|
|
Simon,
I have a class
MyCopyAction extends Action
{
public void run()
{
//Implement the necessary logic
}
public ImageDescriptor getImageDescriptor()
{
//Return the tool bar icon for copy
}
}
And in setGlobalActionHandler(), i register the above action class, so that
the above run() method is
invoked, if our editor is active. Since i had overriden the
getImageDescriptor(), i get the icon for copy in
the tool bar (if our editor is active), and the same run() method gets
invoked, if i click on the copy icon.
Am i clear now?
Could you please clarify my earlier question?
-venkat
"Simon Arsenault" <simon@ibm.oti.lab> wrote in message
news:bj2im5$a8v$1@eclipse.org...
> Sorry, I do not understand what you mean. How can overriding
> getImageDescriptor() solve your problem of having the cut/copy/paste
actions
> on the toolbar?
>
> Simon :-)
>
> "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> news:bj10m2$lcn$1@eclipse.org...
> > Simon,
> >
> > Instead, can i override getImageDescriptor method in Action class? This
> way,
> > i need not create
> > a retarget actions, and still i can get the tool bar button placed in
the
> > tool bar.
> >
> > Please clarify this.
> >
> > -venkat
> >
> > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > news:bilga3$q1v$1@eclipse.org...
> > > The code for setGlobalActionHandler is not menu specific, it works for
> > tool
> > > bar also. The eclipse ide just does not add the cut/copy/paste
retarget
> > > actions to the tool bar. You could provide an action set that added
> these
> > > retarget actions. Just need to make sure the "actionDefinitionId"
> matches
> > > the one used for the menu items (i.e. org.eclipse.ui.edit.copy for the
> > copy
> > > retarget action, etc)
> > >
> > > This whole story will become much easier to understand and use with
the
> > new
> > > "command" work that is going on.
> > >
> > > Simon :-)
> > >
> > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> > > news:bijrgs$1oa$1@eclipse.org...
> > > > So, what should we do, if we need the same action to be registered
for
> > > tool
> > > > bar buttons?
> > > >
> > > > Another Question: As per your answer, if there are different
editors,
> > > having
> > > > their own actions
> > > > for copy/cut/paste, the menu item will be common, but tool bar
buttons
> > can
> > > > differ. Is this the
> > > > understanding?
> > > >
> > > > -venkat
> > > >
> > > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > > news:biik91$r67$1@eclipse.org...
> > > > > The eclipse IDE does not place the cut/copy/paste actions on the
> > toolbar
> > > > >
> > > > > Simon :-)
> > > > >
> > > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
> message
> > > > > news:bihj7l$oj4$1@eclipse.org...
> > > > > > Already , i read this documentation and my question is simple,
> > > > > > setGlobalActionHandler api
> > > > > > is with respect to menu items only, what should we do for tool
bar
> > > > > buttons?
> > > > > > Hope you got my question.
> > > > > >
> > > > > > When is used JDT, i couldn't see copy,cut,paste icons in the
tool
> > bar.
> > > > Why
> > > > > > is it so? Does eclipse provide
> > > > > > global tool bar buttons for copy,paste,cut, etc...?
> > > > > >
> > > > > > -venkat
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Chris Laffra" <Chris_Laffra@oti.com> wrote in message
> > > > > > news:big7gd$l7v$1@eclipse.org...
> > > > > > > What documentation did you consult?
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> > > > > > > sv/doc/reference/api/org/eclipse/ui/IActionBars.html
> > > > > > > states this:
> > > > > > >
> > > > > > >
> > > > > > > Used by a part to access its menu, toolbar, and status line
> > > managers.
> > > > > > >
> > > > > > > Within the workbench each part, editor or view, has a private
> set
> > of
> > > > > > action
> > > > > > > bars. This set, which contains a menu, toolbar, and status
line,
> > > > appears
> > > > > > in
> > > > > > > the local toolbar for a view and in the window for an editor.
> The
> > > view
> > > > > may
> > > > > > > provide an implementation for pre-existing actions or add new
> > > actions
> > > > to
> > > > > > the
> > > > > > > action bars.
> > > > > > >
> > > > > > > In a workbench window there a number of actions which are
> > applicable
> > > > to
> > > > > > all
> > > > > > > parts. Some common examples are CUT, COPY and PASTE. These
> > actions,
> > > > > known
> > > > > > as
> > > > > > > "global actions", are contributed to the workbench window by
the
> > > > window
> > > > > > > itself and shared by all parts. The presentation is owned by
the
> > > > window.
> > > > > > The
> > > > > > > implementation is delegated to the active part.
> > > > > > >
> > > > > > > To participate in the global action design an IWorkbenchPart
> > should
> > > > > > register
> > > > > > > a handler for each global action which is implemented by the
> part.
> > > > This
> > > > > > can
> > > > > > > be done by calling setGlobalActionHandler. For convenience,
the
> > > > standard
> > > > > > > global actions are defined in
> > > > org.eclipse.ui.IWorkbenchActionConstants.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
> > > message
> > > > > > > news:bifd3f$p46$1@eclipse.org...
> > > > > > > > All,
> > > > > > > >
> > > > > > > > I have a "Copy" menu item and i used setGlobalActionHandler
> api
> > to
> > > > > > > register
> > > > > > > > my action for the
> > > > > > > > same. This works fine for the menu items. I need the same to
> > work
> > > > for
> > > > > > tool
> > > > > > > > bar icons.
> > > > > > > >
> > > > > > > > I assumed that, copy/paste/cut tool bar icons will be
provided
> > by
> > > > > > default
> > > > > > > > and the
> > > > > > > > programmers needs to register their actions, so that based
on
> > the
> > > > > > editor,
> > > > > > > > relevant actions will be fired.
> > > > > > > > I searched the eclipse documentations, and concluded that
> > > > > > > > setGlobalActionHandler api is with respect
> > > > > > > > to MENU ITEMS, what should we do for tool bar buttons.??
> > > > > > > >
> > > > > > > > Does eclipse provides api's similar to
setGlobalActionHandler
> > api
> > > > for
> > > > > > > > registering the actions related
> > > > > > > > to tool bar buttons.
> > > > > > > >
> > > > > > > > Could anyone help me in this regard?
> > > > > > > >
> > > > > > > > Also you can mail the replies to
vamirthalingam@selectica.com
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > > venkat
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Clarification needed - Copy menu item and tool bar button - Global Actions [message #122192 is a reply to message #121643] |
Wed, 03 September 2003 11:38   |
Eclipse User |
|
|
|
Originally posted by: simon.ibm.oti.lab
If I understand correctly, your editor is contributing the MyCopyAction to
the toolbar. And also registering it using setGlobalActionHandler to hook
the Edit>Copy menu item. Right? If so, that is an acceptable solution.
Instead of overriding getImageDescriptor, why not call setImageDescriptor
instead?
Simon :-)
"venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
news:bj3m8c$blj$1@eclipse.org...
> Simon,
>
> I have a class
> MyCopyAction extends Action
> {
> public void run()
> {
> //Implement the necessary logic
> }
>
> public ImageDescriptor getImageDescriptor()
> {
> //Return the tool bar icon for copy
> }
> }
>
> And in setGlobalActionHandler(), i register the above action class, so
that
> the above run() method is
> invoked, if our editor is active. Since i had overriden the
> getImageDescriptor(), i get the icon for copy in
> the tool bar (if our editor is active), and the same run() method gets
> invoked, if i click on the copy icon.
>
> Am i clear now?
>
> Could you please clarify my earlier question?
>
> -venkat
>
> "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> news:bj2im5$a8v$1@eclipse.org...
> > Sorry, I do not understand what you mean. How can overriding
> > getImageDescriptor() solve your problem of having the cut/copy/paste
> actions
> > on the toolbar?
> >
> > Simon :-)
> >
> > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> > news:bj10m2$lcn$1@eclipse.org...
> > > Simon,
> > >
> > > Instead, can i override getImageDescriptor method in Action class?
This
> > way,
> > > i need not create
> > > a retarget actions, and still i can get the tool bar button placed in
> the
> > > tool bar.
> > >
> > > Please clarify this.
> > >
> > > -venkat
> > >
> > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > news:bilga3$q1v$1@eclipse.org...
> > > > The code for setGlobalActionHandler is not menu specific, it works
for
> > > tool
> > > > bar also. The eclipse ide just does not add the cut/copy/paste
> retarget
> > > > actions to the tool bar. You could provide an action set that added
> > these
> > > > retarget actions. Just need to make sure the "actionDefinitionId"
> > matches
> > > > the one used for the menu items (i.e. org.eclipse.ui.edit.copy for
the
> > > copy
> > > > retarget action, etc)
> > > >
> > > > This whole story will become much easier to understand and use with
> the
> > > new
> > > > "command" work that is going on.
> > > >
> > > > Simon :-)
> > > >
> > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
message
> > > > news:bijrgs$1oa$1@eclipse.org...
> > > > > So, what should we do, if we need the same action to be registered
> for
> > > > tool
> > > > > bar buttons?
> > > > >
> > > > > Another Question: As per your answer, if there are different
> editors,
> > > > having
> > > > > their own actions
> > > > > for copy/cut/paste, the menu item will be common, but tool bar
> buttons
> > > can
> > > > > differ. Is this the
> > > > > understanding?
> > > > >
> > > > > -venkat
> > > > >
> > > > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > > > news:biik91$r67$1@eclipse.org...
> > > > > > The eclipse IDE does not place the cut/copy/paste actions on the
> > > toolbar
> > > > > >
> > > > > > Simon :-)
> > > > > >
> > > > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
> > message
> > > > > > news:bihj7l$oj4$1@eclipse.org...
> > > > > > > Already , i read this documentation and my question is simple,
> > > > > > > setGlobalActionHandler api
> > > > > > > is with respect to menu items only, what should we do for tool
> bar
> > > > > > buttons?
> > > > > > > Hope you got my question.
> > > > > > >
> > > > > > > When is used JDT, i couldn't see copy,cut,paste icons in the
> tool
> > > bar.
> > > > > Why
> > > > > > > is it so? Does eclipse provide
> > > > > > > global tool bar buttons for copy,paste,cut, etc...?
> > > > > > >
> > > > > > > -venkat
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > "Chris Laffra" <Chris_Laffra@oti.com> wrote in message
> > > > > > > news:big7gd$l7v$1@eclipse.org...
> > > > > > > > What documentation did you consult?
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> > > > > > > > sv/doc/reference/api/org/eclipse/ui/IActionBars.html
> > > > > > > > states this:
> > > > > > > >
> > > > > > > >
> > > > > > > > Used by a part to access its menu, toolbar, and status line
> > > > managers.
> > > > > > > >
> > > > > > > > Within the workbench each part, editor or view, has a
private
> > set
> > > of
> > > > > > > action
> > > > > > > > bars. This set, which contains a menu, toolbar, and status
> line,
> > > > > appears
> > > > > > > in
> > > > > > > > the local toolbar for a view and in the window for an
editor.
> > The
> > > > view
> > > > > > may
> > > > > > > > provide an implementation for pre-existing actions or add
new
> > > > actions
> > > > > to
> > > > > > > the
> > > > > > > > action bars.
> > > > > > > >
> > > > > > > > In a workbench window there a number of actions which are
> > > applicable
> > > > > to
> > > > > > > all
> > > > > > > > parts. Some common examples are CUT, COPY and PASTE. These
> > > actions,
> > > > > > known
> > > > > > > as
> > > > > > > > "global actions", are contributed to the workbench window by
> the
> > > > > window
> > > > > > > > itself and shared by all parts. The presentation is owned by
> the
> > > > > window.
> > > > > > > The
> > > > > > > > implementation is delegated to the active part.
> > > > > > > >
> > > > > > > > To participate in the global action design an IWorkbenchPart
> > > should
> > > > > > > register
> > > > > > > > a handler for each global action which is implemented by the
> > part.
> > > > > This
> > > > > > > can
> > > > > > > > be done by calling setGlobalActionHandler. For convenience,
> the
> > > > > standard
> > > > > > > > global actions are defined in
> > > > > org.eclipse.ui.IWorkbenchActionConstants.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote
in
> > > > message
> > > > > > > > news:bifd3f$p46$1@eclipse.org...
> > > > > > > > > All,
> > > > > > > > >
> > > > > > > > > I have a "Copy" menu item and i used
setGlobalActionHandler
> > api
> > > to
> > > > > > > > register
> > > > > > > > > my action for the
> > > > > > > > > same. This works fine for the menu items. I need the same
to
> > > work
> > > > > for
> > > > > > > tool
> > > > > > > > > bar icons.
> > > > > > > > >
> > > > > > > > > I assumed that, copy/paste/cut tool bar icons will be
> provided
> > > by
> > > > > > > default
> > > > > > > > > and the
> > > > > > > > > programmers needs to register their actions, so that based
> on
> > > the
> > > > > > > editor,
> > > > > > > > > relevant actions will be fired.
> > > > > > > > > I searched the eclipse documentations, and concluded that
> > > > > > > > > setGlobalActionHandler api is with respect
> > > > > > > > > to MENU ITEMS, what should we do for tool bar buttons.??
> > > > > > > > >
> > > > > > > > > Does eclipse provides api's similar to
> setGlobalActionHandler
> > > api
> > > > > for
> > > > > > > > > registering the actions related
> > > > > > > > > to tool bar buttons.
> > > > > > > > >
> > > > > > > > > Could anyone help me in this regard?
> > > > > > > > >
> > > > > > > > > Also you can mail the replies to
> vamirthalingam@selectica.com
> > > > > > > > >
> > > > > > > > > Regards,
> > > > > > > > > venkat
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Clarification needed - Copy menu item and tool bar button - Global Actions [message #122461 is a reply to message #122192] |
Wed, 03 September 2003 23:11   |
Eclipse User |
|
|
|
Simon,
I am unable to understand...where do you want me to call setImageDescriptor?
-venkat
"Simon Arsenault" <simon@ibm.oti.lab> wrote in message
news:bj51rh$p9o$1@eclipse.org...
> If I understand correctly, your editor is contributing the MyCopyAction to
> the toolbar. And also registering it using setGlobalActionHandler to hook
> the Edit>Copy menu item. Right? If so, that is an acceptable solution.
>
> Instead of overriding getImageDescriptor, why not call setImageDescriptor
> instead?
>
> Simon :-)
>
>
> "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> news:bj3m8c$blj$1@eclipse.org...
> > Simon,
> >
> > I have a class
> > MyCopyAction extends Action
> > {
> > public void run()
> > {
> > //Implement the necessary logic
> > }
> >
> > public ImageDescriptor getImageDescriptor()
> > {
> > //Return the tool bar icon for copy
> > }
> > }
> >
> > And in setGlobalActionHandler(), i register the above action class, so
> that
> > the above run() method is
> > invoked, if our editor is active. Since i had overriden the
> > getImageDescriptor(), i get the icon for copy in
> > the tool bar (if our editor is active), and the same run() method gets
> > invoked, if i click on the copy icon.
> >
> > Am i clear now?
> >
> > Could you please clarify my earlier question?
> >
> > -venkat
> >
> > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > news:bj2im5$a8v$1@eclipse.org...
> > > Sorry, I do not understand what you mean. How can overriding
> > > getImageDescriptor() solve your problem of having the cut/copy/paste
> > actions
> > > on the toolbar?
> > >
> > > Simon :-)
> > >
> > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> > > news:bj10m2$lcn$1@eclipse.org...
> > > > Simon,
> > > >
> > > > Instead, can i override getImageDescriptor method in Action class?
> This
> > > way,
> > > > i need not create
> > > > a retarget actions, and still i can get the tool bar button placed
in
> > the
> > > > tool bar.
> > > >
> > > > Please clarify this.
> > > >
> > > > -venkat
> > > >
> > > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > > news:bilga3$q1v$1@eclipse.org...
> > > > > The code for setGlobalActionHandler is not menu specific, it works
> for
> > > > tool
> > > > > bar also. The eclipse ide just does not add the cut/copy/paste
> > retarget
> > > > > actions to the tool bar. You could provide an action set that
added
> > > these
> > > > > retarget actions. Just need to make sure the "actionDefinitionId"
> > > matches
> > > > > the one used for the menu items (i.e. org.eclipse.ui.edit.copy for
> the
> > > > copy
> > > > > retarget action, etc)
> > > > >
> > > > > This whole story will become much easier to understand and use
with
> > the
> > > > new
> > > > > "command" work that is going on.
> > > > >
> > > > > Simon :-)
> > > > >
> > > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
> message
> > > > > news:bijrgs$1oa$1@eclipse.org...
> > > > > > So, what should we do, if we need the same action to be
registered
> > for
> > > > > tool
> > > > > > bar buttons?
> > > > > >
> > > > > > Another Question: As per your answer, if there are different
> > editors,
> > > > > having
> > > > > > their own actions
> > > > > > for copy/cut/paste, the menu item will be common, but tool bar
> > buttons
> > > > can
> > > > > > differ. Is this the
> > > > > > understanding?
> > > > > >
> > > > > > -venkat
> > > > > >
> > > > > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > > > > news:biik91$r67$1@eclipse.org...
> > > > > > > The eclipse IDE does not place the cut/copy/paste actions on
the
> > > > toolbar
> > > > > > >
> > > > > > > Simon :-)
> > > > > > >
> > > > > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
> > > message
> > > > > > > news:bihj7l$oj4$1@eclipse.org...
> > > > > > > > Already , i read this documentation and my question is
simple,
> > > > > > > > setGlobalActionHandler api
> > > > > > > > is with respect to menu items only, what should we do for
tool
> > bar
> > > > > > > buttons?
> > > > > > > > Hope you got my question.
> > > > > > > >
> > > > > > > > When is used JDT, i couldn't see copy,cut,paste icons in the
> > tool
> > > > bar.
> > > > > > Why
> > > > > > > > is it so? Does eclipse provide
> > > > > > > > global tool bar buttons for copy,paste,cut, etc...?
> > > > > > > >
> > > > > > > > -venkat
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > "Chris Laffra" <Chris_Laffra@oti.com> wrote in message
> > > > > > > > news:big7gd$l7v$1@eclipse.org...
> > > > > > > > > What documentation did you consult?
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> > > > > > > > > sv/doc/reference/api/org/eclipse/ui/IActionBars.html
> > > > > > > > > states this:
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Used by a part to access its menu, toolbar, and status
line
> > > > > managers.
> > > > > > > > >
> > > > > > > > > Within the workbench each part, editor or view, has a
> private
> > > set
> > > > of
> > > > > > > > action
> > > > > > > > > bars. This set, which contains a menu, toolbar, and status
> > line,
> > > > > > appears
> > > > > > > > in
> > > > > > > > > the local toolbar for a view and in the window for an
> editor.
> > > The
> > > > > view
> > > > > > > may
> > > > > > > > > provide an implementation for pre-existing actions or add
> new
> > > > > actions
> > > > > > to
> > > > > > > > the
> > > > > > > > > action bars.
> > > > > > > > >
> > > > > > > > > In a workbench window there a number of actions which are
> > > > applicable
> > > > > > to
> > > > > > > > all
> > > > > > > > > parts. Some common examples are CUT, COPY and PASTE. These
> > > > actions,
> > > > > > > known
> > > > > > > > as
> > > > > > > > > "global actions", are contributed to the workbench window
by
> > the
> > > > > > window
> > > > > > > > > itself and shared by all parts. The presentation is owned
by
> > the
> > > > > > window.
> > > > > > > > The
> > > > > > > > > implementation is delegated to the active part.
> > > > > > > > >
> > > > > > > > > To participate in the global action design an
IWorkbenchPart
> > > > should
> > > > > > > > register
> > > > > > > > > a handler for each global action which is implemented by
the
> > > part.
> > > > > > This
> > > > > > > > can
> > > > > > > > > be done by calling setGlobalActionHandler. For
convenience,
> > the
> > > > > > standard
> > > > > > > > > global actions are defined in
> > > > > > org.eclipse.ui.IWorkbenchActionConstants.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > "venkat amirthalingam" <vamirthalingam@selectica.com>
wrote
> in
> > > > > message
> > > > > > > > > news:bifd3f$p46$1@eclipse.org...
> > > > > > > > > > All,
> > > > > > > > > >
> > > > > > > > > > I have a "Copy" menu item and i used
> setGlobalActionHandler
> > > api
> > > > to
> > > > > > > > > register
> > > > > > > > > > my action for the
> > > > > > > > > > same. This works fine for the menu items. I need the
same
> to
> > > > work
> > > > > > for
> > > > > > > > tool
> > > > > > > > > > bar icons.
> > > > > > > > > >
> > > > > > > > > > I assumed that, copy/paste/cut tool bar icons will be
> > provided
> > > > by
> > > > > > > > default
> > > > > > > > > > and the
> > > > > > > > > > programmers needs to register their actions, so that
based
> > on
> > > > the
> > > > > > > > editor,
> > > > > > > > > > relevant actions will be fired.
> > > > > > > > > > I searched the eclipse documentations, and concluded
that
> > > > > > > > > > setGlobalActionHandler api is with respect
> > > > > > > > > > to MENU ITEMS, what should we do for tool bar buttons.??
> > > > > > > > > >
> > > > > > > > > > Does eclipse provides api's similar to
> > setGlobalActionHandler
> > > > api
> > > > > > for
> > > > > > > > > > registering the actions related
> > > > > > > > > > to tool bar buttons.
> > > > > > > > > >
> > > > > > > > > > Could anyone help me in this regard?
> > > > > > > > > >
> > > > > > > > > > Also you can mail the replies to
> > vamirthalingam@selectica.com
> > > > > > > > > >
> > > > > > > > > > Regards,
> > > > > > > > > > venkat
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Clarification needed - Copy menu item and tool bar button - Global Actions [message #122719 is a reply to message #122461] |
Thu, 04 September 2003 11:28   |
Eclipse User |
|
|
|
Originally posted by: simon.ibm.oti.lab
How about in the constructor of the MyCopyAction? Or maybe in the method who
is creating an instance of MyCopyAction?
Simon :-)
"venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
news:bj6aah$13n$1@eclipse.org...
> Simon,
>
> I am unable to understand...where do you want me to call
setImageDescriptor?
>
> -venkat
>
> "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> news:bj51rh$p9o$1@eclipse.org...
> > If I understand correctly, your editor is contributing the MyCopyAction
to
> > the toolbar. And also registering it using setGlobalActionHandler to
hook
> > the Edit>Copy menu item. Right? If so, that is an acceptable solution.
> >
> > Instead of overriding getImageDescriptor, why not call
setImageDescriptor
> > instead?
> >
> > Simon :-)
> >
> >
> > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> > news:bj3m8c$blj$1@eclipse.org...
> > > Simon,
> > >
> > > I have a class
> > > MyCopyAction extends Action
> > > {
> > > public void run()
> > > {
> > > //Implement the necessary logic
> > > }
> > >
> > > public ImageDescriptor getImageDescriptor()
> > > {
> > > //Return the tool bar icon for copy
> > > }
> > > }
> > >
> > > And in setGlobalActionHandler(), i register the above action class, so
> > that
> > > the above run() method is
> > > invoked, if our editor is active. Since i had overriden the
> > > getImageDescriptor(), i get the icon for copy in
> > > the tool bar (if our editor is active), and the same run() method gets
> > > invoked, if i click on the copy icon.
> > >
> > > Am i clear now?
> > >
> > > Could you please clarify my earlier question?
> > >
> > > -venkat
> > >
> > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > news:bj2im5$a8v$1@eclipse.org...
> > > > Sorry, I do not understand what you mean. How can overriding
> > > > getImageDescriptor() solve your problem of having the cut/copy/paste
> > > actions
> > > > on the toolbar?
> > > >
> > > > Simon :-)
> > > >
> > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
message
> > > > news:bj10m2$lcn$1@eclipse.org...
> > > > > Simon,
> > > > >
> > > > > Instead, can i override getImageDescriptor method in Action class?
> > This
> > > > way,
> > > > > i need not create
> > > > > a retarget actions, and still i can get the tool bar button placed
> in
> > > the
> > > > > tool bar.
> > > > >
> > > > > Please clarify this.
> > > > >
> > > > > -venkat
> > > > >
> > > > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > > > news:bilga3$q1v$1@eclipse.org...
> > > > > > The code for setGlobalActionHandler is not menu specific, it
works
> > for
> > > > > tool
> > > > > > bar also. The eclipse ide just does not add the cut/copy/paste
> > > retarget
> > > > > > actions to the tool bar. You could provide an action set that
> added
> > > > these
> > > > > > retarget actions. Just need to make sure the
"actionDefinitionId"
> > > > matches
> > > > > > the one used for the menu items (i.e. org.eclipse.ui.edit.copy
for
> > the
> > > > > copy
> > > > > > retarget action, etc)
> > > > > >
> > > > > > This whole story will become much easier to understand and use
> with
> > > the
> > > > > new
> > > > > > "command" work that is going on.
> > > > > >
> > > > > > Simon :-)
> > > > > >
> > > > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
> > message
> > > > > > news:bijrgs$1oa$1@eclipse.org...
> > > > > > > So, what should we do, if we need the same action to be
> registered
> > > for
> > > > > > tool
> > > > > > > bar buttons?
> > > > > > >
> > > > > > > Another Question: As per your answer, if there are different
> > > editors,
> > > > > > having
> > > > > > > their own actions
> > > > > > > for copy/cut/paste, the menu item will be common, but tool bar
> > > buttons
> > > > > can
> > > > > > > differ. Is this the
> > > > > > > understanding?
> > > > > > >
> > > > > > > -venkat
> > > > > > >
> > > > > > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > > > > > news:biik91$r67$1@eclipse.org...
> > > > > > > > The eclipse IDE does not place the cut/copy/paste actions on
> the
> > > > > toolbar
> > > > > > > >
> > > > > > > > Simon :-)
> > > > > > > >
> > > > > > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote
in
> > > > message
> > > > > > > > news:bihj7l$oj4$1@eclipse.org...
> > > > > > > > > Already , i read this documentation and my question is
> simple,
> > > > > > > > > setGlobalActionHandler api
> > > > > > > > > is with respect to menu items only, what should we do for
> tool
> > > bar
> > > > > > > > buttons?
> > > > > > > > > Hope you got my question.
> > > > > > > > >
> > > > > > > > > When is used JDT, i couldn't see copy,cut,paste icons in
the
> > > tool
> > > > > bar.
> > > > > > > Why
> > > > > > > > > is it so? Does eclipse provide
> > > > > > > > > global tool bar buttons for copy,paste,cut, etc...?
> > > > > > > > >
> > > > > > > > > -venkat
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > "Chris Laffra" <Chris_Laffra@oti.com> wrote in message
> > > > > > > > > news:big7gd$l7v$1@eclipse.org...
> > > > > > > > > > What documentation did you consult?
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> > > > > > > > > > sv/doc/reference/api/org/eclipse/ui/IActionBars.html
> > > > > > > > > > states this:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Used by a part to access its menu, toolbar, and status
> line
> > > > > > managers.
> > > > > > > > > >
> > > > > > > > > > Within the workbench each part, editor or view, has a
> > private
> > > > set
> > > > > of
> > > > > > > > > action
> > > > > > > > > > bars. This set, which contains a menu, toolbar, and
status
> > > line,
> > > > > > > appears
> > > > > > > > > in
> > > > > > > > > > the local toolbar for a view and in the window for an
> > editor.
> > > > The
> > > > > > view
> > > > > > > > may
> > > > > > > > > > provide an implementation for pre-existing actions or
add
> > new
> > > > > > actions
> > > > > > > to
> > > > > > > > > the
> > > > > > > > > > action bars.
> > > > > > > > > >
> > > > > > > > > > In a workbench window there a number of actions which
are
> > > > > applicable
> > > > > > > to
> > > > > > > > > all
> > > > > > > > > > parts. Some common examples are CUT, COPY and PASTE.
These
> > > > > actions,
> > > > > > > > known
> > > > > > > > > as
> > > > > > > > > > "global actions", are contributed to the workbench
window
> by
> > > the
> > > > > > > window
> > > > > > > > > > itself and shared by all parts. The presentation is
owned
> by
> > > the
> > > > > > > window.
> > > > > > > > > The
> > > > > > > > > > implementation is delegated to the active part.
> > > > > > > > > >
> > > > > > > > > > To participate in the global action design an
> IWorkbenchPart
> > > > > should
> > > > > > > > > register
> > > > > > > > > > a handler for each global action which is implemented by
> the
> > > > part.
> > > > > > > This
> > > > > > > > > can
> > > > > > > > > > be done by calling setGlobalActionHandler. For
> convenience,
> > > the
> > > > > > > standard
> > > > > > > > > > global actions are defined in
> > > > > > > org.eclipse.ui.IWorkbenchActionConstants.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > "venkat amirthalingam" <vamirthalingam@selectica.com>
> wrote
> > in
> > > > > > message
> > > > > > > > > > news:bifd3f$p46$1@eclipse.org...
> > > > > > > > > > > All,
> > > > > > > > > > >
> > > > > > > > > > > I have a "Copy" menu item and i used
> > setGlobalActionHandler
> > > > api
> > > > > to
> > > > > > > > > > register
> > > > > > > > > > > my action for the
> > > > > > > > > > > same. This works fine for the menu items. I need the
> same
> > to
> > > > > work
> > > > > > > for
> > > > > > > > > tool
> > > > > > > > > > > bar icons.
> > > > > > > > > > >
> > > > > > > > > > > I assumed that, copy/paste/cut tool bar icons will be
> > > provided
> > > > > by
> > > > > > > > > default
> > > > > > > > > > > and the
> > > > > > > > > > > programmers needs to register their actions, so that
> based
> > > on
> > > > > the
> > > > > > > > > editor,
> > > > > > > > > > > relevant actions will be fired.
> > > > > > > > > > > I searched the eclipse documentations, and concluded
> that
> > > > > > > > > > > setGlobalActionHandler api is with respect
> > > > > > > > > > > to MENU ITEMS, what should we do for tool bar
buttons.??
> > > > > > > > > > >
> > > > > > > > > > > Does eclipse provides api's similar to
> > > setGlobalActionHandler
> > > > > api
> > > > > > > for
> > > > > > > > > > > registering the actions related
> > > > > > > > > > > to tool bar buttons.
> > > > > > > > > > >
> > > > > > > > > > > Could anyone help me in this regard?
> > > > > > > > > > >
> > > > > > > > > > > Also you can mail the replies to
> > > vamirthalingam@selectica.com
> > > > > > > > > > >
> > > > > > > > > > > Regards,
> > > > > > > > > > > venkat
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: Clarification needed - Copy menu item and tool bar button - Global Actions [message #123992 is a reply to message #122719] |
Mon, 08 September 2003 02:38  |
Eclipse User |
|
|
|
Simon,
I found an elegant way to solve this.
Instead of using get/set ImageDescriptor, i modified the MyCopyAction class
as:
MyCopyAction extends Action implements IEditorActionDelegate
{
public void run()
{
//Implementation of run
}
public void setActiveEditor(IAction action, IEditorPart targetEditor)
{ }
public void run(IAction action)
{
run() ;
}
public void selectionChanged(IAction action, ISelection selection) { }
}
In this way, i registered the above action class in setGlobalActionHandler
as well as in
plugin.xml
Hope this is the simplest way :)
Please let me know your comments
Regards,
venkat
"Simon Arsenault" <simon@ibm.oti.lab> wrote in message
news:bj7lmb$ash$1@eclipse.org...
> How about in the constructor of the MyCopyAction? Or maybe in the method
who
> is creating an instance of MyCopyAction?
>
> Simon :-)
>
> "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> news:bj6aah$13n$1@eclipse.org...
> > Simon,
> >
> > I am unable to understand...where do you want me to call
> setImageDescriptor?
> >
> > -venkat
> >
> > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > news:bj51rh$p9o$1@eclipse.org...
> > > If I understand correctly, your editor is contributing the
MyCopyAction
> to
> > > the toolbar. And also registering it using setGlobalActionHandler to
> hook
> > > the Edit>Copy menu item. Right? If so, that is an acceptable solution.
> > >
> > > Instead of overriding getImageDescriptor, why not call
> setImageDescriptor
> > > instead?
> > >
> > > Simon :-)
> > >
> > >
> > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in message
> > > news:bj3m8c$blj$1@eclipse.org...
> > > > Simon,
> > > >
> > > > I have a class
> > > > MyCopyAction extends Action
> > > > {
> > > > public void run()
> > > > {
> > > > //Implement the necessary logic
> > > > }
> > > >
> > > > public ImageDescriptor getImageDescriptor()
> > > > {
> > > > //Return the tool bar icon for copy
> > > > }
> > > > }
> > > >
> > > > And in setGlobalActionHandler(), i register the above action class,
so
> > > that
> > > > the above run() method is
> > > > invoked, if our editor is active. Since i had overriden the
> > > > getImageDescriptor(), i get the icon for copy in
> > > > the tool bar (if our editor is active), and the same run() method
gets
> > > > invoked, if i click on the copy icon.
> > > >
> > > > Am i clear now?
> > > >
> > > > Could you please clarify my earlier question?
> > > >
> > > > -venkat
> > > >
> > > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > > news:bj2im5$a8v$1@eclipse.org...
> > > > > Sorry, I do not understand what you mean. How can overriding
> > > > > getImageDescriptor() solve your problem of having the
cut/copy/paste
> > > > actions
> > > > > on the toolbar?
> > > > >
> > > > > Simon :-)
> > > > >
> > > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
> message
> > > > > news:bj10m2$lcn$1@eclipse.org...
> > > > > > Simon,
> > > > > >
> > > > > > Instead, can i override getImageDescriptor method in Action
class?
> > > This
> > > > > way,
> > > > > > i need not create
> > > > > > a retarget actions, and still i can get the tool bar button
placed
> > in
> > > > the
> > > > > > tool bar.
> > > > > >
> > > > > > Please clarify this.
> > > > > >
> > > > > > -venkat
> > > > > >
> > > > > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > > > > news:bilga3$q1v$1@eclipse.org...
> > > > > > > The code for setGlobalActionHandler is not menu specific, it
> works
> > > for
> > > > > > tool
> > > > > > > bar also. The eclipse ide just does not add the cut/copy/paste
> > > > retarget
> > > > > > > actions to the tool bar. You could provide an action set that
> > added
> > > > > these
> > > > > > > retarget actions. Just need to make sure the
> "actionDefinitionId"
> > > > > matches
> > > > > > > the one used for the menu items (i.e. org.eclipse.ui.edit.copy
> for
> > > the
> > > > > > copy
> > > > > > > retarget action, etc)
> > > > > > >
> > > > > > > This whole story will become much easier to understand and use
> > with
> > > > the
> > > > > > new
> > > > > > > "command" work that is going on.
> > > > > > >
> > > > > > > Simon :-)
> > > > > > >
> > > > > > > "venkat amirthalingam" <vamirthalingam@selectica.com> wrote in
> > > message
> > > > > > > news:bijrgs$1oa$1@eclipse.org...
> > > > > > > > So, what should we do, if we need the same action to be
> > registered
> > > > for
> > > > > > > tool
> > > > > > > > bar buttons?
> > > > > > > >
> > > > > > > > Another Question: As per your answer, if there are different
> > > > editors,
> > > > > > > having
> > > > > > > > their own actions
> > > > > > > > for copy/cut/paste, the menu item will be common, but tool
bar
> > > > buttons
> > > > > > can
> > > > > > > > differ. Is this the
> > > > > > > > understanding?
> > > > > > > >
> > > > > > > > -venkat
> > > > > > > >
> > > > > > > > "Simon Arsenault" <simon@ibm.oti.lab> wrote in message
> > > > > > > > news:biik91$r67$1@eclipse.org...
> > > > > > > > > The eclipse IDE does not place the cut/copy/paste actions
on
> > the
> > > > > > toolbar
> > > > > > > > >
> > > > > > > > > Simon :-)
> > > > > > > > >
> > > > > > > > > "venkat amirthalingam" <vamirthalingam@selectica.com>
wrote
> in
> > > > > message
> > > > > > > > > news:bihj7l$oj4$1@eclipse.org...
> > > > > > > > > > Already , i read this documentation and my question is
> > simple,
> > > > > > > > > > setGlobalActionHandler api
> > > > > > > > > > is with respect to menu items only, what should we do
for
> > tool
> > > > bar
> > > > > > > > > buttons?
> > > > > > > > > > Hope you got my question.
> > > > > > > > > >
> > > > > > > > > > When is used JDT, i couldn't see copy,cut,paste icons in
> the
> > > > tool
> > > > > > bar.
> > > > > > > > Why
> > > > > > > > > > is it so? Does eclipse provide
> > > > > > > > > > global tool bar buttons for copy,paste,cut, etc...?
> > > > > > > > > >
> > > > > > > > > > -venkat
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > "Chris Laffra" <Chris_Laffra@oti.com> wrote in message
> > > > > > > > > > news:big7gd$l7v$1@eclipse.org...
> > > > > > > > > > > What documentation did you consult?
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
http://www.eclipse.org/documentation/html/plugins/org.eclips e.platform.doc.i
> > > > > > > > > > > sv/doc/reference/api/org/eclipse/ui/IActionBars.html
> > > > > > > > > > > states this:
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Used by a part to access its menu, toolbar, and status
> > line
> > > > > > > managers.
> > > > > > > > > > >
> > > > > > > > > > > Within the workbench each part, editor or view, has a
> > > private
> > > > > set
> > > > > > of
> > > > > > > > > > action
> > > > > > > > > > > bars. This set, which contains a menu, toolbar, and
> status
> > > > line,
> > > > > > > > appears
> > > > > > > > > > in
> > > > > > > > > > > the local toolbar for a view and in the window for an
> > > editor.
> > > > > The
> > > > > > > view
> > > > > > > > > may
> > > > > > > > > > > provide an implementation for pre-existing actions or
> add
> > > new
> > > > > > > actions
> > > > > > > > to
> > > > > > > > > > the
> > > > > > > > > > > action bars.
> > > > > > > > > > >
> > > > > > > > > > > In a workbench window there a number of actions which
> are
> > > > > > applicable
> > > > > > > > to
> > > > > > > > > > all
> > > > > > > > > > > parts. Some common examples are CUT, COPY and PASTE.
> These
> > > > > > actions,
> > > > > > > > > known
> > > > > > > > > > as
> > > > > > > > > > > "global actions", are contributed to the workbench
> window
> > by
> > > > the
> > > > > > > > window
> > > > > > > > > > > itself and shared by all parts. The presentation is
> owned
> > by
> > > > the
> > > > > > > > window.
> > > > > > > > > > The
> > > > > > > > > > > implementation is delegated to the active part.
> > > > > > > > > > >
> > > > > > > > > > > To participate in the global action design an
> > IWorkbenchPart
> > > > > > should
> > > > > > > > > > register
> > > > > > > > > > > a handler for each global action which is implemented
by
> > the
> > > > > part.
> > > > > > > > This
> > > > > > > > > > can
> > > > > > > > > > > be done by calling setGlobalActionHandler. For
> > convenience,
> > > > the
> > > > > > > > standard
> > > > > > > > > > > global actions are defined in
> > > > > > > > org.eclipse.ui.IWorkbenchActionConstants.
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > "venkat amirthalingam" <vamirthalingam@selectica.com>
> > wrote
> > > in
> > > > > > > message
> > > > > > > > > > > news:bifd3f$p46$1@eclipse.org...
> > > > > > > > > > > > All,
> > > > > > > > > > > >
> > > > > > > > > > > > I have a "Copy" menu item and i used
> > > setGlobalActionHandler
> > > > > api
> > > > > > to
> > > > > > > > > > > register
> > > > > > > > > > > > my action for the
> > > > > > > > > > > > same. This works fine for the menu items. I need the
> > same
> > > to
> > > > > > work
> > > > > > > > for
> > > > > > > > > > tool
> > > > > > > > > > > > bar icons.
> > > > > > > > > > > >
> > > > > > > > > > > > I assumed that, copy/paste/cut tool bar icons will
be
> > > > provided
> > > > > > by
> > > > > > > > > > default
> > > > > > > > > > > > and the
> > > > > > > > > > > > programmers needs to register their actions, so that
> > based
> > > > on
> > > > > > the
> > > > > > > > > > editor,
> > > > > > > > > > > > relevant actions will be fired.
> > > > > > > > > > > > I searched the eclipse documentations, and concluded
> > that
> > > > > > > > > > > > setGlobalActionHandler api is with respect
> > > > > > > > > > > > to MENU ITEMS, what should we do for tool bar
> buttons.??
> > > > > > > > > > > >
> > > > > > > > > > > > Does eclipse provides api's similar to
> > > > setGlobalActionHandler
> > > > > > api
> > > > > > > > for
> > > > > > > > > > > > registering the actions related
> > > > > > > > > > > > to tool bar buttons.
> > > > > > > > > > > >
> > > > > > > > > > > > Could anyone help me in this regard?
> > > > > > > > > > > >
> > > > > > > > > > > > Also you can mail the replies to
> > > > vamirthalingam@selectica.com
> > > > > > > > > > > >
> > > > > > > > > > > > Regards,
> > > > > > > > > > > > venkat
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
|
|
|
Goto Forum:
Current Time: Fri May 09 16:56:11 EDT 2025
Powered by FUDForum. Page generated in 0.04720 seconds
|