Bug 197617 - Improve validate action enablement rules
Summary: Improve validate action enablement rules
Status: NEW
Alias: None
Product: WTP Common Tools
Classification: WebTools
Component: wst.validation (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows Vista
: P3 major with 5 votes (vote)
Target Milestone: Future   Edit
Assignee: wst.validation CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords: usability
: 235717 312408 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-07-24 05:41 EDT by Bouchet Stéphane CLA
Modified: 2013-01-25 07:47 EST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bouchet Stéphane CLA 2007-07-24 05:41:17 EDT
Build ID: I20070625-1500

Steps To Reproduce:
1. create a new XMI file (for example this one from getting started guide : 
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
      name="library "nsURI="http:///library.ecore" nsPrefix="library">
    <eClassifiers xsi:type="ecore:EClass" name="Book">
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="title"
          eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="pages"
          eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
    </eClassifiers>
</ecore:EPackage>

2. right click on editor
3. there is two validate actions in the menu 


More information:
Using Eclipse 3.3, I have also WTP 2.0 plugins installed.

Disabling all validation for projet colors in gray the second validation entry in the menu. ( in Window -> Preferences -> Validation, "Suspend all validators"
Comment 1 Christian Damus CLA 2007-07-24 10:19:54 EDT
This isn't related to the EMF Validation Framework, but rather is a consequence of EMF's editor generation capability (which generated the Ecore editor) using the same "Validate" menu action label as the WST Validation Framework uses.
Comment 2 Ed Merks CLA 2007-07-24 17:33:44 EDT
What does the validate action from WTP do for a .ecore file?  Does it make sense that it should appear for .ecore files and even in the popup for our editors?  I'd prefer these actions not apply to any of EMF's resources...
Comment 3 Bouchet Stéphane CLA 2007-07-25 04:02:53 EDT
I totally agree with that. 
Comment 4 Ed Merks CLA 2007-07-25 07:02:01 EDT
I guess I should reassign the owner to make sure someone notices...
Comment 5 Carl Anderson CLA 2007-07-26 14:57:24 EDT
Hari- can we filter our popup menu so it doesn't appear on these resources?  If this is not trivial, feel free to retarget to 3.0.
Comment 6 Chuck Bridgham CLA 2007-09-05 09:30:41 EDT
Moving to 3.0
Comment 7 Gary Karasiuk CLA 2008-04-29 17:01:39 EDT
Does this problem still exists in 30? I couldn't reproduce it, but maybe I didn't use the right file extension.
Comment 8 Valentin Baciu CLA 2009-08-14 22:22:30 EDT
WTP 3.2 M1. I tried opening an XMI file with the Sample Reflective Ecore Model Editor and I cannot see the duplicate action. However the VF validate action is in the context menu.

The Validate action is contributed like this:

   <extension
         point="org.eclipse.ui.popupMenus">
      <objectContribution
            adaptable="true"
            objectClass="org.eclipse.core.resources.IResource"
            id="ValidationMenuAction">
         <action
             label="%VBF_UI_POPUP_RUNVALIDATION"
             class="org.eclipse.wst.validation.internal.ui.ValidationMenuAction"
             menubarPath="additions"
             enablesFor="+"
             id="ValidationAction">
         </action>
      </objectContribution>      
   </extension>

If I read this right, it means it will show up for every IResource, regardless of whether or not a validator is registered to validate this resource.

We could think about moving this action to the new command/handler framework and using the more powerful enablement rules to get the enablement right. We'd have to watch for early/unwanted validation framework activation and for how expensive the enablement computation is.
Comment 9 Valentin Baciu CLA 2009-08-17 17:56:44 EDT
*** Bug 235717 has been marked as a duplicate of this bug. ***
Comment 10 Valentin Baciu CLA 2009-08-17 18:00:31 EDT
I have found another Bug 235717 that requests similar better enablement/visibility rules for the Validate menu action. I have marked it as a duplicate, changed the summary on this bug and converted it into an enhancement. See comment #8.
Comment 11 Valentin Baciu CLA 2010-05-11 10:09:02 EDT
*** Bug 312408 has been marked as a duplicate of this bug. ***
Comment 12 Valentin Baciu CLA 2010-05-25 13:02:01 EDT
*** Bug 312408 has been marked as a duplicate of this bug. ***
Comment 13 Valentin Baciu CLA 2010-05-31 10:35:16 EDT
*** Bug 312408 has been marked as a duplicate of this bug. ***
Comment 14 Valentin Baciu CLA 2010-07-16 10:55:56 EDT
*** Bug 319945 has been marked as a duplicate of this bug. ***
Comment 15 Ed Willink CLA 2010-07-16 11:26:12 EDT
Given the number of people duplicating this and the clearly bad functionality being inflicted on other projects, this cannot be an enhancement. Please change to at least normal if not major.

I'm sure you can fix it with custom enablement code.
Comment 16 Bouchet Stéphane CLA 2012-09-06 05:30:14 EDT
Hi,

This is still present in 4.2. 

Any improvements about this ?
Comment 17 Thomas Ritter CLA 2013-01-25 07:41:42 EST
Hi,

I am backing Ed's comment. We are in a situation in which we can't get rid of the WST dependencies and because of that on all our editors the "validate" menu item appears which does absolutely nothing in our context and is confusing for the user.

In my opinion this is a bug which should be fixed asap.
Comment 18 Ed Willink CLA 2013-01-25 07:47:50 EST
(In reply to comment #15)
> Please change to at least normal if not major.

Changing to major since nobody else has.