JBoss Tools SVN: r16600 - trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/META-INF.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-07-16 13:09:14 -0400 (Thu, 16 Jul 2009)
New Revision: 16600
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/META-INF/MANIFEST.MF
Log:
JBIDE-4623: Manifest Format Errors in text.ext.test test projects
The following line in the manifest file causes this exception:
Bundle-RequiredExecutionEnvironment: J2SE-1.5
After the line was removed the test began to be executed without errors.
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/META-INF/MANIFEST.MF 2009-07-16 16:54:15 UTC (rev 16599)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/META-INF/MANIFEST.MF 2009-07-16 17:09:14 UTC (rev 16600)
@@ -1,4 +1,3 @@
Manifest-Version: 1.0
Class-Path:
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
16 years, 9 months
JBoss Tools SVN: r16599 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-07-16 12:54:15 -0400 (Thu, 16 Jul 2009)
New Revision: 16599
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1826
Custom taglibs JsfCore and JsfHtmlBasic migrated
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java 2009-07-16 16:53:49 UTC (rev 16598)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java 2009-07-16 16:54:15 UTC (rev 16599)
@@ -53,6 +53,7 @@
import org.jboss.tools.jst.web.kb.KbQuery.Type;
import org.jboss.tools.jst.web.kb.taglib.IAttribute;
import org.jboss.tools.jst.web.kb.taglib.IComponent;
+import org.jboss.tools.jst.web.kb.taglib.ICustomTagLibComponent;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
@@ -100,8 +101,8 @@
DocumentTypeAdapter adapter = ownerDocument == null ? null : (DocumentTypeAdapter) ((INodeNotifier) ownerDocument).getAdapterFor(DocumentTypeAdapter.class);
if (adapter != null)
fCaseSensitive = adapter.getTagNameCase() == DocumentTypeAdapter.STRICT_CASE;
+ offset = ((IDOMElement)fNode).getStartOffset() + ("" + fNode.getNodeType()).length();
}
- offset = ((IDOMElement)fNode).getStartOffset() + ("" + fNode.getNodeType()).length();
JspContentAssistProcessor processor = valueHelper.isFacetets() ? new FaceletPageContectAssistProcessor() : new JspContentAssistProcessor();
processor.createContext(getTextViewer(), offset);
pageContext = processor.getContext();
@@ -175,12 +176,9 @@
List<String> namesLow = new ArrayList<String>();
IPropertyDescriptor descriptor;
- IComponent[] components = PageProcessor.getInstance().getComponents(kbQuery, pageContext);
+ Map<String, IAttribute> as = getAttributes();
- if(components != null && components.length != 0) {
- for (IComponent component: components) {
- IAttribute[] list = component.getAttributes();
- for (IAttribute d: list) {
+ for (IAttribute d: as.values()) {
descriptor = null;
String attrName = d.getName();
if (fCaseSensitive) {
@@ -193,6 +191,7 @@
|| attrName.equals("class")) {
descriptor = createJSPPropertyDescriptor(d, attrName, false);
} else {
+ System.out.println(attrName);
descriptor = createTextPropertyDescriptor(attrName, CATEGORY_ATTRIBUTES, 0);
}
if (descriptor != null) {
@@ -201,8 +200,6 @@
descriptorList.add(descriptor);
}
}
- }
- }
/*
TagDescriptor td = valueHelper.getTagDescriptor("/" + fNode.getNodeName());
if(td != null) {
@@ -261,7 +258,7 @@
if (attrDecl != null) {
descriptor = createPropertyDescriptor(attrDecl);
if(descriptor instanceof TextPropertyDescriptor) {
- IAttribute a = findAttribute(components, attrName);
+ IAttribute a = as.get(attrName);
if(valueHelper.isAvailable(getQuery(attr)) && a != null) {
descriptor = createJSPPropertyDescriptor(a, attr.getName(), false);
// descriptor = createJSPPropertyDescriptor(getQuery(attr), attr.getName(), false);
@@ -273,7 +270,7 @@
}
}
else {
- IAttribute a = findAttribute(components, attrName);
+ IAttribute a = as.get(attrName);
if(valueHelper.isAvailable(getQuery(attr)) && a != null) {
descriptor = createJSPPropertyDescriptor(a, attr.getName(), false);
// descriptor = createJSPPropertyDescriptor(getQuery(attr), attr.getName(), false);
@@ -302,7 +299,7 @@
}
IPropertyDescriptor holdDescriptor = createPropertyDescriptor(attrDecl);
if(holdDescriptor instanceof TextPropertyDescriptor) {
- IAttribute a = findAttribute(components, attrDecl.getAttrName());
+ IAttribute a = as.get(attrDecl.getAttrName());
if(valueHelper.isAvailable(query) && a != null) {
holdDescriptor = createJSPPropertyDescriptor(a, attrDecl.getAttrName(), false);
// holdDescriptor = createJSPPropertyDescriptor(query, attrDecl.getAttrName(), false);
@@ -324,7 +321,7 @@
KbQuery kbQuery = new KbQuery();
String[] parentTags = processor.getParentTags(false);
-// parentTags = add(parentTags, nodeName);
+ parentTags = add(parentTags, fNode.getNodeName());
kbQuery.setPrefix(getPrefix());
kbQuery.setUri(processor.getUri(getPrefix()));
kbQuery.setParentTags(parentTags);
@@ -338,6 +335,12 @@
return kbQuery;
}
+ private String[] add(String[] result, String v) {
+ String[] result1 = new String[result.length + 1];
+ System.arraycopy(result, 0, result1, 0, result.length);
+ result1[result.length] = v;
+ return result1;
+ }
private String getPrefix() {
int i = fNode.getNodeName().indexOf(':');
return i < 0 ? null : fNode.getNodeName().substring(0, i);
@@ -438,18 +441,10 @@
return changed;
}
- private IAttribute findAttribute(IComponent[] components, String attrName) {
- for (IComponent component: components) {
- IAttribute a = component.getAttribute(attrName);
- if(a != null) return a;
- }
- return null;
- }
-
protected void updatePropertyDescriptors() {
if (fDescriptors == null || fDescriptors.length == 0) return;
- IComponent[] components = PageProcessor.getInstance().getComponents(kbQuery, pageContext);
+ Map<String, IAttribute> as = getAttributes();
// List of all names encountered in the tag and defined by the element
@@ -492,7 +487,7 @@
else if (validValues != null && validValues.length > 0) {
fDescriptors[j] = createPropertyDescriptor(attrDecl);
if(fDescriptors[j] instanceof TextPropertyDescriptor) {
- IAttribute a = findAttribute(components, attrName);
+ IAttribute a = as.get(attrName);
if(valueHelper.isAvailable(query) && a != null) {
fDescriptors[j] = createJSPPropertyDescriptor(a, attrDecl.getAttrName(), false);
// fDescriptors[j] = createJSPPropertyDescriptor(query, attrDecl.getAttrName(), false);
@@ -542,7 +537,7 @@
if (!descriptorNames.contains(attrName)) {
IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl);
if(descriptor instanceof TextPropertyDescriptor) {
- IAttribute a = findAttribute(components, attrName);
+ IAttribute a = as.get(attrName);
if(valueHelper.isAvailable(query) && a != null) {
descriptor = createJSPPropertyDescriptor(a, attrDecl.getAttrName(), false);
// descriptor = createJSPPropertyDescriptor(query, attrDecl.getAttrName(), false);
@@ -562,7 +557,7 @@
descriptorNamesLow.add(attrName.toLowerCase());
IPropertyDescriptor descriptor = createPropertyDescriptor(attrDecl);
if(descriptor instanceof TextPropertyDescriptor) {
- IAttribute a = findAttribute(components, attrName);
+ IAttribute a = as.get(attrName);
if(valueHelper.isAvailable(query) && a != null) {
descriptor = createJSPPropertyDescriptor(a, attrDecl.getAttrName(), false);
// descriptor = createJSPPropertyDescriptor(query, attrDecl.getAttrName(), false);
@@ -578,20 +573,17 @@
}
}
- if(components != null && components.length != 0) {
for (int i = 0; i < fDescriptors.length; i++) {
if (fDescriptors[i] != null) {
String descriptorName = fDescriptors[i].getId().toString();
- if (components[0].getAttribute(descriptorName) != null && !descriptorNames.contains(descriptorName)) {
+ if (as.get(descriptorName) != null && !descriptorNames.contains(descriptorName)) {
descriptorNames.add(descriptorName);
descriptorNamesLow.add(descriptorName.toLowerCase());
descriptors.add(fDescriptors[i]);
}
}
}
- for (IComponent component: components) {
- IAttribute[] list = component.getAttributes();
- for (IAttribute d: list) {
+ for (IAttribute d: as.values()) {
String attrName = d.getName();
if (fCaseSensitive) {
if (descriptorNames.contains(attrName)) continue;
@@ -609,8 +601,6 @@
}
descriptors.add(descriptor);
}
- }
- }
/*
TagDescriptor td = valueHelper.getTagDescriptor("/" + fNode.getNodeName());
if(td != null) {
@@ -738,16 +728,30 @@
}
boolean isRequiredAttribute(String attributeName) {
- IComponent[] components = PageProcessor.getInstance().getComponents(kbQuery, pageContext);
- IAttribute d = findAttribute(components, attributeName);
+ Map<String, IAttribute> as = getAttributes();
+ IAttribute d = as.get(attributeName);
// String query = getQuery(attributeName);
// AttributeDescriptor d = valueHelper.getAttributeDescriptor(query);
if(d == null) return false; // do not remove unknown attribute? Remove it!
return d.isRequired();
}
+ private Map<String, IAttribute> getAttributes() {
+ IComponent[] components = PageProcessor.getInstance().getComponents(kbQuery, pageContext, true);
+ Map<String, IAttribute> map = new HashMap<String, IAttribute>();
+ for (IComponent component: components) {
+ IAttribute[] as = component.getAttributes();
+ for (IAttribute a: as) {
+ String n = a.getName();
+ if(map.containsKey(n) && !(component instanceof ICustomTagLibComponent)) {
+ continue;
+ }
+ map.put(n, a);
+ }
+ }
+ return map;
+ }
-
//////// XMLPropertyDescriptor
public boolean isAdapterForType(Object type) {
16 years, 9 months
JBoss Tools SVN: r16597 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-07-16 12:29:46 -0400 (Thu, 16 Jul 2009)
New Revision: 16597
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-770- Fixed the problem with background color in Note sections.</p>
</body></html>
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml 2009-07-16 16:03:04 UTC (rev 16596)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml 2009-07-16 16:29:46 UTC (rev 16597)
@@ -255,9 +255,8 @@
<listitem>
<para>Create an environment variable called JAVA_HOME that points to the JDK installation
directory, for example:
- <literallayout>
- <emphasis>C:\Program Files\Java\jdk1.5.0_11\</emphasis>
- </literallayout></para>
+ <emphasis>C:\Program Files\Java\jdk1.5.0_11\</emphasis>
+ </para>
</listitem>
</itemizedlist>
16 years, 9 months
JBoss Tools SVN: r16596 - in trunk/as/plugins: org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-07-16 12:03:04 -0400 (Thu, 16 Jul 2009)
New Revision: 16596
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/JBTProjectModuleDelegate.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualFolder.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ModuleAssemblyRootPage.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IChildModuleProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/J2EEDependenciesPage.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualComponent.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/IDependencyPageProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependenciesPropertyPage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependencyPageProvider.java
Log:
JBIDE-4320 - Further development on the property page...
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IChildModuleProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IChildModuleProvider.java 2009-07-16 16:00:38 UTC (rev 16595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IChildModuleProvider.java 2009-07-16 16:03:04 UTC (rev 16596)
@@ -1,23 +0,0 @@
-package org.jboss.ide.eclipse.as.wtp.override.core.modules;
-
-import org.eclipse.wst.server.core.IModule;
-
-
-public interface IChildModuleProvider {
- /**
- * Returns the modules contained within this module. The returned modules
- * can be either modulecore projects or representations of binary jars
- *
- * @return a possibly empty array of modules contained within this application
- */
- public IModule[] getModules();
-
- /**
- * Returns the URI of the given module within this enterprise application.
- *
- * @param module a module within this application
- * @return the URI of the given module, or <code>null</code> if the URI could
- * not be found
- */
- public String getURI(IModule module);
-}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/JBTProjectModuleDelegate.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/JBTProjectModuleDelegate.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/JBTProjectModuleDelegate.java 2009-07-16 16:03:04 UTC (rev 16596)
@@ -0,0 +1,62 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.modules;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.model.IModuleResource;
+import org.eclipse.wst.server.core.util.ModuleFile;
+import org.eclipse.wst.server.core.util.ModuleFolder;
+import org.eclipse.wst.server.core.util.ProjectModule;
+
+public class JBTProjectModuleDelegate extends ProjectModule {
+ public JBTProjectModuleDelegate() {
+ super();
+ }
+ public JBTProjectModuleDelegate(IProject project) {
+ super(project);
+ }
+
+ @Override
+ public IModule[] getChildModules() {
+ return null;
+ }
+
+ public IModuleResource[] members() throws CoreException {
+ IProject project = getProject();
+ final IVirtualComponent c = ComponentCore.createComponent(project);
+ IVirtualFolder vf = c.getRootFolder();
+ IModuleResource[] children = getResources(vf);
+ return children;
+ }
+
+ protected IModuleResource[] getResources(IVirtualFolder parent) {
+ ArrayList<IModuleResource> members = new ArrayList<IModuleResource>();
+ IVirtualResource[] resources = new IVirtualResource[]{};
+ try {
+ resources = parent.members();
+ } catch( CoreException ce ) {}
+ for( int i = 0; i < resources.length; i++ ) {
+ if( resources[i].getType() == IVirtualResource.FILE) {
+ IFile f = (IFile)resources[i].getUnderlyingResource();
+ ModuleFile mf = new ModuleFile(f, f.getName(), resources[i].getRuntimePath().removeLastSegments(1));
+ members.add(mf);
+ } else if( resources[i].getType() == IVirtualResource.FOLDER){
+ IFolder folder = (IFolder)resources[i].getUnderlyingResource();
+ ModuleFolder mf = new ModuleFolder(folder, folder.getName(), resources[i].getRuntimePath().removeLastSegments(1));
+ IModuleResource[] children = getResources((IVirtualFolder)resources[i]);
+ mf.setMembers(children);
+ members.add(mf);
+ }
+ }
+ return (IModuleResource[]) members
+ .toArray(new IModuleResource[members.size()]);
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualComponent.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualComponent.java 2009-07-16 16:00:38 UTC (rev 16595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualComponent.java 2009-07-16 16:03:04 UTC (rev 16596)
@@ -23,6 +23,7 @@
import org.eclipse.wst.common.componentcore.internal.resources.VirtualFolder;
import org.eclipse.wst.common.componentcore.internal.util.IComponentImplFactory;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
@@ -52,7 +53,7 @@
}
public IVirtualFolder createFolder(IProject aProject, IPath aRuntimePath) {
- return new VirtualFolder(aProject, aRuntimePath);
+ return new JBTVirtualFolder(aProject, aRuntimePath, this);
}
@@ -62,12 +63,11 @@
*/
public IVirtualReference[] getReferences() {
-
IVirtualReference[] cached = getCachedReferences();
if (cached != null)
return cached;
List<IVirtualReference> hardReferences = getHardReferences(this);
- if( shouldExposeLooseReferences()) {
+ if( exposesLooseReferences()) {
List dynamicReferences = getLooseArchiveReferences(this, hardReferences);
if (dynamicReferences != null) {
hardReferences.addAll(dynamicReferences);
@@ -77,10 +77,14 @@
return cachedReferences;
}
- protected boolean shouldExposeLooseReferences() {
+ protected boolean exposesLooseReferences() {
return false;
}
+ protected boolean isDynamicComponent(IVirtualFile file) {
+ return false;
+ }
+
// Returns cache if still valid or null
public IVirtualReference[] getCachedReferences() {
if (cachedReferences != null && checkIfStillValid())
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualFolder.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualFolder.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualFolder.java 2009-07-16 16:03:04 UTC (rev 16596)
@@ -0,0 +1,62 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualFolder;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
+import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
+
+public class JBTVirtualFolder extends VirtualFolder {
+ private JBTVirtualComponent component;
+ public JBTVirtualFolder(IProject aComponentProject,
+ IPath aRuntimePath, JBTVirtualComponent component) {
+ super(aComponentProject, aRuntimePath);
+ this.component = component;
+ }
+
+ public IVirtualResource[] superMembers() throws CoreException {
+ return superMembers(IResource.NONE);
+ }
+
+ public IVirtualResource[] superMembers(int memberFlags) throws CoreException {
+ return super.members(memberFlags);
+ }
+
+ public boolean isDynamicComponent(IVirtualFile vFile){
+ return component.isDynamicComponent(vFile);
+ }
+
+ /**
+ * For now, just rip out files with .jar, .rar, or .war file extensions, because these are
+ * the only files automatically added dyamically
+ */
+ public IVirtualResource[] members(int memberFlags) throws CoreException {
+ // If this component doesn't expose loose refs, just give normal answer
+ if( !component.exposesLooseReferences() ) {
+ return superMembers(memberFlags);
+ }
+
+ IVirtualResource[] members = superMembers(memberFlags);
+ List virtualResources = new ArrayList();
+ boolean shouldAdd = true;
+ for (int i = 0; i < members.length; i++) {
+ shouldAdd = true;
+ if (IVirtualResource.FILE == members[i].getType()) {
+ if(isDynamicComponent((IVirtualFile)members[i])){
+ shouldAdd = false;
+ }
+ }
+ if (shouldAdd) {
+ virtualResources.add(members[i]);
+ }
+ }
+ return (IVirtualResource[]) virtualResources
+ .toArray(new IVirtualResource[virtualResources.size()]);
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/plugin.xml 2009-07-16 16:00:38 UTC (rev 16595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/plugin.xml 2009-07-16 16:03:04 UTC (rev 16596)
@@ -10,7 +10,7 @@
adaptable="true"
objectClass="org.eclipse.core.resources.IProject"
name="Module Dependencies (JBT)"
- class="org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.J2EEDependenciesPage"
+ class="org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.ModuleAssemblyRootPage"
id="org.jboss.ide.eclipse.as.wtp.override.ui.J2EEDependenciesPage">
<enabledWhen>
<and>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java 2009-07-16 16:00:38 UTC (rev 16595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/AddModuleDependenciesPropertiesPage.java 2009-07-16 16:03:04 UTC (rev 16596)
@@ -103,7 +103,7 @@
protected final String PATH_SEPARATOR = ComponentDependencyContentProvider.PATH_SEPARATOR;
private boolean hasInitialized = false;
protected final IProject project;
- protected final J2EEDependenciesPage propPage;
+ protected final ModuleAssemblyRootPage propPage;
protected IVirtualComponent rootComponent = null;
protected Text componentNameText;
protected Label availableModules;
@@ -126,7 +126,7 @@
* Constructor for AddModulestoEARPropertiesControl.
*/
public AddModuleDependenciesPropertiesPage(final IProject project,
- final J2EEDependenciesPage page) {
+ final ModuleAssemblyRootPage page) {
this.project = project;
this.propPage = page;
rootComponent = ComponentCore.createComponent(project);
@@ -143,7 +143,7 @@
layout.marginWidth = 0;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- J2EEDependenciesPage.createDescriptionComposite(composite,
+ ModuleAssemblyRootPage.createDescriptionComposite(composite,
ManifestUIResourceHandler.EAR_Modules_Desc);
createListGroup(composite);
refresh();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/IDependencyPageProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/IDependencyPageProvider.java 2009-07-16 16:00:38 UTC (rev 16595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/IDependencyPageProvider.java 2009-07-16 16:03:04 UTC (rev 16596)
@@ -5,6 +5,6 @@
public interface IDependencyPageProvider {
public boolean canHandle(IFacetedProject project);
- public IModuleDependenciesControl[] createPages(IFacetedProject project, J2EEDependenciesPage parent);
+ public IModuleDependenciesControl[] createPages(IFacetedProject project, ModuleAssemblyRootPage parent);
public Composite createRootControl(IModuleDependenciesControl[] pages, Composite parent);
}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/J2EEDependenciesPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/J2EEDependenciesPage.java 2009-07-16 16:00:38 UTC (rev 16595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/J2EEDependenciesPage.java 2009-07-16 16:03:04 UTC (rev 16596)
@@ -1,258 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation as prop page heirarchy
- * rfrost(a)bea.com - conversion to single property page impl
- *******************************************************************************/
-
-package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.jboss.ide.eclipse.as.wtp.override.ui.Messages;
-import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.impl.EarModuleDependenciesPropertyPage;
-
-
-/*
- * The only change in this file between here and upstream is
- * the method createEARContent
- *
- * We'd obviously prefer to remove the extension of the superclass here
- * but elements in the web ui demand we be a part of that tree for right now
- * Also we'd switch to depending on IModuleDependenciesControl (local)
- */
-
-/**
- * Primary project property page for J2EE dependencies; content is dynamically
- * generated based on the project facets and will be comprised by a
- * set of IJ2EEDependenciesControl implementations.
- *
- */
-public class J2EEDependenciesPage extends PropertyPage {
-
- public String DESCRIPTION = Messages.J2EEDependenciesPage_Description;
-
- private IProject project;
- private IModuleDependenciesControl[] controls = new IModuleDependenciesControl[0];
-
- public J2EEDependenciesPage() {
- super();
- }
-
- private Composite getFacetErrorComposite(final Composite parent) {
- final String errorCheckingFacet = Messages.J2EEDependenciesPage_ErrorCheckingFacets;
- setErrorMessage(errorCheckingFacet);
- setValid(false);
- return getErrorComposite(parent, errorCheckingFacet);
- }
-
- private Composite getErrorComposite(final Composite parent, final String error) {
- final Composite composite = new Composite(parent, SWT.NONE);
- final GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- final Label label= new Label(composite, SWT.NONE);
- label.setText(error);
- return composite;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.IPreferencePage#performOk()
- */
- public boolean performOk() {
- for (int i = 0; i < controls.length; i++) {
- if (controls[i] != null) {
- if (!controls[i].performOk()) {
- return false;
- }
- }
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
- */
- public void performDefaults() {
- for (int i = 0; i < controls.length; i++) {
- if (controls[i] != null) {
- controls[i].performDefaults();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.preference.IPreferencePage#performCancel()
- */
- public boolean performCancel() {
- for (int i = 0; i < controls.length; i++) {
- if (controls[i] != null) {
- if (!controls[i].performCancel()) {
- return false;
- }
- }
- }
- return super.performCancel();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#setVisible(boolean)
- */
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- for (int i = 0; i < controls.length; i++) {
- if (controls[i] != null) {
- controls[i].setVisible(visible);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#dispose()
- */
- public void dispose() {
- super.dispose();
- for (int i = 0; i < controls.length; i++) {
- if(controls[i] != null){
- controls[i].dispose();
- }
- }
- }
-
- protected static void createDescriptionComposite(final Composite parent, final String description) {
- Composite descriptionComp = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- descriptionComp.setLayout(layout);
- descriptionComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- fillDescription(descriptionComp, description);
- }
-
- private static void fillDescription(Composite c, String s) {
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.widthHint = 250;
- Text text = new Text(c, SWT.READ_ONLY | SWT.WRAP);
- text.setLayoutData(data);
- text.setText(s);
- }
-
- protected Control createContents(Composite parent) {
-
- // Need to find out what type of project we are handling
- project = (IProject) getElement().getAdapter(IResource.class);
- if( project != null ) {
- try {
- IFacetedProject facetedProject = ProjectFacetsManager.create(project);
- IDependencyPageProvider provider = null;
- if( facetedProject == null )
- return getFacetErrorComposite(parent);
-
- provider = DependencyPageExtensionManager.getManager().getProvider(facetedProject);
- if( provider != null ) {
- controls = provider.createPages(facetedProject, this);
- return provider.createRootControl(controls, parent);
- }
- AddModuleDependenciesPropertiesPage page = new AddModuleDependenciesPropertiesPage(project, this);
- controls = new IModuleDependenciesControl[1];
- controls[0] = page;
- return page.createContents(parent);
- } catch( CoreException ce ) {
- }
- }
- return getFacetErrorComposite(parent);
- }
-
- /*
- * This can maybe be replaced with an extension point in the future
- * This is the area that needs to be extended.
- */
- protected Control createContents2(Composite parent, IFacetedProject facetedProject) {
-// boolean isEAR = facetedProject.hasProjectFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_EAR_MODULE));
-// boolean isWEB = facetedProject.hasProjectFacet(ProjectFacetsManager.getProjectFacet(IModuleConstants.JST_WEB_MODULE));
-// if (isEAR) {
-// return createEARContent(parent);
-// } else if (isWEB) {
-// return createWebContent(parent);
-// }
- return null;
- }
-
-
- /*
- * This method is different from upstream
- */
- private Composite createEARContent(final Composite parent) {
- //AddModuleDependenciesPropertiesPage page = new AddModuleDependenciesPropertiesPage(project, this);
- EarModuleDependenciesPropertyPage page = new EarModuleDependenciesPropertyPage(project, this);
- controls = new IModuleDependenciesControl[1];
- controls[0] = page;
- return page.createContents(parent);
- }
-
-// private Composite createWebContent(final Composite parent) {
-// final boolean standalone = J2EEProjectUtilities.isStandaloneProject(project);
-//
-// if (standalone) {
-// // only need to create the Web Libraries page
-// controls = new IJ2EEDependenciesControl[1];
-// controls[0] = new WebLibDependencyPropertiesPage(project, this);
-// return controls[0].createContents(parent);
-// } else {
-// // Create a tabbed folder with both "J2EE Modules" and "Web Libraries"
-// final TabFolder folder = new TabFolder(parent, SWT.LEFT);
-// folder.setLayoutData(new GridData(GridData.FILL_BOTH));
-// folder.setFont(parent.getFont());
-//
-// // Create the two tabs
-// controls = new IJ2EEDependenciesControl[2];
-//
-// controls[0] = new JARDependencyPropertiesPage(project, this);
-// TabItem tab = new TabItem(folder, SWT.NONE);
-// tab.setControl(controls[0].createContents(folder));
-// tab.setText(ManifestUIResourceHandler.J2EE_Modules);
-// controls[1] = new WebLibDependencyPropertiesPage(project, this);
-// tab = new TabItem(folder, SWT.NONE);
-// tab.setControl(controls[1].createContents(folder));
-// tab.setText(ManifestUIResourceHandler.Web_Libraries);
-//
-// folder.setSelection(0);
-// return folder;
-// }
-// }
-//
-// private Composite createNonEARContent(final Composite parent) {
-// controls = new IJ2EEDependenciesControl[1];
-// final boolean standalone = J2EEProjectUtilities.isStandaloneProject(project);
-// if (standalone) {
-// // if not referenced by an EAR, check if referenced by a dynamic web project
-// if (J2EEProjectUtilities.getReferencingWebProjects(project).length > 0) {
-// controls[0] = new WebRefDependencyPropertiesPage(project, this);
-// } else {
-// return getUnreferencedErrorComposite(parent);
-// }
-// } else {
-// controls[0] = new JARDependencyPropertiesPage(project, this);
-// }
-//
-// return controls[0].createContents(parent);
-// }
-//
-}
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ModuleAssemblyRootPage.java (from rev 16376, trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/J2EEDependenciesPage.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ModuleAssemblyRootPage.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ModuleAssemblyRootPage.java 2009-07-16 16:03:04 UTC (rev 16596)
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial implementation as prop page heirarchy
+ * rfrost(a)bea.com - conversion to single property page impl
+ *******************************************************************************/
+
+package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.PropertyPage;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.ide.eclipse.as.wtp.override.ui.Messages;
+import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.impl.EarModuleDependenciesPropertyPage;
+
+
+/*
+ * The only change in this file between here and upstream is
+ * the method createEARContent
+ *
+ * We'd obviously prefer to remove the extension of the superclass here
+ * but elements in the web ui demand we be a part of that tree for right now
+ * Also we'd switch to depending on IModuleDependenciesControl (local)
+ */
+
+/**
+ * Primary project property page for J2EE dependencies; content is dynamically
+ * generated based on the project facets and will be comprised by a
+ * set of IJ2EEDependenciesControl implementations.
+ *
+ */
+public class ModuleAssemblyRootPage extends PropertyPage {
+
+ public String DESCRIPTION = Messages.J2EEDependenciesPage_Description;
+
+ private IProject project;
+ private IModuleDependenciesControl[] controls = new IModuleDependenciesControl[0];
+
+ public ModuleAssemblyRootPage() {
+ super();
+ }
+
+ private Composite getFacetErrorComposite(final Composite parent) {
+ final String errorCheckingFacet = Messages.J2EEDependenciesPage_ErrorCheckingFacets;
+ setErrorMessage(errorCheckingFacet);
+ setValid(false);
+ return getErrorComposite(parent, errorCheckingFacet);
+ }
+
+ private Composite getErrorComposite(final Composite parent, final String error) {
+ final Composite composite = new Composite(parent, SWT.NONE);
+ final GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ layout.marginWidth = 0;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ final Label label= new Label(composite, SWT.NONE);
+ label.setText(error);
+ return composite;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferencePage#performOk()
+ */
+ public boolean performOk() {
+ for (int i = 0; i < controls.length; i++) {
+ if (controls[i] != null) {
+ if (!controls[i].performOk()) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#performDefaults()
+ */
+ public void performDefaults() {
+ for (int i = 0; i < controls.length; i++) {
+ if (controls[i] != null) {
+ controls[i].performDefaults();
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.IPreferencePage#performCancel()
+ */
+ public boolean performCancel() {
+ for (int i = 0; i < controls.length; i++) {
+ if (controls[i] != null) {
+ if (!controls[i].performCancel()) {
+ return false;
+ }
+ }
+ }
+ return super.performCancel();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#setVisible(boolean)
+ */
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ for (int i = 0; i < controls.length; i++) {
+ if (controls[i] != null) {
+ controls[i].setVisible(visible);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.IDialogPage#dispose()
+ */
+ public void dispose() {
+ super.dispose();
+ for (int i = 0; i < controls.length; i++) {
+ if(controls[i] != null){
+ controls[i].dispose();
+ }
+ }
+ }
+
+ protected static void createDescriptionComposite(final Composite parent, final String description) {
+ Composite descriptionComp = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ descriptionComp.setLayout(layout);
+ descriptionComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ fillDescription(descriptionComp, description);
+ }
+
+ private static void fillDescription(Composite c, String s) {
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ data.widthHint = 250;
+ Text text = new Text(c, SWT.READ_ONLY | SWT.WRAP);
+ text.setLayoutData(data);
+ text.setText(s);
+ }
+
+ protected Control createContents(Composite parent) {
+
+ // Need to find out what type of project we are handling
+ project = (IProject) getElement().getAdapter(IResource.class);
+ if( project != null ) {
+ try {
+ IFacetedProject facetedProject = ProjectFacetsManager.create(project);
+ IDependencyPageProvider provider = null;
+ if( facetedProject == null )
+ return getFacetErrorComposite(parent);
+
+ provider = DependencyPageExtensionManager.getManager().getProvider(facetedProject);
+ if( provider != null ) {
+ controls = provider.createPages(facetedProject, this);
+ return provider.createRootControl(controls, parent);
+ }
+ AddModuleDependenciesPropertiesPage page = new AddModuleDependenciesPropertiesPage(project, this);
+ controls = new IModuleDependenciesControl[1];
+ controls[0] = page;
+ return page.createContents(parent);
+ } catch( CoreException ce ) {
+ }
+ }
+ return getFacetErrorComposite(parent);
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependenciesPropertyPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependenciesPropertyPage.java 2009-07-16 16:00:38 UTC (rev 16595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependenciesPropertyPage.java 2009-07-16 16:03:04 UTC (rev 16596)
@@ -41,7 +41,7 @@
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.AddModuleDependenciesPropertiesPage;
-import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.J2EEDependenciesPage;
+import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.ModuleAssemblyRootPage;
public class EarModuleDependenciesPropertyPage extends
AddModuleDependenciesPropertiesPage {
@@ -50,7 +50,7 @@
protected String oldLibDir;
protected boolean isVersion5;
public EarModuleDependenciesPropertyPage(IProject project,
- J2EEDependenciesPage page) {
+ ModuleAssemblyRootPage page) {
super(project, page);
initMemberVariables();
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependencyPageProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependencyPageProvider.java 2009-07-16 16:00:38 UTC (rev 16595)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/impl/EarModuleDependencyPageProvider.java 2009-07-16 16:03:04 UTC (rev 16596)
@@ -5,7 +5,7 @@
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.IDependencyPageProvider;
import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.IModuleDependenciesControl;
-import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.J2EEDependenciesPage;
+import org.jboss.ide.eclipse.as.wtp.override.ui.propertypage.ModuleAssemblyRootPage;
public class EarModuleDependencyPageProvider implements IDependencyPageProvider {
@@ -15,7 +15,7 @@
}
public IModuleDependenciesControl[] createPages(IFacetedProject project,
- J2EEDependenciesPage parent) {
+ ModuleAssemblyRootPage parent) {
return new IModuleDependenciesControl[] {
new EarModuleDependenciesPropertyPage(project.getProject(), parent)
};
16 years, 9 months
JBoss Tools SVN: r16595 - in trunk/jsf/plugins: org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-07-16 12:00:38 -0400 (Thu, 16 Jul 2009)
New Revision: 16595
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesJSPBundleHyperlinkPartitioner.java
trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPBundleHyperlinkPartitioner.java
Log:
JBIDE-4559: OpenOn doesn't work for resource EL on xhtml page if it was declared using <a4j:loadBundle />
The namespaces are used to get the XXX:loadBundle tags prefixes for xhtml-documents.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPBundleHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPBundleHyperlinkPartitioner.java 2009-07-16 11:45:36 UTC (rev 16594)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext/src/org/jboss/tools/jsf/text/ext/hyperlink/JsfJSPBundleHyperlinkPartitioner.java 2009-07-16 16:00:38 UTC (rev 16595)
@@ -54,7 +54,14 @@
return prefixes.toArray(new String[prefixes.size()]);
}
- static Map<String, Set<String>> getNameSpaces(IDocument document, int offset) {
+ /**
+ * Method collects the namespaces used in the document
+ *
+ * @param document
+ * @param offset
+ * @return
+ */
+ static public Map<String, Set<String>> getNameSpaces(IDocument document, int offset) {
IStructuredModel sModel = StructuredModelManager
.getModelManager()
.getExistingModelForRead(document);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesJSPBundleHyperlinkPartitioner.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesJSPBundleHyperlinkPartitioner.java 2009-07-16 11:45:36 UTC (rev 16594)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.text.ext.richfaces/src/org/jboss/tools/jsf/text/ext/richfaces/hyperlink/RichfacesJSPBundleHyperlinkPartitioner.java 2009-07-16 16:00:38 UTC (rev 16595)
@@ -12,10 +12,13 @@
package org.jboss.tools.jsf.text.ext.richfaces.hyperlink;
import java.util.ArrayList;
+import java.util.Map;
+import java.util.Set;
import org.eclipse.jface.text.IDocument;
import org.jboss.tools.common.text.ext.util.TaglibManagerWrapper;
import org.jboss.tools.jsf.text.ext.hyperlink.JSPBundleHyperlinkPartitioner;
+import org.jboss.tools.jsf.text.ext.hyperlink.JsfJSPBundleHyperlinkPartitioner;
/**
*
@@ -41,17 +44,28 @@
* @Override
*/
protected String[] getLoadBundleTagPrefixes(IDocument document, int offset) {
+ ArrayList<String> prefixes = new ArrayList<String>();
TaglibManagerWrapper tmw = new TaglibManagerWrapper();
tmw.init(document, offset);
- if(!tmw.exists()) return null;
-
- ArrayList<String> prefixes = new ArrayList<String>();
- for (String uri : LoadBundleURIs) {
- String prefix = tmw.getPrefix(uri);
- if (prefix != null)
- prefixes.add(prefix);
+ if(tmw.exists()) {
+ for (String uri : LoadBundleURIs) {
+ String prefix = tmw.getPrefix(uri);
+ if (prefix != null)
+ prefixes.add(prefix);
+ }
}
- return (String[])prefixes.toArray(new String[prefixes.size()]);
+ // JBIDE-4559: For XHTML pages we should use alternate way to get the prefixes
+ Map<String, Set<String>> namespaces = JsfJSPBundleHyperlinkPartitioner.getNameSpaces(document, offset);
+
+ if (namespaces != null) {
+ for (String uri : LoadBundleURIs) {
+ Set<String> altPrefixes = namespaces.get(uri);
+ if (altPrefixes != null)
+ prefixes.addAll(altPrefixes);
+ }
+ }
+
+ return (prefixes.size() == 0 ? null : (String[])prefixes.toArray(new String[prefixes.size()]));
}
}
16 years, 9 months
JBoss Tools SVN: r16594 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-07-16 07:45:36 -0400 (Thu, 16 Jul 2009)
New Revision: 16594
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4012
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2009-07-16 11:45:01 UTC (rev 16593)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2009-07-16 11:45:36 UTC (rev 16594)
@@ -241,7 +241,7 @@
if (viewsFolder != null){
if (!viewsFolder.getFolder(new Path("layout")).exists()){//$NON-NLS-1$
setErrorMessage(SeamUIMessages.bind(SeamUIMessages.VALIDATOR_FACTORY_FOLDER_DOES_NOT_EXIST,
- viewsFolder.getName() + "/" + "layout"));//$NON-NLS-1$
+ viewsFolder.getName() + "/layout"));//$NON-NLS-1$
setPageComplete(false);
return;
}
16 years, 9 months
JBoss Tools SVN: r16593 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-07-16 07:45:01 -0400 (Thu, 16 Jul 2009)
New Revision: 16593
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4012
Added error when the folder doesn't exists.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2009-07-16 09:17:09 UTC (rev 16592)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizardPage.java 2009-07-16 11:45:01 UTC (rev 16593)
@@ -16,10 +16,12 @@
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.wizard.IWizardPage;
@@ -208,7 +210,8 @@
}
private void validate() {
- Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(projectEditor.getValue(), null);
+ String projectName = projectEditor.getValue().toString();
+ Map<String, IStatus> errors = ValidatorFactory.SEAM_PROJECT_NAME_VALIDATOR.validate(projectName, null);
if(!errors.isEmpty() || !isProjectSettingsOk()) {
IStatus errorMessage = errors.get(IValidator.DEFAULT_ERROR);
@@ -231,12 +234,25 @@
setPageComplete(false);
return;
}
+
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ SeamProjectsSet seamProjectsSet = SeamProjectsSet.create(project);
+ IContainer viewsFolder = seamProjectsSet.getDefaultViewsFolder();
+ if (viewsFolder != null){
+ if (!viewsFolder.getFolder(new Path("layout")).exists()){//$NON-NLS-1$
+ setErrorMessage(SeamUIMessages.bind(SeamUIMessages.VALIDATOR_FACTORY_FOLDER_DOES_NOT_EXIST,
+ viewsFolder.getName() + "/" + "layout"));//$NON-NLS-1$
+ setPageComplete(false);
+ return;
+ }
+ }
setErrorMessage(null);
setMessage(null);
setPageComplete(true);
}
+ @SuppressWarnings("unchecked")
public Object getAdapter(Class adapter) {
if(adapter == Map.class) {
Map<String, INamedElement> values = new HashMap<String, INamedElement>();
16 years, 9 months
JBoss Tools SVN: r16592 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-07-16 05:17:09 -0400 (Thu, 16 Jul 2009)
New Revision: 16592
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4614
Fixed:
1. Method name is validated by JavaConvention.
2. Added default colpilation unit constants. Compilation Level is determined from selected project.
3. When interface name is validated do not rely on previous validator (do not gulp errors and see only for warning).
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2009-07-16 07:42:47 UTC (rev 16591)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2009-07-16 09:17:09 UTC (rev 16592)
@@ -24,7 +24,6 @@
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.DialogPage;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -81,6 +80,7 @@
* @author eskimo
*
*/
+@SuppressWarnings("restriction")
public class SeamInstallWizardPage extends AbstractFacetWizardPage implements
IFacetWizardPage, IDataModelListener {
@@ -281,6 +281,7 @@
/**
* Finish has been pressed.
*/
+ @SuppressWarnings("deprecation")
public void transferStateToConfig() {
String seamRuntimeName = jBossSeamHomeEditor.getValueAsString();
SeamRuntime seamRuntime = SeamRuntimeManager.getInstance()
@@ -597,30 +598,19 @@
* @see IValidator#validate(Object, Object)
*/
public Map<String, IStatus> validate(Object value, Object context) {
- IStatus status = JavaConventions.validatePackageName(value
- .toString(), CompilerOptions.VERSION_1_5,
- CompilerOptions.VERSION_1_5);
- if (status.getSeverity() == IStatus.ERROR) {
- return ValidatorFactory
- .createErrormessage(
- fieldName,
- new Status(
- IStatus.ERROR,
- SeamCorePlugin.PLUGIN_ID,
- NLS.bind(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_PACKAGE_NAME_NOT_VALID,
- targetName)));
- } else if (status.getSeverity() == IStatus.WARNING) {
- return ValidatorFactory
- .createErrormessage(
- fieldName,
- new Status(
- IStatus.WARNING,
- SeamCorePlugin.PLUGIN_ID,
- NLS.bind(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_PACKAGE_NAME_NOT_VALID,
- targetName)));
+ IStatus status = JavaConventions.validatePackageName(value.toString(),
+ ValidatorFactory.DEFAULT_SOURCE_LEVEL,
+ ValidatorFactory.DEFAULT_COMPLIANCE_LEVEL);
+
+ if (((IStatus.ERROR | IStatus.WARNING) & status.getSeverity() ) != 0 ){
+ return doPackStatus(status,
+ fieldName,
+ NLS.bind(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_PACKAGE_NAME_NOT_VALID,
+ targetName));
}
return ValidatorFactory.NO_ERRORS;
}
+
}
class ProjectNameValidator implements IValidator {
@@ -638,8 +628,7 @@
IStatus status = SeamFacetProjectCreationDataModelProvider
.validateUpperCaseInProjectName(projectName);
if (!status.isOK()) {
- return ValidatorFactory
- .createErrormessage(propertyName, status);
+ return ValidatorFactory.createErrormessage(propertyName, status);
}
return ValidatorFactory.NO_ERRORS;
}
@@ -665,70 +654,35 @@
final String testProjectName = projectName + "-test"; //$NON-NLS-1$
IStatus status = ProjectCreationDataModelProviderNew
.validateName(testProjectName);
- if (status.getSeverity() == IStatus.ERROR) {
- return ValidatorFactory
- .createErrormessage(
- propertyName,
- new Status(
- IStatus.ERROR,
- SeamCorePlugin.PLUGIN_ID,
- NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_TEST_PROJECT_ALREADY_EXISTS,
- testProjectName)));
- } else if (status.getSeverity() == IStatus.WARNING) {
- return ValidatorFactory
- .createErrormessage(
- propertyName,
- new Status(
- IStatus.WARNING,
- SeamCorePlugin.PLUGIN_ID,
- NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_TEST_PROJECT_ALREADY_EXISTS,
- testProjectName)));
+
+ if (((IStatus.ERROR | IStatus.WARNING) & status.getSeverity() ) != 0 ){
+ return doPackStatus(status,
+ propertyName,
+ NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_TEST_PROJECT_ALREADY_EXISTS,
+ testProjectName));
}
+
if (ISeamFacetDataModelProperties.DEPLOY_AS_EAR.equals(deployAs)) {
final String earProjectName = projectName + "-ear"; //$NON-NLS-1$
status = ProjectCreationDataModelProviderNew
.validateName(earProjectName);
- if (status.getSeverity() == IStatus.ERROR) {
- return ValidatorFactory
- .createErrormessage(
- propertyName,
- new Status(
- IStatus.ERROR,
- SeamCorePlugin.PLUGIN_ID,
- NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_EAR_PROJECT_ALREADY_EXISTS,
- earProjectName)));
- } else if (status.getSeverity() == IStatus.WARNING) {
- return ValidatorFactory
- .createErrormessage(
- propertyName,
- new Status(
- IStatus.WARNING,
- SeamCorePlugin.PLUGIN_ID,
- NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_EAR_PROJECT_ALREADY_EXISTS,
- earProjectName)));
+
+ if (((IStatus.ERROR | IStatus.WARNING) & status.getSeverity() ) != 0 ){
+ return doPackStatus(status,
+ propertyName,
+ NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_EAR_PROJECT_ALREADY_EXISTS,
+ earProjectName));
}
final String ejbProjectName = projectName + "-ejb"; //$NON-NLS-1$
status = ProjectCreationDataModelProviderNew
.validateName(ejbProjectName);
- if (status.getSeverity() == IStatus.ERROR) {
- return ValidatorFactory
- .createErrormessage(
- propertyName,
- new Status(
- IStatus.ERROR,
- SeamCorePlugin.PLUGIN_ID,
- NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_EJB_PROJECT_ALREADY_EXISTS,
- ejbProjectName)));
- } else if (status.getSeverity() == IStatus.WARNING) {
- return ValidatorFactory
- .createErrormessage(
- propertyName,
- new Status(
- IStatus.WARNING,
- SeamCorePlugin.PLUGIN_ID,
- NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_EJB_PROJECT_ALREADY_EXISTS,
- ejbProjectName)));
+
+ if (((IStatus.ERROR | IStatus.WARNING) & status.getSeverity() ) != 0 ){
+ return doPackStatus(status,
+ propertyName,
+ NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_EJB_PROJECT_ALREADY_EXISTS,
+ ejbProjectName));
}
}
return ValidatorFactory.NO_ERRORS;
@@ -786,20 +740,16 @@
IRuntime rt = RuntimeManager.getRuntime(runtimeName
.toString());
if (!rt.supports(EJB_30) || !rt.supports(EAR_50)) {
- return ValidatorFactory
- .createErrormessage(
- propertyName,
- new Status(
- IStatus.ERROR,
- SeamCorePlugin.PLUGIN_ID,
- NLS
- .bind(
- SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_CANNOT_USE_SELECTED_DEPLOYMENT6,
- new String[] {
- deploymentType
- .toUpperCase(),
- runtimeName
- .toString() })));
+ return ValidatorFactory.createErrormessage(
+ propertyName,
+ new Status(
+ IStatus.ERROR,
+ SeamCorePlugin.PLUGIN_ID,
+ NLS.bind(
+ SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_CANNOT_USE_SELECTED_DEPLOYMENT6,
+ new String[] {
+ deploymentType.toUpperCase(),
+ runtimeName.toString() })));
}
}
}
@@ -863,4 +813,10 @@
public String getTestsPkgName() {
return (String) testsPkgNameditor.getValue();
}
+
+ private Map<String, IStatus> doPackStatus(IStatus status, String propertyName, String message){
+ return ValidatorFactory.createErrormessage(
+ propertyName,
+ new Status(status.getSeverity(), SeamCorePlugin.PLUGIN_ID, message));
+ }
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2009-07-16 07:42:47 UTC (rev 16591)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2009-07-16 09:17:09 UTC (rev 16592)
@@ -48,7 +48,12 @@
* @author eskimo
*
*/
+@SuppressWarnings("restriction")
public class ValidatorFactory {
+
+ public static final String DEFAULT_SOURCE_LEVEL = CompilerOptions.VERSION_1_5;
+
+ public static final String DEFAULT_COMPLIANCE_LEVEL = DEFAULT_SOURCE_LEVEL;
/**
*
@@ -218,9 +223,9 @@
public static final IValidator PACKAGE_NAME_VALIDATOR = new IValidator() {
public Map<String, IStatus> validate(Object value, Object context) {
- IStatus status = JavaConventions.validatePackageName(value
- .toString(), CompilerOptions.VERSION_1_5,
- CompilerOptions.VERSION_1_5);
+ IStatus status = JavaConventions.validatePackageName(value.toString(),
+ DEFAULT_SOURCE_LEVEL,
+ DEFAULT_COMPLIANCE_LEVEL);
if (status.getSeverity() == IStatus.ERROR) {
return createErrormessage(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID, Messages.format(NewWizardMessages.NewTypeWizardPage_error_InvalidPackageName, status.getMessage())));
}
@@ -255,13 +260,13 @@
return createErrormessage(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID, NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_COMPONENT_ALREADY_EXISTS, name)));
}
- String[] segs = name.split("\\.");
+ String[] segs = name.split("\\.");//$NON-NLS-1$
for(String segm : segs){
if(!segm.trim().equals(segm))
return createErrormessage(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID, SeamUIMessages.VALIDATOR_FACTORY_NAME_IS_NOT_VALID));
IStatus status = JavaConventions.validateClassFileName(segm
- + ".class", "5.0", "5.0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ + ".class", DEFAULT_SOURCE_LEVEL, DEFAULT_COMPLIANCE_LEVEL); //$NON-NLS-1$
if (!status.isOK())
return createErrormessage(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID, SeamUIMessages.VALIDATOR_FACTORY_NAME_IS_NOT_VALID));
}
@@ -284,16 +289,11 @@
Object[] contextArray = ((Object[]) context);
IProject project = (IProject) contextArray[1];
-
IJavaProject jProject = JavaCore.create(project);
- String sourceLevel = jProject.getOption(JavaCore.COMPILER_SOURCE,
- true);
- String compliance = jProject.getOption(
- JavaCore.COMPILER_COMPLIANCE, true);
- IStatus status = JavaConventions.validateJavaTypeName(value
- .toString(), sourceLevel, compliance);
- if (status.getSeverity() == IStatus.WARNING) {
+ IStatus status = JavaConventions.validateJavaTypeName(value.toString(),
+ getCompilerSourceLevel(jProject), getCompilerComplianceLevel(jProject));
+ if (((IStatus.ERROR | IStatus.WARNING) & status.getSeverity()) != 0) {
return createErrormessage(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID, SeamUIMessages.VALIDATOR_FACTORY_LOCAL_INTERFACE_NAME_IS_NOT_VALID
+ status.getMessage()));
}
@@ -312,14 +312,12 @@
Object[] contextArray = ((Object[]) context);
String targetName = contextArray[0].toString();
IProject project = (IProject) contextArray[1];
-
- CompilationUnit compilationUnit = createCompilationUnit(
- "class ClassName {public void " //$NON-NLS-1$
- + value.toString() + "() {}}", project); //$NON-NLS-1$
-
- IProblem[] problems = compilationUnit.getProblems();
-
- if (problems.length > 0) {
+ IJavaProject jProject = JavaCore.create(project);
+
+ IStatus status = JavaConventions.validateMethodName(value.toString(),
+ getCompilerSourceLevel(jProject), getCompilerComplianceLevel(jProject));
+
+ if (status.getSeverity() == IStatus.ERROR){
return createErrormessage(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID,
NLS.bind(SeamUIMessages.VALIDATOR_FACTORY_NAME_IS_NOT_VALID, targetName)));
}
@@ -493,7 +491,6 @@
public java.util.Map<String, IStatus> validate(Object value,
Object context) {
Map<String, IStatus> errors = NO_ERRORS;
- String rtName = value.toString();
if (value == null || "".equals(value)) { //$NON-NLS-1$
errors = createErrormessage(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID, SeamUIMessages.VALIDATOR_FACTORY_SEAM_RT_NOT_CONFIGURED));
@@ -535,14 +532,31 @@
return errors;
}
};
+
+ /**
+ *
+ * @param jProject
+ * @return java project's CompilerSourceLevel or default one.
+ */
+ public static String getCompilerSourceLevel(IJavaProject jProject){
+ if (jProject == null){
+ return DEFAULT_SOURCE_LEVEL;
+ }
+ String sourceLevel = jProject.getOption(JavaCore.COMPILER_SOURCE, true);
+ return sourceLevel != null ? sourceLevel : DEFAULT_SOURCE_LEVEL;
+ }
+
+ /**
+ *
+ * @param jProject
+ * @return java project's CompilerComplianceLevel or default one.
+ */
+ public static String getCompilerComplianceLevel(IJavaProject jProject){
+ if (jProject == null){
+ return DEFAULT_COMPLIANCE_LEVEL;
+ }
+ String compliance = jProject.getOption(JavaCore.COMPILER_COMPLIANCE, true);
+ return compliance != null ? compliance : DEFAULT_SOURCE_LEVEL;
+ }
- public static CompilationUnit createCompilationUnit(String classDecl,
- IProject project) {
- ASTParser parser = ASTParser.newParser(AST.JLS3);
- parser.setSource(classDecl.toCharArray());
- parser.setProject(JavaCore.create(project));
- CompilationUnit compilationUnit = (CompilationUnit) parser
- .createAST(null);
- return compilationUnit;
- }
}
\ No newline at end of file
16 years, 9 months
JBoss Tools SVN: r16591 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks: edimap/actions and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-07-16 03:42:47 -0400 (Thu, 16 Jul 2009)
New Revision: 16591
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/actions/DeleteEDIModelCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/editor/EDIMapFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/editor/EDITreeNodeEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/editor/GEFAdapterCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/common/SmooksGraphicalMenuContextProvider.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/model/TreeNodeModel.java
Log:
JBIDE-4626
fix a bug of undo delete segment.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-07-16 04:31:43 UTC (rev 16590)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-07-16 07:42:47 UTC (rev 16591)
@@ -1317,9 +1317,9 @@
if (currentSelect != -1) {
combo.select(currentSelect);
} else {
-
+
}
- if (editValue instanceof String) {
+ if (valueIsSet && (editValue instanceof String)) {
combo.setText(editValue.toString());
}
final Object fm = model;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/actions/DeleteEDIModelCommand.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/actions/DeleteEDIModelCommand.java 2009-07-16 04:31:43 UTC (rev 16590)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/actions/DeleteEDIModelCommand.java 2009-07-16 07:42:47 UTC (rev 16591)
@@ -10,16 +10,23 @@
******************************************************************************/
package org.jboss.tools.smooks.edimap.actions;
+import java.util.List;
+
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.gef.DefaultEditDomain;
import org.eclipse.gef.EditPart;
+import org.eclipse.ui.IEditorPart;
+import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
+import org.jboss.tools.smooks.edimap.editor.EDIMapFormPage;
import org.jboss.tools.smooks.gef.tree.editparts.TreeNodeEditPart;
+import org.jboss.tools.smooks.gef.tree.model.TreeNodeModel;
/**
* @author Dart (dpeng(a)redhat.com)
- *
+ *
*/
-public class DeleteEDIModelCommand extends EDIGEFAdpaterCommand{
+public class DeleteEDIModelCommand extends EDIGEFAdpaterCommand {
private EditPart parentPart;
@@ -27,23 +34,53 @@
super(editPart, domain, emfCommand);
}
- /* (non-Javadoc)
- * @see org.jboss.tools.smooks.edimap.actions.AddOrDeleteEDIMappingModelCommand#refreshEditPart()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.edimap.actions.AddOrDeleteEDIMappingModelCommand
+ * #refreshEditPart()
*/
@Override
protected void refreshEditPart() {
- if(parentPart != null && parentPart instanceof TreeNodeEditPart){
- ((TreeNodeEditPart)parentPart).childrenModelChanged();
- ((TreeNodeEditPart)parentPart).getFigure().repaint();
+
+ if (parentPart != null && parentPart instanceof TreeNodeEditPart) {
+ ((TreeNodeEditPart) parentPart).childrenModelChanged();
+ ((TreeNodeEditPart) parentPart).getFigure().repaint();
}
}
- /* (non-Javadoc)
- * @see org.jboss.tools.smooks.edimap.actions.AddOrDeleteEDIMappingModelCommand#execute()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.smooks.edimap.actions.AddOrDeleteEDIMappingModelCommand
+ * #execute()
*/
@Override
public void execute() {
- parentPart = this.editPart.getParent();
+ if (parentPart == null) {
+ parentPart = this.editPart.getParent();
+ }
super.execute();
}
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.smooks.edimap.actions.EDIGEFAdpaterCommand#undo()
+ */
+ @Override
+ public void undo() {
+ super.undo();
+ if (parentPart != null && parentPart instanceof TreeNodeEditPart) {
+ DefaultEditDomain editDomain = (DefaultEditDomain) parentPart.getViewer().getEditDomain();
+ IEditorPart editorPart = editDomain.getEditorPart();
+ if (editorPart instanceof EDIMapFormPage) {
+ List<TreeNodeModel> linkedNodes = ((EDIMapFormPage) editorPart).createLinkModel();
+ SmooksUIUtils.expandGraphTree(linkedNodes, (TreeNodeEditPart) parentPart);
+ }
+ }
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/editor/EDIMapFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/editor/EDIMapFormPage.java 2009-07-16 04:31:43 UTC (rev 16590)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/editor/EDIMapFormPage.java 2009-07-16 07:42:47 UTC (rev 16591)
@@ -30,6 +30,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandWrapper;
@@ -43,13 +44,13 @@
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
import org.eclipse.gef.DefaultEditDomain;
import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.GraphicalViewer;
import org.eclipse.gef.commands.CommandStack;
import org.eclipse.gef.commands.CommandStackListener;
import org.eclipse.gef.editparts.FreeformGraphicalRootEditPart;
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.gef.ui.actions.DeleteAction;
-import org.eclipse.gef.ui.actions.PrintAction;
import org.eclipse.gef.ui.actions.RedoAction;
import org.eclipse.gef.ui.actions.SaveAction;
import org.eclipse.gef.ui.actions.SelectAllAction;
@@ -349,7 +350,7 @@
action = new AddSubComponentAction(this, modelProvider);
registry.registerAction(action);
- registry.registerAction(new PrintAction(this));
+ // registry.registerAction(new PrintAction(this));
Iterator<?> it = registry.getActions();
while (it.hasNext()) {
IAction a = (IAction) it.next();
@@ -508,6 +509,14 @@
return editDomain.getCommandStack();
}
}
+ if (type == GraphicalViewer.class)
+ return getGraphicalViewer();
+ if (type == ActionRegistry.class)
+ return getActionRegistry();
+ if (type == EditPart.class && getGraphicalViewer() != null)
+ return getGraphicalViewer().getRootEditPart();
+ if (type == IFigure.class && getGraphicalViewer() != null)
+ return ((GraphicalEditPart) getGraphicalViewer().getRootEditPart()).getFigure();
return super.getAdapter(type);
}
@@ -532,6 +541,7 @@
* (java.util.EventObject)
*/
public void commandStackChanged(EventObject event) {
+ updateSelectionActions();
getEditor().editorDirtyStateChanged();
}
@@ -801,7 +811,7 @@
});
- Section ediModelViewerSection = toolkit.createSection(form.getBody(), Section.TITLE_BAR );
+ Section ediModelViewerSection = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 2;
ediModelViewerSection.setLayoutData(gd);
@@ -815,7 +825,7 @@
vgl.numColumns = 2;
viewerComposite.setLayout(vgl);
-
+
Hyperlink showTransformResultLink = toolkit.createHyperlink(viewerComposite, "Test EDI to XML transform",
SWT.NONE);
// showTransformResultLink.setVisible(false);
@@ -1018,7 +1028,7 @@
}
}
- private List<TreeNodeModel> createLinkModel() {
+ public List<TreeNodeModel> createLinkModel() {
if (graphicalRootModel != null && segments != null) {
List<Segment> segmentList = segments.getSegment();
return linkNode(segmentList);
@@ -1026,15 +1036,21 @@
return Collections.emptyList();
}
- private List<TreeNodeModel> linkNode(List<Segment> segmentList) {
+ protected List<TreeNodeModel> linkNode(Collection<?> segmentList) {
List<TreeNodeModel> sourceLinkedModel = new ArrayList<TreeNodeModel>();
for (Iterator<?> iterator = segmentList.iterator(); iterator.hasNext();) {
- Segment segment = (Segment) iterator.next();
+ Object obj = iterator.next();
+ if (!(obj instanceof Segment)) {
+ continue;
+ }
+ Segment segment = (Segment) obj;
TreeNodeModel segmentGraphicalModel = findEDIGraphicalModel(segment);
String code = segment.getSegcode();
TreeNodeModel model = findEDIDataGraphicalModel(code);
if (segmentGraphicalModel != null && model != null) {
- new TreeNodeConnection(segmentGraphicalModel, model).connect();
+ if (!isLinked(segmentGraphicalModel, model)) {
+ new TreeNodeConnection(segmentGraphicalModel, model).connect();
+ }
}
sourceLinkedModel.add(segmentGraphicalModel);
List<TreeNodeModel> linkedModel = linkNode(segment.getSegment());
@@ -1045,6 +1061,17 @@
return sourceLinkedModel;
}
+ private boolean isLinked(TreeNodeModel source, TreeNodeModel target) {
+ List<TreeNodeConnection> connections = source.getSourceConnections();
+ for (Iterator<?> iterator = connections.iterator(); iterator.hasNext();) {
+ TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator.next();
+ if(treeNodeConnection.getTargetNode() == target){
+ return true;
+ }
+ }
+ return false;
+ }
+
// private TreeNodeModel findEDIGraphModel(Object model){
// if (graphicalRootModel != null) {
// List<TreeNodeModel> treeNodeList = graphicalRootModel.getChildren();
@@ -1300,20 +1327,4 @@
List<TreeNodeModel> sourceLinkedModel = this.createLinkModel();
expandSegmentNode(sourceLinkedModel);
}
-
- private class DelimiterModifyListener implements ModifyListener {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.
- * events.ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
- rebuildEDIGraph();
-
- }
-
- }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/editor/EDITreeNodeEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/editor/EDITreeNodeEditPart.java 2009-07-16 04:31:43 UTC (rev 16590)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/editor/EDITreeNodeEditPart.java 2009-07-16 07:42:47 UTC (rev 16591)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.smooks.edimap.editor;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.DeleteCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.gef.DefaultEditDomain;
@@ -81,6 +82,9 @@
@Override
protected Command createDeleteCommand(GroupRequest deleteRequest) {
TreeNodeModel node = (TreeNodeModel) getHost().getModel();
+ if(!(node.getData() instanceof EObject)){
+ return null;
+ }
GraphicalViewer viewer = (GraphicalViewer) ((AbstractGraphicalEditPart) getHost()).getViewer();
DefaultEditDomain domain = (DefaultEditDomain) viewer.getEditDomain();
IEditorPart part = domain.getEditorPart();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/editor/GEFAdapterCommand.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/editor/GEFAdapterCommand.java 2009-07-16 04:31:43 UTC (rev 16590)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/edimap/editor/GEFAdapterCommand.java 2009-07-16 07:42:47 UTC (rev 16591)
@@ -19,9 +19,9 @@
*/
public class GEFAdapterCommand extends Command {
- private org.eclipse.emf.common.command.Command emfCommand;
+ protected org.eclipse.emf.common.command.Command emfCommand;
- private EditingDomain domain;
+ protected EditingDomain domain;
public GEFAdapterCommand(EditingDomain domain, org.eclipse.emf.common.command.Command emfCommand) {
this.emfCommand = emfCommand;
@@ -119,7 +119,6 @@
domain.getCommandStack().redo();
}
}
- super.redo();
}
/*
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/common/SmooksGraphicalMenuContextProvider.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/common/SmooksGraphicalMenuContextProvider.java 2009-07-16 04:31:43 UTC (rev 16590)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/common/SmooksGraphicalMenuContextProvider.java 2009-07-16 07:42:47 UTC (rev 16591)
@@ -56,10 +56,10 @@
menu.add(new Separator(GROUP_CUSTOME));
GEFActionConstants.addStandardActionGroups(menu);
IAction action;
-// action = getActionRegistry().getAction(ActionFactory.UNDO.getId());
-// menu.appendToGroup(GEFActionConstants.GROUP_UNDO, action);
-// action = getActionRegistry().getAction(ActionFactory.REDO.getId());
-// menu.appendToGroup(GEFActionConstants.GROUP_UNDO, action);
+ action = getActionRegistry().getAction(ActionFactory.UNDO.getId());
+ menu.appendToGroup(GEFActionConstants.GROUP_UNDO, action);
+ action = getActionRegistry().getAction(ActionFactory.REDO.getId());
+ menu.appendToGroup(GEFActionConstants.GROUP_UNDO, action);
action = getActionRegistry().getAction(ActionFactory.DELETE.getId());
if (action.isEnabled())
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/model/TreeNodeModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/model/TreeNodeModel.java 2009-07-16 04:31:43 UTC (rev 16590)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/model/TreeNodeModel.java 2009-07-16 07:42:47 UTC (rev 16591)
@@ -150,12 +150,12 @@
for (Iterator<?> iterator2 = tempTargetConnections.iterator(); iterator2.hasNext();) {
TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator2.next();
- treeNodeConnection.disconnect();
+ treeNodeConnection.disconnectSource();
}
for (Iterator<?> iterator2 = tempSourceConnections.iterator(); iterator2.hasNext();) {
TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator2.next();
- treeNodeConnection.disconnect();
+ treeNodeConnection.disconnectTarget();
}
tempSourceConnections.clear();
16 years, 9 months
JBoss Tools SVN: r16590 - trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2009-07-16 00:31:43 -0400 (Thu, 16 Jul 2009)
New Revision: 16590
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/BrowseSelectorDialog.java
Log:
JBIDE-4625: java.lang.ArrayIndexOutOfBoundsException: 0 when switch from 'From import' to 'From project' in the Choose Partnerlink type wizard
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/BrowseSelectorDialog.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/BrowseSelectorDialog.java 2009-07-16 03:19:28 UTC (rev 16589)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/BrowseSelectorDialog.java 2009-07-16 04:31:43 UTC (rev 16590)
@@ -579,7 +579,10 @@
fFilteredList.setElements( contentProvider.getElements( fProjectObjects ) );
// add by Grid.Qian
// update the fTreeViewer because for now the fTreeViewer's input is null
- updateLowerViewWidget(fFilteredList.getSelection());
+ if (contentProvider.getElements( fProjectObjects ) != null &&
+ contentProvider.getElements( fProjectObjects ).length > 0) {
+ updateLowerViewWidget(fFilteredList.getSelection());
+ }
}
}
16 years, 9 months