Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » commonFilter doesn't work for me(commonFilter doesn't work for me when exported plugins are used)
commonFilter doesn't work for me [message #716142] Tue, 16 August 2011 14:38 Go to next message
Michal S is currently offline Michal SFriend
Messages: 74
Registered: July 2011
Member
Hello,
I am preparing my Eclipse Application (using Xtext) and I need to solve following issue:
When I run Eclipse Application from Xtext Eclipse (Run -> Eclipse Application) filters are all available in my navigator and work perfect. On the other hand, when I export plugins and put them into standalone Eclipse Application, no filters are available. I have checked exported .jar files and plugin.xml is available there with good content (...looks to me good - see below).

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>

<plugin>

    <extension
            point="org.eclipse.ui.editors">
        <editor
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.editor.XtextEditor"
            contributorClass="org.eclipse.ui.editors.text.TextEditorActionContributor"
            default="true"
            extensions="tcf"
            id="org.myexample.tCF.TestCaseFramework"
            name="TestCaseFramework Editor">
        </editor>
    </extension>
    <extension
        point="org.eclipse.ui.handlers">
        <handler
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclarationHandler"
            commandId="org.eclipse.xtext.ui.editor.hyperlinking.OpenDeclaration">
            <activeWhen>
                <reference
                    definitionId="org.myexample.tCF.TestCaseFramework.Editor.opened">
                </reference>
            </activeWhen>
        </handler>
        <handler
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.editor.handler.ValidateActionHandler"
            commandId="org.myexample.tCF.TestCaseFramework.validate">
         <activeWhen>
            <reference
                    definitionId="org.myexample.tCF.TestCaseFramework.Editor.opened">
            </reference>
         </activeWhen>
      </handler>
    </extension>
    <extension point="org.eclipse.core.expressions.definitions">
        <definition id="org.myexample.tCF.TestCaseFramework.Editor.opened">
            <and>
                <reference definitionId="isActiveEditorAnInstanceOfXtextEditor"/>
                <with variable="activeEditor">
                    <test property="org.eclipse.xtext.ui.editor.XtextEditor.languageName" 
                        value="org.myexample.tCF.TestCaseFramework" 
                        forcePluginActivation="true"/>
                </with>        
            </and>
        </definition>
    </extension>
    <extension
            point="org.eclipse.ui.preferencePages">
        <page
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.editor.preferences.LanguageRootPreferencePage"
            id="org.myexample.tCF.TestCaseFramework"
            name="TestCaseFramework">
            <keywordReference id="org.myexample.tCF.ui.keyword_TestCaseFramework"/>
        </page>
        <page
            category="org.myexample.tCF.TestCaseFramework"
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.editor.syntaxcoloring.SyntaxColoringPreferencePage"
            id="org.myexample.tCF.TestCaseFramework.coloring"
            name="Syntax Coloring">
            <keywordReference id="org.myexample.tCF.ui.keyword_TestCaseFramework"/>
        </page>
        <page
            category="org.myexample.tCF.TestCaseFramework"
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.editor.templates.XtextTemplatePreferencePage"
            id="org.myexample.tCF.TestCaseFramework.templates"
            name="Templates">
            <keywordReference id="org.myexample.tCF.ui.keyword_TestCaseFramework"/>
        </page>
    </extension>
    <extension
        point="org.eclipse.ui.keywords">
        <keyword
            id="org.myexample.tCF.ui.keyword_TestCaseFramework"
            label="TestCaseFramework"/>
    </extension>
    <extension
         point="org.eclipse.ui.commands">
      <command
            description="Trigger expensive validation"
            id="org.myexample.tCF.TestCaseFramework.validate"
            name="Validate">
      </command>
    </extension>
    <extension point="org.eclipse.ui.menus">
        <menuContribution
            locationURI="popup:#TextEditorContext?after=group.edit">
             <command
                 commandId="org.myexample.tCF.TestCaseFramework.validate"
                 style="push"
                 tooltip="Trigger expensive validation">
            <visibleWhen checkEnabled="false">
                <reference
                    definitionId="org.myexample.tCF.TestCaseFramework.Editor.opened">
                </reference>
            </visibleWhen>
         </command>  
         </menuContribution>
    </extension>
    <extension point="org.eclipse.ui.menus">
		<menuContribution locationURI="popup:#TextEditorContext?endof=group.find">
			<command commandId="org.eclipse.xtext.ui.editor.FindReferences">
				<visibleWhen checkEnabled="false">
                	<reference definitionId="org.myexample.tCF.TestCaseFramework.Editor.opened">
                	</reference>
            	</visibleWhen>
			</command>
		</menuContribution>
	</extension>
	<extension point="org.eclipse.ui.handlers">
	    <handler
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.editor.findrefs.FindReferencesHandler"
            commandId="org.eclipse.xtext.ui.editor.FindReferences">
            <activeWhen>
                <reference
                    definitionId="org.myexample.tCF.TestCaseFramework.Editor.opened">
                </reference>
            </activeWhen>
        </handler>
    </extension>   

