| Summary: | [ActivityMgmt] View shortcut is displayed in the Show View's sub-menu if the activity was disabled | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Hiroyuki <hiroyuki.inaba> | ||||
| Component: | UI | Assignee: | Paul Webster <pwebster> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | albert.choi, remy.suen, steffen.pingel | ||||
| Version: | 3.4.1 | ||||||
| Target Milestone: | 3.5 M7 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows Vista | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Hiroyuki
Created attachment 123068 [details]
screenshot.png
I investigated.
On org.eclipse.ui.workbench, org.eclipse.ui.activities.WorkbenchTriggerPointAdvisor,
Line 84: public Set allow(ITriggerPoint triggerPoint, IIdentifier identifier) {
Line 93: if (activity.getExpression() != null) {
activity.getExpression() always returns null.
activity org.eclipse.ui.internal.activities.Activity (id=194)
activityListeners null
activityPatternBindings java.util.Collections$UnmodifiableSet<E> (id=199)
activityPatternBindingsAsArray org.eclipse.ui.activities.IActivityPatternBinding[1] (id=205)
activityRequirementBindings java.util.Collections$UnmodifiableSet<E> (id=208)
activityRequirementBindingsAsArray org.eclipse.ui.activities.IActivityRequirementBinding[0] (id=209)
defaultEnabled false
defined true
description "Ant for test" (id=212)
enabled false
> expression null
hashCode 552537032 [0x20ef0bc8]
id "my.activity.ui.activity" (id=191)
name "Ant for test" (id=6644)
string "[[],[[my.activity.ui.activity,false,org\\.eclipse\\.ant\\.ui/.*]],true,false,my.activity.ui.activity,Ant for test]" (id=198)
allow( ) returned Collections.EMPTY_SET, and the sub-menu "Ant" were displayed.
Pretty sure this isn't a UA problem... On M20080911-1700, I can see the behaviour depicted by attachment 123068 [details]. On I20090217-2200, I see it both in the submenu and in the 'Show View' dialog.
(In reply to comment #4) > On I20090217-2200, I see it both in the submenu and in the 'Show View' dialog. I think it is failing here because the activity is enabled. There also seems to be another activity that Ant is contributing. Paul, you can reproduce the problem with the following XML snippet instead that filters out the 'Outline' view. <extension point="org.eclipse.ui.activities"> <activity id="forbiddenViewActivityId" name="Forbidden"/> <activityPatternBinding activityId="forbiddenViewActivityId" pattern="org.eclipse.ui.views/org.eclipse.ui.views.ContentOutline"/> </extension> Removing the null check for activity.getExpression() in line 93 of WorkbenchTriggerPointAdvisor as hinted at by Hiroyuki in comment 2 seems to work although I don't know if that's what's right since I'm not familiar with activities. This appears to be a bug I introduced switching to commands instead of ShowViewActions (which were IPluginContributions) We don't filter CommandContributionItems the same way. PW Released to HEAD >20090427 PW In I20090428-0100 PW *** Bug 279102 has been marked as a duplicate of this bug. *** |