Modifying org.eclipse.ui.ide.prefs [message #1773061] |
Thu, 21 September 2017 00:39 |
Bradley Small Messages: 8 Registered: September 2017 |
Junior Member |
|
|
Hello, I am trying to do something that I assume Eclipse does not want me to do.
I am currently working in C/C++ and am using the "Problem View" to process errors and warnings in a large project. As I have started to use the filters I wanted to add in each possible gcc warning as a "NOT-CONTAINS" text filter. Rather than use the UI interface, nice as it may be to enter these one at a time, I wanted to use a known editor and regex tools to get them to the place I wanted them.
I found that they were being kept in an xml document within org.eclipse.ui.ide.prefs. However, as carefully as I crafted the text, modeled after a UI generated example, when I put them in, Eclipse no longer recognized them, or any other things added. I assume that somewhere is a check value to tells Eclipse that this file is corrupt.
I am not yet ready to begin writing Eclipse plugins, but still I would like to be able to make this modification to the prefs file.
Any ideas.. or is this the wrong forum? If it matters, I am using Mars, Neon and Oxygen depending on the machine I have access to at the time.
Thanks,
-- Abs
|
|
|
|
|
|
|
|
Re: Modifying org.eclipse.ui.ide.prefs [message #1773611 is a reply to message #1773496] |
Sat, 30 September 2017 04:55 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
If I do the following in an Oxygen installation, Navigate -> Open Setup -> User, click on the main toolbar button with hover "Capture Preferences", type org.eclipse.ui.internal.views.markers.CachedMarkerBuilderorg.eclipse.ui.views.ProblemView in the filter box, it will show the one preference for that. This contains the big XML blob. I can double click that entry in the dialog, to move it to the Selected Preferences side. In the Setup Editor for the User, it will select that preference task that was just added, which I can double click to show it in the properties view. In the Properties view, for the Value property, I can select it to activate the cell editor, and use the ... button to the far right to bring up the multi-lined editor for that value, which looks like this:<?xml version="1.0" encoding="UTF-8"?>
<filterGroups andFilters="false" markerLimit="100" markerLimitEnabled="true">
<filterGroup IMemento.internal.id="Errors/Warnings on Project" enabled="false" filterLimit="-1" scope="3" workingSet="Aggregate for window 1499318382968">
<fieldFilter IMemento.internal.id="org.eclipse.ui.ide.severityAndDescriptionField" containsModifier="CONTAINS" containsText="" selectedSeverities="6"/>
<fieldFilter IMemento.internal.id="org.eclipse.ui.ide.markerType"/>
</filterGroup>
<filterGroup IMemento.internal.id="Errors/Warnings on Selection" enabled="false" filterLimit="-1" scope="2" workingSet="Aggregate for window 1499318382968">
<fieldFilter IMemento.internal.id="org.eclipse.ui.ide.severityAndDescriptionField" containsModifier="CONTAINS" containsText="" selectedSeverities="6"/>
<fieldFilter IMemento.internal.id="org.eclipse.ui.ide.markerType"/>
</filterGroup>
<filterGroup IMemento.internal.id="Warnings on Selection" enabled="false" filterLimit="-1" scope="2" workingSet="Aggregate for window 1499318382968">
<fieldFilter IMemento.internal.id="org.eclipse.ui.ide.severityAndDescriptionField" containsModifier="CONTAINS" containsText="" selectedSeverities="2"/>
<fieldFilter IMemento.internal.id="org.eclipse.ui.ide.markerType"/>
</filterGroup>
<filterGroup IMemento.internal.id="All Errors on Workspace" enabled="false" filterLimit="-1" scope="0" workingSet="Aggregate for window 1499318382968">
<fieldFilter IMemento.internal.id="org.eclipse.ui.ide.severityAndDescriptionField" containsModifier="CONTAINS" containsText="" selectedSeverities="4"/>
<fieldFilter IMemento.internal.id="org.eclipse.ui.ide.markerType"/>
</filterGroup>
<filterGroup IMemento.internal.id="USER1506745803182" enabled="true" filterLimit="0" name="My Configuration" scope="0" workingSet="Aggregate for window 1499318382968">
<fieldFilter IMemento.internal.id="org.eclipse.ui.ide.severityAndDescriptionField" containsModifier="CONTAINS" containsText="foobar" selectedSeverities="7"/>
<fieldFilter IMemento.internal.id="org.eclipse.ui.ide.markerType"/>
</filterGroup>
</filterGroups> Showing the "My Configuration" that I added with the containsText="foobar" that I added for it. So here I can edit the XML and save in my User setup so that it's applied on startup to every workspace.
Of course it might be the case that the IDE reads this preference before Oomph's preference task modifies it...
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
|
Re: Modifying org.eclipse.ui.ide.prefs [message #1773725 is a reply to message #1773690] |
Tue, 03 October 2017 16:45 |
Bradley Small Messages: 8 Registered: September 2017 |
Junior Member |
|
|
Currently, this screen is broken in Oxygen anyway. The 2 radio buttons at the top are either removed or obscured and as it is , it is unusable because of the default behavior.
In working on a large code base doing code cleanup and such, I can compile several modules and see the output in the problems window. There are certain warnings, for instance, that we will either not fix, or not be interested in fixing in some particular phase. As I come to these I would want to turn them off and look at the other 30,000 warnings. So with GCC, I figured I could turn them off via the warning value in []. Back in neon where it wasn't broken yet, I was able to do this with a few that I added through the interface. And I was able to turn them off one at a time, additively as I went. This was kind of useful. So I thought that if I went through the compiler's documentation and got all the different warnings I could do it in an editor that was much more useful with text processing than the onesie-twosie UI available.
That is what started this whole thing. So it sounds like I could do this the way you are describing, then create a new workspace. Then I would have to move all my projects into that new workspace, recreate my old workspace again, and then move all my projects back into it. Does that sound accurate?
|
|
|
Powered by
FUDForum. Page generated in 0.10040 seconds