JBoss Tools SVN: r29046 - in trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation: jsf2/action and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-02-07 08:16:00 -0500 (Mon, 07 Feb 2011)
New Revision: 29046
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/JSFAbstractValidationComponent.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2AbstractProposal.java
Log:
https://issues.jboss.org/browse/JBIDE-7005, refactoring our jsf 2 validators.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/JSFAbstractValidationComponent.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/JSFAbstractValidationComponent.java 2011-02-07 13:13:28 UTC (rev 29045)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/JSFAbstractValidationComponent.java 2011-02-07 13:16:00 UTC (rev 29046)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.jsf.web.validation;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2AbstractProposal.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2AbstractProposal.java 2011-02-07 13:13:28 UTC (rev 29045)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2AbstractProposal.java 2011-02-07 13:16:00 UTC (rev 29046)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.jsf.web.validation.jsf2.action;
import org.eclipse.core.resources.IMarker;
13 years, 11 months
JBoss Tools SVN: r29045 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-02-07 08:13:28 -0500 (Mon, 07 Feb 2011)
New Revision: 29045
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMapUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-7005, refactoring our jsf 2 validators.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMapUtil.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMapUtil.java 2011-02-07 13:09:16 UTC (rev 29044)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/bundle/BundleMapUtil.java 2011-02-07 13:13:28 UTC (rev 29045)
@@ -21,6 +21,8 @@
*
*/
public class BundleMapUtil {
+
+ private static final String elPattern = "(?s:(.*)[#\\$]\\{(.+)\\}(.*))"; //$NON-NLS-1$
/**
* Checks if node contains text information from resource bundle
* @param pageContext
@@ -32,7 +34,6 @@
return rst;
}
-
/**
* @param pageContext
* @param sourceNode
@@ -84,6 +85,6 @@
* @return
*/
public static boolean isContainsEl(final String value) {
- return (value.contains("#{") || value.contains("${")); //$NON-NLS-1$//$NON-NLS-2$
+ return value.matches(elPattern);
}
}
13 years, 11 months
JBoss Tools SVN: r29044 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-07 08:09:16 -0500 (Mon, 07 Feb 2011)
New Revision: 29044
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java
Log:
removed unneeded jaxb annotations
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java 2011-02-07 13:04:02 UTC (rev 29043)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/client/Instance.java 2011-02-07 13:09:16 UTC (rev 29044)
@@ -13,8 +13,6 @@
import java.util.ArrayList;
import java.util.List;
-import javax.xml.bind.annotation.XmlElement;
-
/**
* @author Martyn Taylor
* @author Andre Dietisheim
@@ -27,10 +25,8 @@
RUNNING, STOPPED, PENDING, TERMINATED, BOGUS
};
- @XmlElement(name = "owner_id")
private String ownerId;
- @XmlElement
private String name;
private String imageId;
@@ -47,13 +43,10 @@
private String keyId;
- @XmlElement
private InstanceState state;
- @XmlElement(name = "public_addresses")
private AddressList publicAddresses;
- @XmlElement(name = "private_addresses")
private AddressList privateAddresses;
public Instance() {
13 years, 11 months
JBoss Tools SVN: r29043 - in trunk/jsf/plugins/org.jboss.tools.jsf: src/org/jboss/tools/jsf/web/validation and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-02-07 08:04:02 -0500 (Mon, 07 Feb 2011)
New Revision: 29043
Added:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/JSFAbstractValidationComponent.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ValidatorUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/IJSFValidationComponent.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ValidatorConstants.java
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/IJSF2ValidationComponent.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AbstractValidationComponent.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2XMLValidator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeAttrsProposal.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeComponentProposal.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2QuickFixProcessor.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ResourcesFolderProposal.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AttrTempComponent.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2ComponentFactory.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2CompositeTempComponent.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2URITempComponent.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ComponentRecognizer.java
Log:
https://issues.jboss.org/browse/JBIDE-7005, refactoring our jsf 2 validators.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/META-INF/MANIFEST.MF 2011-02-07 13:04:02 UTC (rev 29043)
@@ -65,3 +65,4 @@
Bundle-Version: 3.2.0.qualifier
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.jboss.tools.jst.jsp.bundle
Copied: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/JSFAbstractValidationComponent.java (from rev 28999, trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AbstractValidationComponent.java)
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/JSFAbstractValidationComponent.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/JSFAbstractValidationComponent.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -0,0 +1,52 @@
+package org.jboss.tools.jsf.web.validation;
+
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.jboss.tools.jsf.web.validation.jsf2.components.IJSFValidationComponent;
+
+public abstract class JSFAbstractValidationComponent implements
+ IJSFValidationComponent {
+
+ private int length;
+ private int startOffSet;
+ private int line;
+ private Object[] messageParams;
+
+ public int getLength() {
+ return length;
+ }
+
+ public void setLength(int length) {
+ this.length = length;
+ }
+
+ public int getLine() {
+ return line;
+ }
+
+ public void setLine(int lineNumber) {
+ this.line = lineNumber;
+ }
+
+ public int getStartOffSet() {
+ return startOffSet;
+ }
+
+ public void setStartOffSet(int startOffSet) {
+ this.startOffSet = startOffSet;
+ }
+
+ public Object[] getMessageParams() {
+ return messageParams;
+ }
+
+ public int getSeverity() {
+ return IMessage.NORMAL_SEVERITY;
+ }
+
+ public abstract void createValidationMessage();
+
+ public void createMessageParams() {
+ this.messageParams = new Object[] { this };
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ValidatorUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ValidatorUtil.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/ValidatorUtil.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.jsf.web.validation;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+
+
+/**
+ * @author mareshkau
+ *
+ */
+public class ValidatorUtil {
+ public static void reportProblems(IReporter reporter,
+ IMessage message,IResource resource) {
+ }
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidator.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidator.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -22,6 +22,7 @@
import org.eclipse.wst.validation.internal.provisional.core.IValidator;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.jboss.tools.jsf.jsf2.model.JSF2ComponentModelManager;
+import org.jboss.tools.jst.jsp.bundle.BundleMapUtil;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
@@ -56,20 +57,34 @@
public void validate(IValidationContext helper, IReporter reporter)
throws ValidationException {
- List<Node> stringNodes = new ArrayList<Node>();
- lookForStrings(document, stringNodes);
+ List<Node> notValidNodes = new ArrayList<Node>();
+ validateDOM(document, notValidNodes);
+
}
- private void lookForStrings(Node node, List<Node> nonExtStings){
+ private void validateDOM(Node node, List<Node> nonExtStings){
NodeList childNodes = node.getChildNodes();
for(int i=0;i<childNodes.getLength();i++) {
Node childNode = childNodes.item(i);
if(childNode instanceof Text){
- nonExtStings.add(childNode);
- } else {
- lookForStrings(childNode, nonExtStings);
- }
+ if(!validateTextNode(((Text)childNode).getNodeValue())){
+ nonExtStings.add(childNode);
+ }
+ }else {
+ validateDOM(childNode, nonExtStings);
+ }
}
}
+ /**
+ * Return false if not not valid
+ * @param String to validate
+ * @return true is string ext and valid, false otherwise
+ *
+ */
+ private boolean validateTextNode(String stringToValidate){
+ if(stringToValidate==null) return true;
+ if(stringToValidate.trim().length()<1) return true;
+ return BundleMapUtil.isContainsEl(stringToValidate);
+ }
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -13,6 +13,7 @@
import java.io.InputStream;
import java.util.Scanner;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -27,10 +28,10 @@
import org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
-import org.jboss.tools.jsf.web.validation.jsf2.components.IJSF2ValidationComponent;
import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2AttrTempComponent;
import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2CompositeTempComponent;
import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2URITempComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
import org.jboss.tools.jst.web.kb.IKbProject;
import org.jboss.tools.jst.web.kb.KbProjectFactory;
@@ -108,7 +109,7 @@
}
if (args[0] instanceof JSF2CompositeTempComponent) {
JSF2CompositeTempComponent component = (JSF2CompositeTempComponent) args[0];
- message.setAttribute(IJSF2ValidationComponent.JSF2_TYPE_KEY,
+ message.setAttribute(JSF2ValidatorConstants.JSF2_TYPE_KEY,
component.getType());
message.setAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY,
component.getComponentResourceLocation());
@@ -117,7 +118,7 @@
if (attrNames != null) {
for (int i = 0; i < attrNames.length; i++) {
message.setAttribute(
- IJSF2ValidationComponent.JSF2_ATTR_NAME_KEY
+ JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY
+ String.valueOf(i), attrNames[i]);
}
}
@@ -125,9 +126,9 @@
}
if (args[0] instanceof JSF2AttrTempComponent) {
JSF2AttrTempComponent component = (JSF2AttrTempComponent) args[0];
- message.setAttribute(IJSF2ValidationComponent.JSF2_TYPE_KEY,
+ message.setAttribute(JSF2ValidatorConstants.JSF2_TYPE_KEY,
component.getType());
- message.setAttribute(IJSF2ValidationComponent.JSF2_ATTR_NAME_KEY,
+ message.setAttribute(JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY,
component.getName());
message.setAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY,
component.getComponentResourceLocation());
@@ -136,9 +137,9 @@
}
if (args[0] instanceof JSF2URITempComponent) {
JSF2URITempComponent component = (JSF2URITempComponent) args[0];
- message.setAttribute(IJSF2ValidationComponent.JSF2_TYPE_KEY,
- IJSF2ValidationComponent.JSF2_URI_TYPE);
- message.setAttribute(IJSF2ValidationComponent.JSF2_URI_NAME_KEY,
+ message.setAttribute(JSF2ValidatorConstants.JSF2_TYPE_KEY,
+ JSF2ValidatorConstants.JSF2_URI_TYPE);
+ message.setAttribute(JSF2ValidatorConstants.JSF2_URI_NAME_KEY,
component.getURI());
message.setAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY,
component.getResourcesFolder());
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2SourceValidator.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -32,10 +32,11 @@
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.jsf2.model.JSF2ComponentModelManager;
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
-import org.jboss.tools.jsf.web.validation.jsf2.components.IJSF2ValidationComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.components.IJSFValidationComponent;
import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2AttrTempComponent;
import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2CompositeTempComponent;
import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2URITempComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
/**
* Validates when we change smth in file
@@ -99,7 +100,7 @@
}
private void reportProblems(IReporter reporter,
- IJSF2ValidationComponent[] validationComponents,IResource resource) {
+ IJSFValidationComponent[] validationComponents,IResource resource) {
try {
resource.deleteMarkers(JSF2XMLValidator.JSF2_PROBLEM_ID, false, IResource.DEPTH_INFINITE);
for (int i = 0; i < validationComponents.length; i++) {
@@ -116,13 +117,13 @@
private static class LocalizedMessage extends Message {
- private IJSF2ValidationComponent component;
+ private IJSFValidationComponent component;
- public LocalizedMessage(IJSF2ValidationComponent component,
+ public LocalizedMessage(IJSFValidationComponent component,
IFile validateFile) {
this.component = component;
setAttribute("problemType", JSF2XMLValidator.JSF2_PROBLEM_ID); //$NON-NLS-1$
- setAttribute(IJSF2ValidationComponent.JSF2_TYPE_KEY, component
+ setAttribute(JSF2ValidatorConstants.JSF2_TYPE_KEY, component
.getType());
setAttribute(
"validateResourcePath", validateFile == null ? "" : validateFile.getFullPath().toString()); //$NON-NLS-1$//$NON-NLS-2$
@@ -132,10 +133,10 @@
setAttribute(IMarker.SEVERITY, 1);
setAttribute(ValidatorMessage.ValidationId, "org.jboss.tools.jsf.jsf2.source"); //$NON-NLS-1$
if (component instanceof JSF2URITempComponent) {
- setAttribute(IJSF2ValidationComponent.JSF2_URI_NAME_KEY,
+ setAttribute(JSF2ValidatorConstants.JSF2_URI_NAME_KEY,
((JSF2URITempComponent) component).getURI());
} else if (component instanceof JSF2AttrTempComponent) {
- setAttribute(IJSF2ValidationComponent.JSF2_ATTR_NAME_KEY,
+ setAttribute(JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY,
((JSF2AttrTempComponent) component).getName());
setAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME, ((JSF2AttrTempComponent) component).getElementName());
} else if (component instanceof JSF2CompositeTempComponent) {
@@ -144,7 +145,7 @@
if (attrNames != null) {
for (int i = 0; i < attrNames.length; i++) {
setAttribute(
- IJSF2ValidationComponent.JSF2_ATTR_NAME_KEY
+ JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY
+ String.valueOf(i), attrNames[i]);
}
setAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME, ((JSF2CompositeTempComponent) component).getElement().getLocalName());
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2XMLValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2XMLValidator.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2XMLValidator.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -26,7 +26,7 @@
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.jsf2.model.JSF2ComponentModelManager;
import org.jboss.tools.jsf.jsf2.util.JSF2ComponentUtil;
-import org.jboss.tools.jsf.web.validation.jsf2.components.IJSF2ValidationComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.components.IJSFValidationComponent;
import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ComponentRecognizer;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.PageContextFactory;
@@ -78,7 +78,7 @@
private void validateAsDOM(IFile file) {
IDOMDocument document = JSF2ComponentModelManager
.getReadableDOMDocument(file);
- IJSF2ValidationComponent[] components = getValidationComponents(
+ IJSFValidationComponent[] components = getValidationComponents(
document, file);
if (components != null) {
for (int i = 0; i < components.length; i++) {
@@ -88,16 +88,16 @@
}
private void createMarkerForComponent(
- IJSF2ValidationComponent jsf2ValidationComponent) {
+ IJSFValidationComponent jsf2ValidationComponent) {
validationInfo.addWarning(jsf2ValidationComponent
.getValidationMessage(), jsf2ValidationComponent.getLine(), 0,
validationInfo.getFileURI(), null, jsf2ValidationComponent
.getMessageParams());
}
- public static IJSF2ValidationComponent[] getValidationComponents(Node node,
+ public static IJSFValidationComponent[] getValidationComponents(Node node,
IFile file) {
- List<IJSF2ValidationComponent> components = new ArrayList<IJSF2ValidationComponent>(
+ List<IJSFValidationComponent> components = new ArrayList<IJSFValidationComponent>(
0);
Map<String, List<Element>> compositeComponentsMap = JSF2ComponentUtil
.findCompositeComponents(node);
@@ -106,7 +106,7 @@
for (Entry<String, List<Element>> entry : entries) {
List<Element> elements = entry.getValue();
for (Element element : elements) {
- IJSF2ValidationComponent[] validationComponents = JSF2ComponentRecognizer
+ IJSFValidationComponent[] validationComponents = JSF2ComponentRecognizer
.recognizeCompositeValidationComponents(file,
(IDOMElement) element);
for (int i = 0; i < validationComponents.length; i++) {
@@ -119,7 +119,7 @@
for (int i = 0; i < attrs.length; i++) {
if (!attrValuesSet.contains(attrs[i].getValue())) {
attrValuesSet.add(attrs[i].getValue());
- IJSF2ValidationComponent validationComponent = JSF2ComponentRecognizer
+ IJSFValidationComponent validationComponent = JSF2ComponentRecognizer
.recognizeURIValidationComponent(file.getProject(),
attrs[i]);
if (validationComponent != null) {
@@ -127,6 +127,6 @@
}
}
}
- return components.toArray(new IJSF2ValidationComponent[0]);
+ return components.toArray(new IJSFValidationComponent[0]);
}
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -15,11 +15,9 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.IMarkerResolutionGenerator;
-import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.jboss.tools.jsf.JSFModelPlugin;
-import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
import org.jboss.tools.jsf.web.validation.jsf2.JSF2XMLValidator;
-import org.jboss.tools.jsf.web.validation.jsf2.components.IJSF2ValidationComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
/**
*
@@ -38,14 +36,14 @@
return new IMarkerResolution[0];
}
String fixType = (String) marker
- .getAttribute(IJSF2ValidationComponent.JSF2_TYPE_KEY);
- if (IJSF2ValidationComponent.JSF2_COMPOSITE_COMPONENT_TYPE.equals(fixType)) {
+ .getAttribute(JSF2ValidatorConstants.JSF2_TYPE_KEY);
+ if (JSF2ValidatorConstants.JSF2_COMPOSITE_COMPONENT_TYPE.equals(fixType)) {
return new IMarkerResolution[] { new JSF2CompositeComponentProposal(marker) };
}
- if (IJSF2ValidationComponent.JSF2_FIXABLE_ATTR_TYPE.equals(fixType)) {
+ if (JSF2ValidatorConstants.JSF2_FIXABLE_ATTR_TYPE.equals(fixType)) {
return new IMarkerResolution[] { new JSF2CompositeAttrsProposal(marker) };
}
- if (IJSF2ValidationComponent.JSF2_URI_TYPE.equals(fixType)) {
+ if (JSF2ValidatorConstants.JSF2_URI_TYPE.equals(fixType)) {
return new IMarkerResolution[] { new JSF2ResourcesFolderProposal(marker) };
}
} catch (CoreException e) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeAttrsProposal.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeAttrsProposal.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeAttrsProposal.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -13,6 +13,7 @@
import java.text.MessageFormat;
import java.util.Map;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
@@ -24,7 +25,7 @@
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
import org.jboss.tools.jsf.messages.JSFUIMessages;
import org.jboss.tools.jsf.web.validation.jsf2.JSF2XMLValidator;
-import org.jboss.tools.jsf.web.validation.jsf2.components.IJSF2ValidationComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
/**
*
@@ -44,7 +45,7 @@
try {
this.elementName=(String) marker.getAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME);
this.componentPath=(String) marker.getAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY);
- this.attrName=(String)marker.getAttribute(IJSF2ValidationComponent.JSF2_ATTR_NAME_KEY);
+ this.attrName=(String)marker.getAttribute(JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY);
} catch (CoreException e) {
JSFModelPlugin.getPluginLog().logError(e);
}
@@ -72,7 +73,7 @@
.get(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY);
componentPath = (String) object;
attrs = new String[] { (String) marker
- .getAttribute(IJSF2ValidationComponent.JSF2_ATTR_NAME_KEY) };
+ .getAttribute(JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY) };
}
final IFile createdFile = JSF2ResourceUtil
.createCompositeComponentFile(validateResource.getProject(),
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeComponentProposal.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeComponentProposal.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeComponentProposal.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -16,6 +16,7 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
@@ -27,7 +28,7 @@
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
import org.jboss.tools.jsf.messages.JSFUIMessages;
import org.jboss.tools.jsf.web.validation.jsf2.JSF2XMLValidator;
-import org.jboss.tools.jsf.web.validation.jsf2.components.IJSF2ValidationComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
/**
*
@@ -67,7 +68,7 @@
Set<Entry> entries = attrsMap.entrySet();
for (Entry entry : entries) {
String key = (String) entry.getKey();
- if (key.startsWith(IJSF2ValidationComponent.JSF2_ATTR_NAME_KEY)) {
+ if (key.startsWith(JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY)) {
set.add((String) entry.getValue());
}
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2QuickFixProcessor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2QuickFixProcessor.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2QuickFixProcessor.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -22,7 +22,7 @@
import org.eclipse.jface.text.source.Annotation;
import org.eclipse.wst.sse.ui.StructuredTextInvocationContext;
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
-import org.jboss.tools.jsf.web.validation.jsf2.components.IJSF2ValidationComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
/**
*
@@ -45,7 +45,7 @@
if (invocationContext instanceof StructuredTextInvocationContext) {
StructuredTextInvocationContext context = (StructuredTextInvocationContext) invocationContext;
String type = (String) context
- .getAttribute(IJSF2ValidationComponent.JSF2_TYPE_KEY);
+ .getAttribute(JSF2ValidatorConstants.JSF2_TYPE_KEY);
IResource resource = ResourcesPlugin.getWorkspace().getRoot()
.findMember(
(String) context
@@ -53,23 +53,23 @@
String compPath = (String) context
.getAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY);
- if (type.equals(IJSF2ValidationComponent.JSF2_FIXABLE_ATTR_TYPE)) {
+ if (type.equals(JSF2ValidatorConstants.JSF2_FIXABLE_ATTR_TYPE)) {
String[] attrs = new String[] { (String) context
- .getAttribute(IJSF2ValidationComponent.JSF2_ATTR_NAME_KEY) };
+ .getAttribute(JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY) };
ICompletionProposal proposal = new JSF2CompositeAttrsProposal(
- resource, compPath, attrs,(String)context.getAttribute(IJSF2ValidationComponent.JSF2_ATTR_NAME_KEY),
+ resource, compPath, attrs,(String)context.getAttribute(JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY),
(String)context.getAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME));
return new ICompletionProposal[] { proposal };
} else if (type
- .equals(IJSF2ValidationComponent.JSF2_COMPOSITE_COMPONENT_TYPE)) {
+ .equals(JSF2ValidatorConstants.JSF2_COMPOSITE_COMPONENT_TYPE)) {
ICompletionProposal proposal = new JSF2CompositeComponentProposal(
resource, compPath, retriveAttrsFromContext(context),(String)context.getAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME));
return new ICompletionProposal[] { proposal };
- } else if (type.equals(IJSF2ValidationComponent.JSF2_URI_TYPE)) {
+ } else if (type.equals(JSF2ValidatorConstants.JSF2_URI_TYPE)) {
String uriPath = (String) context
- .getAttribute(IJSF2ValidationComponent.JSF2_URI_NAME_KEY);
+ .getAttribute(JSF2ValidatorConstants.JSF2_URI_NAME_KEY);
ICompletionProposal proposal = new JSF2ResourcesFolderProposal(
- resource, uriPath,(String)context.getAttribute(IJSF2ValidationComponent.JSF2_URI_NAME_KEY));
+ resource, uriPath,(String)context.getAttribute(JSF2ValidatorConstants.JSF2_URI_NAME_KEY));
return new ICompletionProposal[] { proposal };
}
}
@@ -81,10 +81,10 @@
List<String> attrsList = new ArrayList<String>();
int i = 0;
while (!(context
- .getAttribute(IJSF2ValidationComponent.JSF2_ATTR_NAME_KEY
+ .getAttribute(JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY
+ String.valueOf(i)) == null)) {
attrsList.add((String) context
- .getAttribute(IJSF2ValidationComponent.JSF2_ATTR_NAME_KEY
+ .getAttribute(JSF2ValidatorConstants.JSF2_ATTR_NAME_KEY
+ String.valueOf(i)));
i++;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ResourcesFolderProposal.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ResourcesFolderProposal.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ResourcesFolderProposal.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -20,7 +20,7 @@
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
import org.jboss.tools.jsf.messages.JSFUIMessages;
import org.jboss.tools.jsf.web.validation.jsf2.JSF2XMLValidator;
-import org.jboss.tools.jsf.web.validation.jsf2.components.IJSF2ValidationComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
/**
*
@@ -37,7 +37,7 @@
super(marker.getResource());
try {
this.componentPath=(String) marker.getAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY);
- this.URL = (String) marker.getAttribute(IJSF2ValidationComponent.JSF2_URI_NAME_KEY);
+ this.URL = (String) marker.getAttribute(JSF2ValidatorConstants.JSF2_URI_NAME_KEY);
} catch (CoreException e) {
JSFModelPlugin.getPluginLog().logError(e);
}
@@ -62,7 +62,7 @@
protected void runWithMarker(IMarker marker) throws CoreException {
if (marker != null) {
componentPath = (String) marker
- .getAttribute(IJSF2ValidationComponent.JSF2_URI_NAME_KEY);
+ .getAttribute(JSF2ValidatorConstants.JSF2_URI_NAME_KEY);
validateResource = marker.getResource();
}
JSF2ResourceUtil.createResourcesFolderByNameSpace(validateResource
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/IJSF2ValidationComponent.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/IJSF2ValidationComponent.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/IJSF2ValidationComponent.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 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.jsf.web.validation.jsf2.components;
-
-/**
- *
- * @author yzhishko
- *
- */
-
-public interface IJSF2ValidationComponent {
-
- String JSF2_TYPE_KEY = "JSF2_TYPE_KEY"; //$NON-NLS-1$
-
- String JSF2_COMPONENT_NAME_KEY = "AJSF2_COMPONENT_NAME_KEY"; //$NON-NLS-1$
-
- String JSF2_ATTR_NAME_KEY = "ATTR_NAME_KEY"; //$NON-NLS-1$
-
- String JSF2_URI_NAME_KEY = "JSF2_URI_NAME_KEY"; //$NON-NLS-1$
-
- String JSF2_URI_TYPE_KEY = "JSF2_URI_TYPE_KEY"; //$NON-NLS-1$
-
- String JSF2_COMPOSITE_COMPONENT_TYPE = "JSF2_COMPOSITE_COMPONENT_TYPE"; //$NON-NLS-1$
-
- String JSF2_UNFIXABLE_ATTR_TYPE = "JSF2_UNFIXABLE_ATTR_TYPE"; //$NON-NLS-1$
-
- String JSF2_FIXABLE_ATTR_TYPE = "JSF2_FIXABLE_ATTR_TYPE"; //$NON-NLS-1$
-
- String JSF2_URI_TYPE = "JSF2_URI_TYPE"; //$NON-NLS-1$
-
- int getLine();
-
- int getStartOffSet();
-
- int getLength();
-
- String getValidationMessage();
-
- Object[] getMessageParams();
-
- String getType();
-
- String getComponentResourceLocation();
-
- int getSeverity();
-
-}
Copied: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/IJSFValidationComponent.java (from rev 28999, trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/IJSF2ValidationComponent.java)
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/IJSFValidationComponent.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/IJSFValidationComponent.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 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.jsf.web.validation.jsf2.components;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public interface IJSFValidationComponent {
+
+ int getLine();
+
+ int getStartOffSet();
+
+ int getLength();
+
+ String getValidationMessage();
+
+ Object[] getMessageParams();
+
+ String getType();
+
+ String getComponentResourceLocation();
+
+ int getSeverity();
+
+}
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AbstractValidationComponent.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AbstractValidationComponent.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AbstractValidationComponent.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -1,51 +0,0 @@
-package org.jboss.tools.jsf.web.validation.jsf2.components;
-
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public abstract class JSF2AbstractValidationComponent implements
- IJSF2ValidationComponent {
-
- private int length;
- private int startOffSet;
- private int line;
- private Object[] messageParams;
-
- public int getLength() {
- return length;
- }
-
- public void setLength(int length) {
- this.length = length;
- }
-
- public int getLine() {
- return line;
- }
-
- public void setLine(int lineNumber) {
- this.line = lineNumber;
- }
-
- public int getStartOffSet() {
- return startOffSet;
- }
-
- public void setStartOffSet(int startOffSet) {
- this.startOffSet = startOffSet;
- }
-
- public Object[] getMessageParams() {
- return messageParams;
- }
-
- public int getSeverity() {
- return IMessage.NORMAL_SEVERITY;
- }
-
- public abstract void createValidationMessage();
-
- public void createMessageParams() {
- this.messageParams = new Object[] { this };
- }
-
-}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AttrTempComponent.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AttrTempComponent.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AttrTempComponent.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -16,6 +16,8 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
import org.jboss.tools.jsf.messages.JSFUIMessages;
+import org.jboss.tools.jsf.web.validation.JSFAbstractValidationComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
/**
*
@@ -24,10 +26,10 @@
*/
@SuppressWarnings("restriction")
-public class JSF2AttrTempComponent extends JSF2AbstractValidationComponent {
+public class JSF2AttrTempComponent extends JSFAbstractValidationComponent {
private String validationMessage = ""; //$NON-NLS-1$
- private String type = JSF2_UNFIXABLE_ATTR_TYPE;
+ private String type = JSF2ValidatorConstants.JSF2_UNFIXABLE_ATTR_TYPE;
private ElementImpl parentEl;
private IDOMAttr attr;
private String componentResLocation;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2ComponentFactory.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2ComponentFactory.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2ComponentFactory.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -22,6 +22,7 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.jsf.jsf2.model.JSF2ComponentModelManager;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -40,7 +41,7 @@
uncheckedAttrs.add("id"); //$NON-NLS-1$
}
- public static IJSF2ValidationComponent createCompositeTempComponent(
+ public static IJSFValidationComponent createCompositeTempComponent(
IDOMElement element) {
JSF2CompositeTempComponent component = new JSF2CompositeTempComponent(
(ElementImpl) element);
@@ -54,9 +55,9 @@
return component;
}
- public static IJSF2ValidationComponent[] createUnfixableAttrTempComponents(
+ public static IJSFValidationComponent[] createUnfixableAttrTempComponents(
JarEntryFile container, IDOMElement elementWithAttrs) {
- List<IJSF2ValidationComponent> validationComponents = new ArrayList<IJSF2ValidationComponent>(
+ List<IJSFValidationComponent> validationComponents = new ArrayList<IJSFValidationComponent>(
0);
IDOMDocument containerDocument = JSF2ComponentModelManager
.getReadableDOMDocument(container);
@@ -72,7 +73,7 @@
JSF2AttrTempComponent component = new JSF2AttrTempComponent(
attr, (ElementImpl) elementWithAttrs);
component
- .setType(IJSF2ValidationComponent.JSF2_UNFIXABLE_ATTR_TYPE);
+ .setType(JSF2ValidatorConstants.JSF2_UNFIXABLE_ATTR_TYPE);
component.setStartOffSet(attr.getStartOffset());
component.setLine(attr.getStructuredDocument().getLineOfOffset(
component.getStartOffSet()) + 1);
@@ -82,12 +83,12 @@
validationComponents.add(component);
}
}
- return validationComponents.toArray(new IJSF2ValidationComponent[0]);
+ return validationComponents.toArray(new IJSFValidationComponent[0]);
}
- public static IJSF2ValidationComponent[] createFixableAttrTempComponents(
+ public static IJSFValidationComponent[] createFixableAttrTempComponents(
IFile compContainerFile, IDOMElement elementWithAttrs) {
- List<IJSF2ValidationComponent> components = new ArrayList<IJSF2ValidationComponent>(
+ List<IJSFValidationComponent> components = new ArrayList<IJSFValidationComponent>(
0);
IDOMDocument document = JSF2ComponentModelManager
.getReadableDOMDocument(compContainerFile);
@@ -103,7 +104,7 @@
JSF2AttrTempComponent component = new JSF2AttrTempComponent(
attr, (ElementImpl) elementWithAttrs);
component
- .setType(IJSF2ValidationComponent.JSF2_FIXABLE_ATTR_TYPE);
+ .setType(JSF2ValidatorConstants.JSF2_FIXABLE_ATTR_TYPE);
component.setStartOffSet(attr.getStartOffset());
component.setLine(attr.getStructuredDocument().getLineOfOffset(
component.getStartOffSet()) + 1);
@@ -113,10 +114,10 @@
components.add(component);
}
}
- return components.toArray(new IJSF2ValidationComponent[0]);
+ return components.toArray(new IJSFValidationComponent[0]);
}
- public static IJSF2ValidationComponent createURITempComponent(
+ public static IJSFValidationComponent createURITempComponent(
IDOMAttr attrContainer) {
JSF2URITempComponent component = new JSF2URITempComponent(attrContainer
.getValue());
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2CompositeTempComponent.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2CompositeTempComponent.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2CompositeTempComponent.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -18,6 +18,8 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
import org.jboss.tools.jsf.messages.JSFUIMessages;
+import org.jboss.tools.jsf.web.validation.JSFAbstractValidationComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
import org.w3c.dom.NamedNodeMap;
/**
@@ -27,7 +29,7 @@
*/
@SuppressWarnings("restriction")
-public class JSF2CompositeTempComponent extends JSF2AbstractValidationComponent {
+public class JSF2CompositeTempComponent extends JSFAbstractValidationComponent {
private String validationMessage = ""; //$NON-NLS-1$
private List<String> attrNames = new ArrayList<String>(0);
@@ -65,7 +67,7 @@
}
public String getType() {
- return JSF2_COMPOSITE_COMPONENT_TYPE;
+ return JSF2ValidatorConstants.JSF2_COMPOSITE_COMPONENT_TYPE;
}
public String getComponentResourceLocation() {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2URITempComponent.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2URITempComponent.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2URITempComponent.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -15,6 +15,8 @@
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
import org.jboss.tools.jsf.messages.JSFUIMessages;
+import org.jboss.tools.jsf.web.validation.JSFAbstractValidationComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
/**
*
@@ -22,7 +24,7 @@
*
*/
-public class JSF2URITempComponent extends JSF2AbstractValidationComponent {
+public class JSF2URITempComponent extends JSFAbstractValidationComponent {
private String validationMessage = ""; //$NON-NLS-1$
private String URI;
@@ -45,7 +47,7 @@
}
public String getType() {
- return JSF2_URI_TYPE;
+ return JSF2ValidatorConstants.JSF2_URI_TYPE;
}
public String getComponentResourceLocation() {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ComponentRecognizer.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ComponentRecognizer.java 2011-02-07 13:01:01 UTC (rev 29042)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ComponentRecognizer.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -18,7 +18,7 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
-import org.jboss.tools.jsf.web.validation.jsf2.components.IJSF2ValidationComponent;
+import org.jboss.tools.jsf.web.validation.jsf2.components.IJSFValidationComponent;
import org.jboss.tools.jsf.web.validation.jsf2.components.JSF2ComponentFactory;
/**
@@ -30,34 +30,34 @@
@SuppressWarnings("restriction")
public class JSF2ComponentRecognizer {
- public static IJSF2ValidationComponent[] recognizeCompositeValidationComponents(
+ public static IJSFValidationComponent[] recognizeCompositeValidationComponents(
IFile file, IDOMElement element) {
- List<IJSF2ValidationComponent> validationComponents = new ArrayList<IJSF2ValidationComponent>(
+ List<IJSFValidationComponent> validationComponents = new ArrayList<IJSFValidationComponent>(
0);
Object container = JSF2ResourceUtil.findCompositeComponentContainer(
file.getProject(), element);
if (container == null) {
- IJSF2ValidationComponent component = JSF2ComponentFactory
+ IJSFValidationComponent component = JSF2ComponentFactory
.createCompositeTempComponent(element);
validationComponents.add(component);
} else if (container instanceof IFile) {
- IJSF2ValidationComponent[] components = JSF2ComponentFactory
+ IJSFValidationComponent[] components = JSF2ComponentFactory
.createFixableAttrTempComponents((IFile) container, element);
for (int i = 0; i < components.length; i++) {
validationComponents.add(components[i]);
}
} else if (container instanceof JarEntryFile) {
- IJSF2ValidationComponent[] components = JSF2ComponentFactory
+ IJSFValidationComponent[] components = JSF2ComponentFactory
.createUnfixableAttrTempComponents(
(JarEntryFile) container, element);
for (int i = 0; i < components.length; i++) {
validationComponents.add(components[i]);
}
}
- return validationComponents.toArray(new IJSF2ValidationComponent[0]);
+ return validationComponents.toArray(new IJSFValidationComponent[0]);
}
- public static IJSF2ValidationComponent recognizeURIValidationComponent(
+ public static IJSFValidationComponent recognizeURIValidationComponent(
IProject project, IDOMAttr attrContainer) {
if (!JSF2ResourceUtil.isResourcesFolderExists(project, attrContainer
.getValue())) {
Added: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ValidatorConstants.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ValidatorConstants.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ValidatorConstants.java 2011-02-07 13:04:02 UTC (rev 29043)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 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.jsf.web.validation.jsf2.util;
+
+/**
+ * Class for storing constants
+ *
+ * @author mareshkau
+ *
+ */
+public final class JSF2ValidatorConstants {
+ public static final String JSF2_TYPE_KEY = "JSF2_TYPE_KEY"; //$NON-NLS-1$
+
+ public static final String JSF2_COMPONENT_NAME_KEY = "AJSF2_COMPONENT_NAME_KEY"; //$NON-NLS-1$
+
+ public static final String JSF2_ATTR_NAME_KEY = "ATTR_NAME_KEY"; //$NON-NLS-1$
+
+ public static final String JSF2_URI_NAME_KEY = "JSF2_URI_NAME_KEY"; //$NON-NLS-1$
+
+ public static final String JSF2_URI_TYPE_KEY = "JSF2_URI_TYPE_KEY"; //$NON-NLS-1$
+
+ public static final String JSF2_COMPOSITE_COMPONENT_TYPE = "JSF2_COMPOSITE_COMPONENT_TYPE"; //$NON-NLS-1$
+
+ public static final String JSF2_UNFIXABLE_ATTR_TYPE = "JSF2_UNFIXABLE_ATTR_TYPE"; //$NON-NLS-1$
+
+ public static final String JSF2_FIXABLE_ATTR_TYPE = "JSF2_FIXABLE_ATTR_TYPE"; //$NON-NLS-1$
+
+ public static final String JSF2_URI_TYPE = "JSF2_URI_TYPE"; //$NON-NLS-1$
+}
13 years, 11 months
JBoss Tools SVN: r29042 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-07 08:01:01 -0500 (Mon, 07 Feb 2011)
New Revision: 29042
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
Log:
[JBIDE-8343] increased wait delay for refreshing instance, waiting before refreshing (was: refreshed first and waited afterwards)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2011-02-07 13:00:30 UTC (rev 29041)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2011-02-07 13:01:01 UTC (rev 29042)
@@ -1,3 +1,8 @@
+2011-02-07 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/core/DeltaCloud.java (waitForState):
+ [JBIDE-8343] increased wait delay for refreshing instance, waiting before refreshing (was: refreshed first and waited afterwards)
+
2011-02-03 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/deltacloud/core/ImageFilter.java:
13 years, 11 months
JBoss Tools SVN: r29041 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-07 08:00:30 -0500 (Mon, 07 Feb 2011)
New Revision: 29041
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-8343] increased wait delay for refreshing instance, waiting before refreshing (was: refreshed first and waited afterwards)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-02-07 12:56:20 UTC (rev 29040)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-02-07 13:00:30 UTC (rev 29041)
@@ -36,6 +36,8 @@
*/
public class DeltaCloud extends ObservablePojo {
+ private static final int WAIT_FOR_STATE_DELAY = 2000;
+
public static final String PROP_INSTANCES = "instances";
public static final String PROP_INSTANCES_REMOVED = "instancesRemoved";
public static final String PROP_IMAGES = "images";
@@ -280,12 +282,12 @@
DeltaCloudInstance instance = getInstancesRepository().getById(instanceId);
if (instance != null) {
while (!pm.isCanceled()) {
+ Thread.sleep(WAIT_FOR_STATE_DELAY);
+ instance = refreshInstance(instance);
if (stateMatcher.matchesState(instance, instance.getState())
|| instance.getState().equals(DeltaCloudInstance.State.TERMINATED)) {
return instance;
}
- Thread.sleep(400);
- instance = refreshInstance(instance);
}
}
return instance;
13 years, 11 months
JBoss Tools SVN: r29040 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-07 07:56:20 -0500 (Mon, 07 Feb 2011)
New Revision: 29040
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-8343] corrected typo
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-02-07 12:55:06 UTC (rev 29039)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2011-02-07 12:56:20 UTC (rev 29040)
@@ -451,7 +451,7 @@
return deltaCloudInstance;
} catch (DeltaCloudClientException e) {
// TODO : internationalize strings
- throw new DeltaCloudException(MessageFormat.format("Coud not refresh instance \"{0}\"",
+ throw new DeltaCloudException(MessageFormat.format("Could not refresh instance \"{0}\"",
deltaCloudInstance.getId()), e);
}
}
13 years, 11 months
JBoss Tools SVN: r29039 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration: src/org/jboss/tools/deltacloud/integration/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-02-07 07:55:06 -0500 (Mon, 07 Feb 2011)
New Revision: 29039
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java
Log:
[JBIDE-8341] added history proposals to text fields when launching a new instance
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog 2011-02-07 12:48:59 UTC (rev 29038)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/ChangeLog 2011-02-07 12:55:06 UTC (rev 29039)
@@ -1,3 +1,8 @@
+2011-02-07 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java (createControl):
+ [JBIDE-8341] added history proposals to text fields when launching a new instance
+
2011-02-02 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java (createControl):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java 2011-02-07 12:48:59 UTC (rev 29038)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java 2011-02-07 12:55:06 UTC (rev 29039)
@@ -20,6 +20,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FormLayout;
@@ -46,6 +47,11 @@
* @author Rob Stryker
*/
public class RSEandASWizardPage extends WizardPage implements INewInstanceWizardPage {
+ private static final String SERVER_DETAILS_PROPOSAL_KEY = "server_details";
+ private static final String SERVER_HOME_PROPOSAL_KEY = "server_home";
+ private static final String SERVER_CONFIG_PROPOSAL_KEY = "server_config";
+ private static final String SERVER_DEPLOY_PROPOSAL_KEY = "server_deploy";
+
private static final String SELECT_RUNTIME_ERROR = "Please select a local runtime. The created server will be of the same version as the local runtime.";
private static final String DEPLOY_FOLDER_NOT_EMPTY = "The deploy folder must not be empty";
private final static String REMOTE_DETAILS_LOC_ERROR = "You must fill in a path to fetch the server configuration from";
@@ -109,6 +115,7 @@
remoteDetailsLoc.setLayoutData(LayoutUtils.createFormData(autoScanCheck, 5, null, 0, 0, INDENTATION, 100, -5));
remoteDetailsLoc.setText("./.jboss");
this.remoteDetailsLocDeco = UIUtils.createErrorDecoration(REMOTE_DETAILS_LOC_ERROR, remoteDetailsLoc);
+ UIUtils.createPreferencesProposalAdapter(remoteDetailsLoc, SERVER_DETAILS_PROPOSAL_KEY);
autoLocalRuntimeLabel = new Label(g, SWT.NONE);
autoLocalRuntimeLabel.setText("Local Runtime: ");
@@ -142,6 +149,7 @@
serverHomeText.setLayoutData(LayoutUtils.createFormData(hardCodeServerDetails, 5, null, 0, serverHome, 10, 100, -5));
serverHomeText.setText("/etc/jboss/jboss-as");
this.serverHomeDeco = UIUtils.createErrorDecoration(SERVER_HOME_ERROR, serverHomeText);
+ UIUtils.createPreferencesProposalAdapter(serverHomeText, SERVER_HOME_PROPOSAL_KEY);
serverConfig = new Label(g, SWT.NONE);
serverConfig.setText("Configuration: ");
@@ -150,6 +158,7 @@
serverConfigText.setLayoutData(LayoutUtils.createFormData(serverHomeText, 5, null, 0, serverHome, 10, 100, -5));
serverConfigText.setText("default");
this.serverConfigDeco = UIUtils.createErrorDecoration(SERVER_CONFIG_ERROR, serverConfigText);
+ UIUtils.createPreferencesProposalAdapter(serverConfigText, SERVER_CONFIG_PROPOSAL_KEY);
localRuntimeLabel = new Label(g, SWT.NONE);
localRuntimeLabel.setText("Local Runtime: ");
@@ -158,13 +167,10 @@
addLocalRuntimeButton = new Button(g, SWT.DEFAULT);
addLocalRuntimeButton.setText("Configure Runtimes...");
addLocalRuntimeButton.setLayoutData(LayoutUtils.createFormData(serverConfigText, 7, null, 0, null, 0, 100, -5));
- addLocalRuntimeButton.addSelectionListener(new SelectionListener() {
+ addLocalRuntimeButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
configureRuntimesPressed();
}
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
});
localRuntimeCombo = new Combo(g, SWT.READ_ONLY);
localRuntimeCombo.setLayoutData(LayoutUtils.createFormData(serverConfigText, 5, null, 0, serverHome, 10,
@@ -182,6 +188,7 @@
deployFolderText.setText("/path/to/deploy");
deployFolderText.setLayoutData(LayoutUtils.createFormData(deployOnlyRadio, 5, null, 0, deployFolder, 10, 100, -5));
this.deployFolderDeco = UIUtils.createErrorDecoration(DEPLOY_FOLDER_NOT_EMPTY, deployFolderText);
+ UIUtils.createPreferencesProposalAdapter(deployFolderText, SERVER_DEPLOY_PROPOSAL_KEY);
Label dummyLabel = new Label(g, SWT.NONE);
dummyLabel.setLayoutData(LayoutUtils.createFormData(deployOnlyRadio, 5, null, 0, deployFolderText, 10, 100, -5));
13 years, 11 months
JBoss Tools SVN: r29038 - in trunk/jsf/tests/org.jboss.tools.jsf.ui.test: src/org/jboss/tools/jsf/jsp/ca/test and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-02-07 07:48:59 -0500 (Mon, 07 Feb 2011)
New Revision: 29038
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JavaClassContentAssistProviderTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
Log:
JBIDE-8328
https://issues.jboss.org/browse/JBIDE-8328
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2011-02-07 11:45:16 UTC (rev 29037)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/META-INF/MANIFEST.MF 2011-02-07 12:48:59 UTC (rev 29038)
@@ -30,6 +30,7 @@
org.jboss.tools.jsf,
org.eclipse.jst.standard.schemas,
org.jboss.tools.vpe.ui.palette,
- org.eclipse.gef
+ org.eclipse.gef,
+ org.eclipse.pde.ui
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JavaClassContentAssistProviderTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JavaClassContentAssistProviderTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JavaClassContentAssistProviderTest.java 2011-02-07 12:48:59 UTC (rev 29038)
@@ -0,0 +1,64 @@
+package org.jboss.tools.jsf.jsp.ca.test;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.fieldassist.IContentProposal;
+import org.eclipse.jface.fieldassist.IContentProposalProvider;
+import org.eclipse.jst.j2ee.internal.common.classpath.J2EEComponentClasspathUpdater;
+import org.eclipse.pde.internal.ui.editor.contentassist.TypeContentProposal;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.project.IModelNature;
+import org.jboss.tools.common.model.ui.attribute.adapter.JavaClassContentAssistProvider;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.test.util.ProjectImportTestSetup;
+
+import junit.framework.TestCase;
+
+public class JavaClassContentAssistProviderTest extends TestCase {
+ static String jsfProjectName = "testJSFProject";
+ static IProject jsfProject;
+
+ public void setUp() throws Exception {
+ loadProjects();
+ List<IProject> projectList = new ArrayList<IProject>();
+ projectList.add(jsfProject);
+ J2EEComponentClasspathUpdater.getInstance().forceUpdate(projectList);
+ loadProjects();
+ }
+
+ private void loadProjects() throws Exception {
+ jsfProject = ProjectImportTestSetup.loadProject(jsfProjectName);
+ jsfProject.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ }
+
+ public void testJavaClassContentAssistProvider() {
+ IModelNature n = EclipseResourceUtil.getModelNature(jsfProject);
+ XModel model = n.getModel();
+ XModelObject listener = model.createModelObject("WebAppListener24", new Properties());
+ assertNotNull(listener);
+ XAttribute a = listener.getModelEntity().getAttribute("listener-class");
+ JavaClassContentAssistProvider p = new JavaClassContentAssistProvider();
+ p.init(listener, null, a);
+ IContentProposalProvider pv = p.getContentProposalProvider();
+ IContentProposal[] ps = pv.getProposals("java.lang.", 10);
+ assertNotNull(ps);
+ assertTrue(ps.length > 0);
+ assertTrue(ps[0] instanceof TypeContentProposal);
+ Set<String> proposals = new HashSet<String>();
+ for (IContentProposal c: ps) {
+ proposals.add(c.getLabel());
+ }
+ assertTrue(proposals.contains("Double - java.lang"));
+
+ }
+
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/jsp/ca/test/JavaClassContentAssistProviderTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2011-02-07 11:45:16 UTC (rev 29037)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2011-02-07 12:48:59 UTC (rev 29038)
@@ -23,6 +23,7 @@
import org.jboss.tools.jsf.jsp.ca.test.CASuggestsNotOnlyELProposalsJBIDE2437Test;
import org.jboss.tools.jsf.jsp.ca.test.CAUnnecessaryElementsForDirAttributeInXHTMLPageJBIDE1813Test;
import org.jboss.tools.jsf.jsp.ca.test.CAVarAttributeForDataTableTagJBIDE2016;
+import org.jboss.tools.jsf.jsp.ca.test.JavaClassContentAssistProviderTest;
import org.jboss.tools.jsf.jsp.ca.test.JsfJspJbide1704Test;
import org.jboss.tools.jsf.jsp.ca.test.JsfJspJbide1717Test;
import org.jboss.tools.jsf.jsp.ca.test.JsfJspJbide6259Test;
@@ -80,6 +81,11 @@
"org.jboss.tools.jsf.ui.test",
new String[] { "projects/testJSFProject", }, //$NON-NLS-1$
new String[] { "testJSFProject" })); //$NON-NLS-1$
+ suite.addTest(
+ new ProjectImportTestSetup(new TestSuite(JavaClassContentAssistProviderTest.class),
+ "org.jboss.tools.jsf.ui.test",
+ new String[] { "projects/testJSFProject", }, //$NON-NLS-1$
+ new String[] { "testJSFProject" })); //$NON-NLS-1$
suite.addTestSuite(JsfUiPreferencesPagesTest.class);
suite.addTestSuite(TaglibXMLUnformatedDTD_JBIDE5642.class);
13 years, 11 months
JBoss Tools SVN: r29037 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-02-07 06:45:16 -0500 (Mon, 07 Feb 2011)
New Revision: 29037
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/AttributeContentProposalProviderFactory.java
Log:
JBIDE-8328
https://issues.jboss.org/browse/JBIDE-8328
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/AttributeContentProposalProviderFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/AttributeContentProposalProviderFactory.java 2011-02-07 10:53:31 UTC (rev 29036)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/AttributeContentProposalProviderFactory.java 2011-02-07 11:45:16 UTC (rev 29037)
@@ -31,6 +31,7 @@
import org.eclipse.jface.fieldassist.IControlContentAdapter;
import org.eclipse.jface.fieldassist.TextContentAdapter;
import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.pde.internal.ui.editor.contentassist.TypeContentProposal;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
@@ -108,6 +109,17 @@
cpp,
AttributeContentProposalProviderFactory.getCtrlSpaceKeyStroke(),
null);
+
+ //TODO let IAttributeContentProposalProvider return specific label provider.
+ adapter.setLabelProvider(new LabelProvider() {
+ public Image getImage(Object element) {
+ if(element instanceof TypeContentProposal) {
+ return ((TypeContentProposal)element).getImage();
+ }
+ return null;
+ }
+ });
+
adapter.setPropagateKeys(true);
adapter.setProposalAcceptanceStyle(p.getProposalAcceptanceStyle());
if(listener != null) {
13 years, 11 months