Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Unable to set hierarchical project presentation by default
Unable to set hierarchical project presentation by default [message #1787602] Tue, 29 May 2018 21:19 Go to next message
Nick Forrette is currently offline Nick ForretteFriend
Messages: 1
Registered: May 2018
Junior Member
I'm trying to get Project Explorer > Projects Presentation > Hierarchical set by default (as opposed to Flat) in a custom Eclipse RCP application.

We've had great luck using plugin_customization.ini for most preferences, but org.eclipse.ui.navigator.ProjectExplorer.activatedExtensions and org.eclipse.ui.navigator.ProjectExplorer.filterActivation have been causing grief.

- I start our product with new / clean workspace, exit, then create a copy of the whole .metadata structure.


- I start our product, set Projects Presentation to Hierarchical via the Project Explorer menu, then exit.


- I "diff -r" the new and copied .metadata directories. That pointed me to org.eclipse.ui.navigator.prefs, where I found org.eclipse.ui.navigator.ProjectExplorer.activatedExtensions and org.eclipse.ui.navigator.ProjectExplorer.filterActivation.


- I added the following to our plugin_customization.ini file:

org.eclipse.ui.navigator/org.eclipse.ui.navigator.ProjectExplorer.activatedExtensions=org.eclipse.cdt.make.ui.makeTargets.content\=true;org.eclipse.ui.navigator.resourceContent\=true;org.eclipse.cdt.ui.navigator.content\=true;org.eclipse.egit.ui.changeSetContent\=false;org.eclipse.ui.navigator.resources.workingSets\=true;org.eclipse.team.ui.patchSyncNavigatorContent\=true;org.eclipse.team.ui.resourceContent\=true;org.eclipse.egit.ui.RepositoriesViewContent\=true;org.eclipse.ui.navigator.resources.nested.nestedProjectContentProvider\=true;org.eclipse.jdt.java.ui.javaContent\=true;org.eclipse.jdt.ui.javaModelContent\=true;org.eclipse.remote.ui.navigatorContent.connections\=true;
org.eclipse.ui.navigator/org.eclipse.ui.navigator.ProjectExplorer.filterActivation=\:org.eclipse.jdt.java.ui.filters.HidePackageDeclaration\:org.eclipse.jdt.java.ui.filters.HideOutputFolder\:org.eclipse.cdt.ui.navigator.filters.AnonymousStructFilter\:org.eclipse.ui.navigator.resources.nested.HideTopLevelProjectIfNested\:org.eclipse.cdt.ui.navigator.filters.ForwardDeclarationFilter\:org.eclipse.jdt.java.ui.filters.HideEmptyInnerPackages\:org.eclipse.jdt.java.ui.filters.HideInnerClassFiles\:org.eclipse.ui.navigator.resources.filters.startsWithDot\:org.eclipse.jdt.java.ui.filters.HideEmptyLibraryContainers\:org.eclipse.jdt.java.ui.filters.HideImportDeclaration\:org.eclipse.jdt.java.ui.filters.HideSyntheticMembers\:org.eclipse.ui.navigator.resources.nested.HideFolderWhenProjectIsShownAsNested\:


- I rebuilt our product, ran it with a new workspace, but Projects Presentation is still Flat.

- If I manually copy org.eclipse.ui.navigator.prefs in to the workspace and restart, then I see Projects Presentation set to Hierarchical.


I isn't clear to me why those prefs aren't customizable like the other preferences we've customized. Would appreciate any assistance.
Re: Unable to set hierarchical project presentation by default [message #1807137 is a reply to message #1787602] Thu, 23 May 2019 12:22 Go to previous messageGo to next message
Julien Dehaudt is currently offline Julien DehaudtFriend
Messages: 8
Registered: March 2016
Junior Member
Hi Nick,

I'm facing the same issue today with a product based on Eclipse 2019-03, did you found a solution past year to solve this issue?

Thanks by advance.
Re: Unable to set hierarchical project presentation by default [message #1826363 is a reply to message #1807137] Fri, 24 April 2020 05:57 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi Nick and Julien,

could you solve the issue?

I was running into the same behaviour as I want to hide resources starting with a dot.
Re: Unable to set hierarchical project presentation by default [message #1826385 is a reply to message #1826363] Fri, 24 April 2020 08:55 Go to previous messageGo to next message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi,

i would not call it solutions but workaround.

Modifying the jar files of the navigator:
https://stackoverflow.com/questions/6137848/eclipse-how-to-hide-custom-files-in-project-explorer

or defining your own extensions

plugin.xml
<extension
      point="org.eclipse.ui.navigator.viewer">
   <viewerContentBinding
         viewerId="org.eclipse.ui.navigator.ProjectExplorer">
      <includes>
         <contentExtension
               pattern="de.company.rcp.navigator.resources.filters.*">
         </contentExtension>
      </includes>
   </viewerContentBinding>
</extension>

<extension
      point="org.eclipse.ui.navigator.navigatorContent">
   <commonFilter
         activeByDefault="true"
         id="de.company.rcp.navigator.resources.filters.startsWithDot"
         name="hide resources starting with ."
         visibleInUI="true">
      <filterExpression>
         <and>
            <adapt
                  type="org.eclipse.core.resources.IResource">
               <test
                     property="org.eclipse.core.resources.name"
                     value="'.*'">
               </test>
            </adapt>
         </and>
      </filterExpression>
   </commonFilter>
</extension>

The contentBinding is required as otherwise the commonFilter definition wont be used. Make sure the pattern of the contentBinding and id of the commonFilter match.
Re: Unable to set hierarchical project presentation by default [message #1826391 is a reply to message #1826385] Fri, 24 April 2020 09:32 Go to previous messageGo to next message
Julien Dehaudt is currently offline Julien DehaudtFriend
Messages: 1
Registered: April 2020
Junior Member
Hi Martin,

This has been fixed in my company by a kind of workaround too. AFAIR something done at first startup. I don't remember how but clearly not clean enough to be proudly shared...

Since this time, the platform evolved a bit and thanks to Mickael Istria the associated defect is now fixed. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=491185

Feel free to give it a try and post an update here and/or on the bugzilla ticket.
Re: Unable to set hierarchical project presentation by default [message #1826583 is a reply to message #1826391] Mon, 27 April 2020 13:47 Go to previous message
Martin Jacob is currently offline Martin JacobFriend
Messages: 191
Registered: July 2009
Senior Member
Hi Julien,

thanks to point me to the bug. As far as I understood the fix is only regarding flat/hierarchical project layout but not other settings as filters.

I was searching a bit more through the bugs and found https://bugs.eclipse.org/bugs/show_bug.cgi?id=558022 which should already (re)enable the filters by default.

The cause of my issue was an target 2019-03 as of December 06th (https://download.eclipse.org/releases/2019-12/201912061000/), the target as of December 18th (https://download.eclipse.org/releases/2019-12/201912181000/) includes the fix.

Thanks again for your hint.
Martin

[Updated on: Mon, 27 April 2020 13:49]

Report message to a moderator

Previous Topic:Blurred menu icons on Linux [HiDPI ]
Next Topic:Theming: reduce space between parts
Goto Forum:
  


Current Time: Fri Mar 29 01:23:09 GMT 2024

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

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

Back to the top