Skip to content

Commit

Permalink
Merge pull request #88 from lhein/7.2.x
Browse files Browse the repository at this point in the history
fixes for ECLIPSE-1073 and ECLIPSE-1074
  • Loading branch information
lhein committed Apr 10, 2014
2 parents 3632738 + c5aaa23 commit 4125a69
Show file tree
Hide file tree
Showing 3 changed files with 22 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
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public boolean visit(IResourceDelta delta) {
// camel virtual folder too
try {
if (resource != null
&& resource instanceof IFile
&& ((IFile) resource).getContentDescription() != null
&& ((IFile) resource)
.getContentDescription()
Expand Down

0 comments on commit 4125a69

Please sign in to comment.