Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » QuickAccess contribution and activities
QuickAccess contribution and activities [message #911757] Wed, 12 September 2012 09:01
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
Presumably bug entry

https://bugs.eclipse.org/bugs/show_bug.cgi?id=362420

belongs to the most annoying things when you try to migrate to e4 from
an existing 3.x RCP application.

The bug entry also suggests a code pattern to get rid of the search
field but I would prefer an approach that does not depend on explicit e4
dependencies, because during migration I would like to easily switch
between a 3.x and a 4.x Eclipse runtime for easier testing the runtime
differences. I thought that activities could be a solution for this.

Now, usually, activities provide a good means to filter away unwanted
contributions. The usual idiom is to invent a special "exclusion
activity", lets do this via

<extension
point="org.eclipse.ui.activities">
<activity
id="forbiddenViewActivityId"
name="%activity.name">
</activity>
[...]
</extension>

and to list unwanted contributions like so:

<extension
point="org.eclipse.ui.activities">
<activity
id="forbiddenViewActivityId"
name="%activity.name">
</activity>
<activityPatternBinding
activityId="forbiddenViewActivityId"
pattern="org.eclipse.gef/org.eclipse.gef.ui.palette_view">
</activityPatternBinding>
<activityPatternBinding
activityId="forbiddenViewActivityId"
pattern="org.eclipse.ui.window.showKeyAssist">
</activityPatternBinding>
</extension>

I was trying to find a way to express a pattern that catches the quick
access search field "contribution" and after some code search I tried it
by adding

<activityPatternBinding
activityId="forbiddenViewActivityId"
pattern="org.eclipse.ui.window.quickAccess">
</activityPatternBinding>

but that won't help alone because this only would deactivate the handler
that is performed for the quick search (as I understand it) and it also
seems not be considered by activity filtering (because I can still
activate the handler).

I also tried this one:

<activityPatternBinding
activityId="forbiddenViewActivityId"
pattern="*org.eclipse.ui.internal.quickaccess.SearchField">
</activityPatternBinding>

and this had unexpectedly very fundamental effects, in fact I get an
application state that does not have the search field but all views are
empty as well, there are no contributions, menus, just an empty window.
I wonder why this effect is so extreme and whether there exists a better
activity filter to realize the wanted effect.

Thanks for any help & greetings from Bremen,

Daniel Krügler
Previous Topic:E4 Styling mechanism?
Next Topic:Expensive updates of ToolItems
Goto Forum:
  


Current Time: Wed Sep 03 02:30:40 GMT 2014

Powered by FUDForum. Page generated in 0.01540 seconds