Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
AW: [platform-ui-dev] Content sensitive object contributions

Hi!
 
I appreciate the work on content sensitive object contributions but I'd like to recommend a more generics solutions because there are more problems related to this. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=21652 for an example. IMHO it would be nice to have a extensible solution for 3.0.
 
In general the problem is that a resource type can not be identified by its same. Instead it is often necessary to look at its content (sometimes file header is enough). XML files are _the_ reference for this problem.
 
IMHO this porblem is related to the IDE part of the RCP and should be separated if possible. In my eyes we need some kind of IResourceClassifier that can be registered to resources. This can be a simple interface with only one method "boolean isQualifiedResource(IResource resource);" and registered to IResource objects with a specified type (file/folder) and name (regular expression match).
 
Example: 
   <extension
         point="org.eclipse.core.resources.resourceClassifier">
      <classifier
            resource_type="org.eclipse.core.resources.IFile"
            name_match=".*\.xml"
            class="my.sax.based.xml.content.classifiers.AntBuildFileClassifier">
      </classifier>
   </extension>

 
<extension point = "org.eclipse.ui.popupMenus">
  <objectContribution ....
    ...
    <visibility>
      <or>
        <objectState name="resourceClassifier" value="my.sax.based.xml.content.classifiers.AntBuildFileClassifier"/>
      </or>
    </visibility>
    ....
  </objectContribution>
</extension>
 
The AntBuildFileClassifier can be inherited from a generic abstract "SAXbasedXMLFileClassifier" that defines some abstract methods like "String needsFirstTag()" or "String needsDTD()".
 
Cu, Gunnar
 

	-----Ursprüngliche Nachricht----- 
	Von: Bob Foster [mailto:bob@xxxxxxxxxx] 
	Gesendet: Mi 10.12.2003 23:53 
	An: platform-ui-dev@xxxxxxxxxxx 
	Cc: 
	Betreff: Re: [platform-ui-dev] Content sensitive object contributions
	
	

	There is no such link on that page. It is at:
	
	http://www.eclipse.org/platform/index.html > UI > Development Resources
	 > Content Sensistive Object Contributions.
	
	or the easy-to-type full address
	
	http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-ui-home/object-aware-contributions/objCont.htm
	
	Bob
	
	
	
	Debbie Wilson wrote:
	
	>
	> Have you ever been fussed by the fact that 'Run Ant...' is one of the
	> actions available in the context menu of a plugin.xml file?  This no
	> longer needs to be the case.  There is new functionality in the UI which
	> will allow object contributions to be sensitive to the contents of an
	> xml file (currently only the root level tag and the dtd, if specified).
	>  If this intrigues you, check out the following link:
	>
	> http://www.eclipse.org/platform/index.html -> Content Sensitive Object
	> Contributions
	>
	>                                        Deb
	
	
	_______________________________________________
	platform-ui-dev mailing list
	platform-ui-dev@xxxxxxxxxxx
	http://dev.eclipse.org/mailman/listinfo/platform-ui-dev
	
	
	
	

<<winmail.dat>>


Back to the top