Home » Eclipse Projects » GEF » Should these actions be retargetable?
Should these actions be retargetable? [message #173759] |
Sun, 27 March 2005 23:36  |
Eclipse User |
|
|
|
Hello all,
I need a "set priority" and a "set color" action in my application, since
there is an outline view, I think the first one should be retargetable, and
the other be regular action.
Now the problem, I create "set color" action in editor's createActions(),
but I can't get it in ActionBarContributor through getAction(), seems
createActions() is not called yet.
Where should I create this action? Should this type of action retargetable
or regular?
Wishes
Hao
|
|
| | |
Re: Should these actions be retargetable? [message #174146 is a reply to message #174096] |
Tue, 29 March 2005 07:11   |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Depends on how you use the action. For instance, alignment action may
have a button, a menuitem, and may appear in the context menu. Thats 3
different retarget actions that will fire up the one action.
For actions that are not retargetable like say, 'new project wizard' you
dont need a retarget action. Such an action does not care about the
current selection.
Yes do use ActionBarContributor. If it changes it probably won't be
hard to adapt to the new one.
CL
Hao Zhang wrote:
> Do you mean that every concrete action in my application must have a
> matching retarget action?
> ActionBarContributor's comment says this class is to be changed, should I
> still use it?
>
> "CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> ????
> news:d29b9r$42u$2@news.eclipse.org...
>
>>Hao Zhang wrote:
>>
>>>Hello all,
>>>I need a "set priority" and a "set color" action in my application,
>
> since
>
>>>there is an outline view, I think the first one should be retargetable,
>
> and
>
>>>the other be regular action.
>>>Now the problem, I create "set color" action in editor's
>
> createActions(),
>
>>>but I can't get it in ActionBarContributor through getAction(), seems
>>>createActions() is not called yet.
>>>Where should I create this action? Should this type of action
>
> retargetable
>
>>>or regular?
>>>
>>>Wishes
>>>Hao
>>>
>>>
>>
>>i think in the action bar you need to create the retarget action to
>>match the action you created in the editor.
>>
>>CL
>
>
>
|
|
|
Re: Should these actions be retargetable? [message #174224 is a reply to message #174146] |
Tue, 29 March 2005 10:43  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
"CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in message
news:d2bgme$483$1@news.eclipse.org...
> Depends on how you use the action. For instance, alignment action may
> have a button, a menuitem, and may appear in the context menu. Thats 3
> different retarget actions that will fire up the one action.
You can put the same action instance (of a retarget action or not) in
multiple places.
If where you are putting the action is shared across editor instances
(menubar, toolbar, or statusbar), you can either
1) use a retarget action like we do, and have the action in the editor.
2) Use a "smart" action which sends some magic event ID to the active
editor. The editor then implements some interface to receive this
doSomething(ID) call.
If you are putting the action on a contextmenu inside the editor, no
retarget action is needed.
>
> For actions that are not retargetable like say, 'new project wizard' you
> dont need a retarget action. Such an action does not care about the
> current selection.
>
> Yes do use ActionBarContributor. If it changes it probably won't be hard
> to adapt to the new one.
>
>
> CL
>
>
> Hao Zhang wrote:
>> Do you mean that every concrete action in my application must have a
>> matching retarget action?
>> ActionBarContributor's comment says this class is to be changed, should I
>> still use it?
>>
>> "CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> ????
>> news:d29b9r$42u$2@news.eclipse.org...
>>
>>>Hao Zhang wrote:
>>>
>>>>Hello all,
>>>>I need a "set priority" and a "set color" action in my application,
>>
>> since
>>
>>>>there is an outline view, I think the first one should be retargetable,
>>
>> and
>>
>>>>the other be regular action.
>>>>Now the problem, I create "set color" action in editor's
>>
>> createActions(),
>>
>>>>but I can't get it in ActionBarContributor through getAction(), seems
>>>>createActions() is not called yet.
>>>>Where should I create this action? Should this type of action
>>
>> retargetable
>>
>>>>or regular?
>>>>
>>>>Wishes
>>>>Hao
>>>>
>>>>
>>>
>>>i think in the action bar you need to create the retarget action to
>>>match the action you created in the editor.
>>>
>>>CL
>>
>>
|
|
|
Re: Should these actions be retargetable? [message #174231 is a reply to message #174146] |
Tue, 29 March 2005 10:41  |
Eclipse User |
|
|
|
Thanks
"CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> ????
news:d2bgme$483$1@news.eclipse.org...
> Depends on how you use the action. For instance, alignment action may
> have a button, a menuitem, and may appear in the context menu. Thats 3
> different retarget actions that will fire up the one action.
>
> For actions that are not retargetable like say, 'new project wizard' you
> dont need a retarget action. Such an action does not care about the
> current selection.
>
> Yes do use ActionBarContributor. If it changes it probably won't be
> hard to adapt to the new one.
>
>
> CL
>
>
> Hao Zhang wrote:
> > Do you mean that every concrete action in my application must have a
> > matching retarget action?
> > ActionBarContributor's comment says this class is to be changed, should
I
> > still use it?
> >
> > "CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> ????
> > news:d29b9r$42u$2@news.eclipse.org...
> >
> >>Hao Zhang wrote:
> >>
> >>>Hello all,
> >>>I need a "set priority" and a "set color" action in my application,
> >
> > since
> >
> >>>there is an outline view, I think the first one should be retargetable,
> >
> > and
> >
> >>>the other be regular action.
> >>>Now the problem, I create "set color" action in editor's
> >
> > createActions(),
> >
> >>>but I can't get it in ActionBarContributor through getAction(), seems
> >>>createActions() is not called yet.
> >>>Where should I create this action? Should this type of action
> >
> > retargetable
> >
> >>>or regular?
> >>>
> >>>Wishes
> >>>Hao
> >>>
> >>>
> >>
> >>i think in the action bar you need to create the retarget action to
> >>match the action you created in the editor.
> >>
> >>CL
> >
> >
> >
|
|
|
Goto Forum:
Current Time: Fri Apr 25 22:57:28 EDT 2025
Powered by FUDForum. Page generated in 0.03475 seconds
|