Skip to content

Commit

Permalink
fixes ECLIPSE-1074
Browse files Browse the repository at this point in the history
  • Loading branch information
lhein committed Apr 10, 2014
1 parent b952a89 commit c5aaa23
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
10 changes: 9 additions & 1 deletion plugins/org.fusesource.ide.project/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
forcePluginActivation="true"
property="org.fusesource.ide.project.CamelNatureTester.camelNatureEnabled">
</test>
<test
forcePluginActivation="true"
property="org.fusesource.ide.project.CamelNatureTester.projectOpen">
</test>
</iterate>
</with>
</visibleWhen>
Expand All @@ -131,6 +135,10 @@
forcePluginActivation="true"
property="org.fusesource.ide.project.CamelNatureTester.camelNatureDisabled">
</test>
<test
forcePluginActivation="true"
property="org.fusesource.ide.project.CamelNatureTester.projectOpen">
</test>
</iterate>
</with>
</visibleWhen>
Expand Down Expand Up @@ -165,7 +173,7 @@
class="org.fusesource.ide.project.CamelNatureTester"
id="org.fusesource.ide.project.CamelNatureTester"
namespace="org.fusesource.ide.project.CamelNatureTester"
properties="camelNatureEnabled,camelNatureDisabled"
properties="camelNatureEnabled,camelNatureDisabled,projectOpen"
type="org.eclipse.core.resources.IProject">
</propertyTester>
</extension>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,27 @@ public boolean test(Object receiver, String property, Object[] args,
return enabled == true;
} else if (property.equals("camelNatureDisabled")) {
return enabled == false;
} else if (property.equals("projectOpen")) {
return project.isOpen() == true;
}
}
return false;
}

private boolean isCamelNatureDefined(IProject project) {
try {
IProjectDescription description = project.getDescription();
String[] natures = description.getNatureIds();
if (project.isOpen()) {
try {
IProjectDescription description = project.getDescription();
String[] natures = description.getNatureIds();

for (int i = 0; i < natures.length; ++i) {
if (RiderProjectNature.NATURE_ID.equals(natures[i])) {
return true;
for (int i = 0; i < natures.length; ++i) {
if (RiderProjectNature.NATURE_ID.equals(natures[i])) {
return true;
}
}
} catch (CoreException e) {
RiderLogFacade.getLog(Activator.getDefault().getLog()).error(e);
}
} catch (CoreException e) {
RiderLogFacade.getLog(Activator.getDefault().getLog()).error(e);
}
return false;
}
Expand Down

0 comments on commit c5aaa23

Please sign in to comment.