Author: scabanovich
Date: 2007-11-15 09:55:25 -0500 (Thu, 15 Nov 2007)
New Revision: 4920
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
Log:
JBIDE-1311
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2007-11-15
14:55:04 UTC (rev 4919)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2007-11-15
14:55:25 UTC (rev 4920)
@@ -205,7 +205,7 @@
private List<String> getNameList() {
Set<String> names = new TreeSet<String>();
- names.addAll(SeamRuntimeManager.getInstance().getRuntimeNames());
+ names.addAll(getAvailableRuntimeNames());
if(hasSeamSupport()) {
String currentName = seamProject.getRuntimeName();
if(currentName != null) names.add(currentName);
@@ -363,11 +363,26 @@
SeamRuntimeManager.getInstance().addRuntime(added.get(0));
getFieldEditor().setValue(added.get(0).getName());
((ITaggedFieldEditor) ((CompositeEditor) runtime)
- .getEditors().get(1)).setTags(SeamRuntimeManager.getInstance().getRuntimeNames()
+ .getEditors().get(1)).setTags(getAvailableRuntimeNames()
.toArray(new String[0]));
runtime.setValue(added.get(0).getName());
}
}
}
+ private List<String> getAvailableRuntimeNames() {
+ if(hasNature("org.eclipse.jdt.core.javanature")
+ && !hasNature("org.eclipse.wst.common.project.facet.core.nature"))
{
+ return SeamRuntimeManager.getInstance().getAllRuntimeNames();
+ }
+ return SeamRuntimeManager.getInstance().getRuntimeNames();
+ }
+
+ private boolean hasNature(String natureId) {
+ try {
+ return project != null && project.isAccessible() &&
project.hasNature(natureId);
+ } catch (CoreException e) {
+ return false;
+ }
+ }
}
Show replies by date