<!-- adding resource factories -->

	<extension
		point="org.eclipse.emf.ecore.extension_parser">
		<parser
			class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.resource.IResourceFactory"
			type="tcf">
		</parser>
	</extension>
	<extension point="org.eclipse.xtext.extension_resourceServiceProvider">
        <resourceServiceProvider
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.resource.IResourceUIServiceProvider"
            uriExtension="tcf">
        </resourceServiceProvider>
    </extension>



   <extension
         point="org.eclipse.xtext.builder.participant">
      <participant
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.builder.IXtextBuilderParticipant">
      </participant>
   </extension>

	<!-- Quick Outline -->
	<extension
		point="org.eclipse.ui.handlers">
		<handler 
			class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.editor.outline.quickoutline.ShowQuickOutlineActionHandler"
			commandId="org.eclipse.xtext.ui.editor.outline.QuickOutline">
			<activeWhen>
				<reference
					definitionId="org.myexample.tCF.TestCaseFramework.Editor.opened">
				</reference>
			</activeWhen>
		</handler>
	</extension>
	<extension
		point="org.eclipse.ui.commands">
		<command
			description="Open the quick outline."
			id="org.eclipse.xtext.ui.editor.outline.QuickOutline"
			name="Quick Outline">
		</command>
	</extension>
	<extension point="org.eclipse.ui.menus">
		<menuContribution
			locationURI="popup:#TextEditorContext?after=group.open">
			<command commandId="org.eclipse.xtext.ui.editor.outline.QuickOutline"
				style="push"
				tooltip="Open Quick Outline">
				<visibleWhen checkEnabled="false">
					<reference definitionId="org.myexample.tCF.TestCaseFramework.Editor.opened"/>
				</visibleWhen>
			</command>
		</menuContribution>
	</extension>
   <!-- quickfix marker resolution generator -->
   <extension
         point="org.eclipse.ui.ide.markerResolution">
      <markerResolutionGenerator
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.editor.quickfix.MarkerResolutionGenerator">
      </markerResolutionGenerator>
   </extension>

   <extension
         point="org.eclipse.ui.newWizards">
      <wizard
            category="org.myexample.tCF.ui.tcfCategory"
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.myexample.tCF.ui.wizard.TcfNewProject"
            icon="icons/tCFproject.gif"
            id="org.myexample.tCF.ui.wizard.TestCaseFrameworkNewProjectWizard"
            name="tCF Project"
            project="true">
      </wizard>
      <category
            id="org.myexample.tCF.ui.tcfCategory"
            name="tCF Project">
      </category>
   </extension>

   	<!-- Rename Refactoring -->
	<extension point="org.eclipse.ui.handlers">
		<handler 
			class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.refactoring.ui.RenameElementHandler"
			commandId="org.eclipse.xtext.ui.refactoring.RenameElement">
			<activeWhen>
				<reference
					definitionId="org.myexample.tCF.TestCaseFramework.Editor.opened">
				</reference>
			</activeWhen>
		</handler>
	</extension>
    <extension point="org.eclipse.ui.menus">
         <menuContribution
            locationURI="popup:#TextEditorContext?after=group.edit">
         <command commandId="org.eclipse.xtext.ui.refactoring.RenameElement"
               style="push">
            <visibleWhen checkEnabled="false">
               <reference
                     definitionId="org.myexample.tCF.TestCaseFramework.Editor.opened">
               </reference>
            </visibleWhen>
         </command>
      </menuContribution>
   </extension>

  <extension point="org.eclipse.compare.contentViewers">
    <viewer id="org.myexample.tCF.TestCaseFramework.compare.contentViewers"
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.compare.InjectableViewerCreator"
            extensions="tcf">
    </viewer>
  </extension>
  <extension point="org.eclipse.compare.contentMergeViewers">
    <viewer id="org.myexample.tCF.TestCaseFramework.compare.contentMergeViewers"
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.compare.InjectableViewerCreator"
            extensions="tcf" label="TestCaseFramework Compare">
     </viewer>
  </extension>
  <extension point="org.eclipse.ui.editors.documentProviders">
    <provider id="org.myexample.tCF.TestCaseFramework.editors.documentProviders"
            class="org.myexample.tCF.ui.TestCaseFrameworkExecutableExtensionFactory:org.eclipse.xtext.ui.editor.model.XtextDocumentProvider"
            extensions="tcf">
    </provider>
  </extension>
  <extension
        id="org.myexample.tCF.ui.TcfNavigationBar"
        point="org.eclipse.ui.views">
     <view
           class="org.myexample.tCF.ui.TcfNavigator"
           icon="icons/tCFproject.gif"
           id="org.myexample.tCF.ui.navigator"
           name="tCF Navigator">
     </view>
  </extension>
  <extension
        id="org.myexample.tCF.navigator.viewer"
        point="org.eclipse.ui.navigator.viewer">
     <viewerActionBinding
           viewerId="org.myexample.tCF.ui.navigator">
        <includes>
           <actionExtension
                 pattern="org.eclipse.ui.navigator.resources.*">
           </actionExtension>
           <contentExtension
                 pattern="org.myexample.tCF.ui.contentExtension2">
           </contentExtension>
        </includes>
     </viewerActionBinding>
     <viewerContentBinding
           viewerId="org.myexample.tCF.ui.navigator">
        <includes>
           <contentExtension
                 pattern="org.eclipse.ui.navigator.resourceContent">
           </contentExtension>
           <contentExtension
                 pattern="org.eclipse.ui.navigator.resources.filters.*">
           </contentExtension>
           <contentExtension
                 pattern="org.eclipse.ui.navigator.resources.linkHelper">
           </contentExtension>
           <contentExtension
                 pattern="org.eclipse.ui.navigator.resources.workingSets">
           </contentExtension>
           <contentExtension
                 pattern="org.eclipse.ui.ide.resourceFilters">
           </contentExtension>
           <contentExtension
                 pattern="org.myexample.tCF.ui.filters.commonFilter1">
           </contentExtension>
        </includes>
     </viewerContentBinding>
  </extension>
  <extension
        point="org.eclipse.ui.perspectives">
     <perspective
           class="org.myexample.tCF.ui.TcfPerspective"
           fixed="false"
           icon="icons/tCFproject.gif"
           id="org.myexample.tCF.ui.tcfPerspective"
           name="tCF Perspective">
     </perspective>
  </extension>
  <extension
        id="org.myexample.tCF.navigator.navigatorContent"
        point="org.eclipse.ui.navigator.navigatorContent">
     <commonFilter
           activeByDefault="true"
           description="Hides all unnecessary files and folders in tCF Navigator"
           id="org.myexample.tCF.ui.filters.commonFilter1"
           name="tCF filter">
        <filterExpression>
           <or>
              <adapt
                    type="org.eclipse.core.resources.IFile">
                 <test
                       forcePluginActivation="true"
                       property="org.eclipse.core.resources.name"
                       value="*.properties">
                 </test>
              </adapt>
              <adapt
                    type="org.eclipse.core.resources.IFile">
                 <test
                       forcePluginActivation="true"
                       property="org.eclipse.core.resources.name"
                       value="*.MF">
                 </test>
              </adapt>
              <adapt
                    type="org.eclipse.core.resources.IFolder">
                 <test
                       forcePluginActivation="true"
                       property="org.eclipse.core.resources.name"
                       value="META-INF">
                 </test>
              </adapt>
              <adapt
                    type="org.eclipse.core.resources.IFolder">
                 <test
                       forcePluginActivation="true"
                       property="org.eclipse.core.resources.name"
                       value="src-gen">
                 </test>
              </adapt>
              <adapt
                    type="org.eclipse.core.resources.IFolder">
                 <test
                       forcePluginActivation="true"
                       property="org.eclipse.core.resources.name"
                       value="bin">
                 </test>
              </adapt>
           </or></filterExpression>
     </commonFilter>
  </extension>

