Code Inspection for Bug 218101

I checked out the validator and validator.ui packages and played around with them in the pass two weeks...

I have discovered how manual validator works.  The validator item in popup menu(context menu) is set up in the plugin configuration.  ValidateMenuAction class is used as menu action class.  ValidateMenuAction calls ManualValidationRunner to start the validation and progress monitoring.  

But I couldn't figured what controls the visibility of "Validate".  The configuration is straight forward but it doesn't control the visibility of the menu item.

<!-- By saying "adaptable=true", this item will appear on both IProject and IJavaProject -->
   <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>

The comment says it only appears on IProject and IJavaProject.   Yes.  It does only appear in editor that the file is in a project.   I need to find out how Eclipse handles a non-project source file.  Isn't it part of IResource?  If so, which part of the code controls the visibility of the menu item?  If not, what is the non-project source file part of?  Also, most of the classes are refering IProject in one way or the other.  Does this imply that the validator only works with project?  I think I'll drop a thread about this on the Eclipse forum later this week.

Comments

 Allen, I am sorry, you could

 Allen,

I am sorry, you could not attend the IBM presentation. I am sure you could find answers to your questions?
I will try to post on our course page the video with this lecture.

Jordan

haha... Each time I

haha... Each time I investigate my bug, it becomes more complicated.

The Bug Report & The Newsgroup


Hi, Allen.

I have posted my questions to the Bug Report as well as the wetbools newsgroup.
It was very helpful. The sooner you post your questions, the better.
Keep blogging...

Peter.


Post new comment

The content of this field is kept private and will not be shown publicly.