JBoss Tools SVN: r16379 - in trunk/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-07-03 16:54:55 -0400 (Fri, 03 Jul 2009)
New Revision: 16379
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ELReference.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ELValidatorContext.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ISeamValidationContext.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/LinkCollection.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ProjectValidationContext.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java
Removed:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamContextValidationHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidatorManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4545 Fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2009-07-03 10:34:22 UTC (rev 16378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2009-07-03 20:54:55 UTC (rev 16379)
@@ -331,9 +331,6 @@
incremental="true"
fullBuild="true"
/>
- <dependentValidator
- depValValue="true">
- </dependentValidator>
</validator>
</extension>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2009-07-03 10:34:22 UTC (rev 16378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -18,6 +18,7 @@
import org.eclipse.core.runtime.IPath;
import org.jboss.tools.seam.core.event.ISeamProjectChangeListener;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.internal.core.validation.ISeamValidationContext;
public interface ISeamProject extends ISeamElement {
@@ -143,6 +144,11 @@
public ISeamComponent[] getComponents();
/**
+ * @return validation context
+ */
+ public ISeamValidationContext getValidationContext();
+
+ /**
* Adds component into project
* @param component
*/
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-07-03 10:34:22 UTC (rev 16378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -62,7 +62,7 @@
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.lib.ClassPath;
-import org.jboss.tools.seam.internal.core.validation.SeamValidationContext;
+import org.jboss.tools.seam.internal.core.validation.ProjectValidationContext;
import org.osgi.service.prefs.BackingStoreException;
import org.w3c.dom.Element;
@@ -106,7 +106,7 @@
List<ISeamProjectChangeListener> listeners = new ArrayList<ISeamProjectChangeListener>();
- SeamValidationContext validationContext;
+ ProjectValidationContext validationContext;
/**
*
@@ -743,13 +743,14 @@
File f = getStorageFile();
return f == null || !f.isFile();
}
- /**
- *
- * @return
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamProject#getValidationContext()
*/
- public SeamValidationContext getValidationContext() {
+ public ProjectValidationContext getValidationContext() {
if(validationContext==null) {
- validationContext = new SeamValidationContext();
+ validationContext = new ProjectValidationContext();
}
return validationContext;
}
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ELReference.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ELReference.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ELReference.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -0,0 +1,313 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.validation;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELInstance;
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.core.parser.ELParser;
+import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.common.el.core.parser.SyntaxError;
+import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.model.project.ext.ITextSourceReference;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine;
+import org.w3c.dom.Element;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class ELReference implements ITextSourceReference {
+
+ private static SeamELCompletionEngine elEngine = new SeamELCompletionEngine();
+
+ private IFile resource;
+ private IPath path;
+ private int length;
+ private int startPosition;
+ private ELExpression[] el;
+ private ElVarSearcher varSearcher;
+ private Set<IMarker> markers;
+ private IMarker[] markerArray;
+ private boolean needToInitMarkers = false;
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamTextSourceReference#getLength()
+ */
+ public int getLength() {
+ return length;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamTextSourceReference#getStartPosition()
+ */
+ public int getStartPosition() {
+ return startPosition;
+ }
+
+ /**
+ * @param length
+ */
+ public void setLength(int length) {
+ this.length = length;
+ }
+
+ /**
+ * @param startPosition
+ */
+ public void setStartPosition(int startPosition) {
+ this.startPosition = startPosition;
+ }
+
+ /**
+ * @return the resource
+ */
+ public IFile getResource() {
+ if(resource==null) {
+ IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
+ resource = wsRoot.getFile(path);
+ }
+ return resource;
+ }
+
+ /**
+ * @param resource the resource to set
+ */
+ public void setResource(IFile resource) {
+ this.resource = resource;
+ if(resource!=null) {
+ this.path = resource.getFullPath();
+ }
+ }
+
+ /**
+ * @return the path
+ */
+ public IPath getPath() {
+ return path;
+ }
+
+ /**
+ * @param path the path to set
+ */
+ public void setPath(IPath path) {
+ this.path = path;
+ }
+
+ /**
+ * @return the el
+ */
+ public ELExpression[] getEl() {
+ if(el==null) {
+ Set<ELExpression> exps = new HashSet<ELExpression>();
+ try {
+ String content = FileUtil.readStream(getResource().getContents());
+ String elText = content.substring(startPosition, startPosition + length);
+ int startEl = elText.indexOf("#{"); //$NON-NLS-1$
+ if(startEl>-1) {
+ ELParser parser = ELParserUtil.getJbossFactory().createParser();
+ ELModel model = parser.parse(elText);
+ List<SyntaxError> errors = model.getSyntaxErrors();
+ if(!errors.isEmpty()) {
+ SeamCorePlugin.getDefault().logWarning("ELObject hold incorrect information. Maybe resource " + getResource() + " has been changed.");
+ return null;
+ }
+ List<ELInstance> is = model.getInstances();
+ for (ELInstance i : is) {
+ if(!i.getErrors().isEmpty()) {
+ SeamCorePlugin.getDefault().logWarning("ELObject hold incorrect information. Maybe resource " + getResource() + " has been changed.");
+ continue;
+ }
+ exps.add(i.getExpression());
+ }
+ }
+ } catch (CoreException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ }
+ el = exps.toArray(new ELExpression[0]);
+ }
+ return el;
+ }
+
+ /**
+ * @param el the el to set
+ */
+ public void setEl(ELExpression[] el) {
+ this.el = el;
+ }
+
+ /**
+ * @param insts
+ */
+ public void setEl(List<ELInstance> insts) {
+ Set<ELExpression> exps = new HashSet<ELExpression>();
+ for (ELInstance el : insts) {
+ exps.add(el.getExpression());
+ }
+ el = exps.toArray(new ELExpression[0]);
+ }
+
+ /**
+ * @return the varSearcher
+ */
+ public ElVarSearcher getVarSearcher() {
+ if(varSearcher == null) {
+ varSearcher = new ElVarSearcher(getResource(), elEngine);
+ }
+ return varSearcher;
+ }
+
+ /**
+ * @param varSearcher the varSearcher to set
+ */
+ public void setVarSearcher(ElVarSearcher varSearcher) {
+ this.varSearcher = varSearcher;
+ }
+
+ private IMarker[] EMPTY_MARKER_ARRAY = new IMarker[0];
+
+ private void initMarkers() {
+ if(markers==null) {
+ markers = new HashSet<IMarker>();
+ if(needToInitMarkers) {
+ IFile file = getResource();
+ if(file!=null) {
+ IMarker[] markers = null;
+ try {
+ markers = file.findMarkers(null, true, IResource.DEPTH_INFINITE);
+ } catch (CoreException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ }
+ for(int i=0; i<markers.length; i++){
+ String groupName = markers[i].getAttribute("groupName", null); //$NON-NLS-1$
+ if(groupName!=null && (groupName.equals(groupName.equals(ISeamValidator.MARKED_SEAM_RESOURCE_MESSAGE_GROUP)))) {
+ int start = markers[i].getAttribute(IMarker.CHAR_START, -1);
+ int end = markers[i].getAttribute(IMarker.CHAR_END, -1);
+ if(start>=startPosition && end<=startPosition+length) {
+ addMarker(markers[i]);
+ }
+ }
+ }
+ }
+ }
+ needToInitMarkers = false;
+ }
+ }
+
+ /**
+ * @param needToInitMarkers the needToInitMarkers to set
+ */
+ public synchronized void setNeedToInitMarkers(boolean needToInitMarkers) {
+ this.needToInitMarkers = needToInitMarkers;
+ }
+
+ public synchronized void setMarkers(Set<IMarker> markers) {
+ this.markers = markers;
+ }
+
+ /**
+ * @return the markers
+ */
+ public synchronized IMarker[] getMarkers() {
+ initMarkers();
+ if(markerArray==null) {
+ if(markers.isEmpty()) {
+ markerArray = EMPTY_MARKER_ARRAY;
+ } else {
+ markerArray = markers.toArray(new IMarker[0]);
+ }
+ }
+ return markerArray;
+ }
+
+ /**
+ * @param markers the markers to set
+ */
+ public synchronized void addMarker(IMarker marker) {
+ if(marker==null) {
+ return;
+ }
+ markerArray = null;
+ if(markers==null) {
+ markers = new HashSet<IMarker>();
+ }
+ markers.add(marker);
+ }
+
+ /**
+ * Removes all markers from this EL.
+ */
+ public synchronized void deleteMarkers() {
+ initMarkers();
+ for (IMarker marker : markers) {
+ try {
+ marker.delete();
+ } catch (CoreException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ }
+ }
+ markers.clear();
+ markerArray = null;
+ }
+
+ /**
+ * Store this EL into XML element.
+ * @param element
+ */
+ public synchronized void store(Element element) {
+ element.setAttribute("path", path.toString()); //$NON-NLS-1$
+ element.setAttribute("offset", "" + startPosition); //$NON-NLS-1$ //$NON-NLS-2$
+ element.setAttribute("length", "" + length); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Load this EL from XML element.
+ * @param element
+ */
+ public synchronized void load(Element element) {
+ path = new Path(element.getAttribute("path")); //$NON-NLS-1$
+ startPosition = new Integer(element.getAttribute("offset")); //$NON-NLS-1$
+ length = new Integer(element.getAttribute("length")); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if(this == obj) {
+ return true;
+ }
+ ELReference el = (ELReference)obj;
+ return this.path.equals(el.path) && this.startPosition == el.startPosition;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return path.hashCode() + startPosition;
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ELReference.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ELValidatorContext.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ELValidatorContext.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ELValidatorContext.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.validation;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.common.xml.XMLUtilities;
+import org.w3c.dom.Element;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class ELValidatorContext extends LinkCollection {
+
+ private Map<String, Set<ELReference>> elsByVariableName = new HashMap<String, Set<ELReference>>();
+ private Map<ELReference, Set<String>> variableNamesByEl = new HashMap<ELReference, Set<String>>();
+ private Map<IPath, Set<ELReference>> elsByResource = new HashMap<IPath, Set<ELReference>>();
+
+ /**
+ * Save link between EL and variable name.
+ * @param variableName
+ * @param el
+ */
+ public synchronized void addLinkedEl(String variableName, ELReference el) {
+ Set<ELReference> linkedEls = elsByVariableName.get(variableName);
+ if(linkedEls==null) {
+ // create set of linked ELs with variable name.
+ linkedEls = new HashSet<ELReference>();
+ elsByVariableName.put(variableName, linkedEls);
+ }
+ // save linked ELs.
+ linkedEls.add(el);
+
+ // Save link between EL and variable names.
+ Set<String> variableNames = variableNamesByEl.get(el);
+ if(variableNames==null) {
+ variableNames = new HashSet<String>();
+ variableNamesByEl.put(el, variableNames);
+ }
+ variableNames.add(variableName);
+
+ // Save link between EL and resource.
+ Set<ELReference> els = elsByResource.get(el.getPath());
+ if(els==null) {
+ els = new HashSet<ELReference>();
+ elsByResource.put(el.getPath(), els);
+ }
+ els.add(el);
+ }
+
+ public synchronized void removeLinkedEls(Set<IFile> resorces) {
+ for (IFile file : resorces) {
+ removeLinkedEls(file);
+ }
+ }
+
+ public synchronized void removeLinkedEls(IFile resource) {
+ Set<ELReference> els = elsByResource.get(resource.getFullPath());
+ if(els!=null) {
+ elsByResource.remove(resource.getFullPath());
+ for (ELReference el : els) {
+ Set<String> names = variableNamesByEl.get(el);
+ if(names!=null) {
+ String[] nameStrins = names.toArray(new String[0]);
+ for (int i = 0; i < nameStrins.length; i++) {
+ removeLinkedEl(nameStrins[i], el);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Removes link between EL and variable name.
+ * @param name
+ * @param el
+ */
+ public synchronized void removeLinkedEl(String name, ELReference el) {
+ Set<ELReference> linkedEls = elsByVariableName.get(name);
+ if(linkedEls!=null) {
+ linkedEls.remove(el);
+ }
+ if(linkedEls.isEmpty()) {
+ elsByVariableName.remove(name);
+ }
+
+ // Remove link between EL and variable names.
+ Set<String> variableNames = variableNamesByEl.get(el);
+ if(variableNames!=null) {
+ variableNames.remove(name);
+ }
+ if(variableNames.isEmpty()) {
+ variableNamesByEl.remove(el);
+ }
+ }
+
+ /**
+ * Return ELs with given variable name
+ * @param variableName
+ * @return
+ */
+ public synchronized Set<ELReference> getElsByVariableName(String variableName) {
+ return elsByVariableName.get(variableName);
+ }
+
+ /**
+ * @param names
+ * @return
+ */
+ public synchronized Set<ELReference> getElsByVariableNames(Set<String> names) {
+ Set<ELReference> result = new HashSet<ELReference>();
+ for(String name : names) {
+ Set<ELReference> els = getElsByVariableName(name);
+ if(els!=null) {
+ result.addAll(els);
+ }
+ }
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.LinkCollection#clearAll()
+ */
+ @Override
+ public synchronized void clearAll() {
+ super.clearAll();
+ elsByVariableName.clear();
+ variableNamesByEl.clear();
+ elsByResource.clear();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.LinkCollection#store(org.w3c.dom.Element)
+ */
+ @Override
+ public synchronized void store(Element root) {
+ super.store(root);
+ Set<String> variables = elsByVariableName.keySet();
+ for (String name: variables) {
+ Set<ELReference> els = elsByVariableName.get(name);
+ if(els == null) {
+ continue;
+ }
+ for (ELReference el: els) {
+ Element linkedEl = XMLUtilities.createElement(root, "linked-el"); //$NON-NLS-1$
+ linkedEl.setAttribute("name", name); //$NON-NLS-1$
+ el.store(linkedEl);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.LinkCollection#load(org.w3c.dom.Element)
+ */
+ @Override
+ public synchronized void load(Element root) {
+ super.load(root);
+ if(root == null) {
+ return;
+ }
+ Element[] linkedEls = XMLUtilities.getChildren(root, "linked-el"); //$NON-NLS-1$
+ if(linkedEls != null) {
+ for (int i = 0; i < linkedEls.length; i++) {
+ String name = linkedEls[i].getAttribute("name"); //$NON-NLS-1$
+ if(name == null || name.trim().length() == 0) {
+ continue;
+ }
+ ELReference el = new ELReference();
+ el.load(linkedEls[i]);
+ el.setNeedToInitMarkers(true);
+ addLinkedEl(name, el);
+ }
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ELValidatorContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ISeamValidationContext.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ISeamValidationContext.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ISeamValidationContext.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.validation;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.w3c.dom.Element;
+
+/**
+ * Contains information for seam validators that must be saved between
+ * validation invoking.
+ * @author Alexey Kazakov
+ */
+public interface ISeamValidationContext {
+
+ /**
+ * Save link between core resource and variable name.
+ * It's needed for incremental validation because we must save all linked resources of changed java file.
+ */
+ void addLinkedCoreResource(String variableName, IPath linkedResourcePath, boolean declaration);
+
+ /**
+ * Removes link between core resource and variable name.
+ * @param oldVariableName
+ * @param linkedResourcePath
+ */
+ void removeLinkedCoreResource(String name, IPath linkedResourcePath);
+
+ /**
+ * Removes link between core resources and variable names.
+ * @param linkedResources
+ */
+ void removeLinkedCoreResources(Set<IPath> resources);
+
+ /**
+ * Removes link between core resource and variable names.
+ * @param linkedResource
+ */
+ void removeLinkedCoreResource(IPath resource);
+
+ Set<IPath> getCoreResourcesByVariableName(String variableName, boolean declaration);
+
+ Set<String> getVariableNamesByCoreResource(IPath fullPath, boolean declaration);
+
+ /**
+ * Adds core resource without any link to any context variable name.
+ * @param fullPath
+ */
+ void addUnnamedCoreResource(IPath fullPath);
+
+ /**
+ * @return Set of coreresources without any link to any context variable name.
+ * @param fullPath
+ */
+ Set<IPath> getUnnamedCoreResources();
+
+ /**
+ * Removes unnamed EL resource.
+ * @param fullPath
+ */
+ void removeUnnamedCoreResource(IPath fullPath);
+
+ /**
+ * Adds EL resource without any link to any context variable name.
+ * @param fullPath
+ */
+ void addUnnamedElResource(IPath fullPath);
+
+ /**
+ * @return Set of EL resources without any link to any context variable name.
+ * @param fullPath
+ */
+ Set<IPath> getUnnamedElResources();
+
+ /**
+ * Removes unnamed EL resource.
+ * @param fullPath
+ */
+ void removeUnnamedElResource(IPath fullPath);
+
+ /**
+ * We should validate all EL resources which use these names.
+ * @param name
+ */
+ void addVariableNameForELValidation(String name);
+
+ void removeLinkedEls(Set<IFile> resorces);
+
+ /**
+ * Get ELs which should be validated
+ * @param changedFiles
+ * @param onlyChangedVariables
+ * @return
+ */
+ Set<ELReference> getElsForValidation(Set<IFile> changedFiles, boolean onlyChangedVariables);
+
+ void clearAll();
+
+ void clearAllResourceLinks();
+
+ void clearRegisteredFiles();
+
+ void clearElResourceLinks();
+
+ void clearOldVariableNameForElValidation();
+
+ /**
+ * Save link between EL and variable name.
+ * @param variableName
+ * @param el
+ */
+ void addLinkedEl(String variableName, ELReference el);
+
+ /**
+ * Removes link between EL and variable name.
+ * @param name
+ * @param el
+ */
+ void removeLinkedEl(String name, ELReference el);
+
+ /**
+ * Return ELs with given variable name
+ * @param variableName
+ * @return
+ */
+ Set<ELReference> getElsByVariableName(String variableName);
+
+ /**
+ * Stores context to XML element
+ * @param root
+ */
+ void store(Element root);
+
+ /**
+ * Loads context from XML element
+ * @param root
+ */
+ void load(Element root);
+
+ Set<IFile> getRemovedFiles();
+
+ void addRemovedFile(IFile file);
+
+ Set<IFile> getRegisteredFiles();
+
+ void registerFile(IFile file);
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ISeamValidationContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java 2009-07-03 10:34:22 UTC (rev 16378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/IValidationErrorManager.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -12,8 +12,8 @@
import java.util.Set;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
-import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
import org.jboss.tools.common.model.project.ext.ITextSourceReference;
import org.jboss.tools.seam.core.ISeamProject;
@@ -30,7 +30,7 @@
* @param location
* @param target
*/
- void addError(String messageId, String preferenceKey,
+ IMarker addError(String messageId, String preferenceKey,
String[] messageArguments, ITextSourceReference location,
IResource target);
@@ -41,7 +41,7 @@
* @param messageArguments
* @param target
*/
- void addError(String messageId, String preferenceKey,
+ IMarker addError(String messageId, String preferenceKey,
String[] messageArguments,
IResource target);
@@ -52,7 +52,7 @@
* @param location
* @param target
*/
- void addError(String messageId, String preferenceKey,
+ IMarker addError(String messageId, String preferenceKey,
ITextSourceReference location, IResource target);
/**
@@ -64,7 +64,7 @@
* @param offset
* @param target
*/
- void addError(String messageId, String preferenceKey,
+ IMarker addError(String messageId, String preferenceKey,
String[] messageArguments, int length, int offset, IResource target);
/**
@@ -76,7 +76,7 @@
* @param offset
* @param target
*/
- void addError(String messageId, int severity, String[] messageArguments, int length, int offset, IResource target);
+ IMarker addError(String messageId, int severity, String[] messageArguments, int length, int offset, IResource target);
/**
* Displays a subtask in the progress view.
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/LinkCollection.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/LinkCollection.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/LinkCollection.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -0,0 +1,277 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.validation;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.seam.core.SeamCoreMessages;
+import org.w3c.dom.Element;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class LinkCollection {
+ protected Map<String, Set<IPath>> resourcesByVariableName = new HashMap<String, Set<IPath>>();
+ protected Map<IPath, Set<String>> variableNamesByResource = new HashMap<IPath, Set<String>>();
+ protected Map<String, Set<IPath>> resourcesByDeclaringVariableName = new HashMap<String, Set<IPath>>();
+ protected Map<IPath, Set<String>> declaringVariableNamesByResource = new HashMap<IPath, Set<String>>();
+ protected Set<IPath> unnamedResources = new HashSet<IPath>();
+
+ /**
+ * Save link between resource and variable name.
+ * It's needed for incremental validation because we must save all linked resources of changed java file.
+ */
+ public void addLinkedResource(String variableName, IPath linkedResourcePath, boolean declaration) {
+ if(linkedResourcePath==null) {
+ throw new IllegalArgumentException(SeamCoreMessages.SEAM_VALIDATION_CONTEXT_LINKED_RESOURCE_PATH_MUST_NOT_BE_NULL);
+ }
+ if(variableName==null) {
+ throw new IllegalArgumentException(SeamCoreMessages.SEAM_VALIDATION_CONTEXT_VARIABLE_NAME_MUST_NOT_BE_NULL);
+ }
+
+ synchronized(this) {
+ Set<IPath> linkedResources = resourcesByVariableName.get(variableName);
+ if(linkedResources==null) {
+ // create set of linked resources with variable name.
+ linkedResources = new HashSet<IPath>();
+ resourcesByVariableName.put(variableName, linkedResources);
+ }
+ // save linked resources.
+ linkedResources.add(linkedResourcePath);
+ }
+
+ // Save link between resource and variable names. It's needed if variable name changes in resource file.
+ Set<String> variableNames = variableNamesByResource.get(linkedResourcePath);
+ if(variableNames==null) {
+ variableNames = new HashSet<String>();
+ variableNamesByResource.put(linkedResourcePath, variableNames);
+ }
+ variableNames.add(variableName);
+
+ if(declaration) {
+ synchronized(this) {
+ Set<IPath> linkedResources = resourcesByDeclaringVariableName.get(variableName);
+ if(linkedResources==null) {
+ // create set of linked resources with declaring variable name.
+ linkedResources = new HashSet<IPath>();
+ resourcesByDeclaringVariableName.put(variableName, linkedResources);
+ }
+ // save linked resources.
+ linkedResources.add(linkedResourcePath);
+ }
+
+ // Save link between resource and declaring variable names. It's needed if variable name changes in resource file.
+ variableNames = declaringVariableNamesByResource.get(linkedResourcePath);
+ if(variableNames==null) {
+ variableNames = new HashSet<String>();
+ declaringVariableNamesByResource.put(linkedResourcePath, variableNames);
+ }
+ variableNames.add(variableName);
+ }
+ }
+
+ /**
+ * Removes link between resource and variable name.
+ * @param oldVariableName
+ * @param linkedResourcePath
+ */
+ public void removeLinkedResource(String name, IPath linkedResourcePath) {
+ synchronized(this) {
+ Set<IPath> linkedResources = resourcesByVariableName.get(name);
+ if(linkedResources!=null) {
+ // remove linked resource.
+ linkedResources.remove(linkedResourcePath);
+ }
+ if(linkedResources.isEmpty()) {
+ resourcesByVariableName.remove(name);
+ }
+ }
+ // Remove link between resource and declaring variable names.
+ Set<String> variableNames = variableNamesByResource.get(linkedResourcePath);
+ if(variableNames!=null) {
+ variableNames.remove(name);
+ }
+ if(variableNames.isEmpty()) {
+ variableNamesByResource.remove(linkedResourcePath);
+ }
+ synchronized(this) {
+ Set<IPath> linkedResources = resourcesByDeclaringVariableName.get(name);
+ if(linkedResources!=null) {
+ // remove linked resource.
+ linkedResources.remove(linkedResourcePath);
+ }
+ if(linkedResources.isEmpty()) {
+ resourcesByDeclaringVariableName.remove(name);
+ }
+ }
+ // Remove link between resource and declaring variable names.
+ variableNames = declaringVariableNamesByResource.get(linkedResourcePath);
+ if(variableNames!=null) {
+ variableNames.remove(name);
+ }
+ if(variableNames.isEmpty()) {
+ declaringVariableNamesByResource.remove(linkedResourcePath);
+ }
+ }
+
+ /**
+ * Removes link between resources and variable names.
+ * @param linkedResources
+ */
+ public void removeLinkedResources(Set<IPath> resources) {
+ for (IPath resource : resources) {
+ removeLinkedResource(resource);
+ }
+ }
+
+ /**
+ * Removes link between resource and variable names.
+ * @param linkedResources
+ */
+ public synchronized void removeLinkedResource(IPath resource) {
+ Set<String> resourceNames = variableNamesByResource.get(resource);
+ if(resourceNames!=null) {
+ for (String name : resourceNames) {
+ Set<IPath> linkedResources = resourcesByVariableName.get(name);
+ if(linkedResources!=null) {
+ linkedResources.remove(resource);
+ if(linkedResources.isEmpty()) {
+ resourcesByVariableName.remove(name);
+ }
+ }
+ }
+ }
+ variableNamesByResource.remove(resource);
+
+ resourceNames = declaringVariableNamesByResource.get(resource);
+ if(resourceNames!=null) {
+ for (String name : resourceNames) {
+ Set<IPath> linkedResources = resourcesByDeclaringVariableName.get(name);
+ if(linkedResources!=null) {
+ linkedResources.remove(resource);
+ if(linkedResources.isEmpty()) {
+ resourcesByDeclaringVariableName.remove(name);
+ }
+ }
+ }
+ }
+ declaringVariableNamesByResource.remove(resource);
+ }
+
+ public Set<IPath> getResourcesByVariableName(String variableName, boolean declaration) {
+ return declaration?resourcesByDeclaringVariableName.get(variableName):resourcesByVariableName.get(variableName);
+ }
+
+ public synchronized Set<String> getVariableNamesByResource(IPath fullPath, boolean declaration) {
+ return declaration?declaringVariableNamesByResource.get(fullPath):variableNamesByResource.get(fullPath);
+ }
+
+ /**
+ * Adds resource without any link to any context variable name.
+ * @param fullPath
+ */
+ public void addUnnamedResource(IPath fullPath) {
+ unnamedResources.add(fullPath);
+ }
+
+ /**
+ * @return Set of resources without any link to any context variable name.
+ * @param fullPath
+ */
+ public Set<IPath> getUnnamedResources() {
+ return unnamedResources;
+ }
+
+ /**
+ * Removes unnamed resource.
+ * @param fullPath
+ */
+ public void removeUnnamedResource(IPath fullPath) {
+ unnamedResources.remove(fullPath);
+ }
+
+ /**
+ * Clear all references
+ */
+ public synchronized void clearAll() {
+ resourcesByVariableName.clear();
+ variableNamesByResource.clear();
+ declaringVariableNamesByResource.clear();
+ resourcesByDeclaringVariableName.clear();
+ unnamedResources.clear();
+ }
+
+ /**
+ * Store the collection to XML
+ * @param root
+ */
+ public synchronized void store(Element root) {
+ Set<String> variables = resourcesByVariableName.keySet();
+ for (String name: variables) {
+ Set<IPath> paths = resourcesByVariableName.get(name);
+ if(paths == null) continue;
+ for (IPath path: paths) {
+ Element linkedResource = XMLUtilities.createElement(root, "linked-resource"); //$NON-NLS-1$
+ linkedResource.setAttribute("name", name); //$NON-NLS-1$
+ linkedResource.setAttribute("path", path.toString()); //$NON-NLS-1$
+ if(checkDeclaration(path, name)) {
+ linkedResource.setAttribute("declaration", "true"); //$NON-NLS-1$ $NON-NLS-2$
+ }
+ }
+ }
+ for (IPath unnamedPath: unnamedResources) {
+ Element unnamedPathElement = XMLUtilities.createElement(root, "unnamed-path"); //$NON-NLS-1$
+ unnamedPathElement.setAttribute("path", unnamedPath.toString()); //$NON-NLS-1$
+ }
+ }
+
+ private boolean checkDeclaration(IPath resource, String variableName) {
+ Set<IPath> paths = resourcesByDeclaringVariableName.get(variableName);
+ if(paths!=null) {
+ for (IPath path : paths) {
+ if(path.equals(resource)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ /**
+ * Load the collection from XML
+ * @param root
+ */
+ public void load(Element root) {
+ if(root == null) return;
+ Element[] linkedResources = XMLUtilities.getChildren(root, "linked-resource"); //$NON-NLS-1$
+ if(linkedResources != null) for (int i = 0; i < linkedResources.length; i++) {
+ String name = linkedResources[i].getAttribute("name"); //$NON-NLS-1$
+ if(name == null || name.trim().length() == 0) continue;
+ String path = linkedResources[i].getAttribute("path"); //$NON-NLS-1$
+ if(path == null || path.trim().length() == 0) continue;
+ String declaration = linkedResources[i].getAttribute("declaration");
+ boolean declarationFlag = "true".equals(declaration);
+ IPath pathObject = new Path(path);
+ addLinkedResource(name, pathObject, declarationFlag);
+ }
+ Element[] unnamedPathElement = XMLUtilities.getChildren(root, "unnamed-path"); //$NON-NLS-1$
+ if(unnamedPathElement != null) for (int i = 0; i < unnamedPathElement.length; i++) {
+ String path = unnamedPathElement[i].getAttribute("path"); //$NON-NLS-1$
+ IPath pathObject = new Path(path);
+ addUnnamedResource(pathObject);
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/LinkCollection.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ProjectValidationContext.java (from rev 16312, trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java)
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ProjectValidationContext.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ProjectValidationContext.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -0,0 +1,322 @@
+ /*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.validation;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.common.xml.XMLUtilities;
+import org.w3c.dom.Element;
+
+/**
+ * Contains information for seam validators that must be saved between
+ * validation invoking.
+ * @author Alexey Kazakov
+ */
+public class ProjectValidationContext implements ISeamValidationContext {
+
+ // We should load/save these collections between eclipse sessions.
+ private LinkCollection coreLinks = new LinkCollection();
+ private ELValidatorContext elLinks = new ELValidatorContext();
+
+ private Set<IFile> removedFiles = new HashSet<IFile>();
+ private Set<IFile> registeredResources = new HashSet<IFile>();
+ private Set<String> oldVariableNamesForELValidation = new HashSet<String>();
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#addLinkedCoreResource(java.lang.String, org.eclipse.core.runtime.IPath, boolean)
+ */
+ public void addLinkedCoreResource(String variableName, IPath linkedResourcePath, boolean declaration) {
+ coreLinks.addLinkedResource(variableName, linkedResourcePath, declaration);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeLinkedCoreResource(java.lang.String, org.eclipse.core.runtime.IPath)
+ */
+ public void removeLinkedCoreResource(String name, IPath linkedResourcePath) {
+ coreLinks.removeLinkedResource(name, linkedResourcePath);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeLinkedCoreResources(java.util.Set)
+ */
+ public void removeLinkedCoreResources(Set<IPath> resources) {
+ coreLinks.removeLinkedResources(resources);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeLinkedCoreResource(org.eclipse.core.runtime.IPath)
+ */
+ public void removeLinkedCoreResource(IPath resource) {
+ coreLinks.removeLinkedResource(resource);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getCoreResourcesByVariableName(java.lang.String, boolean)
+ */
+ public Set<IPath> getCoreResourcesByVariableName(String variableName, boolean declaration) {
+ return coreLinks.getResourcesByVariableName(variableName, declaration);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getVariableNamesByCoreResource(org.eclipse.core.runtime.IPath, boolean)
+ */
+ public Set<String> getVariableNamesByCoreResource(IPath fullPath, boolean declaration) {
+ return coreLinks.getVariableNamesByResource(fullPath, declaration);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#addUnnamedCoreResource(org.eclipse.core.runtime.IPath)
+ */
+ public void addUnnamedCoreResource(IPath fullPath) {
+ coreLinks.addUnnamedResource(fullPath);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getUnnamedCoreResources()
+ */
+ public Set<IPath> getUnnamedCoreResources() {
+ return coreLinks.getUnnamedResources();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeUnnamedCoreResource(org.eclipse.core.runtime.IPath)
+ */
+ public void removeUnnamedCoreResource(IPath fullPath) {
+ coreLinks.removeUnnamedResource(fullPath);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#addUnnamedElResource(org.eclipse.core.runtime.IPath)
+ */
+ public void addUnnamedElResource(IPath fullPath) {
+ elLinks.addUnnamedResource(fullPath);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getUnnamedElResources()
+ */
+ public Set<IPath> getUnnamedElResources() {
+ return elLinks.getUnnamedResources();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeUnnamedElResource(org.eclipse.core.runtime.IPath)
+ */
+ public void removeUnnamedElResource(IPath fullPath) {
+ elLinks.removeUnnamedResource(fullPath);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#addVariableNameForELValidation(java.lang.String)
+ */
+ public void addVariableNameForELValidation(String name) {
+ oldVariableNamesForELValidation.add(name);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeLinkedEls(java.util.Set)
+ */
+ public void removeLinkedEls(Set<IFile> resorces) {
+ elLinks.removeLinkedEls(resorces);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getElsForValidation(java.util.Set, boolean)
+ */
+ public Set<ELReference> getElsForValidation(Set<IFile> changedFiles, boolean onlyChangedVariables) {
+ Set<ELReference> result = new HashSet<ELReference>();
+ // Collect all ELs which use new variables names
+ for(IResource resource : changedFiles) {
+ Set<String> newNames = getVariableNamesByCoreResource(resource.getFullPath(), true);
+ if(newNames!=null) {
+ for (String newName : newNames) {
+ if(!onlyChangedVariables || !oldVariableNamesForELValidation.contains(newName)) {
+ Set<ELReference> els = elLinks.getElsByVariableName(newName);
+ if(els!=null) {
+ result.addAll(els);
+ }
+ }
+ }
+ }
+ for (String oldName : oldVariableNamesForELValidation) {
+ if(!onlyChangedVariables || newNames==null || !newNames.contains(oldName)) {
+ Set<ELReference> els = elLinks.getElsByVariableName(oldName);
+ if(els!=null) {
+ result.addAll(els);
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#clearAll()
+ */
+ public void clearAll() {
+ removedFiles.clear();
+ synchronized (registeredResources) {
+ registeredResources.clear();
+ }
+ oldVariableNamesForELValidation.clear();
+ coreLinks.clearAll();
+ elLinks.clearAll();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#clearAllResourceLinks()
+ */
+ public void clearAllResourceLinks() {
+ oldVariableNamesForELValidation.clear();
+ coreLinks.clearAll();
+ elLinks.clearAll();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#clearRegisteredFiles()
+ */
+ public void clearRegisteredFiles() {
+ removedFiles.clear();
+ synchronized (registeredResources) {
+ registeredResources.clear();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#clearElResourceLinks()
+ */
+ public void clearElResourceLinks() {
+ oldVariableNamesForELValidation.clear();
+ elLinks.clearAll();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#clearOldVariableNameForElValidation()
+ */
+ public void clearOldVariableNameForElValidation() {
+ oldVariableNamesForELValidation.clear();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#addLinkedEl(java.lang.String, org.jboss.tools.seam.internal.core.validation.ELReference)
+ */
+ public void addLinkedEl(String variableName, ELReference el) {
+ elLinks.addLinkedEl(variableName, el);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeLinkedEl(java.lang.String, org.jboss.tools.seam.internal.core.validation.ELReference)
+ */
+ public void removeLinkedEl(String name, ELReference el) {
+ elLinks.removeLinkedEl(name, el);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getElsByVariableName(java.lang.String)
+ */
+ public Set<ELReference> getElsByVariableName(String variableName) {
+ return elLinks.getElsByVariableName(variableName);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#store(org.w3c.dom.Element)
+ */
+ public void store(Element root) {
+ Element validation = XMLUtilities.createElement(root, "validation"); //$NON-NLS-1$
+ Element core = XMLUtilities.createElement(validation, "core"); //$NON-NLS-1$
+ coreLinks.store(core);
+ Element el = XMLUtilities.createElement(validation, "el"); //$NON-NLS-1$
+ elLinks.store(el);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#load(org.w3c.dom.Element)
+ */
+ public void load(Element root) {
+ Element validation = XMLUtilities.getUniqueChild(root, "validation"); //$NON-NLS-1$
+ if(validation == null) return;
+ Element core = XMLUtilities.getUniqueChild(validation, "core"); //$NON-NLS-1$
+ if(core != null) {
+ coreLinks.load(core);
+ }
+ Element el = XMLUtilities.getUniqueChild(validation, "el"); //$NON-NLS-1$
+ if(el != null) {
+ elLinks.load(el);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getRemovedFiles()
+ */
+ public Set<IFile> getRemovedFiles() {
+ return removedFiles;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#addRemovedFile(org.eclipse.core.resources.IFile)
+ */
+ public void addRemovedFile(IFile file) {
+ removedFiles.add(file);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getRegisteredFiles()
+ */
+ public Set<IFile> getRegisteredFiles() {
+ Set<IFile> copy = new HashSet<IFile>();
+ synchronized (registeredResources) {
+ copy.addAll(registeredResources);
+ }
+ return copy;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#registerFile(org.eclipse.core.resources.IFile)
+ */
+ public void registerFile(IFile file) {
+ synchronized (registeredResources) {
+ registeredResources.add(file);
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamContextValidationHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamContextValidationHelper.java 2009-07-03 10:34:22 UTC (rev 16378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamContextValidationHelper.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -19,7 +19,6 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
import org.eclipse.ui.editors.text.TextFileDocumentProvider;
-import org.jboss.tools.seam.internal.core.SeamProject;
/**
* Helper for Seam Validators that use Seam Validator Context.
@@ -27,7 +26,7 @@
*/
public class SeamContextValidationHelper extends SeamValidationHelper {
- protected SeamValidationContext validationContext;
+ protected ISeamValidationContext validationContext;
protected TextFileDocumentProvider documentProvider = new TextFileDocumentProvider();
/*
@@ -61,13 +60,17 @@
return result;
}
- public SeamValidationContext getValidationContext() {
+ public ISeamValidationContext getValidationContext() {
if(validationContext==null) {
- validationContext = ((SeamProject)getSeamProject()).getValidationContext();
+ validationContext = new SeamValidationContext(getProject());
}
return validationContext;
}
-
+
+ public void setValidationContext(ISeamValidationContext context) {
+ validationContext = context;
+ }
+
public TextFileDocumentProvider getDocumentProvider(){
return documentProvider;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-07-03 10:34:22 UTC (rev 16378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamCoreValidator.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -95,7 +95,7 @@
public SeamCoreValidator(SeamValidatorManager validatorManager,
SeamContextValidationHelper coreHelper, IReporter reporter,
- SeamValidationContext validationContext, ISeamProject project) {
+ ISeamValidationContext validationContext, ISeamProject project) {
super(validatorManager, coreHelper, reporter, validationContext, project);
}
@@ -130,36 +130,33 @@
validateUnnamedResources = fileName.endsWith(".java") || fileName.endsWith(".properties") || fileName.equals("components.xml"); //$NON-NLS-1$ $NON-NLS-2$
}
if (checkFileExtension(currentFile)) {
- // Get all variable names which were linked with this resource.
- Set<String> oldVariablesNamesOfChangedFile = validationContext.getVariableNamesByCoreResource(currentFile.getFullPath());
- if(oldVariablesNamesOfChangedFile!=null) {
- // Check if variable name was changed in source file
- Set<String> newVariableNamesOfChangedFile = getVariablesNameByResource(currentFile.getFullPath());
- for (String newVariableName : newVariableNamesOfChangedFile) {
- if(!oldVariablesNamesOfChangedFile.contains(newVariableName)) {
- // Name was changed.
- // Collect resources with new component name.
- Set<IPath> linkedResources = validationContext.getCoreResourcesByVariableName(newVariableName);
- if(linkedResources!=null) {
- resources.addAll(linkedResources);
- }
- resources.addAll(getAllResourceOfComponent(currentFile.getFullPath()));
- }
+ resources.add(currentFile.getFullPath());
+ // Get new variable names from model
+ Set<String> newVariableNamesOfChangedFile = getVariablesNameByResource(currentFile.getFullPath());
+ Set<String> oldDeclarationsOfChangedFile = validationContext.getVariableNamesByCoreResource(currentFile.getFullPath(), true);
+ for (String newVariableName : newVariableNamesOfChangedFile) {
+ // Collect resources with new variable name.
+ Set<IPath> linkedResources = validationContext.getCoreResourcesByVariableName(newVariableName, false);
+ if(linkedResources!=null) {
+ resources.addAll(linkedResources);
}
- resources.add(currentFile.getFullPath());
-
- // Collect all linked resources with old variable names.
+ resources.addAll(getAllResourceOfComponent(currentFile.getFullPath()));
+ }
+ // Get old variable names which were linked with this resource.
+ Set<String> oldVariablesNamesOfChangedFile = validationContext.getVariableNamesByCoreResource(currentFile.getFullPath(), false);
+ if(oldVariablesNamesOfChangedFile!=null) {
for (String name : oldVariablesNamesOfChangedFile) {
- Set<IPath> linkedResources = validationContext.getCoreResourcesByVariableName(name);
+ Set<IPath> linkedResources = validationContext.getCoreResourcesByVariableName(name, false);
if(linkedResources!=null) {
resources.addAll(linkedResources);
}
- // Save old names for EL validation. We need to validate all EL resources which use this variable name.
+ }
+ }
+ // Save old declarations for EL validation. We need to validate all EL resources which use this variable name but only if the variable has been changed.
+ if(oldDeclarationsOfChangedFile!=null) {
+ for (String name : oldDeclarationsOfChangedFile) {
validationContext.addVariableNameForELValidation(name);
}
- } else {
- // Validate new (unlinked) source file.
- resources.add(currentFile.getFullPath());
}
newResources.add(currentFile.getFullPath());
}
@@ -218,10 +215,8 @@
}
Set<ISeamComponentDeclaration> declarations = component.getAllDeclarations();
for (ISeamComponentDeclaration seamComponentDeclaration : declarations) {
- if(project == seamComponentDeclaration.getResource().getProject()) {
- validateComponent(component);
- break;
- }
+ validateComponent(component);
+ break;
}
}
ISeamFactory[] factories = seamProject.getFactories();
@@ -230,9 +225,7 @@
if(reporter.isCancelled()) {
return OK_STATUS;
}
- if(project == factory.getResource().getProject()) {
- validateFactory(factory, markedDuplicateFactoryNames);
- }
+ validateFactory(factory, markedDuplicateFactoryNames);
}
ISeamJavaComponentDeclaration[] values = ((SeamProject)seamProject).getAllJavaComponentDeclarations();
@@ -241,9 +234,7 @@
return OK_STATUS;
}
displaySubtask(VALIDATING_CLASS_MESSAGE_ID, new String[]{projectName, d.getClassName()});
- if(project == d.getResource().getProject()) {
- validateMethodsOfUnknownComponent(d);
- }
+ validateMethodsOfUnknownComponent(d);
}
return OK_STATUS;
@@ -311,14 +302,14 @@
if(!firstDuplicateVariableWasMarked) {
firstDuplicateVariableWasMarked = true;
// mark original factory
- validationContext.addLinkedCoreResource(factoryName, factory.getSourcePath());
+ validationContext.addLinkedCoreResource(factoryName, factory.getSourcePath(), true);
location = coreHelper.getLocationOfName(factory);
this.addError(DUPLICATE_VARIABLE_NAME_MESSAGE_ID, SeamPreferences.DUPLICATE_VARIABLE_NAME, new String[]{factoryName}, location, factory.getResource());
}
// Mark duplicate variable.
if(!coreHelper.isJar(variable.getSourcePath())) {
IResource resource = coreHelper.getComponentResourceWithName(variable);
- validationContext.addLinkedCoreResource(factoryName, resource.getFullPath());
+ validationContext.addLinkedCoreResource(factoryName, resource.getFullPath(), true);
location = coreHelper.getLocationOfName(variable);
this.addError(DUPLICATE_VARIABLE_NAME_MESSAGE_ID, SeamPreferences.DUPLICATE_VARIABLE_NAME, new String[]{factoryName}, location, resource);
}
@@ -350,7 +341,7 @@
if(unknownVariable && validateUnknownName && voidReturnType) {
// mark unknown factory name
// save link to factory resource
- validationContext.addLinkedCoreResource(factoryName, factory.getSourcePath());
+ validationContext.addLinkedCoreResource(factoryName, factory.getSourcePath(), true);
this.addError(UNKNOWN_FACTORY_NAME_MESSAGE_ID, SeamPreferences.UNKNOWN_FACTORY_NAME, new String[]{factoryName}, coreHelper.getLocationOfName(factory), factory.getResource());
}
}
@@ -420,20 +411,20 @@
ISeamJavaComponentDeclaration jd = (ISeamJavaComponentDeclaration)declaration;
//do not check files declared in another project
- if(jd.getSeamProject() != seamProject) continue;
+// if(jd.getSeamProject() != seamProject) continue;
IType type = (IType)jd.getSourceMember();
boolean sourceJavaDeclaration = !type.isBinary();
if(sourceJavaDeclaration) {
// Save link between component name and java source file.
- validationContext.addLinkedCoreResource(componentName, declaration.getSourcePath());
+ validationContext.addLinkedCoreResource(componentName, declaration.getSourcePath(), true);
// Save link between component name and all supers of java declaration.
try {
IType[] superTypes = TypeInfoCollector.getSuperTypes(type).getSuperTypes();
for (int i = 0; superTypes != null && i < superTypes.length; i++) {
if(!superTypes[i].isBinary()) {
IPath path = superTypes[i].getResource().getFullPath();
- validationContext.addLinkedCoreResource(componentName, path);
+ validationContext.addLinkedCoreResource(componentName, path, true);
}
}
} catch (JavaModelException e) {
@@ -493,9 +484,9 @@
return;
}
//do not check files declared in another project
- if(declaration.getSeamProject() != seamProject) continue;
+// if(declaration.getSeamProject() != seamProject) continue;
- validationContext.addLinkedCoreResource(componentName, declaration.getSourcePath());
+ validationContext.addLinkedCoreResource(componentName, declaration.getSourcePath(), true);
String precedence = declaration.getPrecedence();
if(firstNamedDeclaration == null && declaration.getName()!=null) {
@@ -582,7 +573,7 @@
}
return;
} else if(!type.isBinary()) {
- validationContext.addLinkedCoreResource(componentName, type.getResource().getFullPath());
+ validationContext.addLinkedCoreResource(componentName, type.getResource().getFullPath(), true);
}
} catch (JavaModelException e) {
SeamCorePlugin.getDefault().logError(SeamCoreMessages.SEAM_CORE_VALIDATOR_ERROR_VALIDATING_SEAM_CORE, e);
@@ -719,11 +710,11 @@
if(name==null || name.startsWith("#{") || name.startsWith("${")) { //$NON-NLS-1$ //$NON-NLS-2$
return;
}
- // save link between java source and variable name
- validationContext.addLinkedCoreResource(name, declaration.getSourcePath());
-
// Validate @In
if(bijection.isOfType(BijectedAttributeType.IN)) {
+ // save link between java source and variable name
+ validationContext.addLinkedCoreResource(name, declaration.getSourcePath(), false);
+
Set<ISeamContextVariable> variables = seamProject.getVariablesByName(name);
if(variables==null || variables.size()<1) {
ISeamProject parentProject = seamProject.getParentProject();
@@ -740,6 +731,9 @@
}
addError(UNKNOWN_VARIABLE_NAME_MESSAGE_ID, SeamPreferences.UNKNOWN_VARIABLE_NAME, new String[]{name}, nameRef, declarationResource);
}
+ } else {
+ // save link between java source and variable name
+ validationContext.addLinkedCoreResource(name, declaration.getSourcePath(), true);
}
}
@@ -747,7 +741,7 @@
String dataModelName = bijection.getValue();
String selectionName = bijection.getName();
// save link between java source and variable name
- validationContext.addLinkedCoreResource(selectionName, declaration.getSourcePath());
+ validationContext.addLinkedCoreResource(selectionName, declaration.getSourcePath(), false);
if(dataModelName==null) {
// here must be the only one @DataModel in the component
Set<IBijectedAttribute> dataBinders = declaration.getBijectedAttributesByType(BijectedAttributeType.DATA_BINDER);
@@ -758,7 +752,7 @@
}
} else {
// save link between java source and Data Model name
- validationContext.addLinkedCoreResource(dataModelName, declaration.getSourcePath());
+ validationContext.addLinkedCoreResource(dataModelName, declaration.getSourcePath(), true);
Set<IBijectedAttribute> dataBinders = declaration.getBijectedAttributesByName(dataModelName);
if(dataBinders!=null) {
for (IBijectedAttribute dataBinder : dataBinders) {
@@ -801,7 +795,7 @@
IMethod javaMethod = (IMethod)method.getSourceMember();
String methodName = javaMethod.getElementName();
if(javaDeclaration.getSourcePath().equals(javaMethod.getPath())) {
- validationContext.addLinkedCoreResource(component.getName(), javaDeclaration.getSourcePath());
+ validationContext.addLinkedCoreResource(component.getName(), javaDeclaration.getSourcePath(), true);
ITextSourceReference methodNameLocation = getNameLocation(method);
addError(DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN_ID, SeamPreferences.DESTROY_METHOD_BELONGS_TO_STATELESS_SESSION_BEAN, new String[]{methodName}, methodNameLocation, method.getResource());
}
@@ -898,5 +892,4 @@
}
return false;
}
-
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2009-07-03 10:34:22 UTC (rev 16378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -18,6 +18,7 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
@@ -45,7 +46,6 @@
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
import org.eclipse.wst.validation.internal.core.ValidationException;
-import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
@@ -97,7 +97,7 @@
public SeamELValidator(SeamValidatorManager validatorManager,
SeamContextValidationHelper coreHelper, IReporter reporter,
- SeamValidationContext validationContext, ISeamProject project) {
+ ISeamValidationContext validationContext, ISeamProject project) {
super(validatorManager, coreHelper, reporter, validationContext, project);
engine = new SeamELCompletionEngine();
elVarSearcher = new ElVarSearcher(engine);
@@ -115,21 +115,17 @@
* @see org.jboss.tools.seam.internal.core.validation.ISeamValidator#validate(java.util.Set)
*/
public IStatus validate(Set<IFile> changedFiles) throws ValidationException {
+ webRootFolder = null;
initRevalidationFlag();
IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
- Set<IPath> files = validationContext.getElResourcesForValidation(changedFiles);
- validationContext.removeLinkedElResources(files);
Set<IFile> filesToValidate = new HashSet<IFile>();
boolean containsJavaOrComponentsXml = false;
- for (IPath path : files) {
- IFile file = wsRoot.getFile(path);
- if(file.exists()) {
- filesToValidate.add(file);
- if(!containsJavaOrComponentsXml) {
- String fileName = file.getName().toLowerCase();
- containsJavaOrComponentsXml = fileName.endsWith(".java") || fileName.endsWith(".properties") || fileName.equals("components.xml"); //$NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
- }
+ for (IFile file : changedFiles) {
+ filesToValidate.add(file);
+ if(!containsJavaOrComponentsXml) {
+ String fileName = file.getName().toLowerCase();
+ containsJavaOrComponentsXml = fileName.endsWith(".java") || fileName.endsWith(".properties") || fileName.equals("components.xml"); //$NON-NLS-1$ $NON-NLS-2$ $NON-NLS-3$
}
}
@@ -144,18 +140,29 @@
}
}
}
+
+ Set<ELReference> elsToValidate = validationContext.getElsForValidation(changedFiles, false);
+ validationContext.removeLinkedEls(filesToValidate);
for (IFile file : filesToValidate) {
if(!reporter.isCancelled()) {
validateFile(file);
}
}
+ if(revalidateUnresolvedELs) {
+ for (ELReference el : elsToValidate) {
+ if(!filesToValidate.contains(el.getResource())) {
+ validateEL(el);
+ }
+ }
+ }
+
validationContext.clearOldVariableNameForElValidation();
return OK_STATUS;
}
private void initRevalidationFlag() {
- String revalidateUnresolvedEls = SeamPreferences.getProjectPreference(project, SeamPreferences.RE_VALIDATE_UNRESOLVED_EL);
- revalidateUnresolvedELs = SeamPreferences.ENABLE.equals(revalidateUnresolvedEls);
+ String revalidateUnresolvedELsString = SeamPreferences.getProjectPreference(project, SeamPreferences.RE_VALIDATE_UNRESOLVED_EL);
+ revalidateUnresolvedELs = SeamPreferences.ENABLE.equals(revalidateUnresolvedELsString);
}
/*
@@ -163,8 +170,8 @@
* @see org.jboss.tools.seam.internal.core.validation.ISeamValidator#validateAll()
*/
public IStatus validateAll() throws ValidationException {
+ webRootFolder = null;
initRevalidationFlag();
- validationContext.clearElResourceLinks();
Set<IFile> files = validationContext.getRegisteredFiles();
for (IFile file : files) {
if(!reporter.isCancelled()) {
@@ -188,19 +195,23 @@
}
IProject project = file.getProject();
if(!project.equals(currentProject)) {
- IFacetedProject facetedProject = null;
- try {
- facetedProject = ProjectFacetsManager.create(project);
- } catch (CoreException e) {
- SeamCorePlugin.getDefault().logError(SeamCoreMessages.SEAM_EL_VALIDATOR_ERROR_VALIDATING_SEAM_EL, e);
+ if(webRootFolder!=null && !project.equals(webRootFolder.getProject())) {
+ webRootFolder = null;
}
- webRootFolder = null;
- if(facetedProject!=null && facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET)!=null) {
- IVirtualComponent component = ComponentCore.createComponent(project);
- if(component!=null) {
- IVirtualFolder webRootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
- webRootFolder = webRootVirtFolder.getUnderlyingFolder();
+ if(webRootFolder==null) {
+ IFacetedProject facetedProject = null;
+ try {
+ facetedProject = ProjectFacetsManager.create(project);
+ } catch (CoreException e) {
+ SeamCorePlugin.getDefault().logError(SeamCoreMessages.SEAM_EL_VALIDATOR_ERROR_VALIDATING_SEAM_EL, e);
}
+ if(facetedProject!=null && facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET)!=null) {
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if(component!=null) {
+ IVirtualFolder webRootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
+ webRootFolder = webRootVirtFolder.getUnderlyingFolder();
+ }
+ }
}
currentProject = project;
currentSources = EclipseResourceUtil.getJavaSourceRoots(project);
@@ -226,7 +237,7 @@
if(!shouldFileBeValidated(file)) {
return;
}
- WorkbenchReporter.removeAllMessages(file, new String[]{this.getClass().getName()}, null);
+ removeAllMessagesFromResource(file);
displaySubtask(VALIDATING_EL_FILE_MESSAGE_ID, new String[]{projectName, file.getName()});
elVarSearcher.setFile(file);
String ext = file.getFileExtension();
@@ -244,6 +255,13 @@
}
}
+ private void validateEL(ELReference el) {
+ el.deleteMarkers();
+ for (ELExpression expresion : el.getEl()) {
+ validateELExpression(el, expresion);
+ }
+ }
+
private void validateJava(IFile file, String content) {
try {
FastJavaPartitionScanner scaner = new FastJavaPartitionScanner();
@@ -342,15 +360,24 @@
if(startEl>-1) {
ELParser parser = ELParserUtil.getJbossFactory().createParser();
ELModel model = parser.parse(string);
+ List<ELInstance> is = model.getInstances();
+
+ ELReference elReference = new ELReference();
+ elReference.setResource(file);
+ elReference.setEl(is);
+ elReference.setLength(string.length());
+ elReference.setStartPosition(offset);
+ elReference.setVarSearcher(new ElVarSearcher(file, engine));
+
List<SyntaxError> errors = model.getSyntaxErrors();
if(!errors.isEmpty()) {
for (SyntaxError error: errors) {
//TODO 1) make message more informative
// 2) create other preference
- addError(SYNTAX_ERROR_MESSAGE_ID, SeamPreferences.EL_SYNTAX_ERROR, new String[]{"" + error.getProblem()}, 1, offset + error.getPosition(), file);
+ IMarker marker = addError(SYNTAX_ERROR_MESSAGE_ID, SeamPreferences.EL_SYNTAX_ERROR, new String[]{"" + error.getProblem()}, 1, offset + error.getPosition(), file);
+ elReference.addMarker(marker);
}
}
- List<ELInstance> is = model.getInstances();
for (ELInstance i : is) {
if (reporter.isCancelled()) {
return;
@@ -359,45 +386,42 @@
//Already reported syntax problem in this piece of EL.
continue;
}
- validateEl(file, i.getExpression(), offset);
+ validateELExpression(elReference, i.getExpression());
}
}
}
- private void validateEl(IFile file, ELExpression el, int offset) {
+ private void validateELExpression(ELReference elReference, ELExpression el) {
if(el == null) return;
List<ELInvocationExpression> es = el.getInvocations();
for (ELInvocationExpression token: es) {
- validateElOperand(file, token, offset);
+ validateElOperand(elReference, token);
}
}
- private void validateElOperand(IFile file, ELInvocationExpression operandToken, int documnetOffset) {
+ private void validateElOperand(ELReference elReference, ELInvocationExpression operandToken) {
+ IFile file = elReference.getResource();
+ int documnetOffset = elReference.getStartPosition();
String operand = operandToken.getText();
String varName = operand;
int offsetOfVarName = documnetOffset + operandToken.getFirstToken().getStart();
int lengthOfVarName = varName.length();
boolean unresolvedTokenIsVariable = false;
try {
- int offset = operand.length();
if (!operand.endsWith(".")) { //$NON-NLS-1$
SeamELOperandResolveStatus status =
(SeamELOperandResolveStatus)engine.resolveELOperand(file, operandToken, true, varListForCurentValidatedNode, elVarSearcher);
if(status.isError()) {
- if(revalidateUnresolvedELs) {
- Set<String> names = findVariableNames(operandToken);
- for (String name : names) {
- validationContext.addLinkedElResource(name, file.getFullPath());
- }
+ Set<String> names = findVariableNames(operandToken);
+ for (String name : names) {
+ validationContext.addLinkedEl(name, elReference);
}
- // Save resources with unknown variables names
-// validationContext.addUnnamedElResource(file.getFullPath());
}
// Save links between resource and used variables names
for(ISeamContextVariable variable: status.getUsedVariables()) {
- validationContext.addLinkedElResource(variable.getName(), file.getFullPath());
+ validationContext.addLinkedEl(variable.getName(), elReference);
}
// Check pair for getter/setter
@@ -411,7 +435,15 @@
missingMethodName = existedMethodName;
existedMethodName = SeamCoreMessages.SEAM_EL_VALIDATOR_SETTER;
}
- addError(UNPAIRED_GETTER_OR_SETTER_MESSAGE_ID, SeamPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, operand.length(), documnetOffset, file);
+ int startPosition = documnetOffset + operandToken.getStartPosition();
+ int length = operandToken.getLength();
+ int startPr = operand.indexOf(propertyName);
+ if(startPr>-1) {
+ startPosition = startPosition + startPr;
+ length = propertyName.length();
+ }
+ IMarker marker = addError(UNPAIRED_GETTER_OR_SETTER_MESSAGE_ID, SeamPreferences.UNPAIRED_GETTER_OR_SETTER, new String[]{propertyName, existedMethodName, missingMethodName}, length, startPosition, file);
+ elReference.addMarker(marker);
}
if (status.isOK()) {
@@ -439,9 +471,11 @@
}
// Mark invalid EL
if(unresolvedTokenIsVariable) {
- addError(UNKNOWN_EL_VARIABLE_NAME_MESSAGE_ID, SeamPreferences.UNKNOWN_EL_VARIABLE_NAME, new String[]{varName}, lengthOfVarName, offsetOfVarName, file);
+ IMarker marker = addError(UNKNOWN_EL_VARIABLE_NAME_MESSAGE_ID, SeamPreferences.UNKNOWN_EL_VARIABLE_NAME, new String[]{varName}, lengthOfVarName, offsetOfVarName, file);
+ elReference.addMarker(marker);
} else {
- addError(UNKNOWN_EL_VARIABLE_PROPERTY_NAME_MESSAGE_ID, SeamPreferences.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new String[]{varName}, lengthOfVarName, offsetOfVarName, file);
+ IMarker marker = addError(UNKNOWN_EL_VARIABLE_PROPERTY_NAME_MESSAGE_ID, SeamPreferences.UNKNOWN_EL_VARIABLE_PROPERTY_NAME, new String[]{varName}, lengthOfVarName, offsetOfVarName, file);
+ elReference.addMarker(marker);
}
}
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java 2009-07-03 10:34:22 UTC (rev 16378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -1,428 +0,0 @@
- /*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.internal.core.validation;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.jboss.tools.common.xml.XMLUtilities;
-import org.jboss.tools.seam.core.SeamCoreMessages;
-import org.w3c.dom.Element;
-
-/**
- * Contains information for seam validators that must be saved between
- * validation invoking.
- * @author Alexey Kazakov
- */
-public class SeamValidationContext {
-
- // We should load/save these collections between eclipse sessions.
- private LinkCollection coreLinks = new LinkCollection();
- private LinkCollection elLinks = new LinkCollection();
-
- private Set<IFile> removedFiles = new HashSet<IFile>();
- private Set<IFile> registeredResources = new HashSet<IFile>();
- private Set<String> oldVariableNamesForELValidation = new HashSet<String>();
-
- /**
- * Save link between core resource and variable name.
- * It's needed for incremental validation because we must save all linked resources of changed java file.
- */
- public void addLinkedCoreResource(String variableName, IPath linkedResourcePath) {
- coreLinks.addLinkedResource(variableName, linkedResourcePath);
- }
-
- /**
- * Removes link between core resource and variable name.
- * @param oldVariableName
- * @param linkedResourcePath
- */
- public void removeLinkedCoreResource(String name, IPath linkedResourcePath) {
- coreLinks.removeLinkedResource(name, linkedResourcePath);
- }
-
- /**
- * Removes link between core resources and variable names.
- * @param linkedResources
- */
- public void removeLinkedCoreResources(Set<IPath> resources) {
- coreLinks.removeLinkedResources(resources);
- }
-
- /**
- * Removes link between core resource and variable names.
- * @param linkedResource
- */
- public void removeLinkedCoreResource(IPath resource) {
- coreLinks.removeLinkedResource(resource);
- }
-
- public Set<IPath> getCoreResourcesByVariableName(String variableName) {
- return coreLinks.getResourcesByVariableName(variableName);
- }
-
- public Set<String> getVariableNamesByCoreResource(IPath fullPath) {
- return coreLinks.getVariableNamesByResource(fullPath);
- }
-
- /**
- * Adds core resource without any link to any context variable name.
- * @param fullPath
- */
- public void addUnnamedCoreResource(IPath fullPath) {
- coreLinks.addUnnamedResource(fullPath);
- }
-
- /**
- * @return Set of coreresources without any link to any context variable name.
- * @param fullPath
- */
- public Set<IPath> getUnnamedCoreResources() {
- return coreLinks.getUnnamedResources();
- }
-
- /**
- * Removes unnamed EL resource.
- * @param fullPath
- */
- public void removeUnnamedCoreResource(IPath fullPath) {
- coreLinks.removeUnnamedResource(fullPath);
- }
-
- /**
- * Adds EL resource without any link to any context variable name.
- * @param fullPath
- */
- public void addUnnamedElResource(IPath fullPath) {
- elLinks.addUnnamedResource(fullPath);
- }
-
- /**
- * @return Set of EL resources without any link to any context variable name.
- * @param fullPath
- */
- public Set<IPath> getUnnamedElResources() {
- return elLinks.getUnnamedResources();
- }
-
- /**
- * Removes unnamed EL resource.
- * @param fullPath
- */
- public void removeUnnamedElResource(IPath fullPath) {
- elLinks.removeUnnamedResource(fullPath);
- }
-
- /**
- * We should validate all EL resources which use these names.
- * @param name
- */
- public void addVariableNameForELValidation(String name) {
- oldVariableNamesForELValidation.add(name);
- }
-
- /**
- * Save link between EL resource and variable name.
- * It's needed for incremental validation because we must save all linked resources of changed java file.
- */
- public void addLinkedElResource(String variableName, IPath linkedResourcePath) {
- elLinks.addLinkedResource(variableName, linkedResourcePath);
- }
-
- /**
- * Removes link between resources and variable names.
- * @param linkedResources
- */
- public void removeLinkedElResources(Set<IPath> resources) {
- elLinks.removeLinkedResources(resources);
- }
-
- /**
- * Removes link between resource and variable names.
- * @param linkedResource
- */
- public void removeLinkedElResource(IPath resource) {
- elLinks.removeLinkedResource(resource);
- }
-
- /**
- * @param changedFiles - files which were changed.
- * @return Set of resources which we should validate during incremental EL validation.
- */
- public Set<IPath> getElResourcesForValidation(Set<IFile> changedFiles) {
- Set<IPath> result = new HashSet<IPath>();
- // Collect all resources which use old variables names.
- for(String name : oldVariableNamesForELValidation) {
- Set<IPath> oldResources = elLinks.getResourcesByVariableName(name);
- if(oldResources!=null) {
- result.addAll(oldResources);
- }
- }
- // Collect all resources which use new variables names
- for(IResource resource : changedFiles) {
- result.add(resource.getFullPath());
- Set<String> names = getVariableNamesByCoreResource(resource.getFullPath());
- if(names!=null) {
- for (String name : names) {
- Set<IPath> newResources = elLinks.getResourcesByVariableName(name);
- if(newResources!=null) {
- result.addAll(newResources);
- }
- }
- }
- }
-// result.addAll(elLinks.getUnnamedResources());
- return result;
- }
-
- public void clearAll() {
- removedFiles.clear();
- synchronized (registeredResources) {
- registeredResources.clear();
- }
- oldVariableNamesForELValidation.clear();
- coreLinks.clearAll();
- elLinks.clearAll();
- }
-
- public void clearAllResourceLinks() {
- oldVariableNamesForELValidation.clear();
- coreLinks.clearAll();
- elLinks.clearAll();
- }
-
- public void clearRegisteredFiles() {
- removedFiles.clear();
- synchronized (registeredResources) {
- registeredResources.clear();
- }
- }
-
- public void clearElResourceLinks() {
- oldVariableNamesForELValidation.clear();
- elLinks.clearAll();
- }
-
- public void clearOldVariableNameForElValidation() {
- oldVariableNamesForELValidation.clear();
- }
-
- public void store(Element root) {
- Element validation = XMLUtilities.createElement(root, "validation"); //$NON-NLS-1$
- Element core = XMLUtilities.createElement(validation, "core"); //$NON-NLS-1$
- coreLinks.store(core);
- Element el = XMLUtilities.createElement(validation, "el"); //$NON-NLS-1$
- elLinks.store(el);
- }
-
- public void load(Element root) {
- Element validation = XMLUtilities.getUniqueChild(root, "validation"); //$NON-NLS-1$
- if(validation == null) return;
- Element core = XMLUtilities.getUniqueChild(validation, "core"); //$NON-NLS-1$
- if(core != null) {
- coreLinks.load(core);
- }
- Element el = XMLUtilities.getUniqueChild(validation, "el"); //$NON-NLS-1$
- if(el != null) {
- elLinks.load(el);
- }
- }
-
- public Set<IFile> getRemovedFiles() {
- return removedFiles;
- }
-
- public void addRemovedFile(IFile file) {
- removedFiles.add(file);
- }
-
- public Set<IFile> getRegisteredFiles() {
- Set<IFile> copy = new HashSet<IFile>();
- synchronized (registeredResources) {
- copy.addAll(registeredResources);
- }
- return copy;
- }
-
- public void registerFile(IFile file) {
- synchronized (registeredResources) {
- registeredResources.add(file);
- }
- }
-
- public static class LinkCollection {
- private Map<String, Set<IPath>> resourcesByVariableName = new HashMap<String, Set<IPath>>();
- private Map<IPath, Set<String>> variableNamesByResource = new HashMap<IPath, Set<String>>();
- private Set<IPath> unnamedResources = new HashSet<IPath>();
-
- /**
- * Save link between resource and variable name.
- * It's needed for incremental validation because we must save all linked resources of changed java file.
- */
- public void addLinkedResource(String variableName, IPath linkedResourcePath) {
- if(linkedResourcePath==null) {
- throw new IllegalArgumentException(SeamCoreMessages.SEAM_VALIDATION_CONTEXT_LINKED_RESOURCE_PATH_MUST_NOT_BE_NULL);
- }
- if(variableName==null) {
- throw new IllegalArgumentException(SeamCoreMessages.SEAM_VALIDATION_CONTEXT_VARIABLE_NAME_MUST_NOT_BE_NULL);
- }
-
- synchronized(this) {
- Set<IPath> linkedResources = resourcesByVariableName.get(variableName);
- if(linkedResources==null) {
- // create set of linked resources with variable name.
- linkedResources = new HashSet<IPath>();
- resourcesByVariableName.put(variableName, linkedResources);
- }
- // save linked resources.
- linkedResources.add(linkedResourcePath);
- }
-
- // Save link between resource and variable names. It's needed if variable name changes in resource file.
- Set<String> variableNames = variableNamesByResource.get(linkedResourcePath);
- if(variableNames==null) {
- variableNames = new HashSet<String>();
- variableNamesByResource.put(linkedResourcePath, variableNames);
- }
- variableNames.add(variableName);
- }
-
- /**
- * Removes link between resource and variable name.
- * @param oldVariableName
- * @param linkedResourcePath
- */
- public void removeLinkedResource(String name, IPath linkedResourcePath) {
- synchronized(this) {
- Set<IPath> linkedResources = resourcesByVariableName.get(name);
- if(linkedResources!=null) {
- // remove linked resource.
- linkedResources.remove(linkedResourcePath);
- }
- }
- // Remove link between resource and variable names.
- Set<String> variableNames = variableNamesByResource.get(linkedResourcePath);
- if(variableNames!=null) {
- variableNames.remove(name);
- }
- }
-
- /**
- * Removes link between resources and variable names.
- * @param linkedResources
- */
- public void removeLinkedResources(Set<IPath> resources) {
- for (IPath resource : resources) {
- removeLinkedResource(resource);
- }
- }
-
- /**
- * Removes link between resource and variable names.
- * @param linkedResources
- */
- public synchronized void removeLinkedResource(IPath resource) {
- Set<String> resourceNames = variableNamesByResource.get(resource);
- if(resourceNames!=null) {
- for (String name : resourceNames) {
- Set<IPath> linkedResources = resourcesByVariableName.get(name);
- if(linkedResources!=null) {
- linkedResources.remove(resource);
- if(linkedResources.isEmpty()) {
- resourcesByVariableName.remove(name);
- }
- }
- }
- }
- variableNamesByResource.remove(resource);
- }
-
- public Set<IPath> getResourcesByVariableName(String variableName) {
- return resourcesByVariableName.get(variableName);
- }
-
- public synchronized Set<String> getVariableNamesByResource(IPath fullPath) {
- return variableNamesByResource.get(fullPath);
- }
-
- /**
- * Adds resource without any link to any context variable name.
- * @param fullPath
- */
- public void addUnnamedResource(IPath fullPath) {
- unnamedResources.add(fullPath);
- }
-
- /**
- * @return Set of resources without any link to any context variable name.
- * @param fullPath
- */
- public Set<IPath> getUnnamedResources() {
- return unnamedResources;
- }
-
- /**
- * Removes unnamed resource.
- * @param fullPath
- */
- public void removeUnnamedResource(IPath fullPath) {
- unnamedResources.remove(fullPath);
- }
-
- public synchronized void clearAll() {
- resourcesByVariableName.clear();
- variableNamesByResource.clear();
- unnamedResources.clear();
- }
-
- public synchronized void store(Element root) {
- Set<String> variables = resourcesByVariableName.keySet();
- for (String name: variables) {
- Set<IPath> paths = resourcesByVariableName.get(name);
- if(paths == null) continue;
- for (IPath path: paths) {
- Element linkedResource = XMLUtilities.createElement(root, "linked-resource"); //$NON-NLS-1$
- linkedResource.setAttribute("name", name); //$NON-NLS-1$
- linkedResource.setAttribute("path", path.toString()); //$NON-NLS-1$
- }
- }
- for (IPath unnamedPath: unnamedResources) {
- Element unnamedPathElement = XMLUtilities.createElement(root, "unnamed-path"); //$NON-NLS-1$
- unnamedPathElement.setAttribute("path", unnamedPath.toString()); //$NON-NLS-1$
- }
- }
-
- public void load(Element root) {
- if(root == null) return;
- Element[] linkedResources = XMLUtilities.getChildren(root, "linked-resource"); //$NON-NLS-1$
- if(linkedResources != null) for (int i = 0; i < linkedResources.length; i++) {
- String name = linkedResources[i].getAttribute("name"); //$NON-NLS-1$
- if(name == null || name.trim().length() == 0) continue;
- String path = linkedResources[i].getAttribute("path"); //$NON-NLS-1$
- if(path == null || path.trim().length() == 0) continue;
- IPath pathObject = new Path(path);
- addLinkedResource(name, pathObject);
- }
- Element[] unnamedPathElement = XMLUtilities.getChildren(root, "unnamed-path"); //$NON-NLS-1$
- if(unnamedPathElement != null) for (int i = 0; i < unnamedPathElement.length; i++) {
- String path = unnamedPathElement[i].getAttribute("path"); //$NON-NLS-1$
- IPath pathObject = new Path(path);
- addUnnamedResource(pathObject);
- }
- }
- }
-}
\ No newline at end of file
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -0,0 +1,253 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.validation;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.SeamProjectsSet;
+import org.w3c.dom.Element;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class SeamValidationContext implements ISeamValidationContext {
+
+ private ISeamValidationContext rootContext;
+
+ public SeamValidationContext(IProject project) {
+ SeamProjectsSet set = new SeamProjectsSet(project);
+ IProject war = set.getWarProject();
+ if(war!=null) {
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(war, false);
+ if(seamProject!=null) {
+ rootContext = seamProject.getValidationContext();
+ }
+ }
+ if(rootContext==null) {
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, false);
+ if(seamProject!=null) {
+ rootContext = seamProject.getValidationContext();
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#addLinkedCoreResource(java.lang.String, org.eclipse.core.runtime.IPath, boolean)
+ */
+ public void addLinkedCoreResource(String variableName, IPath linkedResourcePath, boolean declaration) {
+ rootContext.addLinkedCoreResource(variableName, linkedResourcePath, declaration);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#addLinkedEl(java.lang.String, org.jboss.tools.seam.internal.core.validation.ELReference)
+ */
+ public void addLinkedEl(String variableName, ELReference el) {
+ rootContext.addLinkedEl(variableName, el);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#addRemovedFile(org.eclipse.core.resources.IFile)
+ */
+ public void addRemovedFile(IFile file) {
+ rootContext.addRemovedFile(file);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#addUnnamedCoreResource(org.eclipse.core.runtime.IPath)
+ */
+ public void addUnnamedCoreResource(IPath fullPath) {
+ rootContext.addUnnamedCoreResource(fullPath);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#addUnnamedElResource(org.eclipse.core.runtime.IPath)
+ */
+ public void addUnnamedElResource(IPath fullPath) {
+ rootContext.addUnnamedElResource(fullPath);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#addVariableNameForELValidation(java.lang.String)
+ */
+ public void addVariableNameForELValidation(String name) {
+ rootContext.addVariableNameForELValidation(name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#clearAll()
+ */
+ public void clearAll() {
+ rootContext.clearAll();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#clearAllResourceLinks()
+ */
+ public void clearAllResourceLinks() {
+ rootContext.clearAllResourceLinks();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#clearElResourceLinks()
+ */
+ public void clearElResourceLinks() {
+ rootContext.clearElResourceLinks();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#clearOldVariableNameForElValidation()
+ */
+ public void clearOldVariableNameForElValidation() {
+ rootContext.clearOldVariableNameForElValidation();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#clearRegisteredFiles()
+ */
+ public void clearRegisteredFiles() {
+ rootContext.clearRegisteredFiles();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getCoreResourcesByVariableName(java.lang.String, boolean)
+ */
+ public Set<IPath> getCoreResourcesByVariableName(String variableName, boolean declaration) {
+ return rootContext.getCoreResourcesByVariableName(variableName, declaration);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getElsByVariableName(java.lang.String)
+ */
+ public Set<ELReference> getElsByVariableName(String variableName) {
+ return rootContext.getElsByVariableName(variableName);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getElsForValidation(java.util.Set, boolean)
+ */
+ public Set<ELReference> getElsForValidation(Set<IFile> changedFiles, boolean onlyChangedVariables) {
+ return rootContext.getElsForValidation(changedFiles, onlyChangedVariables);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getRegisteredFiles()
+ */
+ public Set<IFile> getRegisteredFiles() {
+ return rootContext.getRegisteredFiles();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getRemovedFiles()
+ */
+ public Set<IFile> getRemovedFiles() {
+ return rootContext.getRemovedFiles();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getUnnamedCoreResources()
+ */
+ public Set<IPath> getUnnamedCoreResources() {
+ return rootContext.getUnnamedCoreResources();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getUnnamedElResources()
+ */
+ public Set<IPath> getUnnamedElResources() {
+ return rootContext.getUnnamedElResources();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#getVariableNamesByCoreResource(org.eclipse.core.runtime.IPath, boolean)
+ */
+ public Set<String> getVariableNamesByCoreResource(IPath fullPath, boolean declaration) {
+ return rootContext.getVariableNamesByCoreResource(fullPath, declaration);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#load(org.w3c.dom.Element)
+ */
+ public void load(Element root) {
+ rootContext.load(root);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#registerFile(org.eclipse.core.resources.IFile)
+ */
+ public void registerFile(IFile file) {
+ rootContext.registerFile(file);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeLinkedCoreResource(org.eclipse.core.runtime.IPath)
+ */
+ public void removeLinkedCoreResource(IPath resource) {
+ rootContext.removeLinkedCoreResource(resource);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeLinkedCoreResource(java.lang.String, org.eclipse.core.runtime.IPath)
+ */
+ public void removeLinkedCoreResource(String name, IPath linkedResourcePath) {
+ rootContext.removeLinkedCoreResource(name, linkedResourcePath);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeLinkedCoreResources(java.util.Set)
+ */
+ public void removeLinkedCoreResources(Set<IPath> resources) {
+ rootContext.removeLinkedCoreResources(resources);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeLinkedEl(java.lang.String, org.jboss.tools.seam.internal.core.validation.ELReference)
+ */
+ public void removeLinkedEl(String name, ELReference el) {
+ rootContext.removeLinkedEl(name, el);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeLinkedEls(java.util.Set)
+ */
+ public void removeLinkedEls(Set<IFile> resorces) {
+ rootContext.removeLinkedEls(resorces);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeUnnamedCoreResource(org.eclipse.core.runtime.IPath)
+ */
+ public void removeUnnamedCoreResource(IPath fullPath) {
+ rootContext.removeUnnamedCoreResource(fullPath);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#removeUnnamedElResource(org.eclipse.core.runtime.IPath)
+ */
+ public void removeUnnamedElResource(IPath fullPath) {
+ rootContext.removeUnnamedElResource(fullPath);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.internal.core.validation.ISeamValidationContext#store(org.w3c.dom.Element)
+ */
+ public void store(Element root) {
+ rootContext.store(root);
+ }
+}
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationHelper.java 2009-07-03 10:34:22 UTC (rev 16378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationHelper.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -41,15 +41,23 @@
*/
public class SeamValidationHelper extends WorkbenchContext {
+ protected ISeamProject seamProject;
+
/**
* @return Seam project
*/
public ISeamProject getSeamProject() {
- ISeamProject project = null;
- project = SeamCorePlugin.getSeamProject(getProject(), true);
- return project;
+ if(seamProject==null) {
+ ISeamProject project = null;
+ seamProject = SeamCorePlugin.getSeamProject(getProject(), true);
+ }
+ return seamProject;
}
+ public void setSeamProject(ISeamProject project) {
+ seamProject = project;
+ }
+
/**
* @return Java project
*/
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2009-07-03 10:34:22 UTC (rev 16378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -21,7 +21,7 @@
*/
public abstract class SeamValidator extends ValidationErrorManager implements ISeamValidator {
- protected SeamValidationContext validationContext;
+ protected ISeamValidationContext validationContext;
protected String projectName;
/**
@@ -34,7 +34,7 @@
*/
public SeamValidator(IValidator validatorManager,
SeamContextValidationHelper coreHelper, IReporter reporter,
- SeamValidationContext validationContext, ISeamProject project) {
+ ISeamValidationContext validationContext, ISeamProject project) {
super(validatorManager, coreHelper, reporter, project, coreHelper.getProject(), ISeamValidator.MARKED_SEAM_RESOURCE_MESSAGE_GROUP);
this.validationContext = validationContext;
this.projectName = project.getProject().getName();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidatorManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidatorManager.java 2009-07-03 10:34:22 UTC (rev 16378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidatorManager.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -10,9 +10,11 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.validation;
+import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.wst.validation.internal.core.ValidationException;
@@ -20,7 +22,8 @@
import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
import org.eclipse.wst.validation.internal.provisional.core.IValidatorJob;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.internal.core.SeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.SeamProjectsSet;
/**
* This Manager invokes all dependent seam validators that should be invoked in one job.
@@ -30,6 +33,8 @@
*/
public class SeamValidatorManager implements IValidatorJob {
+ private static Set<ISeamProject> validatingProjects = new HashSet<ISeamProject>();
+
public SeamValidatorManager() {
super();
}
@@ -47,27 +52,43 @@
*/
public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException {
SeamContextValidationHelper coreHelper = (SeamContextValidationHelper)helper;
- ISeamProject project = coreHelper.getSeamProject();
+ IProject project = coreHelper.getProject();
if(project==null) {
return OK_STATUS;
}
- SeamValidationContext validationContext = ((SeamProject)project).getValidationContext();
- IStatus status = null;
- try {
- ISeamValidator coreValidator = new SeamCoreValidator(this, coreHelper, reporter, validationContext, project);
- ISeamValidator elValidator = new SeamELValidator(this, coreHelper, reporter, validationContext, project);
- ISeamValidator[] validators = new ISeamValidator[]{coreValidator, elValidator};
+ SeamProjectsSet set = new SeamProjectsSet(project);
+ IProject warProject = set.getWarProject();
+ ISeamProject seamWarProject = SeamCorePlugin.getSeamProject(warProject, false);
+ IStatus status = OK_STATUS;
+ synchronized (validatingProjects) {
+ if(validatingProjects.contains(seamWarProject)) {
+ return OK_STATUS;
+ }
+ validatingProjects.add(seamWarProject);
+ }
+ synchronized (validatingProjects) {
+ ISeamValidationContext validationContext = null;
+ try {
+ coreHelper.setSeamProject(seamWarProject);
+ validationContext = new SeamValidationContext(project);
+ coreHelper.setValidationContext(validationContext);
+ ISeamValidator coreValidator = new SeamCoreValidator(this, coreHelper, reporter, validationContext, seamWarProject);
+ ISeamValidator elValidator = new SeamELValidator(this, coreHelper, reporter, validationContext, seamWarProject);
+ ISeamValidator[] validators = new ISeamValidator[]{coreValidator, elValidator};
- Set<IFile> changedFiles = coreHelper.getChangedFiles();
- if(!changedFiles.isEmpty()) {
- status = validate(validators, changedFiles);
- } else {
-// reporter.removeAllMessages(this);
- validationContext.clearAllResourceLinks();
- status = validateAll(validators);
+ Set<IFile> changedFiles = coreHelper.getChangedFiles();
+ if(!changedFiles.isEmpty()) {
+ status = validate(validators, changedFiles);
+ } else if(!validationContext.getRegisteredFiles().isEmpty()) {
+ validationContext.clearAllResourceLinks();
+ status = validateAll(validators);
+ }
+ } finally {
+ if(validationContext!=null) {
+ validationContext.clearRegisteredFiles();
+ }
+ validatingProjects.remove(seamWarProject);
}
- } finally {
- validationContext.clearRegisteredFiles();
}
return status;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java 2009-07-03 10:34:22 UTC (rev 16378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/ValidationErrorManager.java 2009-07-03 20:54:55 UTC (rev 16379)
@@ -12,12 +12,14 @@
import java.util.Set;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.wst.validation.internal.TaskListUtility;
import org.eclipse.wst.validation.internal.core.Message;
import org.eclipse.wst.validation.internal.operations.WorkbenchReporter;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
@@ -75,10 +77,10 @@
* org.jboss.tools.seam.core.ISeamTextSourceReference,
* org.eclipse.core.resources.IResource)
*/
- public void addError(String messageId, String preferenceKey,
+ public IMarker addError(String messageId, String preferenceKey,
String[] messageArguments, ITextSourceReference location,
IResource target) {
- addError(messageId, preferenceKey, messageArguments, location
+ return addError(messageId, preferenceKey, messageArguments, location
.getLength(), location.getStartPosition(), target);
}
@@ -90,17 +92,17 @@
* org.jboss.tools.seam.core.ISeamTextSourceReference,
* org.eclipse.core.resources.IResource)
*/
- public void addError(String messageId, String preferenceKey,
+ public IMarker addError(String messageId, String preferenceKey,
ITextSourceReference location, IResource target) {
- addError(messageId, preferenceKey, new String[0], location, target);
+ return addError(messageId, preferenceKey, new String[0], location, target);
}
/* (non-Javadoc)
* @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#addError(java.lang.String, java.lang.String, java.lang.String[], org.eclipse.core.resources.IResource)
*/
- public void addError(String messageId, String preferenceKey,
+ public IMarker addError(String messageId, String preferenceKey,
String[] messageArguments, IResource target) {
- addError(messageId, preferenceKey, messageArguments, 0, 0, target);
+ return addError(messageId, preferenceKey, messageArguments, 0, 0, target);
}
private String getMarkerId() {
@@ -109,12 +111,9 @@
/*
* (non-Javadoc)
- *
- * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#addError(java.lang.String,
- * java.lang.String, java.lang.String[], int, int,
- * org.eclipse.core.resources.IResource)
+ * @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#addError(java.lang.String, java.lang.String, java.lang.String[], int, int, org.eclipse.core.resources.IResource)
*/
- public void addError(String messageId, String preferenceKey,
+ public IMarker addError(String messageId, String preferenceKey,
String[] messageArguments, int length, int offset, IResource target) {
String preferenceValue = SeamPreferences.getProjectPreference(target.getProject(), preferenceKey);
if(preferenceValue==null && seamProject!=null) {
@@ -129,7 +128,7 @@
}
if (ignore) {
- return;
+ return null;
}
IMessage message = new Message(getBaseName(), messageSeverity,
@@ -147,27 +146,33 @@
SeamCorePlugin.getPluginLog().logError(
"Exception occurred during error line number calculation",
e);
- return;
+ return null;
} catch (CoreException e) {
SeamCorePlugin.getPluginLog().logError(
"Exception occurred during error line number calculation",
e);
- return;
+ return null;
} finally {
if(coreHelper!=null) {
coreHelper.getDocumentProvider().disconnect(target);
}
}
- WorkbenchReporter.addMessage(target, this.getClass(), message, null, ""+message.getLineNumber());
-// reporter.addMessage(validationManager, message);
+ int severity = message.getSeverity();
+ try {
+ return TaskListUtility.addTask(this.getClass().getName().intern(), target, ""+message.getLineNumber(), message.getId(),
+ message.getText(this.getClass().getClassLoader()), severity, null, message.getGroupName(), message.getOffset(), message.getLength());
+ } catch (CoreException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ }
+ return null;
}
/*
* (non-Javadoc)
* @see org.jboss.tools.seam.internal.core.validation.IValidationErrorManager#addError(java.lang.String, int, java.lang.String[], int, int, org.eclipse.core.resources.IResource)
*/
- public void addError(String messageId, int severity, String[] messageArguments, int length, int offset, IResource target) {
+ public IMarker addError(String messageId, int severity, String[] messageArguments, int length, int offset, IResource target) {
IMessage message = new Message(getBaseName(), severity,
messageId, messageArguments, target,
getMarkerId());
@@ -183,15 +188,21 @@
SeamCorePlugin.getPluginLog().logError(
"Exception occurred during error line number calculation",
e);
- return;
+ return null;
} catch (CoreException e) {
SeamCorePlugin.getPluginLog().logError(
"Exception occurred during error line number calculation",
e);
- return;
+ return null;
}
- WorkbenchReporter.addMessage(target, this.getClass(), message, null, ""+message.getLineNumber());
-// reporter.addMessage(validationManager, message);
+
+ try {
+ return TaskListUtility.addTask(this.getClass().getName().intern(), target, ""+message.getLineNumber(), message.getId(),
+ message.getText(this.getClass().getClassLoader()), severity, null, message.getGroupName(), message.getOffset(), message.getLength());
+ } catch (CoreException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ }
+ return null;
}
/*
16 years, 6 months
JBoss Tools SVN: r16378 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-07-03 06:34:22 -0400 (Fri, 03 Jul 2009)
New Revision: 16378
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java
Log:
JBIDE-4491 - deleting a renamed xpath failed
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java 2009-07-03 08:41:54 UTC (rev 16377)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathCategory.java 2009-07-03 10:34:22 UTC (rev 16378)
@@ -104,7 +104,14 @@
children.put(query.getName(), query);
query.setCategory(this);
}
-
+ protected void renameQuery(String oldName, String newName) {
+ getQueries();
+ XPathQuery q = children.get(oldName);
+ if( q != null ) {
+ children.remove(oldName);
+ children.put(newName, q);
+ }
+ }
public void removeQuery(XPathQuery query) {
getQueries();
children.remove(query.getName());
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java 2009-07-03 08:41:54 UTC (rev 16377)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/descriptors/XPathQuery.java 2009-07-03 10:34:22 UTC (rev 16378)
@@ -151,6 +151,8 @@
return name;
}
public void setName(String name) {
+ if( category != null )
+ category.renameQuery(this.name, name);
this.name = name;
}
public String getFilePattern() {
16 years, 6 months
JBoss Tools SVN: r16377 - in trunk/as/plugins: org.jboss.ide.eclipse.as.wtp.override.core/META-INF and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-07-03 04:41:54 -0400 (Fri, 03 Jul 2009)
New Revision: 16377
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/schema/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/schema/referenceResolver.exsd
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IJBTModule.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ComponentUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/DefaultReferenceResolver.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IJBTComponent.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IReferenceResolver.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualArchiveComponent.java
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/ReferenceResolverUtil.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/build.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/Activator.java
trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/META-INF/MANIFEST.MF
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/ComponentDependencyContentProvider.java
Log:
More development. Woo Hoo.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/MANIFEST.MF 2009-07-03 07:16:52 UTC (rev 16376)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/META-INF/MANIFEST.MF 2009-07-03 08:41:54 UTC (rev 16377)
@@ -1,12 +1,21 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: WTP Overrides Core
-Bundle-SymbolicName: org.jboss.ide.eclipse.as.wtp.override.core
+Bundle-SymbolicName: org.jboss.ide.eclipse.as.wtp.override.core;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.jboss.ide.eclipse.as.wtp.override.core.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.wst.server.core;bundle-version="1.1.101"
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.wst.server.core;bundle-version="1.1.101",
+ org.eclipse.wst.common.modulecore;bundle-version="1.1.300",
+ org.eclipse.core.resources;bundle-version="3.5.0",
+ org.eclipse.emf.common;bundle-version="2.5.0",
+ org.eclipse.emf.ecore;bundle-version="2.5.0",
+ org.eclipse.jst.jee;bundle-version="1.0.200",
+ org.eclipse.jst.j2ee.core;bundle-version="1.1.300",
+ org.eclipse.jst.j2ee;bundle-version="1.1.300",
+ org.eclipse.wst.common.project.facet.core;bundle-version="1.4.0",
+ org.eclipse.jem.util;bundle-version="2.0.200"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.jboss.ide.eclipse.as.wtp.override.core.modules
+Export-Package: org.jboss.ide.eclipse.as.wtp.override.core.modules,
+ org.jboss.ide.eclipse.as.wtp.override.core.vcf
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/build.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/build.properties 2009-07-03 07:16:52 UTC (rev 16376)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/build.properties 2009-07-03 08:41:54 UTC (rev 16377)
@@ -1,4 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ plugin.xml
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/plugin.xml (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/plugin.xml 2009-07-03 08:41:54 UTC (rev 16377)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension-point id="referenceResolver" name="referenceResolver" schema="schema/referenceResolver.exsd"/>
+
+</plugin>
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/schema/referenceResolver.exsd
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/schema/referenceResolver.exsd (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/schema/referenceResolver.exsd 2009-07-03 08:41:54 UTC (rev 16377)
@@ -0,0 +1,116 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.common.modulecore" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.wst.common.modulecore" id="referenceResolver" name="referenceResolver"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="resolver"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="resolver">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ A required id which can be used to reference this resolver
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ The implementation class of this extension
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.wst.common.componentcore.resolvers.IReferenceResolver"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="weight" type="string">
+ <annotation>
+ <documentation>
+ The weight used for sorting the resolvers. Lighter weights float to the top and are tried first.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/Activator.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/Activator.java 2009-07-03 07:16:52 UTC (rev 16376)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/Activator.java 2009-07-03 08:41:54 UTC (rev 16377)
@@ -1,12 +1,12 @@
package org.jboss.ide.eclipse.as.wtp.override.core;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
-public class Activator extends AbstractUIPlugin {
+public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.jboss.ide.eclipse.as.wtp.override.core"; //$NON-NLS-1$
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IJBTModule.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IJBTModule.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/modules/IJBTModule.java 2009-07-03 08:41:54 UTC (rev 16377)
@@ -0,0 +1,45 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.modules;
+
+import org.eclipse.wst.server.core.IModule;
+
+
+public interface IJBTModule {
+ /**
+ * 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);
+
+ /**
+ * Returns true if this is a binary (zipped) module, and
+ * false if it is expanded.
+ *
+ * <p>If true, members() should return only a single element -
+ * the binary (jar or zip file) that contains the contents of
+ * this module. (a single IModuleResource, e.g.
+ * myejb.jar) Also, getLocation() should return the full path
+ * up to and including the binary itself. (e.g.
+ * c:\temp\myejb.jar)</p>
+ *
+ * <p>If false, members() should return the entire contents
+ * of the module, starting at the root. There should be no
+ * preceeding directory structure. (an array of
+ * IModuleResources, e.g. index.html, WEB-INF/web.xml,
+ * ...) In this case, getLocation() should return the path to
+ * the root folder containing these resources.</p>
+ *
+ * @return boolean
+ */
+ public boolean isBinary();
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ComponentUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ComponentUtils.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ComponentUtils.java 2009-07-03 08:41:54 UTC (rev 16377)
@@ -0,0 +1,64 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+
+public class ComponentUtils {
+ private static HashMap<String,String> facetToExtension = null;
+ static {
+ facetToExtension = new HashMap<String, String>();
+ facetToExtension.put(IModuleConstants.JST_WEB_MODULE, ".war");
+ facetToExtension.put(IModuleConstants.JST_EJB_MODULE, ".jar");
+ facetToExtension.put(IModuleConstants.WST_WEB_MODULE, ".war");
+ facetToExtension.put(IModuleConstants.JST_APPCLIENT_MODULE, ".jar");
+ facetToExtension.put(IModuleConstants.JST_CONNECTOR_MODULE, ".rar");
+ facetToExtension.put(IModuleConstants.JST_EAR_MODULE, ".ear");
+ }
+
+ public static void addMapping(String facet, String extension) {
+ facetToExtension.put(facet, extension);
+ }
+
+ public static String getDefaultProjectExtension(IVirtualComponent component) {
+ if( !component.isBinary()) {
+ IFacetedProject fp = getFacetedProject(component.getProject());
+ if( fp != null ) {
+ Iterator i = facetToExtension.keySet().iterator();
+ String facet = null;
+ while(i.hasNext()) {
+ facet = (String)i.next();
+ if( isProjectOfType(fp, facet))
+ return facetToExtension.get(facet);
+ }
+ }
+ }
+ return ".jar";
+ }
+
+ private static IFacetedProject getFacetedProject(IProject project) {
+ IFacetedProject facetedProject = null;
+ if (null != project && project.isAccessible()) {
+ try {
+ facetedProject = ProjectFacetsManager.create(project);
+ } catch (CoreException e) {
+ }
+ }
+ return facetedProject;
+ }
+
+ private static boolean isProjectOfType(IFacetedProject facetedProject, String typeID) {
+ if (facetedProject != null && ProjectFacetsManager.isProjectFacetDefined(typeID)) {
+ IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(typeID);
+ return projectFacet != null && facetedProject.hasProjectFacet(projectFacet);
+ }
+ return false;
+ }
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/DefaultReferenceResolver.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/DefaultReferenceResolver.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/DefaultReferenceResolver.java 2009-07-03 08:41:54 UTC (rev 16377)
@@ -0,0 +1,81 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.UnresolveableURIException;
+import org.eclipse.wst.common.componentcore.internal.ComponentcorePackage;
+import org.eclipse.wst.common.componentcore.internal.DependencyType;
+import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
+import org.eclipse.wst.common.componentcore.internal.StructureEdit;
+import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualReference;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+
+public class DefaultReferenceResolver implements IReferenceResolver {
+ // Does not need to implement,
+ // default is always called as last resort
+ public boolean canResolve(IVirtualComponent context,
+ ReferencedComponent referencedComponent) {
+ return false;
+ }
+
+ // Does not need to implement,
+ // default is always called as last resort
+ public boolean canResolve(IVirtualReference reference) {
+ return false;
+ }
+
+ public IVirtualReference resolve(IVirtualComponent context,
+ ReferencedComponent referencedComponent) {
+ IVirtualComponent targetComponent = null;
+ IProject targetProject = null;
+ URI uri = referencedComponent.getHandle();
+ if (uri == null)
+ return null;
+ boolean isClassPathURI = ModuleURIUtil.isClassPathURI(uri);
+ if( !isClassPathURI ){
+ try {
+ targetProject = StructureEdit.getContainingProject(uri);
+ } catch(UnresolveableURIException uurie) {
+ //Ignore
+ }
+ // if the project cannot be resolved, assume it's local - really it probably deleted
+
+ targetComponent = ComponentCore.createComponent(targetProject);
+
+
+ }else{
+ String archiveType = ""; //$NON-NLS-1$
+ String archiveName = ""; //$NON-NLS-1$
+ try {
+ archiveType = ModuleURIUtil.getArchiveType(uri);
+ archiveName = ModuleURIUtil.getArchiveName(uri);
+
+ } catch (UnresolveableURIException e) {
+ //Ignore
+ }
+ targetComponent = ComponentCore.createArchiveComponent(context.getProject(), archiveType + IPath.SEPARATOR + archiveName );
+ }
+ return new VirtualReference(context, targetComponent, referencedComponent.getRuntimePath(), referencedComponent.getDependencyType().getValue());
+ }
+
+ public ReferencedComponent resolve(IVirtualReference reference) {
+ IVirtualComponent referencedComponent = reference.getReferencedComponent();
+ ReferencedComponent refComp = ComponentcorePackage.eINSTANCE.getComponentcoreFactory().createReferencedComponent();
+ refComp.setRuntimePath(reference.getRuntimePath());
+ refComp.setDependencyType(DependencyType.get(reference.getDependencyType()));
+ refComp.setArchiveName(reference.getArchiveName());
+ if( referencedComponent != null ) {
+ if( !referencedComponent.isBinary())
+ refComp.setHandle(ModuleURIUtil.fullyQualifyURI(referencedComponent.getProject()));
+ else
+ refComp.setHandle(ModuleURIUtil.archiveComponentfullyQualifyURI(referencedComponent.getName()));
+ }
+ return refComp;
+ }
+
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IJBTComponent.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IJBTComponent.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IJBTComponent.java 2009-07-03 08:41:54 UTC (rev 16377)
@@ -0,0 +1,11 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+/**
+ * Simply a marker to know if this is one of our components
+ * or one of WTP's.
+ * @author rob
+ *
+ */
+public interface IJBTComponent {
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IReferenceResolver.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IReferenceResolver.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/IReferenceResolver.java 2009-07-03 08:41:54 UTC (rev 16377)
@@ -0,0 +1,12 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+
+public interface IReferenceResolver {
+ public boolean canResolve(IVirtualComponent context, ReferencedComponent referencedComponent);
+ public IVirtualReference resolve(IVirtualComponent context, ReferencedComponent referencedComponent);
+ public boolean canResolve(IVirtualReference reference);
+ public ReferencedComponent resolve(IVirtualReference reference);
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualArchiveComponent.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualArchiveComponent.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/JBTVirtualArchiveComponent.java 2009-07-03 08:41:54 UTC (rev 16377)
@@ -0,0 +1,15 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent;
+
+public class JBTVirtualArchiveComponent
+ extends J2EEModuleVirtualArchiveComponent implements IJBTComponent {
+
+ public JBTVirtualArchiveComponent(IProject aComponentProject,
+ String archiveLocation, IPath aRuntimePath) {
+ super(aComponentProject, archiveLocation, aRuntimePath);
+ }
+
+}
Added: 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 (rev 0)
+++ 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-03 08:41:54 UTC (rev 16377)
@@ -0,0 +1,336 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.jst.j2ee.componentcore.util.EARVirtualRootFolder;
+import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
+import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
+import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
+import org.eclipse.jst.jee.application.ICommonModule;
+import org.eclipse.wst.common.componentcore.internal.ComponentcoreFactory;
+import org.eclipse.wst.common.componentcore.internal.ComponentcorePackage;
+import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
+import org.eclipse.wst.common.componentcore.internal.StructureEdit;
+import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
+import org.eclipse.wst.common.componentcore.internal.builder.DependencyGraphManager;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent;
+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.IVirtualFolder;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+
+public class JBTVirtualComponent
+ extends VirtualComponent implements IJBTComponent, IComponentImplFactory {
+
+ private IVirtualReference[] cachedReferences;
+ private long depGraphModStamp;
+
+ public JBTVirtualComponent() {
+ super();
+ }
+
+ public JBTVirtualComponent(IProject aProject, IPath aRuntimePath) {
+ super(aProject, aRuntimePath);
+ }
+
+ /*
+ * These methods allow this component to make new elements
+ */
+ public IVirtualComponent createComponent(IProject aProject) {
+ return new JBTVirtualComponent(aProject, new Path("/")); //$NON-NLS-1$
+ }
+
+ public IVirtualComponent createArchiveComponent(IProject aProject, String archiveLocation, IPath aRuntimePath) {
+ return new JBTVirtualArchiveComponent(aProject, archiveLocation, aRuntimePath);
+ }
+
+ public IVirtualFolder createFolder(IProject aProject, IPath aRuntimePath) {
+ return new VirtualFolder(aProject, aRuntimePath);
+ }
+
+
+ /*
+ * The following group of methods was
+ * stolen / adapted from EarVirtualComponent.
+ */
+
+ public IVirtualReference[] getReferences() {
+
+ IVirtualReference[] cached = getCachedReferences();
+ if (cached != null)
+ return cached;
+ List<IVirtualReference> hardReferences = getHardReferences(this);
+ if( shouldExposeLooseReferences()) {
+ List dynamicReferences = getLooseArchiveReferences(this, hardReferences);
+ if (dynamicReferences != null) {
+ hardReferences.addAll(dynamicReferences);
+ }
+ }
+ cachedReferences = (IVirtualReference[]) hardReferences.toArray(new IVirtualReference[hardReferences.size()]);
+ return cachedReferences;
+ }
+
+ protected boolean shouldExposeLooseReferences() {
+ return false;
+ }
+
+ // Returns cache if still valid or null
+ public IVirtualReference[] getCachedReferences() {
+ if (cachedReferences != null && checkIfStillValid())
+ return cachedReferences;
+ else
+ depGraphModStamp = DependencyGraphManager.getInstance().getModStamp();
+ return null;
+ }
+
+ private boolean checkIfStillValid() {
+ return DependencyGraphManager.getInstance().checkIfStillValid(depGraphModStamp);
+ }
+
+ private static List<IVirtualReference> getHardReferences(IVirtualComponent earComponent) {
+ StructureEdit core = null;
+ List hardReferences = new ArrayList();
+ try {
+ core = StructureEdit.getStructureEditForRead(earComponent.getProject());
+ if (core != null && core.getComponent() != null) {
+ WorkbenchComponent component = core.getComponent();
+ if (component != null) {
+ List referencedComponents = component.getReferencedComponents();
+ for (Iterator iter = referencedComponents.iterator(); iter.hasNext();) {
+ ReferencedComponent referencedComponent = (ReferencedComponent) iter.next();
+ if (referencedComponent == null)
+ continue;
+ IVirtualReference vReference = createVirtualReference(earComponent, referencedComponent);
+ if (vReference != null) {
+ IVirtualComponent referencedIVirtualComponent = vReference.getReferencedComponent();
+ if (referencedIVirtualComponent != null && referencedIVirtualComponent.exists()) {
+ String archiveName = getArchiveName(referencedIVirtualComponent, referencedComponent);
+ vReference.setArchiveName(archiveName);
+ hardReferences.add(vReference);
+ }
+ }
+ }
+ }
+ }
+ } finally {
+ if (core != null)
+ core.dispose();
+ }
+ return hardReferences;
+ }
+
+ protected static String getArchiveName(IVirtualComponent referencedIVirtualComponent, ReferencedComponent referencedComponent) {
+ String archiveName = null;
+ if (referencedComponent.getDependentObject() != null) {
+ /*
+ * The getDependentObject part of this code needs explanation.
+ * The IVirtualComponent allows you to set some "dependent object"
+ * if you wish. WTP projects often do in the case that there's a
+ * deployment descriptor of some sort. In those cases, WTP's
+ * "dependent object" is of type ICommonModule and is an EObject.
+ * This allows virtual component to override the default archive
+ * name with one from a deployment descriptor.
+ */
+ archiveName = ((ICommonModule) referencedComponent.getDependentObject()).getUri();
+ } else {
+ if( referencedIVirtualComponent instanceof IJBTComponent ) {
+ archiveName = getJBTComponentArchiveName(referencedIVirtualComponent, referencedComponent);
+ } else {
+ archiveName = legacy_getWTPComponentArchiveName(referencedIVirtualComponent, referencedComponent);
+ }
+
+ }
+ return archiveName;
+ }
+
+ protected static String getJBTComponentArchiveName(IVirtualComponent moduleComp, ReferencedComponent ref) {
+ return ref.getArchiveName();
+ }
+
+ /*
+ * Legacy WTP implementation
+ */
+
+ protected static String legacy_getWTPComponentArchiveName(IVirtualComponent moduleComp, ReferencedComponent ref) {
+ String archiveName = null;
+ if (moduleComp.isBinary()) {
+ String uri = legacy_getJarURI(ref, moduleComp);
+ } else if(ref.getArchiveName() != null){
+ archiveName = ref.getArchiveName();
+ } else {
+ IProject referencedProject = moduleComp.getProject();
+ if (JavaEEProjectUtilities.isDynamicWebProject(referencedProject) || J2EEProjectUtilities.isStaticWebProject(referencedProject)) {
+ archiveName = moduleComp.getName() + IJ2EEModuleConstants.WAR_EXT;
+ } else if (JavaEEProjectUtilities.isJCAProject(referencedProject)) {
+ archiveName = moduleComp.getName() + IJ2EEModuleConstants.RAR_EXT;
+ } else if (JavaEEProjectUtilities.isUtilityProject(referencedProject)) {
+ archiveName = legacy_getJarURI(ref, moduleComp);
+ } else {
+ archiveName = moduleComp.getName() + IJ2EEModuleConstants.JAR_EXT;
+ }
+ }
+ return archiveName;
+ }
+
+ protected static String legacy_getJarURI(ReferencedComponent ref, IVirtualComponent moduleComp) {
+ String uri = null;
+ if (uri == null || uri.length() < 0) {
+ if(moduleComp.isBinary()){
+ uri = new Path(moduleComp.getName()).lastSegment();
+ } else {
+ uri = moduleComp.getName() + IJ2EEModuleConstants.JAR_EXT;
+ }
+ } else {
+ String prefix = ref.getRuntimePath().makeRelative().toString();
+ if (prefix.length() > 0) {
+ uri = prefix + "/" + uri; //$NON-NLS-1$
+ }
+ }
+ return uri;
+ }
+
+ private static List getLooseArchiveReferences(JBTVirtualComponent component, List hardReferences) {
+ return getLooseArchiveReferences(component, hardReferences, null, (EARVirtualRootFolder)component.getRootFolder());
+ }
+
+ private static List getLooseArchiveReferences(JBTVirtualComponent component, List hardReferences, List dynamicReferences, EARVirtualRootFolder folder) {
+ return null;
+ }
+
+
+ // Potentially to be overridden (awesome?)
+ protected static IVirtualReference createVirtualReference(IVirtualComponent context, ReferencedComponent referencedComponent) {
+ IReferenceResolver res = ReferenceResolverUtil.getDefault().getResolver(context, referencedComponent);
+ return res.resolve(context, referencedComponent);
+ }
+
+ protected static ReferencedComponent createReferencedComponent(IVirtualReference reference) {
+ IReferenceResolver res = ReferenceResolverUtil.getDefault().getResolver(reference);
+ return res.resolve(reference);
+ }
+
+ /* *******************************************
+ * Overrides from VirtualComponent class
+ * These are mostly here because of the extrapolation
+ * of createVirtualReference into its own method.
+ * *******************************************/
+ @Override
+ public IVirtualReference[] getAllReferences() {
+ StructureEdit core = null;
+ List references = new ArrayList();
+ try {
+ core = StructureEdit.getStructureEditForRead(getProject());
+ if (core!=null && core.getComponent()!=null) {
+ WorkbenchComponent component = core.getComponent();
+ if (component!=null) {
+ List referencedComponents = component.getReferencedComponents();
+ for (Iterator iter = referencedComponents.iterator(); iter.hasNext();) {
+ ReferencedComponent referencedComponent = (ReferencedComponent) iter.next();
+ if (referencedComponent==null)
+ continue;
+ IVirtualReference vReference = createVirtualReference(this, referencedComponent);
+ if( vReference != null ){
+ vReference.setArchiveName( referencedComponent.getArchiveName() );
+ }
+ if (vReference != null && vReference.getReferencedComponent() != null)
+ references.add(vReference);
+ }
+ }
+ }
+ return (IVirtualReference[]) references.toArray(new IVirtualReference[references.size()]);
+ } finally {
+ if(core != null)
+ core.dispose();
+ }
+ }
+
+ @Override
+ protected ReferencedComponent getWorkbenchReferencedComponent(IVirtualReference aReference, WorkbenchComponent component) {
+ if (aReference == null || aReference.getReferencedComponent() == null || component == null)
+ return null;
+ List referencedComponents = component.getReferencedComponents();
+ URI uri = createReferencedComponent(aReference).getHandle();
+ for (int i=0; i<referencedComponents.size(); i++) {
+ ReferencedComponent ref = (ReferencedComponent) referencedComponents.get(i);
+ if( ref.getHandle().equals(uri))
+ return ref;
+ }
+ return null;
+ }
+
+ @Override
+ public void addReferences(IVirtualReference[] references) {
+ if (references==null || references.length==0)
+ return;
+ StructureEdit core = null;
+ try {
+ core = StructureEdit.getStructureEditForWrite(getProject());
+ if (core == null)
+ return;
+ WorkbenchComponent component = core.getComponent();
+ ReferencedComponent referencedComponent = null;
+ ComponentcoreFactory factory = ComponentcorePackage.eINSTANCE.getComponentcoreFactory();
+ for (int i=0; i<references.length; i++) {
+ if (references[i] == null)
+ continue;
+ referencedComponent = createReferencedComponent(references[i]);
+ if( referencedComponent != null )
+ component.getReferencedComponents().add(referencedComponent);
+ }
+ //clean up any old obsolete references
+ if (component != null){
+ cleanUpReferences(component);
+ }
+ } finally {
+ if(core != null) {
+ core.saveIfNecessary(null);
+ core.dispose();
+ }
+ }
+ }
+
+ /* @Override */
+ private void cleanUpReferences(WorkbenchComponent component) {
+ List referencedComponents = component.getReferencedComponents();
+ for (Iterator iter = referencedComponents.iterator(); iter.hasNext();) {
+ ReferencedComponent referencedComponent = (ReferencedComponent) iter.next();
+ if (referencedComponent==null)
+ continue;
+ IVirtualReference vReference = createVirtualReference(this, referencedComponent);
+ if (vReference == null || vReference.getReferencedComponent() == null || !vReference.getReferencedComponent().exists()){
+ iter.remove();
+ }
+ }
+ }
+
+ @Override
+ public void setReferences(IVirtualReference[] references) {
+ StructureEdit core = null;
+ try {
+ core = StructureEdit.getStructureEditForWrite(getProject());
+ WorkbenchComponent component = core.getComponent();
+ ReferencedComponent referencedComponent = null;
+
+ component.getReferencedComponents().clear();
+ ComponentcoreFactory factory = ComponentcorePackage.eINSTANCE.getComponentcoreFactory();
+ for (int i=0; i<references.length; i++) {
+ referencedComponent = createReferencedComponent(references[i]);
+ if( referencedComponent != null )
+ component.getReferencedComponents().add(referencedComponent);
+ }
+ } finally {
+ if(core != null) {
+ core.saveIfNecessary(null);
+ core.dispose();
+ }
+ }
+ }
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ReferenceResolverUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ReferenceResolverUtil.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.core/src/org/jboss/ide/eclipse/as/wtp/override/core/vcf/ReferenceResolverUtil.java 2009-07-03 08:41:54 UTC (rev 16377)
@@ -0,0 +1,126 @@
+package org.jboss.ide.eclipse.as.wtp.override.core.vcf;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.common.componentcore.internal.ModulecorePlugin;
+import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
+import org.jboss.ide.eclipse.as.wtp.override.core.Activator;
+
+public class ReferenceResolverUtil {
+ public static ReferenceResolverUtil instance = null;
+ public static ReferenceResolverUtil getDefault() {
+ if( instance == null )
+ instance = new ReferenceResolverUtil();
+ return instance;
+ }
+
+ private HashMap<String, ReferenceResolverWrapper> resolvers = null;
+ private ArrayList<IReferenceResolver> sorted = null;
+ private DefaultReferenceResolver defaultResolver = new DefaultReferenceResolver();
+ public IReferenceResolver[] getResolvers() {
+ if( resolvers == null )
+ loadResolvers();
+ return (IReferenceResolver[]) sorted.toArray(new IReferenceResolver[sorted.size()]);
+ }
+
+ public IReferenceResolver getResolver(IVirtualComponent context, ReferencedComponent reference) {
+ getResolvers();
+ Iterator<IReferenceResolver> i = sorted.iterator();
+ IReferenceResolver resolver;
+ while(i.hasNext()) {
+ resolver = i.next();
+ if( resolver.canResolve(context, reference))
+ return resolver;
+ }
+ return defaultResolver;
+ }
+
+ public IReferenceResolver getResolver(IVirtualReference reference) {
+ getResolvers();
+ Iterator<IReferenceResolver> i = sorted.iterator();
+ IReferenceResolver resolver;
+ while(i.hasNext()) {
+ resolver = i.next();
+ if( resolver.canResolve(reference))
+ return resolver;
+ }
+ return defaultResolver;
+ }
+
+ protected void loadResolvers() {
+ HashMap<String, ReferenceResolverWrapper> map = new HashMap<String, ReferenceResolverWrapper>();
+
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IConfigurationElement[] cf = registry.getConfigurationElementsFor(Activator.PLUGIN_ID, "referenceResolver"); //$NON-NLS-1$
+ String id = null;
+ for( int j = 0; j < cf.length; j++ ) {
+ id = cf[j].getAttribute("id");
+ try {
+ map.put(id, new ReferenceResolverWrapper(
+ id, (IReferenceResolver)
+ cf[j].createExecutableExtension("class"),
+ cf[j].getAttribute("weight")));
+ } catch( CoreException ce ) {
+ // TODO figure it out
+ }
+ }
+ resolvers = map;
+
+ // Cache the sorted ones
+ List<ReferenceResolverWrapper> list = new ArrayList(resolvers.values());
+ Comparator comparator = new Comparator() {
+ public int compare(Object o1, Object o2) {
+ if( !(o1 instanceof ReferenceResolverWrapper))
+ return -1;
+ if( !(o2 instanceof ReferenceResolverWrapper))
+ return 1;
+ return ((ReferenceResolverWrapper)o2).getWeight()
+ - ((ReferenceResolverWrapper)o1).getWeight();
+ }
+ };
+
+ Collections.sort(list, comparator);
+ ArrayList<IReferenceResolver> sorted = new ArrayList<IReferenceResolver>();
+ Iterator i = list.iterator();
+ while(i.hasNext())
+ sorted.add(((ReferenceResolverWrapper)i.next()).getResolver());
+ this.sorted = sorted;
+ }
+
+
+ protected class ReferenceResolverWrapper {
+ private String id;
+ private IReferenceResolver resolver;
+ private int weight;
+ public ReferenceResolverWrapper(String id, IReferenceResolver resolver, String weight) {
+ this.id = id;
+ this.resolver = resolver;
+ try {
+ this.weight = Integer.parseInt(weight);
+ } catch( NumberFormatException nfe) {
+ this.weight = 1000;
+ }
+ }
+ public int getWeight() {
+ return weight;
+ }
+ public String getId() {
+ return id;
+ }
+ public IReferenceResolver getResolver() {
+ return resolver;
+ }
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/META-INF/MANIFEST.MF 2009-07-03 07:16:52 UTC (rev 16376)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/META-INF/MANIFEST.MF 2009-07-03 08:41:54 UTC (rev 16377)
@@ -20,6 +20,7 @@
org.eclipse.jdt.core;bundle-version="3.5.0",
org.eclipse.jem.util;bundle-version="2.0.200",
org.eclipse.jst.jee;bundle-version="1.0.200",
- org.eclipse.jdt.ui;bundle-version="3.5.0"
+ org.eclipse.jdt.ui;bundle-version="3.5.0",
+ org.jboss.ide.eclipse.as.wtp.override.core;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
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-03 07:16:52 UTC (rev 16376)
+++ 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-03 08:41:54 UTC (rev 16377)
@@ -51,12 +51,9 @@
import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.Window;
-import org.eclipse.jst.j2ee.componentcore.J2EEModuleVirtualArchiveComponent;
import org.eclipse.jst.j2ee.internal.ManifestUIResourceHandler;
-import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
-import org.eclipse.jst.j2ee.project.JavaEEProjectUtilities;
import org.eclipse.jst.j2ee.project.facet.IJavaProjectMigrationDataModelProperties;
import org.eclipse.jst.j2ee.project.facet.JavaProjectMigrationDataModelProvider;
import org.eclipse.swt.SWT;
@@ -93,8 +90,9 @@
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
+import org.jboss.ide.eclipse.as.wtp.override.core.vcf.ComponentUtils;
import org.jboss.ide.eclipse.as.wtp.override.ui.Messages;
-
+
public class AddModuleDependenciesPropertiesPage implements Listener,
IModuleDependenciesControl {
@@ -993,37 +991,15 @@
* Method returns the name of the given IVirtualComponent being sure the correct extension
* is on the end of the name, this is important for internal projects. Added for [Bug 241509]
*
+ * Note (rs) : I do not believe this ever gets called with a binary virtComp
+ *
* @param virtComp the IVirtualComponent to get the name of with the correct extension
* @return the name of the given IVirtualComponent with the correct extension
*/
protected String getVirtualComponentNameWithExtension(IVirtualComponent virtComp) {
String virtCompURIMapName = this.getURIMappingName(virtComp);
-
- boolean linkedToEAR = true;
- try {
- if(virtComp.isBinary()){
- linkedToEAR = ((J2EEModuleVirtualArchiveComponent)virtComp).isLinkedToEAR();
- ((J2EEModuleVirtualArchiveComponent)virtComp).setLinkedToEAR(false);
- }
- if(JavaEEProjectUtilities.isDynamicWebComponent(virtComp)) {
- if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.WAR_EXT)) {
- //web module URIs need to end in WAR
- virtCompURIMapName += IJ2EEModuleConstants.WAR_EXT;
- }
- } else if(JavaEEProjectUtilities.isJCAComponent(virtComp)) {
- if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.RAR_EXT)) {
- //connector module URIs need to end in RAR
- virtCompURIMapName += IJ2EEModuleConstants.RAR_EXT;
- }
- } else if(!virtCompURIMapName.endsWith(IJ2EEModuleConstants.JAR_EXT)) {
- //all other modules (EJB, AppClient, Utility) need to end in JAR
- virtCompURIMapName += IJ2EEModuleConstants.JAR_EXT;
- }
- } finally {
- if(virtComp.isBinary()){
- ((J2EEModuleVirtualArchiveComponent)virtComp).setLinkedToEAR(linkedToEAR);
- }
- }
+ String extension = ComponentUtils.getDefaultProjectExtension(virtComp);
+ virtCompURIMapName += extension;
return virtCompURIMapName;
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java 2009-07-03 07:16:52 UTC (rev 16376)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.wtp.override.ui/src/org/jboss/ide/eclipse/as/wtp/override/ui/propertypage/ComponentDependencyContentProvider.java 2009-07-03 08:41:54 UTC (rev 16377)
@@ -11,6 +11,7 @@
*******************************************************************************/
package org.jboss.ide.eclipse.as.wtp.override.ui.propertypage;
+import java.io.File;
import java.util.HashMap;
import org.eclipse.core.resources.IProject;
@@ -22,6 +23,7 @@
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.common.componentcore.internal.resources.VirtualArchiveComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -67,6 +69,12 @@
}
return runtimePaths.get(element);
} else if (columnIndex == 1) {
+ if( comp.isBinary() && comp instanceof VirtualArchiveComponent) {
+ IPath p = ((VirtualArchiveComponent)comp).getWorkspaceRelativePath();
+ if( p == null )
+ p = new Path(((VirtualArchiveComponent)comp).getUnderlyingDiskFile().getAbsolutePath());
+ return p.toString();
+ }
return comp.getProject().getName();
}
} else if (element instanceof IProject){
16 years, 6 months
JBoss Tools SVN: r16376 - trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-07-03 03:16:52 -0400 (Fri, 03 Jul 2009)
New Revision: 16376
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
Log:
JBIDE-4551
Add CSV input type string
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-07-03 07:08:57 UTC (rev 16375)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-07-03 07:16:52 UTC (rev 16376)
@@ -50,6 +50,8 @@
public static final String INPUT_TYPE_JAVA = "java";
public static final String INPUT_TYPE_JSON = "json";
+
+ public static final String INPUT_TYPE_CSV = "csv";
public static final String PARAM_NAME_CLASS = "class";
@@ -484,7 +486,8 @@
public static String getInputPath(InputType input) {
List<org.jboss.tools.smooks.model.graphics.ext.ParamType> list = input.getParam();
if (INPUT_TYPE_JAVA.equals(input.getType()) || INPUT_TYPE_XML.equals(input.getType())
- || INPUT_TYPE_XSD.equals(input.getType()) || INPUT_TYPE_JSON.equals(input.getType())) {
+ || INPUT_TYPE_XSD.equals(input.getType()) || INPUT_TYPE_JSON.equals(input.getType())
+ || INPUT_TYPE_CSV.equals(input.getType())) {
for (Iterator<?> iterator = list.iterator(); iterator.hasNext();) {
org.jboss.tools.smooks.model.graphics.ext.ParamType paramType = (org.jboss.tools.smooks.model.graphics.ext.ParamType) iterator
.next();
16 years, 6 months
JBoss Tools SVN: r16375 - trunk/smooks/plugins.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-07-03 03:08:57 -0400 (Fri, 03 Jul 2009)
New Revision: 16375
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.runtime/
Removed:
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/
Log:
JBIDE-4536
Change the plugins name
Copied: trunk/smooks/plugins/org.jboss.tools.smooks.runtime (from rev 16374, trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2)
16 years, 6 months
JBoss Tools SVN: r16374 - in trunk/smooks: plugins/org.jboss.tools.milyn.smooks1_1_2 and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-07-03 03:07:22 -0400 (Fri, 03 Jul 2009)
New Revision: 16374
Modified:
trunk/smooks/features/org.jboss.tools.smooks.feature/feature.xml
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/.project
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/META-INF/MANIFEST.MF
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/plugin.properties
trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
Log:
JBIDE-4536
Change the plugins name
Modified: trunk/smooks/features/org.jboss.tools.smooks.feature/feature.xml
===================================================================
--- trunk/smooks/features/org.jboss.tools.smooks.feature/feature.xml 2009-07-03 07:03:50 UTC (rev 16373)
+++ trunk/smooks/features/org.jboss.tools.smooks.feature/feature.xml 2009-07-03 07:07:22 UTC (rev 16374)
@@ -37,7 +37,7 @@
unpack="false"/>
<plugin
- id="org.jboss.tools.milyn.smooks1_1_2"
+ id="org.jboss.tools.smooks.runtime"
download-size="0"
install-size="0"
version="0.0.0"
Modified: trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/.project
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/.project 2009-07-03 07:03:50 UTC (rev 16373)
+++ trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/.project 2009-07-03 07:07:22 UTC (rev 16374)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.jboss.tools.milyn.smooks1_1_2</name>
+ <name>org.jboss.tools.smooks.runtime</name>
<comment></comment>
<projects>
</projects>
Modified: trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/META-INF/MANIFEST.MF 2009-07-03 07:03:50 UTC (rev 16373)
+++ trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/META-INF/MANIFEST.MF 2009-07-03 07:07:22 UTC (rev 16374)
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
-Bundle-SymbolicName: org.jboss.tools.milyn.smooks1_1_2
+Bundle-SymbolicName: org.jboss.tools.smooks.runtime
Bundle-Version: 1.1.2
Require-Bundle: org.eclipse.core.runtime,
org.antlr.runtime,
Modified: trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/plugin.properties
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/plugin.properties 2009-07-03 07:03:50 UTC (rev 16373)
+++ trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/plugin.properties 2009-07-03 07:07:22 UTC (rev 16374)
@@ -1,2 +1,2 @@
-pluginName=Smooks Library 1.1.2 Plug-in
+pluginName=Smooks Runtime 1.1.2 Plug-in
providerName=JBoss, a division of Red Hat
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2009-07-03 07:03:50 UTC (rev 16373)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2009-07-03 07:07:22 UTC (rev 16374)
@@ -25,7 +25,7 @@
org.eclipse.wst.wsdl,
org.apache.xerces,
javax.wsdl,
- org.jboss.tools.milyn.smooks1_1_2;bundle-version="1.1.2"
+ org.jboss.tools.smooks.runtime;bundle-version="1.1.2"
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
16 years, 6 months
JBoss Tools SVN: r16373 - in trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example: filerouter and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-07-03 03:03:50 -0400 (Fri, 03 Jul 2009)
New Revision: 16373
Removed:
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/css/
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/csvtoxml/
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/editojava/
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/editoxml/
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/FileRouterMain.java
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/FileRouterMain1.java
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/InputOrderGenerator.java
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/ToFileRoutingTest.java
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/order-message.xml
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/orderitem-split.ftl
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/smooks-config.xml
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/target/input-message.xml
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/target/orders/
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/javatojava/
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/model/
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/srcmodel/
trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/trgmodel/
Log:
JBIDE-4536
Remove the example codes
Deleted: trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/FileRouterMain.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/FileRouterMain.java 2009-07-03 06:56:02 UTC (rev 16372)
+++ trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/FileRouterMain.java 2009-07-03 07:03:50 UTC (rev 16373)
@@ -1,119 +0,0 @@
-/*
- Milyn - Copyright (C) 2006
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License (version 2.1) as published by the Free Software
- Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- See the GNU Lesser General Public License for more details:
- http://www.gnu.org/licenses/lgpl.txt
-*/
-package example.filerouter;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.List;
-
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.milyn.Smooks;
-import org.milyn.SmooksException;
-import org.milyn.container.ExecutionContext;
-import org.milyn.routing.file.FileListAccessor;
-import org.xml.sax.SAXException;
-
-/**
- * This is a simple example that demonstrates how Smooks can be
- * configured to "route" the output of a transform to file(s).
- *
- * @author <a href="mailto:daniel.bevenius@gmail.com">Daniel Bevenius</a>
- *
- */
-public class FileRouterMain
-{
- private static final String LINE_SEP = System.getProperty( "line.separator" );
-
- protected void runSmooksTransform() throws IOException, SAXException, ClassNotFoundException
- {
- final Smooks smooks = new Smooks( "example/filerouter/smooks-config.xml" );
- final ExecutionContext executionContext = smooks.createExecutionContext();
-
- // create the source and result
- final StreamSource source = new StreamSource( FileRouterMain.class.getResourceAsStream("target/input-message.xml" ) );
- final StreamResult result = null;
-
- //executionContext.setEventListener(new HtmlReportGenerator("target/report.html"));
-
- // perform the transform
- smooks.filter( source, result, executionContext );
-
- // display the output from the transform
- System.out.println( LINE_SEP );
- System.out.println( "List file : [" + FileListAccessor.getListFileNames( executionContext ) + "]" );
-
- // uncomment to print the files
- printFiles( executionContext );
-
- }
-
- public static void main(String[] args) throws IOException, SAXException, SmooksException, InterruptedException, ClassNotFoundException
- {
- String fileName = "src/example/filerouter/target/input-message.xml";
- System.out.println(fileName);
- System.out.println();
- String nrofLineItems = pause("Please specify number of order-items to generate in the input message > ");
- InputOrderGenerator.main( new String[] { fileName, nrofLineItems } );
-
- final FileRouterMain smooksMain = new FileRouterMain();
-
- System.out.println( LINE_SEP );
- System.out.println("input-message.xml needs to be transformed and appended to a file");
- System.out.println( LINE_SEP );
- pause("Press 'enter' to display the transformed message...");
- smooksMain.runSmooksTransform();
- System.out.println( LINE_SEP );
- pause("That's it ");
- }
-
- /*
- * Can be used to print the list of files and their contents.
- * Beware that this can cause memory issues as the whole list file will be
- * read into memory. This method should only be used with smaller transforms.
- */
- @SuppressWarnings ("unused")
- private void printFiles( ExecutionContext executionContext ) throws IOException, ClassNotFoundException
- {
- List<String> allListFiles = FileListAccessor.getListFileNames( executionContext );
- for (String listFile : allListFiles)
- {
- List<String> fileNames = (List<String>) FileListAccessor.getFileList( executionContext, listFile );
- System.out.println( "Contains [" + fileNames.size() + "] files");
- for (String fileName : fileNames)
- {
- System.out.println( "fileName : [" + fileName + "]" );
- }
- }
- }
-
- private static String pause(String message) {
- try {
- BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
- System.out.print("> " + message);
- return in.readLine();
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- System.out.println( LINE_SEP );
- return null;
- }
-
-}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/FileRouterMain1.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/FileRouterMain1.java 2009-07-03 06:56:02 UTC (rev 16372)
+++ trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/FileRouterMain1.java 2009-07-03 07:03:50 UTC (rev 16373)
@@ -1,78 +0,0 @@
-/*
- Milyn - Copyright (C) 2006
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License (version 2.1) as published by the Free Software
- Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- See the GNU Lesser General Public License for more details:
- http://www.gnu.org/licenses/lgpl.txt
-*/
-package example.filerouter;
-
-import org.milyn.io.StreamUtils;
-import org.milyn.util.DollarBraceDecoder;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.util.regex.Pattern;
-import java.util.regex.Matcher;
-
-/**
- * Simple file consumer.
- * <p/>
- * Eats the files produced by the Smooks file splitter.
- *
- * @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly(a)gmail.com</a>
- */
-public class FileRouterMain1 {
-
- public static void main(String[] args) throws Exception {
- File fileDir = new File("/splitter-router/target/orders");
- SplitFilenameFilter filter = new SplitFilenameFilter();
-
- fileDir.mkdirs();
- System.out.println(fileDir.getAbsolutePath());
- (new File(fileDir, "order-332.lst")).delete();
- (new File(fileDir, "order-332.lst")).deleteOnExit();
-
- System.out.println("Started!");
- System.out.println("Waiting...\n");
- while (true) {
- File[] files = fileDir.listFiles(filter);
-
- if(files.length > 0) {
- for (File file : files) {
- if(file.getName().endsWith(".xml")) {
- System.out.println("Consuming File: " + file.getName());
- System.out.println(new String(StreamUtils.readFile(file)));
- System.out.println("\n");
- file.delete();
- }
-
- Thread.sleep(500);
- }
- System.out.println("Waiting...");
- }else{
- break;
- }
-
- Thread.sleep(1000);
- }
- }
-
- public static class SplitFilenameFilter implements FileFilter {
-
- private Pattern regexPattern = Pattern.compile("order-.*.xml");
-
- public boolean accept(File file) {
- Matcher matcher = regexPattern.matcher(file.getName());
- return matcher.matches();
- }
- }
-}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/InputOrderGenerator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/InputOrderGenerator.java 2009-07-03 06:56:02 UTC (rev 16372)
+++ trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/InputOrderGenerator.java 2009-07-03 07:03:50 UTC (rev 16373)
@@ -1,112 +0,0 @@
-package example.filerouter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-
-/**
- * Simply generates an sample xml
- * </p>
- * Usage: <br>
- * InputOrderGenerator filename <nrOfOrderRows>
- * </br>
- * <pre>
- *Will generate a file that looks like this:
- *<order>
- * <header>
- * <date>Wed Nov 15 13:45:28 EST 2006</date>
- * <customer number="123123">Joe</customer>
- * </header>
- * <order-items>
- * <order-item>
- * <product>111</product>
- * <quantity>2</quantity>
- * <price>8.90</price>
- * </order-item>
- * ...
- * </order-item>
- * </order-items>
- *<order>
- * </pre>
- * The number of order-items is controlled by the 'nrOfOrderRows' argument.
- *
- * @author <a href="mailto:daniel.bevenius@gmail.com">Daniel Bevenius</a>
- *
- */
-public class InputOrderGenerator
-{
- private static final String LINE_SEP = System.getProperty( "line.separator" );
-
- public static void main( String[] args ) throws IOException
- {
- if ( args.length != 2 )
- {
- printUsage();
- return;
- }
-
- String fileName = args[0];
- String nrOfOrderItemRows = args[1];
- int nrOfOrderItems = Integer.parseInt( nrOfOrderItemRows );
-
- File file = new File (fileName);
- deleteFile( file );
- FileWriter writer = new FileWriter( file, true );
- writer.write( "<order id='332'>" + LINE_SEP );
- writer.write( "<header>" + LINE_SEP);
- writer.write( "<customer number=\"123\">Joe</customer>" + LINE_SEP );
- writer.write( "</header>" + LINE_SEP);
- writer.flush();
- writer.write( "<order-items>" + LINE_SEP );
- System.out.print("Generating " + file.getName() + "...");
- for ( int i = 1 ; i <= nrOfOrderItems ; i ++ )
- {
- writer.write( "<order-item id='" + i + "'>" + LINE_SEP );
- writer.write( "<product>" + i + "</product>" + LINE_SEP );
- writer.write( "<quantity>2</quantity>" + LINE_SEP );
- writer.write( "<price>8.80</price>" + LINE_SEP );
- writer.write( "</order-item>" + LINE_SEP );
- writer.flush();
- }
- writer.write( "</order-items>" + LINE_SEP);
- writer.write( "</order>" + LINE_SEP );
- writer.close();
- System.out.println();
- System.out.println("Generated " + file.getName() + " size = [" + getFileLength( file ) + "]" );
- }
-
- private static String getFileLength( final File file )
- {
- long fileLength = file.length();
- int digits = String.valueOf( fileLength ).length();
- if ( digits < 4 )
- {
- return fileLength + " Byte(s)";
- }
- else if ( digits >= 4 && digits <= 6 )
- {
- return fileLength / 1024 + " KB";
- }
- else
- {
- return fileLength / (1024 * 1024 ) + " MB";
- }
- }
-
- private static void deleteFile( final File file ) throws IOException
- {
- if ( file.exists() )
- {
- boolean delete = file.delete();
- if ( !delete )
- {
- throw new IOException ("Could not delete file [" + file.getAbsolutePath() + "]" );
- }
- }
- }
-
- public static void printUsage()
- {
- System.err.println( "Usage: InputOrderGenerator filename <nrOfOrderRows>");
- }
-
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/ToFileRoutingTest.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/ToFileRoutingTest.java 2009-07-03 06:56:02 UTC (rev 16372)
+++ trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/ToFileRoutingTest.java 2009-07-03 07:03:50 UTC (rev 16373)
@@ -1,158 +0,0 @@
-/*
- Milyn - Copyright (C) 2006
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License (version 2.1) as published by the Free Software
- Foundation.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- See the GNU Lesser General Public License for more details:
- http://www.gnu.org/licenses/lgpl.txt
-*/
-package example.filerouter;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.xml.transform.stream.StreamSource;
-
-import junit.framework.TestCase;
-
-import org.milyn.Smooks;
-import org.milyn.container.ExecutionContext;
-import org.milyn.delivery.Filter;
-import org.xml.sax.SAXException;
-
-/**
- * @author <a href="mailto:tom.fennelly@gmail.com">tom.fennelly(a)gmail.com</a>
- */
-public class ToFileRoutingTest extends TestCase {
-
- private File targetDir = new File("src/example/filerouter/target/orders");
- private File file1 = new File(targetDir, "order-231-1.xml");
- private File file2 = new File(targetDir, "order-231-2.xml");
- private File file3 = new File(targetDir, "order-231-3.xml");
- private File file4 = new File(targetDir, "order-231-4.xml");
- private File file5 = new File(targetDir, "order-231-5.xml");
- private File file6 = new File(targetDir, "order-231-6.xml");
- private File file7 = new File(targetDir, "order-231-7.xml");
- private File listFile = new File(targetDir, "order-231.lst");
-
- protected void setUp() throws Exception {
- deleteFiles();
- }
-
- protected void tearDown() throws Exception {
- deleteFiles();
- }
-
- private void deleteFiles() {
- file1.delete();
- file2.delete();
- file3.delete();
- file4.delete();
- file5.delete();
- file6.delete();
- file7.delete();
- listFile.delete();
- }
-
- public void test_dom() throws IOException, SAXException {
- test(Filter.StreamFilterType.DOM);
- }
-
- public void test_sax() throws IOException, SAXException {
- test(Filter.StreamFilterType.SAX);
- }
-
- public void test(Filter.StreamFilterType filterType) throws IOException, SAXException {
- startSmooksThread(filterType);
-
- // The highWaterMark is set to 3 in the smooks config...
- waitForFile(file1, 5000);
- waitForFile(file2, 5000);
- waitForFile(file3, 5000);
-
- sleep(500);
- // file4 shouldn't be there...
- assertTrue("file4 exists!", !file4.exists());
-
- // delete file1 and file4 should appear then...
- file1.delete();
- waitForFile(file4, 5000);
- // file4 should be there...
- assertTrue("file4 doesn't exists!", file4.exists());
-
- sleep(1000);
- // file5 shouldn't be there...
- assertTrue("file5 exists!", !file5.exists());
-
- // delete file2, file3, file4 and file5, file6 and file7 should appear then...
- file2.delete();
- file3.delete();
- file4.delete();
- sleep(2000);
- waitForFile(file7, 5000);
- assertTrue(file5.exists());
- assertTrue(file6.exists());
- assertTrue(file7.exists());
- assertTrue(listFile.exists());
-
- System.out.println("File router test case succuess!");
- }
-
- private void startSmooksThread(Filter.StreamFilterType filterType) {
- SmooksThread thread = new SmooksThread(filterType);
-
- thread.start();
- while(!thread.running) {
- sleep(100);
- }
- }
-
- private void waitForFile(File file, int maxWait) {
- long start = Math.max(500, System.currentTimeMillis());
-
- while(!file.exists() && (System.currentTimeMillis() < start + maxWait)) {
- sleep(100);
- }
- }
-
- private void sleep(long duration) {
- try {
- Thread.sleep(duration);
- } catch (InterruptedException e) {
- TestCase.fail(e.getMessage());
- }
- }
-
- private class SmooksThread extends Thread {
- boolean running = false;
- private Filter.StreamFilterType filterType;
-
- public SmooksThread(Filter.StreamFilterType filterType) {
- this.filterType = filterType;
- }
-
- public void run() {
- Smooks smooks = null;
- try {
- smooks = new Smooks(getClass().getResourceAsStream("smooks-config.xml"));
- } catch (IOException e) {
- TestCase.fail(e.getMessage());
- } catch (SAXException e) {
- TestCase.fail(e.getMessage());
- }
-
- ExecutionContext execCtx = smooks.createExecutionContext();
- //execCtx.setEventListener(new HtmlReportGenerator("/zap/x.html"));
- Filter.setFilterType(smooks, filterType);
- running = true;
- smooks.filter(new StreamSource(getClass().getResourceAsStream("order-message.xml")), null, execCtx);
- }
- }
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/order-message.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/order-message.xml 2009-07-03 06:56:02 UTC (rev 16372)
+++ trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/order-message.xml 2009-07-03 07:03:50 UTC (rev 16373)
@@ -1,42 +0,0 @@
-<order id="231">
- <header>
- <customer number="123123">Joe</customer>
- </header>
- <order-items>
- <order-item id="1">
- <product>111</product>
- <quantity>1</quantity>
- <price>1.00</price>
- </order-item>
- <order-item id="2">
- <product>222</product>
- <quantity>2</quantity>
- <price>2.00</price>
- </order-item>
- <order-item id="3">
- <product>333</product>
- <quantity>3</quantity>
- <price>3.00</price>
- </order-item>
- <order-item id="4">
- <product>444</product>
- <quantity>4</quantity>
- <price>4.00</price>
- </order-item>
- <order-item id="5">
- <product>555</product>
- <quantity>5</quantity>
- <price>5.00</price>
- </order-item>
- <order-item id="6">
- <product>666</product>
- <quantity>6</quantity>
- <price>6.00</price>
- </order-item>
- <order-item id="7">
- <product>777</product>
- <quantity>7</quantity>
- <price>7.00</price>
- </order-item>
- </order-items>
-</order>
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/orderitem-split.ftl
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/orderitem-split.ftl 2009-07-03 06:56:02 UTC (rev 16372)
+++ trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/orderitem-split.ftl 2009-07-03 07:03:50 UTC (rev 16373)
@@ -1,11 +0,0 @@
-<orderitem id="${order.orderItem.itemId}" order="${order.orderId}">
- <customer>
- <name>${order.customerName}</name>
- <number>${order.customerNumber?c}</number>
- </customer>
- <details>
- <productId>${order.orderItem.productId}</productId>
- <quantity>${order.orderItem.quantity}</quantity>
- <price>${order.orderItem.price}</price>
- </details>
-</orderitem>
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/smooks-config.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/smooks-config.xml 2009-07-03 06:56:02 UTC (rev 16372)
+++ trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/smooks-config.xml 2009-07-03 07:03:50 UTC (rev 16373)
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
- xmlns:jb="http://www.milyn.org/xsd/smooks/javabean-1.1.xsd"
- xmlns:file="http://www.milyn.org/xsd/smooks/file-routing-1.1.xsd"
- xmlns:ftl="http://www.milyn.org/xsd/smooks/freemarker-1.1.xsd">
-
- <!--
- Filter the message using the SAX Filter (i.e. not DOM, so no
- intermediate DOM, so we can process huge messages...
- -->
- <params>
- <param name="stream.filter.type">SAX</param>
- </params>
-
- <!-- Extract and decode data from the message. Used in the freemarker template (below).
- Note that we could also use a NodeModel here... -->
- <jb:bindings beanId="order" class="java.util.Hashtable" createOnElement="order">
- <jb:value property="orderId" decoder="Integer" data="order/@id"/>
- <jb:value property="customerNumber" decoder="Long" data="header/customer/@number"/>
- <jb:value property="customerName" data="header/customer"/>
- <jb:wiring property="orderItem" beanIdRef="orderItem"/>
- </jb:bindings>
- <jb:bindings beanId="orderItem" class="java.util.Hashtable" createOnElement="order-item">
- <jb:value property="itemId" decoder="Integer" data="order-item/@id"/>
- <jb:value property="productId" decoder="Long" data="order-item/product"/>
- <jb:value property="quantity" decoder="Integer" data="order-item/quantity"/>
- <jb:value property="price" decoder="Double" data="order-item/price"/>
- </jb:bindings>
-
- <!-- Create/open a file output stream. This is writen to by the freemarker template (below).. -->
- <file:outputStream openOnElement="order-item" resourceName="orderItemSplitStream">
- <file:fileNamePattern>order-${order.orderId}-${order.orderItem.itemId}.xml</file:fileNamePattern>
- <file:destinationDirectoryPattern>src/example/filerouter/target/orders</file:destinationDirectoryPattern>
- <file:listFileNamePattern>order-${order.orderId}.lst</file:listFileNamePattern>
-
- <file:highWaterMark mark="3"/>
- </file:outputStream>
-
- <!--
- Every time we hit the end of an <order-item> element, apply this freemarker template,
- outputting the result to the "orderItemSplitStream" OutputStream, which is the file
- output stream configured above.
- -->
- <ftl:freemarker applyOnElement="order-item">
- <ftl:template>example/filerouter/orderitem-split.ftl</ftl:template>
- <ftl:use>
- <!-- Output the templating result to the "orderItemSplitStream" file output stream... -->
- <ftl:outputTo outputStreamResource="orderItemSplitStream"/>
- </ftl:use>
- </ftl:freemarker>
-
-</smooks-resource-list>
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/target/input-message.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/target/input-message.xml 2009-07-03 06:56:02 UTC (rev 16372)
+++ trunk/smooks/plugins/org.jboss.tools.milyn.smooks1_1_2/src/example/filerouter/target/input-message.xml 2009-07-03 07:03:50 UTC (rev 16373)
@@ -1,12 +0,0 @@
-<order id='332'>
-<header>
-<customer number="123">Joe</customer>
-</header>
-<order-items>
-<order-item id='1'>
-<product>1</product>
-<quantity>2</quantity>
-<price>8.80</price>
-</order-item>
-</order-items>
-</order>
16 years, 6 months
JBoss Tools SVN: r16372 - in trunk: hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-07-03 02:56:02 -0400 (Fri, 03 Jul 2009)
New Revision: 16372
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/.settings/
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/.settings/org.eclipse.jdt.core.prefs
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormActionData.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormAttributeData.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3CacheFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3EventFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3FileFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3MappingFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3PropertyFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3SessionFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3AnyFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ClassFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ColumnFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ComponentFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3CompositeElementFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3DatabaseObjectFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ElementFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FileFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FilterFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormLayoutDataUtil.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormulaFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3IdFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3KeyFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ListFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ManyToOneFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3MapFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3MetaFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3OneToOneFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3PropertyFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3SQLQueryFormLayoutData.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3SetFormLayoutData.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3557 Added NON-NLS comments. Also added javadocs to show which params are translatable when constructing FormData etc.
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormActionData.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormActionData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormActionData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -17,6 +17,11 @@
private String label;
private String actionPath;
+ /**
+ *
+ * @param label (translatable)
+ * @param actionPath (non-translatable)
+ */
public FormActionData(String label, String actionPath) {
this.label = label;
this.actionPath = actionPath;
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormAttributeData.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormAttributeData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormAttributeData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -20,12 +20,20 @@
*/
public class FormAttributeData implements IFormAttributeData {
- private String name;
+ private String name; // (non-translatable)
private ILayoutDataFactory layoutDataFactory;
- private String wraperClassName;
+ private String wraperClassName; // (non-translatable)
private int width;
- private String displayName;
+ private String displayName; // (translatable)
+ /**
+ *
+ * @param name (non-translatable)
+ * @param layoutDataFactory
+ * @param wraperClassName (non-translatable)
+ * @param width
+ * @param displayname (translatable)
+ */
public FormAttributeData(String name, ILayoutDataFactory layoutDataFactory, String wraperClassName, int width, String displayname) {
this.name = name;
if(layoutDataFactory == null) layoutDataFactory = LayoutDataFactory.getInstance();
@@ -35,26 +43,59 @@
this.displayName = displayname;
}
+ /**
+ *
+ * @param name (non-translatable)
+ * @param layoutDataFactory
+ * @param wraperClassName (non-translatable)
+ * @param width
+ */
public FormAttributeData(String name, ILayoutDataFactory layoutDataFactory, String wraperClassName, int width) {
this(name, layoutDataFactory, wraperClassName, width, null);
}
+ /**
+ *
+ * @param name (non-translatable)
+ * @param layoutDataFactory
+ * @param wraperClassName (non-translatable)
+ */
public FormAttributeData(String name, ILayoutDataFactory layoutDataFactory, String wraperClassName) {
this(name, layoutDataFactory, wraperClassName, 0);
}
+ /**
+ *
+ * @param name (non-translatable)
+ * @param layoutDataFactory
+ */
public FormAttributeData(String name, ILayoutDataFactory layoutDataFactory) {
this(name, layoutDataFactory, null, 0);
}
-
+
+ /**
+ *
+ * @param name (non-translatable)
+ * @param width
+ */
public FormAttributeData(String name, int width) {
this(name, LayoutDataFactory.getInstance(), null, width);
}
+ /**
+ *
+ * @param name (non-translatable)
+ * @param width
+ * @param displayName (translatable)
+ */
public FormAttributeData(String name, int width, String displayName) {
this(name, LayoutDataFactory.getInstance(), null, width, displayName);
}
+ /**
+ *
+ * @param name (non-translatable)
+ */
public FormAttributeData(String name) {
this(name, LayoutDataFactory.getInstance(), null, 0);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormData.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/FormData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -17,17 +17,28 @@
*/
public class FormData implements IFormData {
- private String header;
- private String description;
+ private String header; // (translatable)
+ private String description; // (translatable)
private IFormAttributeData[] attributes;
- private String[] entities;
+ private String[] entities; // (non-translatable)
private IFormActionData[] actions;
private IFormData[] forms;
- private String entityName;
+ private String entityName; // (non-translatable)
private IWidgetSettings widgetSettings;
private String formClassName;
+ /**
+ *
+ * @param header (translatable)
+ * @param description (translatable)
+ * @param entityName (non-translatable)
+ * @param attributes
+ * @param entities (non-translatable)
+ * @param actions
+ * @param forms
+ * @param widgetSettings
+ */
public FormData(String header, String description, String entityName, IFormAttributeData[] attributes, String[] entities, IFormActionData[] actions, IFormData[] forms, IWidgetSettings widgetSettings) {
this.header = header;
this.description = description;
@@ -39,30 +50,75 @@
this.widgetSettings = widgetSettings;
}
+ /**
+ *
+ * @param header (translatable)
+ * @param description (translatable)
+ * @param entityName (non-translatable)
+ * @param attributes
+ * @param entities (non-translatable)
+ * @param actions
+ */
public FormData(String header, String description, String entityName, IFormAttributeData[] attributes, String[] entities, IFormActionData[] actions) {
this(header, description, entityName, attributes, entities, actions, null, new WhiteSettings());
}
+ /**
+ *
+ * @param header (translatable)
+ * @param description (translatable)
+ * @param attributes
+ * @param entities (non-translatable)
+ * @param actions
+ */
public FormData(String header, String description, IFormAttributeData[] attributes, String[] entities, IFormActionData[] actions) {
this(header, description, null, attributes, entities, actions, null, new WhiteSettings());
}
+ /**
+ *
+ * @param entityName (non-translatable)
+ * @param entities (non-translatable)
+ * @param forms
+ */
public FormData(String entityName, String[] entities, IFormData[] forms) {
this(null, null, entityName, null, entities, null, forms, new WhiteSettings());
}
+ /**
+ *
+ * @param header (translatable)
+ * @param description (translatable)
+ * @param entityName (non-translatable)
+ * @param attributes
+ */
public FormData(String header, String description, String entityName, IFormAttributeData[] attributes) {
this(header, description, entityName, attributes, null, null, null, new WhiteSettings());
}
+ /**
+ *
+ * @param header (translatable)
+ * @param description (translatable)
+ * @param attributes
+ */
public FormData(String header, String description, IFormAttributeData[] attributes) {
this(header, description, null, attributes, null, null, null, new WhiteSettings());
}
+ /**
+ *
+ * @param entityName (non-translatable)
+ * @param forms
+ */
public FormData(String entityName, IFormData[] forms) {
this(null, null, entityName, null, null, null, forms, null);
}
+ /**
+ *
+ * @param formClassName (non-translatable)
+ */
public FormData(String formClassName) {
this.formClassName = formClassName;
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/.settings/org.eclipse.jdt.core.prefs 2009-07-03 06:56:02 UTC (rev 16372)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3CacheFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3CacheFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3CacheFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -24,8 +24,8 @@
final static IFormData CACHE_LIST_DEFINITION = new FormData(
"Caches",
"", //Description //$NON-NLS-1$
- "Caches",
- new FormAttributeData[]{new FormAttributeData("item", 100, "item")},
+ "Caches", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("item", 100, "item")}, //$NON-NLS-1$
new String[]{CLASS_CACHE_ENTITY, COLLECTION_CACHE_ENTITY},
Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddCache") //$NON-NLS-1$
);
@@ -33,8 +33,8 @@
final static IFormData CACHE_FOLDER_DEFINITION = new FormData(
"Caches",
"", //"Description //$NON-NLS-1$
- "HibConfig3CachesFolder",
- new FormAttributeData[]{new FormAttributeData("item", 100, "item")},
+ "HibConfig3CachesFolder", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("item", 100, "item")}, //$NON-NLS-1$
new String[]{CLASS_CACHE_ENTITY, COLLECTION_CACHE_ENTITY},
Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddCache") //$NON-NLS-1$
);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3EventFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3EventFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3EventFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -19,49 +19,53 @@
* @author glory
*/
public class HibConfig3EventFormLayoutData {
- static String EVENT_ENTITY = "HibConfig3Event";
- static String LISTENER_ENTITY = "HibConfig3Listener";
+ static String EVENT_ENTITY = "HibConfig3Event"; //$NON-NLS-1$
+ static String LISTENER_ENTITY = "HibConfig3Listener"; //$NON-NLS-1$
final static IFormData EVENT_LIST_DEFINITION = new FormData(
"Events",
- "", //Description
- "Events",
- new FormAttributeData[]{new FormAttributeData("type", 100, "type")},
+ "", //Description //$NON-NLS-1$
+ "Events", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("type", 100, "type")}, //$NON-NLS-1$
new String[]{EVENT_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddEvent")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddEvent") //$NON-NLS-1$
);
final static IFormData EVENT_FOLDER_DEFINITION = new FormData(
"Events",
- "", //"Description
- "HibConfig3EventsFolder",
- new FormAttributeData[]{new FormAttributeData("type", 100, "type")},
+ "", //Description //$NON-NLS-1$
+ "HibConfig3EventsFolder", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("type", 100, "type")}, //$NON-NLS-1$
new String[]{EVENT_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddEvent")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddEvent") //$NON-NLS-1$
);
final static IFormData LISTENER_LIST_DEFINITION = new FormData(
"Listeners",
- "", //Description
+ "", //Description //$NON-NLS-1$
// "Listeners",
- new FormAttributeData[]{new FormAttributeData("class", 70, "class"), new FormAttributeData("type", 30, "type")},
+ new FormAttributeData[]{
+ new FormAttributeData("class", 70, "class"), //$NON-NLS-1$
+ new FormAttributeData("type", 30, "type")}, //$NON-NLS-1$
new String[]{LISTENER_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddListener")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddListener") //$NON-NLS-1$
);
final static IFormData LISTENER_FOLDER_DEFINITION = new FormData(
"Listeners",
- "", //"Description
- "HibConfig3ListenersFolder",
- new FormAttributeData[]{new FormAttributeData("class", 70, "class"), new FormAttributeData("type", 30, "type")},
+ "", //"Description //$NON-NLS-1$
+ "HibConfig3ListenersFolder", //$NON-NLS-1$
+ new FormAttributeData[]{
+ new FormAttributeData("class", 70, "class"), //$NON-NLS-1$
+ new FormAttributeData("type", 30, "type")}, //$NON-NLS-1$
new String[]{LISTENER_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddListener")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddListener") //$NON-NLS-1$
);
final static IFormData[] EVENT_DEFINITIONS = new IFormData[] {
new FormData(
"Event",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(EVENT_ENTITY)
),
LISTENER_LIST_DEFINITION,
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3FileFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3FileFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3FileFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -22,11 +22,11 @@
new IFormData[] {
new FormData(
"File Hibernate Configuration 3.0",
- "", //"Description
- Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("FileHibConfig3")
+ "", //"Description //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("FileHibConfig3") //$NON-NLS-1$
),
};
final static IFormData FILE_FORM_DEFINITION = new FormData(
- "FileHibConfig3", new String[]{null}, FILE_DEFINITIONS);
+ "FileHibConfig3", new String[]{null}, FILE_DEFINITIONS); //$NON-NLS-1$
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3MappingFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3MappingFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3MappingFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -18,23 +18,23 @@
* @author glory
*/
public class HibConfig3MappingFormLayoutData {
- static String MAPPING_ENTITY = "HibConfig3Mapping";
+ static String MAPPING_ENTITY = "HibConfig3Mapping"; //$NON-NLS-1$
final static IFormData MAPPING_LIST_DEFINITION = new FormData(
"Mappings",
- "", //Description
- "Mappings",
- new FormAttributeData[]{new FormAttributeData("item", 100, "item")},
+ "", //Description //$NON-NLS-1$
+ "Mappings", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("item", 100, "item")}, //$NON-NLS-1$
new String[]{MAPPING_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddMapping")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddMapping") //$NON-NLS-1$
);
final static IFormData MAPPING_FOLDER_DEFINITION = new FormData(
"Mappings",
- "", //"Description
- "HibConfig3MappingsFolder",
- new FormAttributeData[]{new FormAttributeData("item", 100, "item")},
+ "", //"Description //$NON-NLS-1$
+ "HibConfig3MappingsFolder", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("item", 100, "item")}, //$NON-NLS-1$
new String[]{MAPPING_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddMapping")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddMapping") //$NON-NLS-1$
);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3PropertyFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3PropertyFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3PropertyFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -18,24 +18,24 @@
* @author glory
*/
public class HibConfig3PropertyFormLayoutData {
- static String PROPERTY_ENTITY = "HibConfig3Property";
+ static String PROPERTY_ENTITY = "HibConfig3Property"; //$NON-NLS-1$
final static IFormData PROPERTY_LIST_DEFINITION = new FormData(
"Properties",
- "", //Description
- "Properties",
- new FormAttributeData[]{new FormAttributeData("name", 100, "name")},
+ "", //Description //$NON-NLS-1$
+ "Properties", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("name", 100, "name")}, //$NON-NLS-1$
new String[]{PROPERTY_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddProperty")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddProperty") //$NON-NLS-1$
);
final static IFormData PROPERTY_FOLDER_DEFINITION = new FormData(
"Properties",
- "", //"Description
- "HibConfig3PropertiesFolder",
- new FormAttributeData[]{new FormAttributeData("name", 100, "name")},
+ "", //"Description //$NON-NLS-1$
+ "HibConfig3PropertiesFolder", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("name", 100, "name")}, //$NON-NLS-1$
new String[]{PROPERTY_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddProperty")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddProperty") //$NON-NLS-1$
);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3SessionFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3SessionFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/HibConfig3SessionFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -22,13 +22,13 @@
new IFormData[] {
new FormData(
"Session Factory",
- "", //"Description
- Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("HibConfig3SessionFactory")
+ "", //"Description //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("HibConfig3SessionFactory") //$NON-NLS-1$
),
HibConfig3PropertyFormLayoutData.PROPERTY_LIST_DEFINITION,
HibConfig3MappingFormLayoutData.MAPPING_LIST_DEFINITION,
};
final static IFormData SESSION_FACTORY_FORM_DEFINITION = new FormData(
- "HibConfig3SessionFactory", new String[]{null}, SESSION_FACTORY_DEFINITIONS);
+ "HibConfig3SessionFactory", new String[]{null}, SESSION_FACTORY_DEFINITIONS); //$NON-NLS-1$
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3AnyFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3AnyFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3AnyFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -18,21 +18,21 @@
* @author glory
*/
public class Hibernate3AnyFormLayoutData {
- static String ANY_ENTITY = "Hibernate3Any";
- static String META_VALUE_ENTITY = "Hibernate3MetaValue";
+ static String ANY_ENTITY = "Hibernate3Any"; //$NON-NLS-1$
+ static String META_VALUE_ENTITY = "Hibernate3MetaValue"; //$NON-NLS-1$
static IFormData META_VALUE_LIST_DEFINITION = new FormData(
"Meta Values",
- "", //"Description
- new FormAttributeData[]{new FormAttributeData("value", 50), new FormAttributeData("class", 50)},
+ "", //"Description //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("value", 50), new FormAttributeData("class", 50)}, //$NON-NLS-1$ //$NON-NLS-2$
new String[]{META_VALUE_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddMetaValue")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddMetaValue") //$NON-NLS-1$
);
final static IFormData[] ANY_DEFINITIONS = new IFormData[] {
new FormData(
"Any",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(ANY_ENTITY)
),
META_VALUE_LIST_DEFINITION,
@@ -40,7 +40,7 @@
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(ANY_ENTITY)
),
};
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ClassFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ClassFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ClassFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -18,82 +18,83 @@
* @author glory
*/
public class Hibernate3ClassFormLayoutData {
- static String CLASS_ENTITY = "Hibernate3Class";
- static String SUBCLASS_ENTITY = "Hibernate3Subclass";
- static String JOIN_ENTITY = "Hibernate3Join";
- static String JOINED_SUBCLASS_ENTITY = "Hibernate3JoinedSubclass";
- static String ALL_SUBCLASSES_ENTITY = "Hibernate3AllSubclassFolder";
- static String SUBCLASSES_ENTITY = "Hibernate3SubclassFolder";
- static String JOINED_SUBCLASSES_ENTITY = "Hibernate3JoinedSubclassFolder";
+ static String CLASS_ENTITY = "Hibernate3Class"; //$NON-NLS-1$
+ static String SUBCLASS_ENTITY = "Hibernate3Subclass"; //$NON-NLS-1$
+ static String JOIN_ENTITY = "Hibernate3Join"; //$NON-NLS-1$
+ static String JOINED_SUBCLASS_ENTITY = "Hibernate3JoinedSubclass"; //$NON-NLS-1$
+ static String ALL_SUBCLASSES_ENTITY = "Hibernate3AllSubclassFolder"; //$NON-NLS-1$
+ static String SUBCLASSES_ENTITY = "Hibernate3SubclassFolder"; //$NON-NLS-1$
+ static String JOINED_SUBCLASSES_ENTITY = "Hibernate3JoinedSubclassFolder"; //$NON-NLS-1$
static IFormData ALL_SUBCLASSES_LIST_DEFINITION = new FormData(
"Subclasses",
- "", //Description
- "Subclasses",
- new FormAttributeData[]{new FormAttributeData("details", 100, "subclass info")},
+ "", //Description //$NON-NLS-1$
+ "Subclasses", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("details", 100, "subclass info")}, //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.getChildEntitiesWithAttribute(ALL_SUBCLASSES_ENTITY, "details"),
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyClass")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyClass") //$NON-NLS-1$
);
static IFormData ALL_SUBCLASSES_FOLDER_DEFINITION = new FormData(
"Subclasses",
- "", //Description
+ "", //Description //$NON-NLS-1$
ALL_SUBCLASSES_ENTITY,
- new FormAttributeData[]{new FormAttributeData("details", 100, "subclass info")},
+ new FormAttributeData[]{new FormAttributeData("details", 100, "subclass info")}, //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.getChildEntitiesWithAttribute(ALL_SUBCLASSES_ENTITY, "details"),
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyClass")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyClass") //$NON-NLS-1$
);
static IFormData SUBCLASSES_LIST_DEFINITION = new FormData(
"Subclasses",
- "", //Description
- "Subclasses",
- new FormAttributeData[]{new FormAttributeData("details", 100, "subclass info")},
+ "", //Description //$NON-NLS-1$
+ "Subclasses", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("details", 100, "subclass info")}, //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.getChildEntitiesWithAttribute(SUBCLASSES_ENTITY, "details"),
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyClass")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyClass") //$NON-NLS-1$
);
static IFormData SUBCLASSES_FOLDER_DEFINITION = new FormData(
"Subclasses",
- "", //Description
+ "", //Description //$NON-NLS-1$
SUBCLASSES_ENTITY,
- new FormAttributeData[]{new FormAttributeData("details", 100, "subclass info")},
+ new FormAttributeData[]{new FormAttributeData("details", 100, "subclass info")}, //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.getChildEntitiesWithAttribute(SUBCLASSES_ENTITY, "details"),
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyClass")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyClass") //$NON-NLS-1$
);
static IFormData JOINED_SUBCLASSES_LIST_DEFINITION = new FormData(
"Subclasses",
- "", //Description
- "Subclasses",
- new FormAttributeData[]{new FormAttributeData("name", 100, "class name")},
+ "", //Description //$NON-NLS-1$
+ "Subclasses", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("name", 100, "class name")}, //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.getChildEntitiesWithAttribute(JOINED_SUBCLASSES_ENTITY, "name"),
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddJoinedSubclass")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddJoinedSubclass") //$NON-NLS-1$
);
static IFormData JOINED_SUBCLASSES_FOLDER_DEFINITION = new FormData(
"Subclasses",
- "", //Description
+ "", //Description //$NON-NLS-1$
JOINED_SUBCLASSES_ENTITY,
- new FormAttributeData[]{new FormAttributeData("name", 100, "class name")},
+ new FormAttributeData[]{new FormAttributeData("name", 100, "class name")}, //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.getChildEntitiesWithAttribute(JOINED_SUBCLASSES_ENTITY, "name"),
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddJoinedSubclass")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddJoinedSubclass") //$NON-NLS-1$
);
private final static IFormData[] CLASS_DEFINITIONS = new IFormData[] {
new FormData(
"Class",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(CLASS_ENTITY)
),
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesCFolder", "Properties", "name", "CreateActions.AddAttribute"),
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesCFolder", "Properties", "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
ALL_SUBCLASSES_LIST_DEFINITION,
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
Hibernate3FilterFormLayoutData.FILTER_LIST_DEFINITION,
Hibernate3SQLQueryFormLayoutData.SYNCHRONIZES_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(CLASS_ENTITY)
),
};
@@ -105,16 +106,17 @@
private final static IFormData[] SUBCLASS_DEFINITIONS = new IFormData[] {
new FormData(
"Subclass",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(SUBCLASS_ENTITY)
),
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesCFolder", "Properties", "name", "CreateActions.AddAttribute"),
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesCFolder", "Properties", "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
SUBCLASSES_LIST_DEFINITION,
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
Hibernate3SQLQueryFormLayoutData.SYNCHRONIZES_FOLDER_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(SUBCLASS_ENTITY)
),
};
@@ -126,14 +128,15 @@
private final static IFormData[] JOIN_DEFINITIONS = new IFormData[] {
new FormData(
"Join",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(JOIN_ENTITY)
),
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesJFolder", "Properties", "name", "CreateActions.AddAttribute"),
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesJFolder", "Properties", "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(JOIN_ENTITY)
),
};
@@ -145,16 +148,17 @@
private final static IFormData[] JOINED_SUBCLASS_DEFINITIONS = new IFormData[] {
new FormData(
"Joined Subclass",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(JOINED_SUBCLASS_ENTITY)
),
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesCFolder", "Properties", "name", "CreateActions.AddAttribute"),
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesCFolder", "Properties", "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
JOINED_SUBCLASSES_LIST_DEFINITION,
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
Hibernate3SQLQueryFormLayoutData.SYNCHRONIZES_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(JOINED_SUBCLASS_ENTITY)
),
};
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ColumnFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ColumnFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ColumnFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -21,10 +21,10 @@
final static IFormData COLUMN_LIST_DEFINITION = new FormData(
"Columns",
- "", //"Description
- new FormAttributeData[]{new FormAttributeData("name", 50), new FormAttributeData("sql-type", 50)},
- new String[]{"Hibernate3Column"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddColumn")
+ "", //"Description //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("name", 50), new FormAttributeData("sql-type", 50)}, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[]{"Hibernate3Column"}, //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddColumn") //$NON-NLS-1$
);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ComponentFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ComponentFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ComponentFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -17,20 +17,21 @@
* @author glory
*/
public class Hibernate3ComponentFormLayoutData {
- static String COMPONENT_ENTITY = "Hibernate3Component";
- static String DYNAMIC_COMPONENT_ENTITY = "Hibernate3DynamicComponent";
+ static String COMPONENT_ENTITY = "Hibernate3Component"; //$NON-NLS-1$
+ static String DYNAMIC_COMPONENT_ENTITY = "Hibernate3DynamicComponent"; //$NON-NLS-1$
final static IFormData[] COMPONENT_DEFINITIONS = new IFormData[] {
new FormData(
"Component",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(COMPONENT_ENTITY)
),
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesFolder", "Properties", "name", "CreateActions.AddAttribute"),
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesFolder", "Properties", "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(COMPONENT_ENTITY)
),
};
@@ -42,13 +43,14 @@
final static IFormData[] DYNAMIC_COMPONENT_DEFINITIONS = new IFormData[] {
new FormData(
"Dynamic Component",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(DYNAMIC_COMPONENT_ENTITY)
),
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesFolder", "Properties", "name", "CreateActions.AddAttribute"),
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesFolder", "Properties", "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(COMPONENT_ENTITY)
),
};
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3CompositeElementFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3CompositeElementFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3CompositeElementFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -14,20 +14,21 @@
import org.jboss.tools.common.model.ui.forms.IFormData;
public class Hibernate3CompositeElementFormLayoutData {
- static String ELEMENT_ENTITY = "Hibernate3CompositeElement";
- static String NESTED_ELEMENT_ENTITY = "Hibernate3NestedCompositeElement";
+ static String ELEMENT_ENTITY = "Hibernate3CompositeElement"; //$NON-NLS-1$
+ static String NESTED_ELEMENT_ENTITY = "Hibernate3NestedCompositeElement"; //$NON-NLS-1$
final static IFormData[] ELEMENT_DEFINITIONS = new IFormData[] {
new FormData(
"Composite Element",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(ELEMENT_ENTITY)
),
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesNestedFolder", "Properties", "name", "CreateActions.AddAttribute"),
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesNestedFolder", "Properties", "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(ELEMENT_ENTITY)
)
};
@@ -39,14 +40,15 @@
final static IFormData[] NESTED_ELEMENT_DEFINITIONS = new IFormData[] {
new FormData(
"Composite Element",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(NESTED_ELEMENT_ENTITY)
),
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesNestedFolder", "Properties", "name", "CreateActions.AddAttribute"),
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesNestedFolder", "Properties", "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(NESTED_ELEMENT_ENTITY)
)
};
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3DatabaseObjectFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3DatabaseObjectFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3DatabaseObjectFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -16,31 +16,31 @@
import org.jboss.tools.common.model.ui.forms.IFormData;
public class Hibernate3DatabaseObjectFormLayoutData {
- static String DATABASE_OBJECT_DEF_ENTITY = "Hibernate3DatabaseObjectDef";
- static String DATABASE_OBJECT_CD_ENTITY = "Hibernate3DatabaseObjectCreateDrop";
- static String DIALECT_SCOPE_ENTITY = "Hibernate3DialectScope";
- static String DATABASE_FOLDER_ENTITY = "Hibernate3DatabaseObjectFolder";
+ static String DATABASE_OBJECT_DEF_ENTITY = "Hibernate3DatabaseObjectDef"; //$NON-NLS-1$
+ static String DATABASE_OBJECT_CD_ENTITY = "Hibernate3DatabaseObjectCreateDrop"; //$NON-NLS-1$
+ static String DIALECT_SCOPE_ENTITY = "Hibernate3DialectScope"; //$NON-NLS-1$
+ static String DATABASE_FOLDER_ENTITY = "Hibernate3DatabaseObjectFolder"; //$NON-NLS-1$
final static IFormData DIALECT_SCOPE_LIST_DEFINITION = new FormData(
"Dialect Scopes",
- "", //"Description
- new FormAttributeData[]{new FormAttributeData("name", 100)},
+ "", //"Description //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("name", 100)}, //$NON-NLS-1$
new String[]{DIALECT_SCOPE_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddDialectScope")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddDialectScope") //$NON-NLS-1$
);
final static IFormData DATABASE_OBJECT_LIST_DEFINITION = new FormData(
"Database Objects",
- "", //"Description
- new FormAttributeData[]{new FormAttributeData("presentation", 100, "database object")},
+ "", //"Description //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("presentation", 100, "database object")}, //$NON-NLS-1$
new String[]{DATABASE_OBJECT_DEF_ENTITY, DATABASE_OBJECT_CD_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddDatabaseObject")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddDatabaseObject") //$NON-NLS-1$
);
final static IFormData[] DATABASE_OBJECT_DEF_DEFINITIONS = new IFormData[] {
new FormData(
"Database Object",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(DATABASE_OBJECT_DEF_ENTITY)
),
DIALECT_SCOPE_LIST_DEFINITION,
@@ -49,11 +49,11 @@
final static IFormData[] DATABASE_OBJECT_CD_DEFINITIONS = new IFormData[] {
new FormData(
"Database Object",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
// Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(DATABASE_OBJECT_CD_ENTITY)
new IFormAttributeData[]{
- new FormAttributeData("create", null, Hibernate3FormLayoutDataUtil.SBFEE_CLASS_NAME),
- new FormAttributeData("drop", null, Hibernate3FormLayoutDataUtil.SBFEE_CLASS_NAME),
+ new FormAttributeData("create", null, Hibernate3FormLayoutDataUtil.SBFEE_CLASS_NAME), //$NON-NLS-1$
+ new FormAttributeData("drop", null, Hibernate3FormLayoutDataUtil.SBFEE_CLASS_NAME), //$NON-NLS-1$
}
),
DIALECT_SCOPE_LIST_DEFINITION,
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ElementFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ElementFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ElementFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -14,21 +14,21 @@
import org.jboss.tools.common.model.ui.forms.IFormData;
public class Hibernate3ElementFormLayoutData {
- static String ELEMENT_ENTITY = "Hibernate3Element";
- static String MANY_TO_MANY_ENTITY = "Hibernate3ManyToMany";
- static String MANY_TO_ANY_ENTITY = "Hibernate3ManyToAny";
+ static String ELEMENT_ENTITY = "Hibernate3Element"; //$NON-NLS-1$
+ static String MANY_TO_MANY_ENTITY = "Hibernate3ManyToMany"; //$NON-NLS-1$
+ static String MANY_TO_ANY_ENTITY = "Hibernate3ManyToAny"; //$NON-NLS-1$
final static IFormData[] ELEMENT_DEFINITIONS = new IFormData[] {
new FormData(
"Element",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(ELEMENT_ENTITY)
),
Hibernate3ColumnFormLayoutData.COLUMN_LIST_DEFINITION,
Hibernate3FormulaFormLayoutData.FORMULA_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(ELEMENT_ENTITY)
)
};
@@ -40,7 +40,7 @@
final static IFormData[] MANY_TO_MANY_DEFINITIONS = new IFormData[] {
new FormData(
"Many To Many",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(MANY_TO_MANY_ENTITY)
),
Hibernate3ColumnFormLayoutData.COLUMN_LIST_DEFINITION,
@@ -49,7 +49,7 @@
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(MANY_TO_MANY_ENTITY)
)
};
@@ -61,7 +61,7 @@
final static IFormData[] MANY_TO_ANY_DEFINITIONS = new IFormData[] {
new FormData(
"Many To Any",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(MANY_TO_ANY_ENTITY)
),
Hibernate3AnyFormLayoutData.META_VALUE_LIST_DEFINITION,
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FileFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FileFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FileFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -23,57 +23,65 @@
new IFormData[] {
new FormData(
"File Hibernate 3.0",
- "", //"Description
- Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("FileHibernate3")
+ "", //"Description //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("FileHibernate3") //$NON-NLS-1$
),
new FormData(
"Advanced",
- "", //"Description
- Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData("FileHibernate3")
+ "", //"Description //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData("FileHibernate3") //$NON-NLS-1$
),
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Types",
- "", //Description
- "Types",
- new FormAttributeData[]{new FormAttributeData("name", 30, "name"), new FormAttributeData("class", 70, "class")},
- new String[]{"Hibernate3Typedef"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddTypedef")
+ "", //Description //$NON-NLS-1$
+ "Types", //$NON-NLS-1$
+ new FormAttributeData[]{
+ new FormAttributeData("name", 30, "name"), //$NON-NLS-1$
+ new FormAttributeData("class", 70, "class")}, //$NON-NLS-1$
+ new String[]{"Hibernate3Typedef"}, //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddTypedef") //$NON-NLS-1$
),
new FormData(
"Imports",
- "", //Description
- "Imports",
- new FormAttributeData[]{new FormAttributeData("class", 60, "class"), new FormAttributeData("rename", 40, "rename")},
- new String[]{"Hibernate3Import"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddImport")
+ "", //Description //$NON-NLS-1$
+ "Imports", //$NON-NLS-1$
+ new FormAttributeData[]{
+ new FormAttributeData("class", 60, "class"), //$NON-NLS-1$
+ new FormAttributeData("rename", 40, "rename")}, //$NON-NLS-1$
+ new String[]{"Hibernate3Import"}, //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddImport") //$NON-NLS-1$
),
new FormData(
"Classes",
- "", //Description
- "Classes",
- new FormAttributeData[]{new FormAttributeData("name", 100, "class name")},
- new String[]{"Hibernate3Class", "Hibernate3Subclass", "Hibernate3JoinedSubclass", "Hibernate3UnionSubclass"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyClass")
+ "", //Description //$NON-NLS-1$
+ "Classes", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("name", 100, "class name")}, //$NON-NLS-1$
+ new String[]{"Hibernate3Class", "Hibernate3Subclass", "Hibernate3JoinedSubclass", "Hibernate3UnionSubclass"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyClass") //$NON-NLS-1$
),
new FormData(
"Queries",
- "", //"Description
- "Queries",
- new FormAttributeData[]{new FormAttributeData("name", 30, "name"), new FormAttributeData("query", 70, "query")},
- new String[]{"Hibernate3Query", "Hibernate3SQLQuery"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyQuery")
+ "", //"Description //$NON-NLS-1$
+ "Queries", //$NON-NLS-1$
+ new FormAttributeData[]{
+ new FormAttributeData("name", 30, "name"), //$NON-NLS-1$
+ new FormAttributeData("query", 70, "query")}, //$NON-NLS-1$
+ new String[]{"Hibernate3Query", "Hibernate3SQLQuery"}, //$NON-NLS-1$ //$NON-NLS-2$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyQuery") //$NON-NLS-1$
),
new FormData(
"Filters",
- "", //"Description
- "Filters",
- new FormAttributeData[]{new FormAttributeData("name", 30, "name"), new FormAttributeData("value", 70, "value")},
- new String[]{"Hibernate3Filterdef"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddFilterdef")
+ "", //"Description //$NON-NLS-1$
+ "Filters", //$NON-NLS-1$
+ new FormAttributeData[]{
+ new FormAttributeData("name", 30, "name"), //$NON-NLS-1$
+ new FormAttributeData("value", 70, "value")}, //$NON-NLS-1$
+ new String[]{"Hibernate3Filterdef"}, //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddFilterdef") //$NON-NLS-1$
),
};
final static IFormData FILE_FORM_DEFINITION = new FormData(
- "FileHibernate3", new String[]{null}, FILE_DEFINITIONS);
+ "FileHibernate3", new String[]{null}, FILE_DEFINITIONS); //$NON-NLS-1$
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FilterFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FilterFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FilterFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -18,51 +18,51 @@
* @author glory
*/
public class Hibernate3FilterFormLayoutData {
- static String FILTER_ENTITY = "Hibernate3Filter";
- static String FILTER_FOLDER_ENTITY = "Hibernate3FilterFolder";
- static String FILTERDEF_ENTITY = "Hibernate3Filterdef";
- static String FILTERDEF_FOLDER_ENTITY = "Hibernate3FilterdefFolder";
- static String TYPEDEF_ENTITY = "Hibernate3Typedef";
+ static String FILTER_ENTITY = "Hibernate3Filter"; //$NON-NLS-1$
+ static String FILTER_FOLDER_ENTITY = "Hibernate3FilterFolder"; //$NON-NLS-1$
+ static String FILTERDEF_ENTITY = "Hibernate3Filterdef"; //$NON-NLS-1$
+ static String FILTERDEF_FOLDER_ENTITY = "Hibernate3FilterdefFolder"; //$NON-NLS-1$
+ static String TYPEDEF_ENTITY = "Hibernate3Typedef"; //$NON-NLS-1$
final static IFormData FILTER_LIST_DEFINITION = new FormData(
"Filters",
- "", //Description
- "Filters",
- new FormAttributeData[]{new FormAttributeData("name", 100, "name")},
+ "", //Description //$NON-NLS-1$
+ "Filters", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("name", 100, "name")}, //$NON-NLS-1$
new String[]{FILTER_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddFilter")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddFilter") //$NON-NLS-1$
);
final static IFormData FILTER_FOLDER_DEFINITION = new FormData(
"Filters",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
FILTER_FOLDER_ENTITY,
- new FormAttributeData[]{new FormAttributeData("name", 100, "name")},
+ new FormAttributeData[]{new FormAttributeData("name", 100, "name")}, //$NON-NLS-1$
new String[]{FILTER_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddFilter")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddFilter") //$NON-NLS-1$
);
final static IFormData FILTERDEF_FOLDER_DEFINITION = new FormData(
"Filters",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
FILTERDEF_FOLDER_ENTITY,
- new FormAttributeData[]{new FormAttributeData("name", 100, "name")},
+ new FormAttributeData[]{new FormAttributeData("name", 100, "name")}, //$NON-NLS-1$
new String[]{FILTERDEF_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddFilterdef")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddFilterdef") //$NON-NLS-1$
);
private final static IFormData PARAMETERS = new FormData(
"Parameters",
- "", //"Description
- new FormAttributeData[]{new FormAttributeData("name", 30), new FormAttributeData("type", 70)},
- new String[]{"Hibernate3FilterParam"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddParam")
+ "", //"Description //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("name", 30), new FormAttributeData("type", 70)}, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[]{"Hibernate3FilterParam"}, //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddParam") //$NON-NLS-1$
);
private final static IFormData[] FILTERDEF_DEFINITIONS = new IFormData[] {
new FormData(
"Filter Definition",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(FILTERDEF_ENTITY)
),
PARAMETERS
@@ -75,7 +75,7 @@
private final static IFormData[] TYPEDEF_DEFINITIONS = new IFormData[] {
new FormData(
"Type Definition",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(TYPEDEF_ENTITY)
),
PARAMETERS
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -74,35 +74,41 @@
new FormData(
"Types",
- "", //"Description
- "Hibernate3TypedefFolder",
- new FormAttributeData[]{new FormAttributeData("name", 30, "name"), new FormAttributeData("class", 70, "class")},
- new String[]{"Hibernate3Typedef"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddTypedef")
+ "", //"Description //$NON-NLS-1$
+ "Hibernate3TypedefFolder", //$NON-NLS-1$
+ new FormAttributeData[]{
+ new FormAttributeData("name", 30, "name"), //$NON-NLS-1$
+ new FormAttributeData("class", 70, "class")}, //$NON-NLS-1$
+ new String[]{"Hibernate3Typedef"}, //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddTypedef") //$NON-NLS-1$
),
new FormData(
"Imports",
- "", //"Description
- "Hibernate3ImportFolder",
- new FormAttributeData[]{new FormAttributeData("class", 60, "class"), new FormAttributeData("rename", 40, "rename")},
- new String[]{"Hibernate3Import"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddTypedef")
+ "", //"Description //$NON-NLS-1$
+ "Hibernate3ImportFolder", //$NON-NLS-1$
+ new FormAttributeData[]{
+ new FormAttributeData("class", 60, "class"), //$NON-NLS-1$
+ new FormAttributeData("rename", 40, "rename")}, //$NON-NLS-1$
+ new String[]{"Hibernate3Import"}, //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddTypedef") //$NON-NLS-1$
),
new FormData(
"Classes",
- "", //"Description
- "Hibernate3ClassFolder",
- new FormAttributeData[]{new FormAttributeData("name", 100, "class name")},
- Hibernate3FormLayoutDataUtil.getChildEntitiesWithAttribute("Hibernate3ClassFolder", "name"),
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyClass")
+ "", //"Description //$NON-NLS-1$
+ "Hibernate3ClassFolder", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("name", 100, "class name")}, //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.getChildEntitiesWithAttribute("Hibernate3ClassFolder", "name"), //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyClass") //$NON-NLS-1$
),
new FormData(
"Queries",
- "", //"Description
- "Hibernate3QueryFolder",
- new FormAttributeData[]{new FormAttributeData("name", 30, "name"), new FormAttributeData("query", 70, "query")},
- new String[]{"Hibernate3Query", "Hibernate3SQLQuery"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyQuery")
+ "", //"Description //$NON-NLS-1$
+ "Hibernate3QueryFolder", //$NON-NLS-1$
+ new FormAttributeData[]{
+ new FormAttributeData("name", 30, "name"), //$NON-NLS-1$
+ new FormAttributeData("query", 70, "query")}, //$NON-NLS-1$
+ new String[]{"Hibernate3Query", "Hibernate3SQLQuery"}, //$NON-NLS-1$ //$NON-NLS-2$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddAnyQuery") //$NON-NLS-1$
),
Hibernate3FilterFormLayoutData.FILTER_FOLDER_DEFINITION,
@@ -113,11 +119,16 @@
Hibernate3FilterFormLayoutData.FILTERDEF_DEFINITION,
Hibernate3FilterFormLayoutData.TYPEDEF_DEFINITION,
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesCFolder", null, "name", "CreateActions.AddAttribute"),
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesFolder", null, "name", "CreateActions.AddAttribute"),
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesJFolder", null, "name", "CreateActions.AddAttribute"),
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesPFolder", null, "name", "CreateActions.AddAttribute"),
- Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties", "Hibernate3AttributesNestedFolder", null, "name", "CreateActions.AddAttribute"),
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesCFolder", null, "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesFolder", null, "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesJFolder", null, "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesPFolder", null, "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Hibernate3FormLayoutDataUtil.createAllChildrenFormData("Properties",
+ "Hibernate3AttributesNestedFolder", null, "name", "CreateActions.AddAttribute"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
Hibernate3DatabaseObjectFormLayoutData.DATABASE_OBJECT_CD_DEFINITION,
Hibernate3DatabaseObjectFormLayoutData.DATABASE_OBJECT_DEF_DEFINITION,
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormLayoutDataUtil.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormLayoutDataUtil.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormLayoutDataUtil.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -29,22 +29,36 @@
* @author glory
*/
public class Hibernate3FormLayoutDataUtil {
- private final static String STBFE_CLASS_NAME = "org.jboss.tools.common.model.ui.attribute.editor.JavaHyperlinkLineFieldEditor";
- public final static String SBFEE_CLASS_NAME = "org.jboss.tools.common.model.ui.attribute.editor.StringButtonFieldEditorEx";
+ private final static String STBFE_CLASS_NAME = "org.jboss.tools.common.model.ui.attribute.editor.JavaHyperlinkLineFieldEditor"; //$NON-NLS-1$
+ public final static String SBFEE_CLASS_NAME = "org.jboss.tools.common.model.ui.attribute.editor.StringButtonFieldEditorEx"; //$NON-NLS-1$
- private final static String SELECT_IT_ACTION = "%SelectIt%";
- private final static String INTERNAL_ACTION = "%internal%";
- private final static String DEFAULT_DELETE_ACTION = "DeleteActions.Delete";
+ private final static String SELECT_IT_ACTION = "%SelectIt%"; //$NON-NLS-1$
+ private final static String INTERNAL_ACTION = "%internal%"; //$NON-NLS-1$
+ private final static String DEFAULT_DELETE_ACTION = "DeleteActions.Delete"; //$NON-NLS-1$
// private final static String DEFAULT_EDIT_ACTION = "Properties.Properties";
+ /**
+ * (non-translatable)
+ */
public static IFormAttributeData[] createGeneralFormAttributeData(String entityName) {
return createFormAttributeData(entityName, "general");
}
+ /**
+ *
+ * @param entityName (non-translatable)
+ * @return
+ */
public static IFormAttributeData[] createAdvancedFormAttributeData(String entityName) {
return createFormAttributeData(entityName, "advanced");
}
+ /**
+ *
+ * @param entityName (non-translatable)
+ * @param categoryName
+ * @return
+ */
public static IFormAttributeData[] createFormAttributeData(String entityName, String categoryName) {
XModelEntity entity = PreferenceModelUtilities.getPreferenceModel().getMetaData().getEntity(entityName);
if(entity == null) return new IFormAttributeData[0];
@@ -52,12 +66,12 @@
XAttribute[] as = entity.getAttributes();
for (int i = 0; i < as.length; i++) {
if(!as[i].isVisible()) continue;
- String category = as[i].getProperty("category");
+ String category = as[i].getProperty("category"); //$NON-NLS-1$
if(category != null && category.equals(categoryName)) {
String editorName = as[i].getEditor().getName();
- if("AccessibleJava".equals(editorName)) {
+ if("AccessibleJava".equals(editorName)) { //$NON-NLS-1$
list.add(new FormAttributeData(as[i].getName(), null, STBFE_CLASS_NAME));
- } else if("Note".equals(editorName)) {
+ } else if("Note".equals(editorName)) { //$NON-NLS-1$
list.add(new FormAttributeData(as[i].getName(), InfoLayoutDataFactory.getInstance()));
} else {
list.add(new FormAttributeData(as[i].getName()));
@@ -67,6 +81,12 @@
return (IFormAttributeData[])list.toArray(new IFormAttributeData[0]);
}
+ /**
+ *
+ * @param entityName (non-translatable)
+ * @param attributeName (non-translatable)
+ * @return
+ */
public static String[] getChildEntitiesWithAttribute(String entityName, String attributeName) {
XModelEntity entity = PreferenceModelUtilities.getPreferenceModel().getMetaData().getEntity(entityName);
if(entity == null) return new String[0];
@@ -79,15 +99,34 @@
return list.toArray(new String[0]);
}
+ /**
+ *
+ * @param name (translatable)
+ * @param entityName (non-translatable)
+ * @param childName (non-translatable)
+ * @param attributeName (non-translatable)
+ * @param createAction (non-translatable)
+ * @return
+ */
public static FormData createAllChildrenFormData(String name, String entityName, String childName, String attributeName, String createAction) {
return createChildrenFormData(name, entityName, childName, attributeName,
Hibernate3FormLayoutDataUtil.getChildEntitiesWithAttribute(entityName, attributeName), createAction);
}
+ /**
+ *
+ * @param name (translatable)
+ * @param entityName (non-translatable)
+ * @param childName (non-translatable)
+ * @param attributeName (non-translatable)
+ * @param entityNames (non-translatable)
+ * @param createAction (non-translatable)
+ * @return
+ */
public static FormData createChildrenFormData(String name, String entityName, String childName, String attributeName, String[] entityNames, String createAction) {
return new FormData(
name,
- "", //"Description
+ "", //"Description //$NON-NLS-1$
childName != null ? childName : entityName,
new FormAttributeData[]{new FormAttributeData(attributeName, 100, attributeName)},
entityNames,
@@ -95,6 +134,11 @@
);
}
+ /**
+ *
+ * @param actionPath (non-translatable)
+ * @return
+ */
public static IFormActionData[] createDefaultFormActionData(String actionPath) {
return new IFormActionData[] {
new FormActionData(TableStructuredEditor.ADD_ACTION, actionPath),
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormulaFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormulaFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3FormulaFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -19,21 +19,21 @@
* @author glory
*/
public class Hibernate3FormulaFormLayoutData {
- static String FORMULA_ENTITY = "Hibernate3Formula";
+ static String FORMULA_ENTITY = "Hibernate3Formula"; //$NON-NLS-1$
static IFormData FORMULA_LIST_DEFINITION = new FormData(
"Formulas",
- "", //"Description
- new FormAttributeData[]{new FormAttributeData("value", 100)},
+ "", //"Description //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("value", 100)}, //$NON-NLS-1$
new String[]{FORMULA_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddFormula")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddFormula") //$NON-NLS-1$
);
static IFormData FORMULA_DEFINITION = new FormData(
"Formula",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
FORMULA_ENTITY,
- new FormAttributeData[]{new FormAttributeData("value", GreedyLayoutDataFactory.getInstance())}
+ new FormAttributeData[]{new FormAttributeData("value", GreedyLayoutDataFactory.getInstance())} //$NON-NLS-1$
);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3IdFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3IdFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3IdFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -17,21 +17,24 @@
* @author glory
*/
public class Hibernate3IdFormLayoutData {
- static String COMPOSITE_ID_ENTITY = "Hibernate3CompositeId";
- static String COMPOSITE_INDEX_ENTITY = "Hibernate3CompositeIndex";
- static String COLLECTION_ID_ENTITY = "Hibernate3CollectionId";
+ static String COMPOSITE_ID_ENTITY = "Hibernate3CompositeId"; //$NON-NLS-1$
+ static String COMPOSITE_INDEX_ENTITY = "Hibernate3CompositeIndex"; //$NON-NLS-1$
+ static String COLLECTION_ID_ENTITY = "Hibernate3CollectionId"; //$NON-NLS-1$
final static IFormData[] COMPOSITE_ID_DEFINITIONS = new IFormData[] {
new FormData(
"Composite ID",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(COMPOSITE_ID_ENTITY)
),
- Hibernate3FormLayoutDataUtil.createChildrenFormData("Key Properties", null, null, "name", new String[]{"Hibernate3KeyProperty", "Hibernate3KeyManyToOne"}, "CreateActions.AddKeys.AddKey"),
+ Hibernate3FormLayoutDataUtil.createChildrenFormData(
+ "Key Properties", null, null,
+ "name", //$NON-NLS-1$
+ new String[]{"Hibernate3KeyProperty", "Hibernate3KeyManyToOne"}, "CreateActions.AddKeys.AddKey"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(COMPOSITE_ID_ENTITY)
),
};
@@ -43,14 +46,14 @@
final static IFormData[] COLLECTION_ID_DEFINITIONS = new IFormData[] {
new FormData(
"Collection ID",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(COLLECTION_ID_ENTITY)
),
Hibernate3ColumnFormLayoutData.COLUMN_LIST_DEFINITION,
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(COLLECTION_ID_ENTITY)
),
};
@@ -62,10 +65,13 @@
final static IFormData[] COMPOSITE_INDEX_DEFINITIONS = new IFormData[] {
new FormData(
"Composite Index",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(COMPOSITE_INDEX_ENTITY)
),
- Hibernate3FormLayoutDataUtil.createChildrenFormData("Key Properties", null, null, "name", new String[]{"Hibernate3KeyProperty", "Hibernate3KeyManyToOne"}, "CreateActions.AddKeys.AddKey"),
+ Hibernate3FormLayoutDataUtil.createChildrenFormData(
+ "Key Properties", null, null,
+ "name", //$NON-NLS-1$
+ new String[]{"Hibernate3KeyProperty", "Hibernate3KeyManyToOne"}, "CreateActions.AddKeys.AddKey"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
};
static IFormData COMPOSITE_INDEX_DEFINITION = new FormData(
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3KeyFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3KeyFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3KeyFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -17,28 +17,28 @@
* @author glory
*/
public class Hibernate3KeyFormLayoutData {
- static String KEY_ENTITY = "Hibernate3Key";
- static String KEY_MANY_TO_ONE_ENTITY = "Hibernate3KeyManyToOne";
- static String KEY_PROPERTY_ENTITY = "Hibernate3KeyProperty";
+ static String KEY_ENTITY = "Hibernate3Key"; //$NON-NLS-1$
+ static String KEY_MANY_TO_ONE_ENTITY = "Hibernate3KeyManyToOne"; //$NON-NLS-1$
+ static String KEY_PROPERTY_ENTITY = "Hibernate3KeyProperty"; //$NON-NLS-1$
- static String MAP_KEY_ENTITY = "Hibernate3MapKey";
- static String MAP_KEY_MANY_TO_MANY_ENTITY = "Hibernate3MapKeyManyToMany";
- static String COMPOSITE_MAP_KEY_ENTITY = "Hibernate3CompositeMapKey";
+ static String MAP_KEY_ENTITY = "Hibernate3MapKey"; //$NON-NLS-1$
+ static String MAP_KEY_MANY_TO_MANY_ENTITY = "Hibernate3MapKeyManyToMany"; //$NON-NLS-1$
+ static String COMPOSITE_MAP_KEY_ENTITY = "Hibernate3CompositeMapKey"; //$NON-NLS-1$
- static String INDEX_ENTITY = "Hibernate3Index";
- static String LIST_INDEX_ENTITY = "Hibernate3ListIndex";
+ static String INDEX_ENTITY = "Hibernate3Index"; //$NON-NLS-1$
+ static String LIST_INDEX_ENTITY = "Hibernate3ListIndex"; //$NON-NLS-1$
final static IFormData[] KEY_DEFINITIONS = new IFormData[] {
new FormData(
"Key",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(KEY_ENTITY)
),
Hibernate3ColumnFormLayoutData.COLUMN_LIST_DEFINITION,
// Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(KEY_ENTITY)
),
};
@@ -50,14 +50,14 @@
final static IFormData[] KEY_MANY_TO_ONE_DEFINITIONS = new IFormData[] {
new FormData(
"Key Many To One",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(KEY_MANY_TO_ONE_ENTITY)
),
Hibernate3ColumnFormLayoutData.COLUMN_LIST_DEFINITION,
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(KEY_MANY_TO_ONE_ENTITY)
),
};
@@ -69,14 +69,14 @@
final static IFormData[] KEY_PROPERTY_DEFINITIONS = new IFormData[] {
new FormData(
"Key Property",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(KEY_PROPERTY_ENTITY)
),
Hibernate3ColumnFormLayoutData.COLUMN_LIST_DEFINITION,
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(KEY_PROPERTY_ENTITY)
),
};
@@ -88,14 +88,14 @@
final static IFormData[] MAP_KEY_DEFINITIONS = new IFormData[] {
new FormData(
"Map Key",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(MAP_KEY_ENTITY)
),
Hibernate3ColumnFormLayoutData.COLUMN_LIST_DEFINITION,
Hibernate3FormulaFormLayoutData.FORMULA_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(MAP_KEY_ENTITY)
),
};
@@ -107,14 +107,14 @@
final static IFormData[] MAP_KEY_MANY_TO_MANY_DEFINITIONS = new IFormData[] {
new FormData(
"Map Key Many To Many",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(MAP_KEY_MANY_TO_MANY_ENTITY)
),
Hibernate3ColumnFormLayoutData.COLUMN_LIST_DEFINITION,
Hibernate3FormulaFormLayoutData.FORMULA_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(MAP_KEY_MANY_TO_MANY_ENTITY)
),
};
@@ -126,10 +126,11 @@
final static IFormData[] COMPOSITE_MAP_KEY_DEFINITIONS = new IFormData[] {
new FormData(
"Composite Map key",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(COMPOSITE_MAP_KEY_ENTITY)
),
- Hibernate3FormLayoutDataUtil.createChildrenFormData("Key Properties", null, null, "name", new String[]{"Hibernate3KeyProperty", "Hibernate3KeyManyToOne"}, "CreateActions.AddKeys.AddKey"),
+ Hibernate3FormLayoutDataUtil.createChildrenFormData("Key Properties",
+ null, null, "name", new String[]{"Hibernate3KeyProperty", "Hibernate3KeyManyToOne"}, "CreateActions.AddKeys.AddKey"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
};
static IFormData COMPOSITE_MAP_KEY_DEFINITION = new FormData(
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ListFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ListFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ListFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -16,40 +16,40 @@
import org.jboss.tools.common.model.ui.forms.IFormData;
public class Hibernate3ListFormLayoutData {
- static String LIST_ENTITY = "Hibernate3List";
- static String ARRAY_ENTITY = "Hibernate3Array";
+ static String LIST_ENTITY = "Hibernate3List"; //$NON-NLS-1$
+ static String ARRAY_ENTITY = "Hibernate3Array"; //$NON-NLS-1$
final static IFormData[] LIST_DEFINITIONS = new IFormData[] {
new FormData(
"List",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(LIST_ENTITY)
),
new FormData(
"Key",
- "",
- "key",
- Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("Hibernate3Key")
+ "", //$NON-NLS-1$
+ "key", //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("Hibernate3Key") //$NON-NLS-1$
),
new FormData(
"Index",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
new IFormAttributeData[]{
- new FormAttributeData("index", 100, "Index Kind")
+ new FormAttributeData("index", 100, "Index Kind") //$NON-NLS-1$
}
),
new FormData(
"Element",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
new IFormAttributeData[]{
- new FormAttributeData("element", 100, "Element Kind")
+ new FormAttributeData("element", 100, "Element Kind") //$NON-NLS-1$
}
),
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
Hibernate3SQLQueryFormLayoutData.SYNCHRONIZES_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(LIST_ENTITY)
),
};
@@ -57,34 +57,34 @@
final static IFormData[] ARRAY_DEFINITIONS = new IFormData[] {
new FormData(
"Array",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(ARRAY_ENTITY)
),
new FormData(
"Key",
- "",
- "key",
- Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("Hibernate3Key")
+ "", //$NON-NLS-1$
+ "key", //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("Hibernate3Key") //$NON-NLS-1$
),
new FormData(
"Index",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
new IFormAttributeData[]{
- new FormAttributeData("index", 100, "Index Kind")
+ new FormAttributeData("index", 100, "Index Kind") //$NON-NLS-1$
}
),
new FormData(
"Element",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
new IFormAttributeData[]{
- new FormAttributeData("element", 100, "Element Kind")
+ new FormAttributeData("element", 100, "Element Kind") //$NON-NLS-1$
}
),
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
Hibernate3SQLQueryFormLayoutData.SYNCHRONIZES_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(ARRAY_ENTITY)
),
};
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ManyToOneFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ManyToOneFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3ManyToOneFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -17,12 +17,12 @@
* @author glory
*/
public class Hibernate3ManyToOneFormLayoutData {
- static String MANY_TO_ONE_ENTITY = "Hibernate3ManyToOne";
+ static String MANY_TO_ONE_ENTITY = "Hibernate3ManyToOne"; //$NON-NLS-1$
final static IFormData[] MANY_TO_ONE_DEFINITIONS = new IFormData[] {
new FormData(
"Many To One",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(MANY_TO_ONE_ENTITY)
),
Hibernate3ColumnFormLayoutData.COLUMN_LIST_DEFINITION,
@@ -30,7 +30,7 @@
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(MANY_TO_ONE_ENTITY)
),
};
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3MapFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3MapFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3MapFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -21,27 +21,27 @@
final static IFormData[] MAP_DEFINITIONS = new IFormData[] {
new FormData(
"Map",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(MAP_ENTITY)
),
new FormData(
"Key",
- "",
- "key",
+ "", //$NON-NLS-1$
+ "key", //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("Hibernate3Key")
),
new FormData(
"Index",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
new IFormAttributeData[]{
- new FormAttributeData("index", 100, "Index Kind")
+ new FormAttributeData("index", 100, "Index Kind") //$NON-NLS-1$
}
),
new FormData(
"Element",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
new IFormAttributeData[]{
- new FormAttributeData("element", 100, "Element Kind")
+ new FormAttributeData("element", 100, "Element Kind") //$NON-NLS-1$
}
),
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
@@ -49,7 +49,7 @@
Hibernate3FilterFormLayoutData.FILTER_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(MAP_ENTITY)
),
};
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3MetaFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3MetaFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3MetaFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -18,41 +18,45 @@
* @author glory
*/
public class Hibernate3MetaFormLayoutData {
- static String META_ENTITY = "Hibernate3Meta";
- static String TUPLIZER_ENTITY = "Hibernate3Tuplizer";
+ static String META_ENTITY = "Hibernate3Meta"; //$NON-NLS-1$
+ static String TUPLIZER_ENTITY = "Hibernate3Tuplizer"; //$NON-NLS-1$
final static IFormData META_LIST_DEFINITION = new FormData(
"Meta",
- "", //Description
- "Meta",
- new FormAttributeData[]{new FormAttributeData("attribute", 30, "attribute"), new FormAttributeData("value", 70, "value")},
+ "", //Description //$NON-NLS-1$
+ "Meta", //$NON-NLS-1$
+ new FormAttributeData[]{
+ new FormAttributeData("attribute", 30, "attribute"), //$NON-NLS-1$
+ new FormAttributeData("value", 70, "value")}, //$NON-NLS-1$
new String[]{META_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddMeta")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddMeta") //$NON-NLS-1$
);
final static IFormData META_FOLDER_DEFINITION = new FormData(
"Meta",
- "", //"Description
- "Hibernate3MetaFolder",
- new FormAttributeData[]{new FormAttributeData("attribute", 30, "attribute"), new FormAttributeData("value", 70, "value")},
+ "", //"Description //$NON-NLS-1$
+ "Hibernate3MetaFolder", //$NON-NLS-1$
+ new FormAttributeData[]{
+ new FormAttributeData("attribute", 30, "attribute"), //$NON-NLS-1$
+ new FormAttributeData("value", 70, "value")}, //$NON-NLS-1$
new String[]{META_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddMeta")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddMeta") //$NON-NLS-1$
);
final static IFormData TUPLIZER_LIST_DEFINITION = new FormData(
"Tuplizers",
- "", //"Description
- "Tuplizers",
- new FormAttributeData[]{new FormAttributeData("attribute", 100, "class")},
+ "", //"Description //$NON-NLS-1$
+ "Tuplizers", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("attribute", 100, "class")}, //$NON-NLS-1$
new String[]{TUPLIZER_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddTuplizer")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddTuplizer") //$NON-NLS-1$
);
final static IFormData TUPLIZER_FOLDER_DEFINITION = new FormData(
"Tuplizers",
- "", //"Description
- "Hibernate3TuplizerFolder",
- new FormAttributeData[]{new FormAttributeData("attribute", 100, "class")},
+ "", //"Description //$NON-NLS-1$
+ "Hibernate3TuplizerFolder", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("attribute", 100, "class")}, //$NON-NLS-1$
new String[]{TUPLIZER_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddTuplizer")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddTuplizer") //$NON-NLS-1$
);
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3OneToOneFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3OneToOneFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3OneToOneFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -17,18 +17,18 @@
* @author glory
*/
public class Hibernate3OneToOneFormLayoutData {
- static String ONE_TO_ONE_ENTITY = "Hibernate3OneToOne";
+ static String ONE_TO_ONE_ENTITY = "Hibernate3OneToOne"; //$NON-NLS-1$
final static IFormData[] ONE_TO_ONE_DEFINITIONS = new IFormData[] {
new FormData(
"One To One",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(ONE_TO_ONE_ENTITY)
),
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(ONE_TO_ONE_ENTITY)
),
};
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3PropertyFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3PropertyFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3PropertyFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -17,11 +17,11 @@
* @author glory
*/
public class Hibernate3PropertyFormLayoutData {
- static String PROPERTY_ENTITY = "Hibernate3Property";
+ static String PROPERTY_ENTITY = "Hibernate3Property"; //$NON-NLS-1$
final static IFormData[] PROPERTY_DEFINITIONS = new IFormData[] {
new FormData(
"Property",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(PROPERTY_ENTITY)
),
Hibernate3ColumnFormLayoutData.COLUMN_LIST_DEFINITION,
@@ -29,7 +29,7 @@
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(PROPERTY_ENTITY)
),
};
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3SQLQueryFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3SQLQueryFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3SQLQueryFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -18,51 +18,51 @@
* @author glory
*/
public class Hibernate3SQLQueryFormLayoutData {
- static String SQL_QUERY_ENTITY = "Hibernate3SQLQuery";
- static String SYNCHRONIZES_ENTITY = "Hibernate3Synchronize";
- static String RESULT_SET_ENTITY = "Hibernate3ResultSet";
+ static String SQL_QUERY_ENTITY = "Hibernate3SQLQuery"; //$NON-NLS-1$
+ static String SYNCHRONIZES_ENTITY = "Hibernate3Synchronize"; //$NON-NLS-1$
+ static String RESULT_SET_ENTITY = "Hibernate3ResultSet"; //$NON-NLS-1$
static IFormData SYNCHRONIZES_LIST_DEFINITION = new FormData(
"Synchronize",
- "", //"Description
- new FormAttributeData[]{new FormAttributeData("table", 100)},
+ "", //"Description //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("table", 100)}, //$NON-NLS-1$
new String[]{SYNCHRONIZES_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddSynchronize")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddSynchronize") //$NON-NLS-1$
);
static IFormData SYNCHRONIZES_FOLDER_DEFINITION = new FormData(
"Synchronize",
- "", //"Description
- "Synchronize",
- new FormAttributeData[]{new FormAttributeData("table", 100)},
+ "", //"Description //$NON-NLS-1$
+ "Synchronize", //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("table", 100)}, //$NON-NLS-1$
new String[]{SYNCHRONIZES_ENTITY},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddSynchronize")
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddSynchronize") //$NON-NLS-1$
);
final static IFormData[] SQL_QUERY_DEFINITIONS = new IFormData[] {
new FormData(
"SQL Query",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(SQL_QUERY_ENTITY)
),
new FormData(
"Returns",
- "", //"Description
- new FormAttributeData[]{new FormAttributeData("alias", 100)},
- new String[]{"Hibernate3Return", "Hibernate3ReturnJoin", "Hibernate3LoadCollection"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.Returns.AddAnyReturn")
+ "", //"Description //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("alias", 100)}, //$NON-NLS-1$
+ new String[]{"Hibernate3Return", "Hibernate3ReturnJoin", "Hibernate3LoadCollection"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.Returns.AddAnyReturn") //$NON-NLS-1$
),
new FormData(
"Return Scalars",
- "", //"Description
- new FormAttributeData[]{new FormAttributeData("column", 40), new FormAttributeData("type", 60)},
- new String[]{"Hibernate3ReturnScalar"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddReturnScalar")
+ "", //"Description //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("column", 40), new FormAttributeData("type", 60)}, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[]{"Hibernate3ReturnScalar"}, //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddReturnScalar") //$NON-NLS-1$
),
SYNCHRONIZES_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(SQL_QUERY_ENTITY)
),
};
@@ -70,26 +70,26 @@
final static IFormData[] RESULT_SET_DEFINITIONS = new IFormData[] {
new FormData(
"Result Set",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(RESULT_SET_ENTITY)
),
new FormData(
"Returns",
- "", //"Description
- new FormAttributeData[]{new FormAttributeData("alias", 100)},
- new String[]{"Hibernate3Return", "Hibernate3ReturnJoin", "Hibernate3LoadCollection"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.Returns.AddAnyReturn")
+ "", //"Description //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("alias", 100)}, //$NON-NLS-1$
+ new String[]{"Hibernate3Return", "Hibernate3ReturnJoin", "Hibernate3LoadCollection"}, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.Returns.AddAnyReturn") //$NON-NLS-1$
),
new FormData(
"Return Scalars",
- "", //"Description
- new FormAttributeData[]{new FormAttributeData("column", 40), new FormAttributeData("type", 60)},
- new String[]{"Hibernate3ReturnScalar"},
- Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddReturnScalar")
+ "", //"Description //$NON-NLS-1$
+ new FormAttributeData[]{new FormAttributeData("column", 40), new FormAttributeData("type", 60)}, //$NON-NLS-1$ //$NON-NLS-2$
+ new String[]{"Hibernate3ReturnScalar"}, //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createDefaultFormActionData("CreateActions.AddReturnScalar") //$NON-NLS-1$
),
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(RESULT_SET_ENTITY)
),
};
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3SetFormLayoutData.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3SetFormLayoutData.java 2009-07-03 05:38:35 UTC (rev 16371)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml.ui/src/org/jboss/tools/hibernate/ui/xml/form/Hibernate3SetFormLayoutData.java 2009-07-03 06:56:02 UTC (rev 16372)
@@ -16,26 +16,26 @@
import org.jboss.tools.common.model.ui.forms.IFormData;
public class Hibernate3SetFormLayoutData {
- static String SET_ENTITY = "Hibernate3Set";
- static String BAG_ENTITY = "Hibernate3Bag";
+ static String SET_ENTITY = "Hibernate3Set"; //$NON-NLS-1$
+ static String BAG_ENTITY = "Hibernate3Bag"; //$NON-NLS-1$
final static IFormData[] SET_DEFINITIONS = new IFormData[] {
new FormData(
"Set",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(SET_ENTITY)
),
new FormData(
"Key",
- "",
- "key",
- Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("Hibernate3Key")
+ "", //$NON-NLS-1$
+ "key", //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("Hibernate3Key") //$NON-NLS-1$
),
new FormData(
"Element",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
new IFormAttributeData[]{
- new FormAttributeData("element", 100, "Element Kind")
+ new FormAttributeData("element", 100, "Element Kind") //$NON-NLS-1$
}
),
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
@@ -43,7 +43,7 @@
Hibernate3FilterFormLayoutData.FILTER_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(SET_ENTITY)
),
};
@@ -51,20 +51,20 @@
final static IFormData[] BAG_DEFINITIONS = new IFormData[] {
new FormData(
"Bag",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData(BAG_ENTITY)
),
new FormData(
"Key",
- "",
- "key",
- Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("Hibernate3Key")
+ "", //$NON-NLS-1$
+ "key", //$NON-NLS-1$
+ Hibernate3FormLayoutDataUtil.createGeneralFormAttributeData("Hibernate3Key") //$NON-NLS-1$
),
new FormData(
"Element",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
new IFormAttributeData[]{
- new FormAttributeData("element", 100, "Element Kind")
+ new FormAttributeData("element", 100, "Element Kind") //$NON-NLS-1$
}
),
Hibernate3MetaFormLayoutData.META_LIST_DEFINITION,
@@ -72,7 +72,7 @@
Hibernate3FilterFormLayoutData.FILTER_LIST_DEFINITION,
new FormData(
"Advanced",
- "", //"Description
+ "", //"Description //$NON-NLS-1$
Hibernate3FormLayoutDataUtil.createAdvancedFormAttributeData(BAG_ENTITY)
),
};
16 years, 6 months
JBoss Tools SVN: r16371 - in trunk/workingset: plugins/org.jboss.tools.workingset.ui/.settings and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-07-03 01:38:35 -0400 (Fri, 03 Jul 2009)
New Revision: 16371
Modified:
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/Activator.java
trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/PreferenceConstants.java
trunk/workingset/plugins/org.jboss.tools.workingset.ui/.settings/org.eclipse.jdt.core.prefs
trunk/workingset/tests/org.jboss.tools.workingset.core.test/
trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/tools/workingset/core/test/GroupingTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3557 Externalize English strings
Modified: trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/Activator.java
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/Activator.java 2009-07-03 05:29:50 UTC (rev 16370)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/Activator.java 2009-07-03 05:38:35 UTC (rev 16371)
@@ -31,7 +31,7 @@
public class Activator extends AbstractUIPlugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.tools.workingset.core";
+ public static final String PLUGIN_ID = "org.jboss.tools.workingset.core"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
@@ -143,7 +143,7 @@
IWorkingSet newWs = wsManager.createWorkingSet(name, projects
.toArray(new IProject[projects.size()]));
- newWs.setId("org.eclipse.jdt.ui.JavaWorkingSetPage");
+ newWs.setId("org.eclipse.jdt.ui.JavaWorkingSetPage"); //$NON-NLS-1$
wsManager.addWorkingSet(newWs);
}
}
@@ -204,9 +204,9 @@
String newValue = (String) event.getNewValue();
- String[] lines = newValue.split(";");
+ String[] lines = newValue.split(";"); //$NON-NLS-1$
for (int i = 0; i < lines.length; i++) {
- String[] string = lines[i].split(",");
+ String[] string = lines[i].split(","); //$NON-NLS-1$
try {
x.add(string[0], string[1], Boolean.parseBoolean(string[2]));
} catch(Exception e) {
Modified: trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/PreferenceConstants.java
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/PreferenceConstants.java 2009-07-03 05:29:50 UTC (rev 16370)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.core/src/org/jboss/tools/workingset/core/PreferenceConstants.java 2009-07-03 05:38:35 UTC (rev 16371)
@@ -5,7 +5,7 @@
*/
public class PreferenceConstants {
- public static final String P_ENABLE = "enable_automatic_workingsets";
- public static final String P_PATTERNS = "workingset_patterns";
+ public static final String P_ENABLE = "enable_automatic_workingsets"; //$NON-NLS-1$
+ public static final String P_PATTERNS = "workingset_patterns"; //$NON-NLS-1$
}
Modified: trunk/workingset/plugins/org.jboss.tools.workingset.ui/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/workingset/plugins/org.jboss.tools.workingset.ui/.settings/org.eclipse.jdt.core.prefs 2009-07-03 05:29:50 UTC (rev 16370)
+++ trunk/workingset/plugins/org.jboss.tools.workingset.ui/.settings/org.eclipse.jdt.core.prefs 2009-07-03 05:38:35 UTC (rev 16371)
@@ -5,4 +5,5 @@
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.source=1.5
Property changes on: trunk/workingset/tests/org.jboss.tools.workingset.core.test
___________________________________________________________________
Name: svn:ignore
+ bin
Modified: trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/tools/workingset/core/test/GroupingTest.java
===================================================================
--- trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/tools/workingset/core/test/GroupingTest.java 2009-07-03 05:29:50 UTC (rev 16370)
+++ trunk/workingset/tests/org.jboss.tools.workingset.core.test/src/org/jboss/tools/workingset/core/test/GroupingTest.java 2009-07-03 05:38:35 UTC (rev 16371)
@@ -6,6 +6,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
+@SuppressWarnings("nls")
public class GroupingTest {
static NameToWorkingSet nws = new NameToWorkingSet();
16 years, 6 months
JBoss Tools SVN: r16370 - in trunk/maven/plugins: org.jboss.tools.maven.core/.settings and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: sflanigan
Date: 2009-07-03 01:29:50 -0400 (Fri, 03 Jul 2009)
New Revision: 16370
Added:
trunk/maven/plugins/org.jboss.tools.maven.core/bin/
trunk/maven/plugins/org.jboss.tools.maven.seam/bin/
trunk/maven/plugins/org.jboss.tools.maven.ui/bin/
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/.settings/org.eclipse.jdt.core.prefs
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/IJBossMavenConstants.java
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
trunk/maven/plugins/org.jboss.tools.maven.seam/.settings/org.eclipse.jdt.core.prefs
trunk/maven/plugins/org.jboss.tools.maven.ui/.settings/org.eclipse.jdt.core.prefs
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Activator.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/project/facet/MavenFacetInstallPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3557 Externalize English strings
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/.settings/org.eclipse.jdt.core.prefs 2009-07-03 00:51:03 UTC (rev 16369)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/.settings/org.eclipse.jdt.core.prefs 2009-07-03 05:29:50 UTC (rev 16370)
@@ -5,4 +5,5 @@
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.source=1.5
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/IJBossMavenConstants.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/IJBossMavenConstants.java 2009-07-03 00:51:03 UTC (rev 16369)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/IJBossMavenConstants.java 2009-07-03 05:29:50 UTC (rev 16370)
@@ -19,16 +19,16 @@
public interface IJBossMavenConstants {
- static final String M2_FACET_ID="jboss.m2";
- static final String ARTIFACT_ID = "artifactId";
- static final String GROUP_ID = "groupId";
- static final String VERSION = "version";
- static final String NAME = "name";
- static final String DESCRIPTION = "description";
- static final String PACKAGING = "packaging";
- static final String MAVEN_MODEL_VERSION = "4.0.0";
- static final String PROJECT_VERSION = "project.version";
- static final String SEAM_MAVEN_VERSION = "seamMavenVersion";
- static final String SEAM_VERSION = "seam.version";
- static final String REMOVE_WTP_CLASSPATH_CONTAINERS = "removeWTPClasspathContainers";
+ static final String M2_FACET_ID="jboss.m2"; //$NON-NLS-1$
+ static final String ARTIFACT_ID = "artifactId"; //$NON-NLS-1$
+ static final String GROUP_ID = "groupId"; //$NON-NLS-1$
+ static final String VERSION = "version"; //$NON-NLS-1$
+ static final String NAME = "name"; //$NON-NLS-1$
+ static final String DESCRIPTION = "description"; //$NON-NLS-1$
+ static final String PACKAGING = "packaging"; //$NON-NLS-1$
+ static final String MAVEN_MODEL_VERSION = "4.0.0"; //$NON-NLS-1$
+ static final String PROJECT_VERSION = "project.version"; //$NON-NLS-1$
+ static final String SEAM_MAVEN_VERSION = "seamMavenVersion"; //$NON-NLS-1$
+ static final String SEAM_VERSION = "seam.version"; //$NON-NLS-1$
+ static final String REMOVE_WTP_CLASSPATH_CONTAINERS = "removeWTPClasspathContainers"; //$NON-NLS-1$
}
\ No newline at end of file
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2009-07-03 00:51:03 UTC (rev 16369)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/MavenCoreActivator.java 2009-07-03 05:29:50 UTC (rev 16370)
@@ -48,14 +48,14 @@
*/
public class MavenCoreActivator extends Plugin {
- private static final String SEPARATOR = "/";
+ private static final String SEPARATOR = "/"; //$NON-NLS-1$
// The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.tools.maven.core";
+ public static final String PLUGIN_ID = "org.jboss.tools.maven.core"; //$NON-NLS-1$
public static final String OWNER_PROJECT_FACETS_ATTR = "owner.project.facets"; //$NON-NLS-1$
- public static final String BASEDIR = "${basedir}";
+ public static final String BASEDIR = "${basedir}"; //$NON-NLS-1$
// The shared instance
private static MavenCoreActivator plugin;
@@ -124,8 +124,8 @@
}
if (!hasJavaNature) {
// EAR project
- createFolder("target",monitor, project);
- IFolder binFolder = createFolder("target/classes",monitor, project);
+ createFolder("target",monitor, project); //$NON-NLS-1$
+ IFolder binFolder = createFolder("target/classes",monitor, project); //$NON-NLS-1$
String[] newNatureIds = new String[natureIds.length + 1];
for (int i = 0; i < natureIds.length; i++) {
newNatureIds[i]=natureIds[i];
@@ -265,7 +265,7 @@
resolverConfiguration.setIncludeModules(false);
// FIXME
resolverConfiguration.setResolveWorkspaceProjects(true);
- resolverConfiguration.setActiveProfiles("");
+ resolverConfiguration.setActiveProfiles(""); //$NON-NLS-1$
IProjectConfigurationManager configurationManager = MavenPlugin
.getDefault().getProjectConfigurationManager();
configurationManager.updateProjectConfiguration(project,
@@ -276,17 +276,17 @@
public static void addMavenWarPlugin(Build build, IProject project) throws JavaModelException {
org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();
- plugin.setGroupId("org.apache.maven.plugins");
- plugin.setArtifactId("maven-war-plugin");
+ plugin.setGroupId("org.apache.maven.plugins"); //$NON-NLS-1$
+ plugin.setArtifactId("maven-war-plugin"); //$NON-NLS-1$
- Xpp3Dom configuration = new Xpp3Dom( "configuration" );
- Xpp3Dom webappDirectory = new Xpp3Dom("webappDirectory");
+ Xpp3Dom configuration = new Xpp3Dom( "configuration" ); //$NON-NLS-1$
+ Xpp3Dom webappDirectory = new Xpp3Dom("webappDirectory"); //$NON-NLS-1$
IVirtualComponent component = ComponentCore.createComponent(project);
IVirtualFolder rootFolder = component.getRootFolder();
IContainer root = rootFolder.getUnderlyingFolder();
String webContentRoot = root.getProjectRelativePath().toString();
configuration.addChild(webappDirectory);
- Xpp3Dom warSourceDirectory = new Xpp3Dom("warSourceDirectory");
+ Xpp3Dom warSourceDirectory = new Xpp3Dom("warSourceDirectory"); //$NON-NLS-1$
if (webContentRoot.startsWith(SEPARATOR)) {
webappDirectory.setValue(MavenCoreActivator.BASEDIR + webContentRoot);
warSourceDirectory.setValue(MavenCoreActivator.BASEDIR + webContentRoot);
@@ -314,7 +314,7 @@
if (sourceDirectory != null) {
resource.setDirectory(sourceDirectory);
List<String> excludes = new ArrayList<String>();
- excludes.add("**/*.java");
+ excludes.add("**/*.java"); //$NON-NLS-1$
resource.setExcludes(excludes);
}
build.getResources().add(resource);
@@ -324,55 +324,55 @@
String sourceDirectory = getEarRoot(project);
build.setSourceDirectory(sourceDirectory);
org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();
- plugin.setGroupId("org.apache.maven.plugins");
- plugin.setArtifactId("maven-ear-plugin");
+ plugin.setGroupId("org.apache.maven.plugins"); //$NON-NLS-1$
+ plugin.setArtifactId("maven-ear-plugin"); //$NON-NLS-1$
- Xpp3Dom configuration = new Xpp3Dom( "configuration" );
- Xpp3Dom version = new Xpp3Dom("version");
- version.setValue("5");
+ Xpp3Dom configuration = new Xpp3Dom( "configuration" ); //$NON-NLS-1$
+ Xpp3Dom version = new Xpp3Dom("version"); //$NON-NLS-1$
+ version.setValue("5"); //$NON-NLS-1$
configuration.addChild(version);
- Xpp3Dom generateApplicationXml = new Xpp3Dom("generateApplicationXml");
- generateApplicationXml.setValue("false");
+ Xpp3Dom generateApplicationXml = new Xpp3Dom("generateApplicationXml"); //$NON-NLS-1$
+ generateApplicationXml.setValue("false"); //$NON-NLS-1$
configuration.addChild(generateApplicationXml);
- Xpp3Dom defaultLibBundleDir = new Xpp3Dom("defaultLibBundleDir");
- defaultLibBundleDir.setValue("lib");
+ Xpp3Dom defaultLibBundleDir = new Xpp3Dom("defaultLibBundleDir"); //$NON-NLS-1$
+ defaultLibBundleDir.setValue("lib"); //$NON-NLS-1$
configuration.addChild(defaultLibBundleDir);
- Xpp3Dom earSourceDirectory = new Xpp3Dom("earSourceDirectory");
+ Xpp3Dom earSourceDirectory = new Xpp3Dom("earSourceDirectory"); //$NON-NLS-1$
earSourceDirectory.setValue(sourceDirectory);
configuration.addChild(earSourceDirectory);
if (addModule) {
- Xpp3Dom modules = new Xpp3Dom("modules");
+ Xpp3Dom modules = new Xpp3Dom("modules"); //$NON-NLS-1$
configuration.addChild(modules);
Xpp3Dom ejbProject = getEarModule(
- "ejbModule",
+ "ejbModule", //$NON-NLS-1$
m2FacetModel.getStringProperty(IJBossMavenConstants.GROUP_ID),
m2FacetModel.getStringProperty(IJBossMavenConstants.ARTIFACT_ID)
- + "-ejb", "/");
+ + "-ejb", "/"); //$NON-NLS-1$ //$NON-NLS-2$
modules.addChild(ejbProject);
- Xpp3Dom seamModule = getEarModule("ejbModule", "org.jboss.seam",
- "jboss-seam", "/");
+ Xpp3Dom seamModule = getEarModule("ejbModule", "org.jboss.seam", //$NON-NLS-1$ //$NON-NLS-2$
+ "jboss-seam", "/"); //$NON-NLS-1$ //$NON-NLS-2$
modules.addChild(seamModule);
Xpp3Dom webProject = getEarModule(
- "webModule",
+ "webModule", //$NON-NLS-1$
m2FacetModel.getStringProperty(IJBossMavenConstants.GROUP_ID),
m2FacetModel.getStringProperty(IJBossMavenConstants.ARTIFACT_ID),
- "/");
- Xpp3Dom contextRoot = new Xpp3Dom("contextRoot");
+ "/"); //$NON-NLS-1$
+ Xpp3Dom contextRoot = new Xpp3Dom("contextRoot"); //$NON-NLS-1$
contextRoot.setValue(m2FacetModel
.getStringProperty(IJBossMavenConstants.ARTIFACT_ID));
webProject.addChild(contextRoot);
modules.addChild(webProject);
- Xpp3Dom richFacesApi = getEarModule("jarModule",
- "org.richfaces.framework", "richfaces-api", "/lib");
+ Xpp3Dom richFacesApi = getEarModule("jarModule", //$NON-NLS-1$
+ "org.richfaces.framework", "richfaces-api", "/lib"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
modules.addChild(richFacesApi);
- Xpp3Dom commonDigester = getEarModule("jarModule",
- "commons-digester", "commons-digester", "/lib");
+ Xpp3Dom commonDigester = getEarModule("jarModule", //$NON-NLS-1$
+ "commons-digester", "commons-digester", "/lib"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
modules.addChild(commonDigester);
}
plugin.setConfiguration(configuration);
@@ -386,13 +386,13 @@
String groupIdString,String artifactIdString, String bundleDirString) {
Xpp3Dom earModule = new Xpp3Dom(module);
//modules.addChild(earModule);
- Xpp3Dom groupId = new Xpp3Dom("groupId");
+ Xpp3Dom groupId = new Xpp3Dom("groupId"); //$NON-NLS-1$
groupId.setValue(groupIdString);
earModule.addChild(groupId);
- Xpp3Dom artifactId = new Xpp3Dom("artifactId");
+ Xpp3Dom artifactId = new Xpp3Dom("artifactId"); //$NON-NLS-1$
artifactId.setValue(artifactIdString);
earModule.addChild(artifactId);
- Xpp3Dom bundleDir = new Xpp3Dom("bundleDir");
+ Xpp3Dom bundleDir = new Xpp3Dom("bundleDir"); //$NON-NLS-1$
bundleDir.setValue(bundleDirString);
earModule.addChild(bundleDir);
return earModule;
@@ -400,13 +400,13 @@
public static void addMavenEjbPlugin(Build build, IProject project) throws JavaModelException {
org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();
- plugin.setGroupId("org.apache.maven.plugins");
- plugin.setArtifactId("maven-ejb-plugin");
- plugin.setInherited("true");
+ plugin.setGroupId("org.apache.maven.plugins"); //$NON-NLS-1$
+ plugin.setArtifactId("maven-ejb-plugin"); //$NON-NLS-1$
+ plugin.setInherited("true"); //$NON-NLS-1$
- Xpp3Dom configuration = new Xpp3Dom( "configuration" );
- Xpp3Dom ejbVersion = new Xpp3Dom("ejbVersion");
- ejbVersion.setValue("3.0");
+ Xpp3Dom configuration = new Xpp3Dom( "configuration" ); //$NON-NLS-1$
+ Xpp3Dom ejbVersion = new Xpp3Dom("ejbVersion"); //$NON-NLS-1$
+ ejbVersion.setValue("3.0"); //$NON-NLS-1$
configuration.addChild(ejbVersion);
plugin.setConfiguration(configuration);
build.getPlugins().add(plugin);
Modified: trunk/maven/plugins/org.jboss.tools.maven.seam/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.seam/.settings/org.eclipse.jdt.core.prefs 2009-07-03 00:51:03 UTC (rev 16369)
+++ trunk/maven/plugins/org.jboss.tools.maven.seam/.settings/org.eclipse.jdt.core.prefs 2009-07-03 05:29:50 UTC (rev 16370)
@@ -5,4 +5,5 @@
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.source=1.5
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/.settings/org.eclipse.jdt.core.prefs 2009-07-03 00:51:03 UTC (rev 16369)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/.settings/org.eclipse.jdt.core.prefs 2009-07-03 05:29:50 UTC (rev 16370)
@@ -5,4 +5,5 @@
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.source=1.5
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Activator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Activator.java 2009-07-03 00:51:03 UTC (rev 16369)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Activator.java 2009-07-03 05:29:50 UTC (rev 16370)
@@ -9,7 +9,7 @@
public class Activator extends AbstractUIPlugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.jboss.tools.maven.ui";
+ public static final String PLUGIN_ID = "org.jboss.tools.maven.ui"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/project/facet/MavenFacetInstallPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/project/facet/MavenFacetInstallPage.java 2009-07-03 00:51:03 UTC (rev 16369)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/project/facet/MavenFacetInstallPage.java 2009-07-03 05:29:50 UTC (rev 16370)
@@ -32,7 +32,7 @@
public class MavenFacetInstallPage extends DataModelWizardPage implements
IFacetWizardPage {
- private static final String SEAM_FACET_ID = "jst.seam";
+ private static final String SEAM_FACET_ID = "jst.seam"; //$NON-NLS-1$
private Text groupId;
private Text artifactId;
private Text version;
@@ -69,7 +69,7 @@
packaging.setLayoutData(gd);
synchHelper.synchCombo(packaging, IJBossMavenConstants.PACKAGING, null);
// FIXME
- String[] items = { "war","ear", "ejb", "jar" };
+ String[] items = { "war","ear", "ejb", "jar" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
packaging.setItems(items);
IFacetedProjectWorkingCopy fpwc = (IFacetedProjectWorkingCopy) getDataModel().getProperty(IFacetDataModelProperties.FACETED_PROJECT_WORKING_COPY);
if (fpwc.hasProjectFacet(WebFacetUtils.WEB_FACET)) {
@@ -89,10 +89,10 @@
if (fpwc.hasProjectFacet(SEAM_FACET)) {
Text seamVersion = createField(composite, "Seam Maven version:", IJBossMavenConstants.SEAM_MAVEN_VERSION);
IProjectFacetVersion seamFacetVersion = fpwc.getProjectFacetVersion(SEAM_FACET);
- if ("2.0".equals(seamFacetVersion.getVersionString())) {
- seamVersion.setText("2.0.2.SP1");
+ if ("2.0".equals(seamFacetVersion.getVersionString())) { //$NON-NLS-1$
+ seamVersion.setText("2.0.2.SP1"); //$NON-NLS-1$
} else {
- seamVersion.setText("2.1.1.GA");
+ seamVersion.setText("2.1.1.GA"); //$NON-NLS-1$
}
Button removeWTPContainers = new Button(composite,SWT.CHECK);
removeWTPContainers.setText("Remove WTP Classpath containers");
16 years, 6 months