Controlling action visibility via plugin.xml? [message #293051] |
Mon, 17 October 2005 08:48  |
Eclipse User |
|
|
|
Originally posted by: csetera.spss.com
Is there any way to control visibility of an action (menu item) via
plugin.xml or must that be done from within code? I can't seem to find
a way to handle that.
|
|
|
|
|
Re: Controlling action visibility via plugin.xml? [message #293060 is a reply to message #293056] |
Mon, 17 October 2005 10:21   |
Eclipse User |
|
|
|
Craig Setera wrote:
>
> I need more control than that. Essentially, I want to apply enablement
> controls to visibility of the menu item.
>
> At this point, I can't even see how to do this in code. I don't see any
> way to get my hands on the action bars/menu bar manager from another
> plugin to add the menu contribution dynamically. I've been hung up on
> this issue for way too long. Thoughts appreciated.
A description of your use case would really help answer your question.
Sometimes there are other ways to do things that play well with eclipse.
If you are talking about actions you add, you can use extensions to add
your actions: actionSets, actionPartAssociations, editorActions, and
viewActions. Your editor can also programmatically add actions using
the ActionBarContributor. You can have your actions register listeners
(window, page, or part) and update their enablement.
If you are talking about general actions contributed by other plugins,
you can use activities (see eclipse help) to mask out menu contributions
by id.
Later,
PW
|
|
|
|
Re: Controlling action visibility via plugin.xml? [message #293076 is a reply to message #293060] |
Mon, 17 October 2005 14:53   |
Eclipse User |
|
|
|
Originally posted by: csetera.spss.com
> A description of your use case would really help answer your question.
> Sometimes there are other ways to do things that play well with eclipse.
>
OK. You asked for it. See below :-)
>
> If you are talking about actions you add, you can use extensions to add
> your actions: actionSets, actionPartAssociations, editorActions, and
> viewActions. Your editor can also programmatically add actions using
> the ActionBarContributor. You can have your actions register listeners
> (window, page, or part) and update their enablement.
>
> If you are talking about general actions contributed by other plugins,
> you can use activities (see eclipse help) to mask out menu contributions
> by id.
>
> Later,
> PW
I think I'm aware of all of the options you mentioned. None of these
really do what I want though.
Here's the scenario. The common administration layer of plugins sits
atop the common layer of plugins. There are multiple administration
extensions that plug into the common administration layer. Each
provides its own wizard pages to a common "new server connection"
wizard. This wizard and the associated action that launches it are
defined in the common administration layer. The common layers ship
separately from the actual administration plugins. In addition, there
is non-administrative functionality that might be there without any
administrative extensions installed. In that case, I don't want the
"create new administrative connection" action to even be visible on the
menu because it can't work. I only want the "create administrative
connection" action to be visible if there are actually plug-ins that are
providing administrative functionality. The common administrative
functionality should just be there to glue together real administrative
functionality and otherwise be completely silent.
Does any of that make sense? Is there some other way I can make this
work?
Thanks,
Craig
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Controlling action visibility via plugin.xml? [message #293563 is a reply to message #293518] |
Wed, 26 October 2005 09:29   |
Eclipse User |
|
|
|
Charles Godwin wrote:
> Is it me? Are my questions dumb? or does this group stop replying once
> the question gets difficult?
Not dumb, but we get busy too.
>
> i've tried repeatedly, in various threads, to finds out how to
> "subtract" actions supplied by other, default, plug-ins and I have yet
> to find a viable example or soulution.
Hmmm ... activites? :-)
Seriously, you have more luck posting "I tried activities, and I
couldn't get X to disappear ... I thought a binding like this would work:
<activityPatternBinding
activityId="org.eclipse.javaDevelopment"
pattern="org\.eclipse\.ui\.workbench/.*">
</activityPatternBinding>
but nothing appeared to happen when I disabled and enabled the
corresponding capability"
If I look at a follow up post the first thing I say is "I said
activities can make contributions disappear ... what problem did you
have with activities?" Since you didn't post anything like that, and
I'm busy, I'll give someone else the chance to help you.
Later,
PW
|
|
|
|
|
Re: Controlling action visibility via plugin.xml? [message #293650 is a reply to message #293578] |
Thu, 27 October 2005 10:38  |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
Douglas Pollock <douglas.pollock@magma.ca> wrote:
> Sunil Kamath wrote:
>> You should also try searching bugzilla first.
>> There is a preexisting bug about this.
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=106007
>> So the reason you aren't getting an answer is because some of what
>> you want can't currently be done properly.
>
> I don't believe this bug is related.
>
I think it is.
This is what he originally asked:
>>>
>>> But... we also want to publish our tool as a Feature. The problem is
>>> that
>>> we would like to suppress some of the popupmenu items that are
>>> contributed
>>> by org.eclipse.jdt* and org.eclipse.team.cvs.*. These cause popups with
>>> topics such as Run As, Debug As, Team etc.
>>> Does anyone have any idea how to "Hide" contributed Actions?
This is exactly what the bug asks.
--
Sunil
|
|
|
Powered by
FUDForum. Page generated in 1.07757 seconds