</plugin>


And I have also second issue to solve: I need to filter folders with specific name, which are also empty. How can I create this rule in Extension manager?

Thank you,
Michal
Re: commonFilter doesn't work for me [message #717248 is a reply to message #716142] Fri, 19 August 2011 17:37 Go to previous messageGo to next message
Francis Upton IV is currently offline Francis Upton IVFriend
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
Do the filters appear in the UI (when you go to the view menu in your CNF view)? One thing you an do is turn on the CNF logging (see the documentation on the CNF in the Platform Plugin manual), that should tell you more about what's going on.

Re: commonFilter doesn't work for me [message #717258 is a reply to message #717248] Fri, 19 August 2011 18:16 Go to previous messageGo to next message
Michal S is currently offline Michal SFriend
Messages: 74
Registered: July 2011
Member
Hello Francis,
I have just tested my exported plugins home on linux (developed on Win XP) and filters work perfect. I don't understand this. I will try to log the problem at work on win machine on Monday.

Regards,
Michal
(no subject) [message #717259 is a reply to message #717248] Fri, 19 August 2011 18:16 Go to previous messageGo to next message
Michal is currently offline MichalFriend
Messages: 5
Registered: July 2009
Junior Member
Hello Francis,
I have just tested my exported plugins home on linux (developed on Win XP) and filters work perfect. I don't understand this. I will try to log the problem at work on win machine on Monday.

Regards,
Michal
Re: commonFilter doesn't work for me [message #717738 is a reply to message #717258] Mon, 22 August 2011 08:31 Go to previous message
Michal S is currently offline Michal SFriend
Messages: 74
Registered: July 2011
Member
I reinstalled Eclipse and copied my plugins there and now it works on Win XP also. I don't understand why (as I always just replaced my .jar plugins in plugins folder and never copied there anything else), but it works.
Does Eclipse keeps some information from deleted plugins?
Regards,
Michal
Previous Topic:[Common Navigator] Problem markers are not shown
Next Topic:New out of memory errors during PDE build?
Goto Forum:
  


Current Time: Mon Dec 22 16:22:54 GMT 2014

Powered by FUDForum. Page generated in 0.02124 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software