[jbosstools-issues] [JBoss JIRA] (JBIDE-12783) Missing QuickFix context menu within Source pane of VPE for JSF project

Victor Rubezhny (JIRA) jira-events at lists.jboss.org
Fri Oct 12 16:35:03 EDT 2012


    [ https://issues.jboss.org/browse/JBIDE-12783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12726064#comment-12726064 ] 

Victor Rubezhny commented on JBIDE-12783:
-----------------------------------------

The problem is that the method MenuManager.handleAboutToShow() at the end of menu creation calls the MenuManager.update(boolean, boolean) method which merges the existing menu items with the latest menu model.

At this moment the menu is full of items (because it's a menu created from a previous step of the menu model creation). So, when an order of the menu model items differs from what we have in the menu (this occurs in MultiPageEditor-s like ours) the IContributionItem.fill(Menu parent, int index) method is used to put new actions from a model into the menu. In case of item is ActionContributionItem the method fill() has the following IF statement:

{code}
	public void fill(Menu parent, int index) {
		if (widget == null && parent != null) {
			<---- ActionContributionItem is to be added here ---->
		}
	}
{code}

So, because the widget member is not null (at the moment of the menu is about to show) the body of IF statement is never executed. For example, this happens with "Quick Assist" which is contributed by AbstractTextEditor by its ID (ITextEditorActionConstants.QUICK_ASSIST) as well as with other contributed actions.

In JSP/HTML Text Editors (StructuredTextEditor based, not MultiPage Editor) the count of existing menu items and their order is completely equals to the new menu contents, so ActionContributionItem.fill(Menu parent, int index) method is never invoked in this case (the menu items just aren't changed at this step), so the menu is shown with all the items.

It seems like a bug in ActionContributionItem.fill(...) methods. 

There is a similar (but not the same) issue in BugZilla (https://bugs.eclipse.org/bugs/show_bug.cgi?id=121529) on support bindings to existing widgets in ActionContributionItem.

                
> Missing QuickFix context menu within Source pane of VPE for JSF project
> -----------------------------------------------------------------------
>
>                 Key: JBIDE-12783
>                 URL: https://issues.jboss.org/browse/JBIDE-12783
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: jsp/jsf/xml source editing
>    Affects Versions: 4.0.0.Alpha2
>         Environment: Linux 64bit, Eclipse SDK 4.2.1, JBT 4.0.0.Alpha2-v20121002-1149-B19
>            Reporter: Vlado Pakan
>            Assignee: Victor Rubezhny
>            Priority: Critical
>             Fix For: 4.0.0.Beta1
>
>         Attachments: disabledquickfixmenuproblemsview.png, noquickfixmenuvpe.png
>
>
> 1. Create JSF project
> 2. Open inputUserName.jsp
> 3. Change EL "#{user.name}" to "#{user.sname}"
> 4. Warning marker is displayed on side of VPE and warning appeared in Problems view
> 5. Right click on changed EL
> ERROR: There is no QuickFix context menu
> !noquickfixmenuvpe.png!
> ERROR: QuickFix menu in Problems view is disabled
> !disabledquickfixmenuproblemsview.png!
> Workaround is to press Ctrl+1 in VPE editor
> It's probably introduced by new Eclipse SDK 4.2.1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list