Skip to content

Commit

Permalink
Add project configuration menu contribution
Browse files Browse the repository at this point in the history
That's the place where all project conversion and configuration
contributions of different plugins should appear.

While that's basically a duplication of the sub menus in the Checkstyle
command, it's the place where Eclipse developers might look first when
trying to enable/disable checkstyle for a project.
  • Loading branch information
Bananeweizen authored and Calixte committed Sep 11, 2023
1 parent e8df55b commit 1f02f11
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 6 deletions.
4 changes: 3 additions & 1 deletion net.sf.eclipsecs.ui/OSGI-INF/l10n/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,6 @@ commands.category.name = Checkstyle
actionSet.label = Checkstyle
extension-point.quickfix-provider.name = Checkstyle Quickfix provider
extension-point.filter-editor.name = Checkstyle filter editors
extension-point.config-types-ui.name = Checkstyle configuration type editors
extension-point.config-types-ui.name = Checkstyle configuration type editors
addnature.label = Add Checkstyle Nature
removenature.label = Remove Checkstyle Nature
55 changes: 50 additions & 5 deletions net.sf.eclipsecs.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
filter="FilesFromPackage"/>
</extension>

<!-- Configuration type editors -->
<extension
<!-- Configuration type editors -->
<extension
point="net.sf.eclipsecs.ui.configtypesui">
<configtypeui
configtypename="builtin"
Expand All @@ -54,7 +54,7 @@
configtypename="project"
editorclass="net.sf.eclipsecs.ui.config.configtypes.ProjectConfigurationEditor"
icon="icons/configtype_project.gif"/>
</extension>
</extension>

<extension
point="org.eclipse.ui.startup">
Expand Down Expand Up @@ -128,8 +128,8 @@
</extension>

<!--
Provide marker resolutions
-->
Provide marker resolutions
-->
<extension
point="org.eclipse.ui.ide.markerResolution">
<markerResolutionGenerator
Expand Down Expand Up @@ -464,6 +464,51 @@
menubarPath="Checkstyle.menu/ondemand"
tooltip="%CheckSelectedFilesAction.tooltip"/>
</objectContribution>

<objectContribution adaptable="true"
id="checkstyle.addNature"
objectClass="org.eclipse.core.resources.IProject">
<action class="net.sf.eclipsecs.ui.actions.ActivateProjectsAction"
enablesFor="+"
icon="icons/checkstyle_command.png"
id="checkstyle.addNature.action"
label="%addnature.label"
menubarPath="org.eclipse.ui.projectConfigure/additions"
style="push">
</action>
<visibility>
<and>
<objectState name="open" value="true"/>
<objectState name="projectNature"
value="org.eclipse.jdt.core.javanature">
</objectState>
<not>
<objectState name="projectNature"
value="net.sf.eclipsecs.core.CheckstyleNature">
</objectState>
</not>
</and>
</visibility>
</objectContribution>
<objectContribution adaptable="true"
id="checkstyle.removeNature"
objectClass="org.eclipse.core.resources.IProject">
<action class="net.sf.eclipsecs.ui.actions.DeactivateProjectsAction"
enablesFor="1"
id="checkstyle.removeNature.action"
label="%removenature.label"
menubarPath="org.eclipse.ui.projectConfigure/additions"
style="push">
</action>
<visibility>
<and>
<objectState name="open" value="true"/>
<objectState name="projectNature"
value="net.sf.eclipsecs.core.CheckstyleNature">
</objectState>
</and>
</visibility>
</objectContribution>
</extension>

<extension
Expand Down

0 comments on commit 1f02f11

Please sign in to comment.