diff options
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues')
50 files changed, 0 insertions, 5294 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/AbstractEnumerationType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/AbstractEnumerationType.java deleted file mode 100644 index fda6dd5a0..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/AbstractEnumerationType.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * Vadim Dmitriev - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.jsf.common.internal.types.CompositeType; -import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor; -import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException; -import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue; -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage; - -/** - * Abstract meta-data processing type representing an enumeration attribute value runtime type - * <p><b>Provisional API - subject to change</b></p> - */ -public abstract class AbstractEnumerationType extends AbstractRootTypeDescriptor implements IValidValues, IDefaultValue, IValidELValues{ - private List validationMessages; - - /** - * An empty list - */ - protected static List EMPTY_LIST = new ArrayList(0); - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#getValidationMessages() - */ - public List getValidationMessages() { - if (validationMessages == null){ - validationMessages = new ArrayList(); - } - return validationMessages; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue#getDefaultValue() - */ - public String getDefaultValue() { - return getTraitValueAsString(IDefaultValue.DEFAULT_VALUE_PROP_NAME); - } - - /** - * @return possible values of type as list of Strings using - * {@link IPossibleValues}.POSSIBLE_VALUES_PROP_NAME trait name - */ - protected List getMDPossibleValues() { - return getTraitValueAsListOfStrings(IPossibleValues.POSSIBLE_VALUES_PROP_NAME); - } - - /** - * @return possible values of type to dislay as list of Strings using - * {@link IPossibleValues}.POSSIBLE_VALUES_FOR_DISPLAY_PROP_NAME trait name - */ - protected List getMDPossibleValuesForDisplay() { - return getTraitValueAsListOfStrings(IPossibleValues.POSSIBLE_VALUES_FOR_DISPLAY_PROP_NAME); - } - - /** - * @return list of valid values as list of Strings using - * {@link IValidValues}.VALID_VALUES_PROP_NAME trait name - */ - protected List getMDValidValues() { - return getTraitValueAsListOfStrings(IValidValues.VALID_VALUES_PROP_NAME); - } - - /** - * @return Validation message for type using - * {@link IValidValues}.VALID_VALUES_MESSAGE_PROP_NAME trait name - */ - protected String getMDValidationMessage() { - return getTraitValueAsString(IValidValues.VALID_VALUES_MESSAGE_PROP_NAME); - } - - /** - * @return Validation severity int value for type using - * {@link IValidValues}.VALID_VALUES_SEVERITY_PROP_NAME trait name - */ - protected int getMDValidationSeverity() { - String val = getTraitValueAsString(IValidValues.VALID_VALUES_SEVERITY_PROP_NAME); - if (val == null) - return IStatus.WARNING; - - int severity = Integer.valueOf(val).intValue(); - return severity; - } - - /** - * @return Validation code as String value for type using - * {@link IValidValues}.VALID_VALUES_CODE_PROP_NAME trait name - */ - protected String getMDValidationCode() { - return getTraitValueAsString(IValidValues.VALID_VALUES_CODE_PROP_NAME); - } - - /** - * Create a {@link ValidationMessage} from metadata or use default message - * and add it to the collection of validation messages - * @param defaultMsg - */ - protected void addNewValidationMessage(String defaultMsg) { - String msg = getMDValidationMessage(); - if (msg == null || msg.equals("")) //$NON-NLS-1$ - msg = defaultMsg; - - String code = getMDValidationCode(); - int severity = getMDValidationSeverity(); - ValidationMessage val = new ValidationMessage(msg, code, severity); - getValidationMessages().add(val); - } - - /** - * @return the value of {@link org.eclipse.jst.jsf.common.internal.types.IAssignable}.ASSIGNMENT_TYPE_NONE. Subclasses to override. - */ - protected int getAssignmentType(){ - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues#getExpectedRuntimeType() - */ - public abstract CompositeType getExpectedRuntimeType() throws ELIsNotValidException; -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ActionType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ActionType.java deleted file mode 100644 index 4e87c5515..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ActionType.java +++ /dev/null @@ -1,180 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ - -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.net.URL; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory; -import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver; -import org.eclipse.jst.jsf.core.jsfappconfig.internal.JSFAppConfigManagerFactory; -import org.eclipse.jst.jsf.facesconfig.FacesConfigPlugin; -import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType; -import org.eclipse.jst.jsf.facesconfig.emf.NavigationCaseType; -import org.eclipse.jst.jsf.facesconfig.emf.NavigationRuleType; -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; -import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage; -import org.eclipse.osgi.util.NLS; -import org.osgi.framework.Bundle; - -/** - * Meta-data processing type representing an "action" attribute - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public class ActionType extends MethodBindingType implements IPossibleValues{ - /** - * Image to use if metadata defined image cannot be created - */ - protected static final ImageDescriptor MISSING_IMAGE = ImageDescriptor.getMissingImageDescriptor(); - - private static final String IMAGE_NAME = "/icons/full/obj16/NavigationCaseType.gif"; //$NON-NLS-1$ - private ImageDescriptor imageDescriptor; - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.MethodBindingType#isValidValue(java.lang.String) - */ - public boolean isValidValue(String value){ - if (value == null || (value != null && value.length() == 0)) { - IValidationMessage msg = new ValidationMessage(Messages.ActionType_invalid_empty_value); - getValidationMessages().add(msg); - return false; - } - //any other value should be one of the possible values - //optimize - IWorkspaceContextResolver wr = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(getStructuredDocumentContext()); - if (wr == null) - return true;//shouldn't get here - - //in case that this is not JSF faceted or missing configs, need to pass - if (JSFAppConfigManagerFactory.getJSFAppConfigManagerInstance(wr.getProject()) == null) - return true; - - IFile jsp = (IFile)wr.getResource(); - List<NavigationRuleType> rules = JSFAppConfigManagerFactory.getJSFAppConfigManagerInstance(wr.getProject()).getNavigationRulesForPage(jsp); - for(final NavigationRuleType rule : rules){ - for (Iterator cases=rule.getNavigationCase().iterator();cases.hasNext();){ - NavigationCaseType navCase = (NavigationCaseType)cases.next(); - if (navCase.getFromOutcome() != null && - value.equals(navCase.getFromOutcome().getTextContent().trim())) - return true; - } - } - IValidationMessage msg = new ValidationMessage(Messages.ActionType_invalid_value); - getValidationMessages().add(msg); - return false; - - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues#getPossibleValues() - */ - public List getPossibleValues() { - final List<NavigationRuleType> ret = new ArrayList<NavigationRuleType>(); - if (getStructuredDocumentContext() == null) - return ret; - - final IWorkspaceContextResolver wr = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(getStructuredDocumentContext()); - if (wr != null && JSFAppConfigManagerFactory.getJSFAppConfigManagerInstance(wr.getProject()) != null) {//may not be JSF faceted project or know faces-config){ - IFile jsp = (IFile)wr.getResource(); - List<NavigationRuleType> rules = JSFAppConfigManagerFactory.getJSFAppConfigManagerInstance(wr.getProject()).getNavigationRulesForPage(jsp); - for(final NavigationRuleType rule : rules){ - if (rule != null) - ret.addAll(createProposals(rule)); - } - } - return ret; - } - - private List createProposals(NavigationRuleType rule) { - List ret = new ArrayList(); - List cases = rule.getNavigationCase(); - for(Iterator it=cases.iterator();it.hasNext();){ - NavigationCaseType navCase = (NavigationCaseType)it.next(); - PossibleValue pv = createProposal(rule, navCase); - if (pv != null) - ret.add(pv); - } - return ret; - } - - private PossibleValue createProposal(NavigationRuleType rule, NavigationCaseType navCase) { - PossibleValue pv = null; - String value = null; - String ruleDisp = null; - String navDisplay = null; - String navAction = null; - String toViewId = null; - - if (navCase.getFromOutcome() != null) - value = navCase.getFromOutcome().getTextContent(); - if (navCase.getToViewId()!= null) - toViewId = navCase.getToViewId().getTextContent(); - if (rule.getFromViewId() != null) - ruleDisp = rule.getFromViewId().getTextContent(); - if (navCase.getDisplayName() != null - && navCase.getDisplayName().size() > 0) { - navDisplay = ((DisplayNameType) navCase - .getDisplayName().get(0)).getTextContent(); - } - if (navCase.getFromAction() != null) { - navAction= navCase.getFromAction().getTextContent(); - } - if (navDisplay == null || navDisplay.trim().equals("")) //$NON-NLS-1$ - navDisplay = NLS.bind(Messages.ActionType_navcase_display, new String[]{value, toViewId}); - - if (value != null){ - pv = new PossibleValue(value, navDisplay); - pv.setIcon(getNavCaseImageDescriptor()); - pv.setAdditionalInformation("from-outcome: "+value //$NON-NLS-1$ - + "<br>to-view-id: " + toViewId //$NON-NLS-1$ - + "<br>from-view-id: " + ruleDisp //$NON-NLS-1$ - + "<br>from-action: " + (navAction == null ? "null" : navAction)); //$NON-NLS-1$ //$NON-NLS-2$ - } - - return pv; - } - - - private ImageDescriptor getNavCaseImageDescriptor() { - ImageDescriptor ret = super.getImage(); - if (ret != null && ret != MISSING_IMAGE) - return ret; - - if (imageDescriptor == null){ - imageDescriptor = getImageDesc(IMAGE_NAME); - } - return imageDescriptor; - - } - - private ImageDescriptor getImageDesc(String img) - { - Bundle bundle = FacesConfigPlugin.getPlugin().getBundle(); - URL url = FileLocator.find(bundle, new Path(img), null); - ImageDescriptor desc = ImageDescriptor.createFromURL(url); - if (desc == MISSING_IMAGE){ - return null; - } - return desc; - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/BindingType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/BindingType.java deleted file mode 100644 index 6932796c6..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/BindingType.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ - -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor; - -/** - * Abstract meta-data processing type representing a binding - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public abstract class BindingType extends AbstractRootTypeDescriptor{ - // TODO: what's the point of this? -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/BooleanType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/BooleanType.java deleted file mode 100644 index cd90e74be..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/BooleanType.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue; -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; - -/** - * Meta-data processing type representing a boolean attribute value runtime type - * that implements IPossibleValues, IValidValues, IDefaultValue, IValidELValues - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public class BooleanType extends EnumerationType implements IValidValues, IPossibleValues, IDefaultValue{ - private static final String TRUE_VAL = "true"; //$NON-NLS-1$ - private static final String FALSE_VAL = "false"; //$NON-NLS-1$ - - private static final String BOOLTYPE_VALIDATION_MSG = Messages.BooleanType_invalid_values; - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType() - */ - protected String getReturnType(){ return "boolean";} //$NON-NLS-1$ - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues#getPossibleValues() - */ - public List getPossibleValues() { - String def = getDefaultValue(); - List vals = new ArrayList(); - vals.add(new PossibleValue(TRUE_VAL, TRUE_VAL, def != null && def.equals(TRUE_VAL) )); - vals.add(new PossibleValue(FALSE_VAL, FALSE_VAL, def != null && def.equals(FALSE_VAL) )); - return vals; - } - - /** - * Type coercion according to JSP 2.0 spec: JSP.1.14.2.1 Conversions from String values - * Although not completely faithful to spec, we will validate values as either 'true' or 'false' - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - **/ - public boolean isValidValue(String value) { - if(TRUE_VAL.equalsIgnoreCase(value) || FALSE_VAL.equalsIgnoreCase(value)) { - return true; - } - addNewValidationMessage(BOOLTYPE_VALIDATION_MSG); - return false; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSClassType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSClassType.java deleted file mode 100644 index 90c2dd483..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSClassType.java +++ /dev/null @@ -1,88 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 Oracle Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver; -import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.impl.StructuredDocumentContextResolverFactory; -import org.eclipse.jst.jsf.core.internal.JSFCorePlugin; -import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor; -import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature; -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue; -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; -import org.eclipse.wst.css.core.internal.provisional.adapters.IStyleSheetListAdapter; -import org.eclipse.wst.css.core.internal.provisional.document.ICSSNode; -import org.eclipse.wst.css.core.internal.util.CSSClassTraverser; -import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; -import org.w3c.dom.Document; -import org.w3c.dom.stylesheets.StyleSheetList; - -/** - * Represents a style class attribute type - * <p><b>Provisional API - subject to change</b></p> - */ -public class CSSClassType extends AbstractRootTypeDescriptor implements - IMetaDataEnabledFeature, IPossibleValues { - - private List<IPossibleValue> _pvs; - - public List<IPossibleValue> getPossibleValues() { - if (_pvs == null){ - IDOMContextResolver resolver = StructuredDocumentContextResolverFactory.getInstance().getDOMContextResolver(getStructuredDocumentContext()); - _pvs = getCSSClasses(resolver.getDOMDocument()); - } - return _pvs; - } - - private List<IPossibleValue> getCSSClasses(Document doc) { - List result = new ArrayList(); - String [] names = internalGetCSSClasses(doc); - for (int i=0;i<names.length;i++){ - IPossibleValue pv = new PossibleValue(names[i]); - result.add(pv); - } - return result; - } - - //code duplicated from pagedesigner CSSUtils. Uses internal CSSClassTraverser - private static String[] internalGetCSSClasses(Document doc) { - Collection c = Collections.EMPTY_SET; - if (doc instanceof INodeNotifier) { - IStyleSheetListAdapter adapter = (IStyleSheetListAdapter) ((INodeNotifier) doc) - .getAdapterFor(IStyleSheetListAdapter.class); - StyleSheetList ssl = (adapter == null ? null : adapter - .getStyleSheets()); - - CSSClassTraverser traverser = new CSSClassTraverser(); - if (ssl != null) { - for (int i = 0, numStyles = ssl.getLength(); i < numStyles; i++) { - // loop for styles (<style> and <link>) - org.w3c.dom.stylesheets.StyleSheet ss = ssl.item(i); - - try { - traverser.apply((ICSSNode) ss); - } catch (ClassCastException ex) { - JSFCorePlugin.log(ex, "Unable to cast to CSS style"); //$NON-NLS-1$ - } - } - c = traverser.getClassNames(); - } - } - String[] result = new String[c.size()]; - c.toArray(result); - return result; - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSIdType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSIdType.java deleted file mode 100644 index 4fa8ee1cc..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSIdType.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 Oracle Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor; -import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature; - -/** - * Represents CSS id attribute type - * EXPERIMENTAL - may change or disappear - * - */ -public class CSSIdType extends AbstractRootTypeDescriptor implements - IMetaDataEnabledFeature { - - /** - * Constructor - */ - public CSSIdType() { - // TODO Auto-generated constructor stub - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSStyleType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSStyleType.java deleted file mode 100644 index 1c7f35bf6..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CSSStyleType.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2008 Oracle Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor; -import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature; - -/** - * Represents CSS style attribute. - * No features currently supported. - * - * <p><b>Provisional API - subject to change</b></p> - * - */ -public class CSSStyleType extends AbstractRootTypeDescriptor implements - IMetaDataEnabledFeature { - - /** - * Constructor - */ - public CSSStyleType() { - // - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CharacterType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CharacterType.java deleted file mode 100644 index 5ec13d825..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CharacterType.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2007 Oracle Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor; -import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage; -import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage; - -/** - * Represents a single unicode character - */ -public class CharacterType extends AbstractRootTypeDescriptor implements - IMetaDataEnabledFeature, IValidValues{ - - private List _msgs; - - /** - * Constructor - */ - public CharacterType() { - super(); - } - - public List<IValidationMessage> getValidationMessages() { - if (_msgs == null){ - _msgs = new ArrayList<IValidationMessage>(1); - } - return _msgs; - } - - public boolean isValidValue(String value) { - if (value.length() != 1) - getValidationMessages().add(new ValidationMessage(Messages.CharacterType_0)); - - return getValidationMessages().size() == 0; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ColorType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ColorType.java deleted file mode 100644 index 897a399ea..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ColorType.java +++ /dev/null @@ -1,128 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation., and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Yury Kats/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.PaletteData; -import org.eclipse.swt.graphics.RGB; - -/** - * Meta-data processing type representing a color. - * A color is defined as in html spec http://www.w3.org/TR/html4/types.html#type-color - * - * <p><b>Provisional API - subject to change</b></p> - * - * @author ykats - */ - -public class ColorType extends EnumerationType implements IPossibleValues { - - /** - * List of standard colors - * See http://www.w3.org/TR/html4/types.html#type-color - */ - private final static String[] COLORS = {"Black", "Silver", "Gray", "White", "Maroon", "Red", "Purple", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ - "Fuchsia", "Green", "Lime", "Olive", "Yellow", "Navy", "Blue", "Teal","Aqua"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ - //if ordering changes, must change RGB[] ordering - - private RGB[] _rgb; - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType() - */ - protected String getReturnType(){ return "java.lang.String";} //$NON-NLS-1$ - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - */ - public boolean isValidValue(String value) { - boolean bValid = true; - String trimmedVal = value.trim(); - if (trimmedVal.length() == 0) - bValid = false; - else if (trimmedVal.charAt(0) == '#' && trimmedVal.length() == 7) { - for (int i=1; i<7; i++) { - if (trimmedVal.charAt(i) < '0' || - (trimmedVal.charAt(i) > '9' && trimmedVal.charAt(i) < 'A') || - (trimmedVal.charAt(i) > 'F' && trimmedVal.charAt(i) < 'a') || - trimmedVal.charAt(i) > 'f') { - bValid = false; - break; - } - } - } - else { - bValid = false; - for (int i = 0; i < COLORS.length; i++) { - if(trimmedVal.equalsIgnoreCase(COLORS[i])) { - bValid = true; - break; - } - } - } - - if(!bValid) { - addNewValidationMessage(Messages.ColorType_invalid_color); - } - - return getValidationMessages().isEmpty(); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues#getPossibleValues() - */ - public List getPossibleValues() { - List ret = new ArrayList(COLORS.length); - for (int i=0;i < COLORS.length;i++){ - PossibleValue pv = new PossibleValue(COLORS[i]); - pv.setIcon(createImage(i)); - ret.add(pv); - } - return ret; - } - - private ImageDescriptor createImage(int color) { - PaletteData pd = getPaletteData(color); - return ImageDescriptor.createFromImageData(new ImageData(16, 16, 1, pd)); - } - - private PaletteData getPaletteData(int color){ - if (_rgb == null){ - _rgb = new RGB[16]; - _rgb[0] = new RGB(0,0,0);//black - _rgb[1] = new RGB(192,192,192);//silver - _rgb[2] = new RGB(128,128,128);//gray - _rgb[3] = new RGB(255,255,255);//white - _rgb[4] = new RGB(128,0,0);//Maroon - _rgb[5] = new RGB(255,0,0);//Red - _rgb[6] = new RGB(128,0,128);//Purple - _rgb[7] = new RGB(255,0,255);//Fuchsia - _rgb[8] = new RGB(0,128,0);//Green - _rgb[9] = new RGB(0,255,0);//Lime - _rgb[10] = new RGB(128,128,0);//Olive - _rgb[11] = new RGB(255,255,0);//Yellow - _rgb[12] = new RGB(0,0,128);//Navy - _rgb[13] = new RGB(0,0,255);//Blue - _rgb[14] = new RGB(0,128,128);//Teal - _rgb[15] = new RGB(0,255,255);//Aqua - } - RGB[] rgbColor = new RGB[1]; - System.arraycopy(_rgb, color, rgbColor, 0, 1); - return new PaletteData(rgbColor); - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ComponentBindingType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ComponentBindingType.java deleted file mode 100644 index 4e394ede7..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ComponentBindingType.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - - -import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage; -import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage; - -/** - * Meta-data processing type representing a "binding" attribute - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public class ComponentBindingType extends ValueBindingType implements - IValidValues, IValidELValues { - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - */ - public boolean isValidValue(String value) { - //Strings are invalid. Requires a EL value binding. - IValidationMessage msg = new ValidationMessage(Messages.ComponentBindingType_invalid_value); - getValidationMessages().add(msg); - return false; - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ComponentIDType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ComponentIDType.java deleted file mode 100644 index 82c995761..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ComponentIDType.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2007 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - - -import org.eclipse.jst.jsf.common.internal.types.CompositeType; -import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage; -import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage; - -/** - * Meta-data processing type representing an "id" attribute - * Represents an ID or NAME HTML attribute type. - * <br> - * Attribute values of type ID and NAME must begin with a letter in the range A-Z or a-z or underscore ("_") and - * may be followed by letters (A-Z, a-z), digits (0-9), hyphens ("-"), underscores ("_"), colons (":"), - * and periods ("."). - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - * TODO: finish regex validation - */ -public class ComponentIDType extends ValueBindingType implements - IValidValues, IValidELValues { - -// private static Pattern idPattern1 = Pattern.compile("[A-Za-z_]");; -// private static Pattern idPattern2 = Pattern.compile("^[:\\w\\.\\-]*"); - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.ValueBindingType#getExpectedRuntimeType() - */ - public CompositeType getExpectedRuntimeType() throws ELIsNotValidException { - throw new ELIsNotValidException(Messages.ComponentIDType_invalid_as_el); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - */ - public boolean isValidValue(String value) { - IValidationMessage msg = null; - if (value != null && value.trim().length() == 0) - msg = new ValidationMessage(Messages.ComponentIDType_invalid_value); - else { - //we could validate uniqueness, but will not for the time being. This would require a DT FacesContext. - //any other coercion rules apply here? - return true; - } - getValidationMessages().add(msg); - return false; - -// if (value != null && value.trim().length() == 0) -// msg = new ValidationMessage(Messages.ComponentIDType_invalid_value); -// -//// else if (!idPattern.matcher(value.trim()).find()) -//// fail = true; -// else if (!idPattern1.matcher(value.trim().substring(0, 1)).find()) -// msg = new ValidationMessage("id must begin with alpha character"); -// else if ((value.trim().length() > 1) && (!( idPattern2.matcher(value.trim().substring(1)).find()))) -// msg = new ValidationMessage("illegal characters in id: must be alphanum, period, colon, and hyphen only"); -// else { -// //we could validate uniqueness, but will not for the time being. This would require a DT FacesContext. -// //any other coercion rules apply here? -// } -// if (msg != null) -// getValidationMessages().add(msg); -// -// return getValidationMessages().size() == 0; - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ContentType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ContentType.java deleted file mode 100644 index 4fb9ec442..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ContentType.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation., and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Yury Kats/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; - -/** - * Meta-data processing type representing a content (MIME) type. - * A ContentType is defined as in 4.0 html spec http://www.w3.org/TR/html401/types.html#h-6.7 - * - * <p><b>Provisional API - subject to change</b></p> - */ - -public class ContentType extends EnumerationType implements IPossibleValues { - - /** - * List of some of the more common content (MIME) types - * See http://www.w3.org/TR/html4/types.html#type-color - */ - private final static String[] commontypes = { - "text/html", //$NON-NLS-1$ - "text/css", //$NON-NLS-1$ - "image/jpeg", //$NON-NLS-1$ - "image/gif", //$NON-NLS-1$ - "audio/mpeg", //$NON-NLS-1$ - "video/mpeg", //$NON-NLS-1$ - "video/quicktime", //$NON-NLS-1$ - "text/javascript" //$NON-NLS-1$ - }; - - protected String getReturnType(){ return "java.lang.String";} //$NON-NLS-1$ - - public boolean isValidValue(String value) { - boolean bValid = true; - if (value == null || value.trim().length() == 0) - bValid = false; - - if(!bValid) { - addNewValidationMessage(Messages.ContentType_MIME_not_empty); - } - - return getValidationMessages().isEmpty(); - } - - public List getPossibleValues() { - List ret = new ArrayList(commontypes.length); - for (int i=0;i < commontypes.length;i++){ - PossibleValue pv = new PossibleValue(commontypes[i]); - ret.add(pv); - } - return ret; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CurrencyCodeType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CurrencyCodeType.java deleted file mode 100644 index 4dc6db80d..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/CurrencyCodeType.java +++ /dev/null @@ -1,232 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation., and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; - -/** - * ISO-4217 Currency codes - */ -public class CurrencyCodeType extends EnumerationType implements IPossibleValues { - private static final CurrencyCodeMap _map = new CurrencyCodeMap(); - - @Override - protected String getReturnType() { - return "java.lang.String"; //$NON-NLS-1$ - } - - public List getPossibleValues() { - List ret = new ArrayList(); - for(Iterator it = _map.keySet().iterator();it.hasNext();){ - String key = (String)it.next(); - String value = _map.get(key); - PossibleValue pv = new PossibleValue(key, value); - ret.add(pv); - } - return ret; - } - - public boolean isValidValue(String value) { - if(!_map.containsKey(value.toUpperCase())) { - addNewValidationMessage(Messages.CurrencyCodeType_invalid); - } - - return getValidationMessages().isEmpty(); - } - - private static class CurrencyCodeMap extends HashMap<String, String> { - - private static final long serialVersionUID = 1L; - - CurrencyCodeMap(){ - put("AED",Messages.CurrencyCodeType_2); //$NON-NLS-1$ - put("AFA",Messages.CurrencyCodeType_3); //$NON-NLS-1$ - put("ALL",Messages.CurrencyCodeType_4); //$NON-NLS-1$ - put("AMD",Messages.CurrencyCodeType_5); //$NON-NLS-1$ - put("ANG",Messages.CurrencyCodeType_6); //$NON-NLS-1$ - put("AOA",Messages.CurrencyCodeType_7); //$NON-NLS-1$ - put("ARS",Messages.CurrencyCodeType_8); //$NON-NLS-1$ - put("AUD",Messages.CurrencyCodeType_9); //$NON-NLS-1$ - put("AWG",Messages.CurrencyCodeType_10); //$NON-NLS-1$ - put("AZM",Messages.CurrencyCodeType_11); //$NON-NLS-1$ - put("BAM",Messages.CurrencyCodeType_12); //$NON-NLS-1$ - put("BBD",Messages.CurrencyCodeType_13); //$NON-NLS-1$ - put("BDT",Messages.CurrencyCodeType_14); //$NON-NLS-1$ - put("BGN",Messages.CurrencyCodeType_15); //$NON-NLS-1$ - put("BHD",Messages.CurrencyCodeType_16); //$NON-NLS-1$ - put("BIF",Messages.CurrencyCodeType_17); //$NON-NLS-1$ - put("BMD",Messages.CurrencyCodeType_18); //$NON-NLS-1$ - put("BND",Messages.CurrencyCodeType_19); //$NON-NLS-1$ - put("BOB",Messages.CurrencyCodeType_20); //$NON-NLS-1$ - put("BRL",Messages.CurrencyCodeType_21); //$NON-NLS-1$ - put("BSD",Messages.CurrencyCodeType_22); //$NON-NLS-1$ - put("BTN",Messages.CurrencyCodeType_23); //$NON-NLS-1$ - put("BWP",Messages.CurrencyCodeType_24); //$NON-NLS-1$ - put("BYR",Messages.CurrencyCodeType_25); //$NON-NLS-1$ - put("BZD",Messages.CurrencyCodeType_26); //$NON-NLS-1$ - put("CAD",Messages.CurrencyCodeType_27); //$NON-NLS-1$ - put("CDF",Messages.CurrencyCodeType_28); //$NON-NLS-1$ - put("CHF",Messages.CurrencyCodeType_29); //$NON-NLS-1$ - put("CLP",Messages.CurrencyCodeType_30); //$NON-NLS-1$ - put("CNY",Messages.CurrencyCodeType_31); //$NON-NLS-1$ - put("COP",Messages.CurrencyCodeType_32); //$NON-NLS-1$ - put("CRC",Messages.CurrencyCodeType_33); //$NON-NLS-1$ - put("CSD",Messages.CurrencyCodeType_34); //$NON-NLS-1$ - put("CUP",Messages.CurrencyCodeType_35); //$NON-NLS-1$ - put("CVE",Messages.CurrencyCodeType_36); //$NON-NLS-1$ - put("CYP",Messages.CurrencyCodeType_37); //$NON-NLS-1$ - put("CZK",Messages.CurrencyCodeType_38); //$NON-NLS-1$ - put("DJF",Messages.CurrencyCodeType_39); //$NON-NLS-1$ - put("DKK",Messages.CurrencyCodeType_40); //$NON-NLS-1$ - put("DOP",Messages.CurrencyCodeType_41); //$NON-NLS-1$ - put("DZD",Messages.CurrencyCodeType_42); //$NON-NLS-1$ - put("EEK",Messages.CurrencyCodeType_43); //$NON-NLS-1$ - put("EGP",Messages.CurrencyCodeType_44); //$NON-NLS-1$ - put("ERN",Messages.CurrencyCodeType_45); //$NON-NLS-1$ - put("ETB",Messages.CurrencyCodeType_46); //$NON-NLS-1$ - put("EUR",Messages.CurrencyCodeType_47); //$NON-NLS-1$ - put("FJD",Messages.CurrencyCodeType_48); //$NON-NLS-1$ - put("FKP",Messages.CurrencyCodeType_49); //$NON-NLS-1$ - put("GBP",Messages.CurrencyCodeType_50); //$NON-NLS-1$ - put("GEL",Messages.CurrencyCodeType_51); //$NON-NLS-1$ - put("GGP",Messages.CurrencyCodeType_52); //$NON-NLS-1$ - put("GHC",Messages.CurrencyCodeType_53); //$NON-NLS-1$ - put("GIP",Messages.CurrencyCodeType_54); //$NON-NLS-1$ - put("GMD",Messages.CurrencyCodeType_55); //$NON-NLS-1$ - put("GNF",Messages.CurrencyCodeType_56); //$NON-NLS-1$ - put("GTQ",Messages.CurrencyCodeType_57); //$NON-NLS-1$ - put("GYD",Messages.CurrencyCodeType_58); //$NON-NLS-1$ - put("HKD",Messages.CurrencyCodeType_59); //$NON-NLS-1$ - put("HNL",Messages.CurrencyCodeType_60); //$NON-NLS-1$ - put("HRK",Messages.CurrencyCodeType_61); //$NON-NLS-1$ - put("HTG",Messages.CurrencyCodeType_62); //$NON-NLS-1$ - put("HUF",Messages.CurrencyCodeType_63); //$NON-NLS-1$ - put("IDR",Messages.CurrencyCodeType_64); //$NON-NLS-1$ - put("ILS",Messages.CurrencyCodeType_65); //$NON-NLS-1$ - put("IMP",Messages.CurrencyCodeType_66); //$NON-NLS-1$ - put("INR",Messages.CurrencyCodeType_67); //$NON-NLS-1$ - put("IQD",Messages.CurrencyCodeType_68); //$NON-NLS-1$ - put("IRR",Messages.CurrencyCodeType_69); //$NON-NLS-1$ - put("ISK",Messages.CurrencyCodeType_70); //$NON-NLS-1$ - put("JEP",Messages.CurrencyCodeType_71); //$NON-NLS-1$ - put("JMD",Messages.CurrencyCodeType_72); //$NON-NLS-1$ - put("JOD",Messages.CurrencyCodeType_73); //$NON-NLS-1$ - put("JPY",Messages.CurrencyCodeType_74); //$NON-NLS-1$ - put("KES",Messages.CurrencyCodeType_75); //$NON-NLS-1$ - put("KGS",Messages.CurrencyCodeType_76); //$NON-NLS-1$ - put("KHR",Messages.CurrencyCodeType_77); //$NON-NLS-1$ - put("KMF",Messages.CurrencyCodeType_78); //$NON-NLS-1$ - put("KPW",Messages.CurrencyCodeType_79); //$NON-NLS-1$ - put("KRW",Messages.CurrencyCodeType_80); //$NON-NLS-1$ - put("KWD",Messages.CurrencyCodeType_81); //$NON-NLS-1$ - put("KYD",Messages.CurrencyCodeType_82); //$NON-NLS-1$ - put("KZT",Messages.CurrencyCodeType_83); //$NON-NLS-1$ - put("LAK",Messages.CurrencyCodeType_84); //$NON-NLS-1$ - put("LBP",Messages.CurrencyCodeType_85); //$NON-NLS-1$ - put("LKR",Messages.CurrencyCodeType_86); //$NON-NLS-1$ - put("LRD",Messages.CurrencyCodeType_87); //$NON-NLS-1$ - put("LSL",Messages.CurrencyCodeType_88); //$NON-NLS-1$ - put("LTL",Messages.CurrencyCodeType_89); //$NON-NLS-1$ - put("LVL",Messages.CurrencyCodeType_90); //$NON-NLS-1$ - put("LYD",Messages.CurrencyCodeType_91); //$NON-NLS-1$ - put("MAD",Messages.CurrencyCodeType_92); //$NON-NLS-1$ - put("MDL",Messages.CurrencyCodeType_93); //$NON-NLS-1$ - put("MGA",Messages.CurrencyCodeType_94); //$NON-NLS-1$ - put("MKD",Messages.CurrencyCodeType_95); //$NON-NLS-1$ - put("MMK",Messages.CurrencyCodeType_96); //$NON-NLS-1$ - put("MNT",Messages.CurrencyCodeType_97); //$NON-NLS-1$ - put("MOP",Messages.CurrencyCodeType_98); //$NON-NLS-1$ - put("MRO",Messages.CurrencyCodeType_99); //$NON-NLS-1$ - put("MTL",Messages.CurrencyCodeType_100); //$NON-NLS-1$ - put("MUR",Messages.CurrencyCodeType_101); //$NON-NLS-1$ - put("MVR",Messages.CurrencyCodeType_102); //$NON-NLS-1$ - put("MWK",Messages.CurrencyCodeType_103); //$NON-NLS-1$ - put("MXN",Messages.CurrencyCodeType_104); //$NON-NLS-1$ - put("MYR",Messages.CurrencyCodeType_105); //$NON-NLS-1$ - put("MZM",Messages.CurrencyCodeType_106); //$NON-NLS-1$ - put("NAD",Messages.CurrencyCodeType_107); //$NON-NLS-1$ - put("NGN",Messages.CurrencyCodeType_108); //$NON-NLS-1$ - put("NIO",Messages.CurrencyCodeType_109); //$NON-NLS-1$ - put("NOK",Messages.CurrencyCodeType_110); //$NON-NLS-1$ - put("NPR",Messages.CurrencyCodeType_111); //$NON-NLS-1$ - put("NZD",Messages.CurrencyCodeType_112); //$NON-NLS-1$ - put("OMR",Messages.CurrencyCodeType_113); //$NON-NLS-1$ - put("PAB",Messages.CurrencyCodeType_114); //$NON-NLS-1$ - put("PEN",Messages.CurrencyCodeType_115); //$NON-NLS-1$ - put("PGK",Messages.CurrencyCodeType_116); //$NON-NLS-1$ - put("PHP",Messages.CurrencyCodeType_117); //$NON-NLS-1$ - put("PKR",Messages.CurrencyCodeType_118); //$NON-NLS-1$ - put("PLN",Messages.CurrencyCodeType_119); //$NON-NLS-1$ - put("PYG",Messages.CurrencyCodeType_120); //$NON-NLS-1$ - put("QAR",Messages.CurrencyCodeType_121); //$NON-NLS-1$ - put("ROL",Messages.CurrencyCodeType_122); //$NON-NLS-1$ - put("RUB",Messages.CurrencyCodeType_123); //$NON-NLS-1$ - put("RWF",Messages.CurrencyCodeType_124); //$NON-NLS-1$ - put("SAR",Messages.CurrencyCodeType_125); //$NON-NLS-1$ - put("SBD",Messages.CurrencyCodeType_126); //$NON-NLS-1$ - put("SCR",Messages.CurrencyCodeType_127); //$NON-NLS-1$ - put("SDD",Messages.CurrencyCodeType_128); //$NON-NLS-1$ - put("SEK",Messages.CurrencyCodeType_129); //$NON-NLS-1$ - put("SGD",Messages.CurrencyCodeType_130); //$NON-NLS-1$ - put("SHP",Messages.CurrencyCodeType_131); //$NON-NLS-1$ - put("SIT",Messages.CurrencyCodeType_132); //$NON-NLS-1$ - put("SKK",Messages.CurrencyCodeType_133); //$NON-NLS-1$ - put("SLL",Messages.CurrencyCodeType_134); //$NON-NLS-1$ - put("SOS",Messages.CurrencyCodeType_135); //$NON-NLS-1$ - put("SPL",Messages.CurrencyCodeType_136); //$NON-NLS-1$ - put("SRD",Messages.CurrencyCodeType_137); //$NON-NLS-1$ - put("STD",Messages.CurrencyCodeType_138); //$NON-NLS-1$ - put("SVC",Messages.CurrencyCodeType_139); //$NON-NLS-1$ - put("SYP",Messages.CurrencyCodeType_140); //$NON-NLS-1$ - put("SZL",Messages.CurrencyCodeType_141); //$NON-NLS-1$ - put("THB",Messages.CurrencyCodeType_142); //$NON-NLS-1$ - put("TJS",Messages.CurrencyCodeType_143); //$NON-NLS-1$ - put("TMM",Messages.CurrencyCodeType_144); //$NON-NLS-1$ - put("TND",Messages.CurrencyCodeType_145); //$NON-NLS-1$ - put("TOP",Messages.CurrencyCodeType_146); //$NON-NLS-1$ - put("TRL",Messages.CurrencyCodeType_147); //$NON-NLS-1$ - put("TRY",Messages.CurrencyCodeType_148); //$NON-NLS-1$ - put("TTD",Messages.CurrencyCodeType_149); //$NON-NLS-1$ - put("TVD",Messages.CurrencyCodeType_150); //$NON-NLS-1$ - put("TWD",Messages.CurrencyCodeType_151); //$NON-NLS-1$ - put("TZS",Messages.CurrencyCodeType_152); //$NON-NLS-1$ - put("UAH",Messages.CurrencyCodeType_153); //$NON-NLS-1$ - put("UGX",Messages.CurrencyCodeType_154); //$NON-NLS-1$ - put("USD",Messages.CurrencyCodeType_155); //$NON-NLS-1$ - put("UYU",Messages.CurrencyCodeType_156); //$NON-NLS-1$ - put("UZS",Messages.CurrencyCodeType_157); //$NON-NLS-1$ - put("VEB",Messages.CurrencyCodeType_158); //$NON-NLS-1$ - put("VND",Messages.CurrencyCodeType_159); //$NON-NLS-1$ - put("VUV",Messages.CurrencyCodeType_160); //$NON-NLS-1$ - put("WST",Messages.CurrencyCodeType_161); //$NON-NLS-1$ - put("XAF",Messages.CurrencyCodeType_162); //$NON-NLS-1$ - put("XAG",Messages.CurrencyCodeType_163); //$NON-NLS-1$ - put("XAU",Messages.CurrencyCodeType_164); //$NON-NLS-1$ - put("XCD",Messages.CurrencyCodeType_165); //$NON-NLS-1$ - put("XDR",Messages.CurrencyCodeType_166); //$NON-NLS-1$ - put("XOF",Messages.CurrencyCodeType_167); //$NON-NLS-1$ - put("XPD",Messages.CurrencyCodeType_168); //$NON-NLS-1$ - put("XPF",Messages.CurrencyCodeType_169); //$NON-NLS-1$ - put("XPT",Messages.CurrencyCodeType_170); //$NON-NLS-1$ - put("YER",Messages.CurrencyCodeType_171); //$NON-NLS-1$ - put("ZAR",Messages.CurrencyCodeType_172); //$NON-NLS-1$ - put("ZMK",Messages.CurrencyCodeType_173); //$NON-NLS-1$ - put("ZWD",Messages.CurrencyCodeType_174); //$NON-NLS-1$ - } - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DateTimePatternType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DateTimePatternType.java deleted file mode 100644 index d48f28d0a..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DateTimePatternType.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation., and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver; -import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory; -import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor; -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; -import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr; -import org.w3c.dom.Node; - -/** - * Meta-data processing type representing a Date, Time and DateTime Pattern types. - * - * <p><b>Provisional API - subject to change</b></p> - * - */ - -public class DateTimePatternType extends AbstractRootTypeDescriptor implements IPossibleValues{ - //should we ever validate the patterns, extend EnumerationType - final private static String[] DATEPATTERNS = {"M/d/yy", "EEE, M/d/yy", "MM/dd/yyyy", "EEE, MM/dd/yyyy", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - "MMM d, yyyy", "EEE, MMM d, yyyy", "MMMM d, yyyy", "EEEE, MMMM d, yyyy", "MMMM yyyy" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ }; - }; - - final private static String[] TIMEPATTERNS = {"hh:mm", "hh:mm z", "HH:mm z", "HH:mm:ss z" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - }; - - final private static String[] DATETIMEPATTERNS = {"M/d/yy hh:mm", "EEE, M/d/yy hh:mm", "MM/dd/yyyy HH:mm:ss z", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - "EEE, MM/dd/yyyy HH:mm:ss z", "MMM d, yyyy HH:mm z", "EEE, MMM d, yyyy HH:mm z", "MMMM d, yyyy HH:mm z", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - "EEEE, MMMM d, yyyy HH:mm z" //$NON-NLS-1$ - }; - - public List getPossibleValues() { - List ret = new ArrayList(); - String typeVal = getTypeValue(); - if ("date".equalsIgnoreCase(typeVal)){ //$NON-NLS-1$ - for (int i=0;i<DATEPATTERNS.length;i++){ - ret.add(new PossibleValue(DATEPATTERNS[i])); - } - } - else if ("time".equalsIgnoreCase(typeVal)){ //$NON-NLS-1$ - for (int i=0;i<TIMEPATTERNS.length;i++){ - ret.add(new PossibleValue(TIMEPATTERNS[i])); - } - } - else { - for (int i=0;i<DATETIMEPATTERNS.length;i++){ - ret.add(new PossibleValue(DATETIMEPATTERNS[i])); - } - } - return ret; - } - - private String getTypeValue() { - if (getStructuredDocumentContext() != null){ - IDOMContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE.getDOMContextResolver(getStructuredDocumentContext()); - if (resolver != null){ - Node aNode = resolver.getNode(); - if (aNode instanceof IDOMAttr) { - Node tagNode = ((IDOMAttr)aNode).getOwnerElement(); - IDOMAttr typeNode = (IDOMAttr) tagNode.getAttributes().getNamedItem("type"); //$NON-NLS-1$ - if (typeNode != null) - return typeNode.getValue(); - } - } - } - return ""; //$NON-NLS-1$ - } - - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DirectBindingType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DirectBindingType.java deleted file mode 100644 index 2c5f7c0b1..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DirectBindingType.java +++ /dev/null @@ -1,21 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; -/** - * Abstract meta-data processing type - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public abstract class DirectBindingType extends BindingType { - // TODO: what is the point of this? -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DoubleType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DoubleType.java deleted file mode 100644 index 0e73d4a9a..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/DoubleType.java +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.List; - -import org.eclipse.osgi.util.NLS; - -/** - * Meta-data processing type representing a "double" attribute value runtime type - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public class DoubleType extends NumberType { - private static final String INVALID_DOUBLE = Messages.DoubleType_invalid_double; - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType() - */ - protected String getReturnType(){ return "double";} //$NON-NLS-1$ - - /** - * Type coercion according to JSP 2.0 spec: JSP.1.14.2.1 Conversions from String values - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - **/ - public boolean isValidValue(String value) { - try { - Double dbl = Double.valueOf(value); - exceedsMaxValue(dbl.doubleValue()); - lessThanMinValue(dbl.doubleValue()); - if (!(minFound || maxFound)){ - List validVals = getMDValidValues(); - if (!validVals.isEmpty()){ - if (!validVals.contains(value)){ - addNewValidationMessage(Messages.DoubleType_invalid_member);//fix me - } - } - } - return getValidationMessages().isEmpty(); - } catch (NumberFormatException e) { - addNewValidationMessage(INVALID_DOUBLE); - return false; - } - - } - - private void exceedsMaxValue(double dbl) { - String strMax = getValidMaximumValue(); - if (strMax != null){ - try { - double max = Double.valueOf(strMax).doubleValue(); - maxFound = true; - if (dbl > max){ - addNewValidationMessage(NLS.bind(EXCEEDS_MAX, strMax)); - } - } catch (NumberFormatException e) { - //TODO: ignore error???? or log it???? - } - } - - } - - private void lessThanMinValue(double dbl) { - String strMin = getValidMinimumValue(); - if (strMin != null){ - try { - double max = Double.valueOf(strMin).doubleValue(); - minFound = true; - if (dbl < max){ - addNewValidationMessage(NLS.bind(LESS_THAN_MIN, strMin)); - } - } catch (NumberFormatException e) { - //TODO: ignore error???? or log it???? - } - } - - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/EnumerationType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/EnumerationType.java deleted file mode 100644 index f92684fe8..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/EnumerationType.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2008 Oracle Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * Vadim Dmitriev - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import org.eclipse.jdt.core.Signature; -import org.eclipse.jst.jsf.common.internal.types.CompositeType; -import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException; - -/** - * Abstract meta-data processing type representing an enumeration attribute value runtime type - * with a single signature - * - * @author Gerry Kessler - Oracle - */ -public abstract class EnumerationType extends AbstractEnumerationType -{ - - /** - * @return return Java type as string (i.e. boolean, java.lang.String, etc.) - * Must not be null. - */ - protected abstract String getReturnType(); - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues#getExpectedRuntimeType() - */ - public CompositeType getExpectedRuntimeType() throws ELIsNotValidException - { - String type = Signature.createTypeSignature(getReturnType(), true); - return new CompositeType(type, getAssignmentType()); - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ExpressionBindingType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ExpressionBindingType.java deleted file mode 100644 index 1ae1d98de..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ExpressionBindingType.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.List; - -/** - * Abstract meta-data processing type representing an expression binding attribute value runtime type - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public abstract class ExpressionBindingType extends BindingType { - /** - * Valid values is any fully qualified Java type or primitive. - * Assign a value for each parameter in order - */ - public static final String RUNTIME_PARAMS_TYPES = "runtime-param-types"; //$NON-NLS-1$ - /** - * Valid values is any fully qualified Java type or primitive. - */ - public static final String RUNTIME_RETURN_TYPE = "runtime-return-type"; //$NON-NLS-1$ - /** - * Value should be set true or false. If not specified, the default inmplementation assumes false. - */ - public static final String RUNTIME_SETTER_REQUIRED = "runtime-type-setter-required"; //$NON-NLS-1$ - private List validationMessages; - - - /** - * @return String value of the "runtime-return-type" trait - */ - protected String getReturnType() { - return getTraitValueAsString(RUNTIME_RETURN_TYPE); - } - - /** - * @return String[] value of the "runtime-param-types" trait - */ - protected String[] getParams() { - List params = getTraitValueAsListOfStrings(RUNTIME_PARAMS_TYPES); - - return (String[])params.toArray(new String[0]); - } - - /** - * @return lits of validation messages - */ - public List getValidationMessages() { - if (validationMessages == null){ - validationMessages = new ArrayList(); - } - return validationMessages; - } - - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigConverterIDFeatures.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigConverterIDFeatures.java deleted file mode 100644 index 79b1c5b38..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigConverterIDFeatures.java +++ /dev/null @@ -1,127 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager; -import org.eclipse.jst.jsf.facesconfig.emf.ConverterType; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; -import org.eclipse.osgi.util.NLS; - -/** - * Meta-data processing feature representing an attribute value requiring a "converterid" - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public class FacesConfigConverterIDFeatures extends FacesConfigIdentifierFeatures { - - /** - * Faces converter classname - */ - protected static final String CONVERTER = "javax.faces.convert.Converter"; //$NON-NLS-1$ - /** - * Imagename to use when displaying converter - */ - protected static final String IMAGE_NAME = "/icons/full/obj16/FacesConfig_Converter.gif"; //$NON-NLS-1$ - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getElements(org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager) - */ - protected List getElements(JSFAppConfigManager mgr) { - if (mgr != null) - return mgr.getConverters(); - return new ArrayList(0); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getReturnType() - */ - protected String getReturnType(){ return CONVERTER;} - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getPossibleValueProposals(java.util.List) - */ - protected List getPossibleValueProposals(List elements) { - List ret = new ArrayList(); - Collections.sort(elements, new ConverterSorter()); - for (Iterator it = elements.iterator();it.hasNext();){ - ConverterType obj = (ConverterType)it.next(); - if (obj.getConverterId() != null && obj.getConverterId().getTextContent() != null){ - PossibleValue pv = createProposal(obj.getConverterId().getTextContent(), obj.getDisplayName(), obj.getDescription()); - if (pv != null){ - pv.setIcon(getImage()); - ret.add(pv); - } - } - } - return ret; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getImageName() - */ - protected String getImageName() { - return IMAGE_NAME; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getMyValidationMessage(java.lang.String) - */ - protected String getMyValidationMessage(String value) { - if (value == null || value.trim().equals("")) //$NON-NLS-1$ - return Messages.FacesConfigConverterIDFeatures_converterid_empty; - - return NLS.bind(Messages.FacesConfigIdentifierType_invalid_converter_id, new String[]{singleQuote(value)}); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getElementIDs(org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager) - */ - protected List getElementIDs(JSFAppConfigManager mgr) { - List elements = getElements(mgr); - List ret = new ArrayList(elements.size()); - for (Iterator it = elements.iterator();it.hasNext();){ - ConverterType aType = (ConverterType)it.next(); - if (aType.getConverterId() != null && aType.getConverterId().getTextContent() != null){ - String id = aType.getConverterId().getTextContent(); - if (id != null) - ret.add(id.trim()); - } - } - return ret; - } - - /** - * - * Converter ID Sorter - incomplete - */ - private static class ConverterSorter implements Comparator, Serializable { - /** - * - */ - private static final long serialVersionUID = 5255291244511783735L; - - public int compare(Object o1, Object o2) { - //TODO - return 0; - - } - - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigConverterIDType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigConverterIDType.java deleted file mode 100644 index 3e81d0484..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigConverterIDType.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2007 Oracle Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -/** - * Type representing a FacesConfig Converter attribute - * - * <p><b>Provisional API - subject to change</b></p> - */ -public class FacesConfigConverterIDType extends FacesConfigIdentifierType { - // FIXME: why do we have an empty class? -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigIdentifierFeatures.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigIdentifierFeatures.java deleted file mode 100644 index b22f4d1ec..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigIdentifierFeatures.java +++ /dev/null @@ -1,305 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.net.URL; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jst.jsf.common.internal.types.CompositeType; -import org.eclipse.jst.jsf.common.internal.types.IAssignable; -import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory; -import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver; -import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager; -import org.eclipse.jst.jsf.facesconfig.FacesConfigPlugin; -import org.eclipse.jst.jsf.facesconfig.emf.DescriptionType; -import org.eclipse.jst.jsf.facesconfig.emf.DisplayNameType; -import org.eclipse.jst.jsf.metadataprocessors.AbstractMetaDataEnabledFeature; -import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException; -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; -import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage; -import org.osgi.framework.Bundle; - -/** - * Abstract meta-data processing feature representing a faces-config type - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public abstract class FacesConfigIdentifierFeatures extends AbstractMetaDataEnabledFeature - implements IPossibleValues, IValidValues, IValidELValues{ - - /** - * Meta-data property name to use for identifying the faces-config type - * - * see jsf_core.xml converterID and validatorID attributes - */ - public static final String ID_TYPE_PROP_NAME = "config-type"; //$NON-NLS-1$ - - /** - * Missing image descriptor - */ - protected static final ImageDescriptor MISSING_IMAGE = ImageDescriptor.getMissingImageDescriptor(); - - /** - * Name of image file to use with content assist proposals - */ - protected String imageName; - private ImageDescriptor imageDescriptor; - /** - * Validation messages to return - */ - protected List validationMessages; - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues#getPossibleValues() - */ - public List getPossibleValues() { - List ret = new ArrayList(); - List idTypes = getConfigTypes(); - - if (idTypes != null){ - for (int i=0;i<idTypes.size();i++){ - //verify this feature can deal with this type - if (getReturnType().equals(idTypes.get(i))){ - ret.addAll(createPossibleValues()); - } - } - } - - return ret; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - */ - public boolean isValidValue(String value) { - List idTypes = getConfigTypes(); - if (idTypes != null){ - for (int i=0;i<idTypes.size();i++){ - if (getReturnType().equals(idTypes.get(i))){ - if (hasValue(getElementIDs(getJSFAppConfigMgr()), value)){ - getValidationMessages().clear(); - return true; - } - getValidationMessages().add(getValidationMessage(value)); - } - } - } - return false; - } - - private boolean hasValue(List elements, String value) { - for (Iterator it=elements.iterator();it.hasNext();){ - if (value.equals(it.next())) - return true; - } - return false; - } - - /** - * @param value of the attribute - * @return the validation message String - */ - protected abstract String getMyValidationMessage(String value); - - /** - * Creates an IValidationMessage - * @param value - * @return IValidationMessage - */ - protected IValidationMessage getValidationMessage(String value) { - String msg; - msg = getCMValidationMessage(); - if (msg == null){ - msg = getMyValidationMessage(value); - } - String code = getCMValidationCode(); - int severity = getCMValidationSeverity(); - - IValidationMessage valMsg = new ValidationMessage(msg, code, severity); - return valMsg; - } - - /** - * - * @param value - * @return single-quoted value - */ - protected String singleQuote(String value){ - return "'" + value+"'"; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#getValidationMessages() - */ - public List getValidationMessages(){ - if (validationMessages == null){ - validationMessages = new ArrayList(); - } - return validationMessages; - } - - /** - * @param jsfAppConfigManager - * @return list of faces-config element for the specified config-type - */ - protected abstract List getElements(JSFAppConfigManager jsfAppConfigManager); - /** - * @param elements - * @return list of IPossibleValue objects for the specified list of config elements - */ - protected abstract List getPossibleValueProposals(List elements); - /** - * @return image name relative to the FacesConfigEditPlugin where the images are stored - */ - protected abstract String getImageName(); - - private List createPossibleValues() { - return getPossibleValueProposals(getElements(getJSFAppConfigMgr())); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.AbstractMetaDataEnabledFeature#getImage() - */ - protected ImageDescriptor getImage() { - ImageDescriptor ret = super.getImage(); - if (ret != null && ret != MISSING_IMAGE) - return ret; - - if (imageDescriptor == null){ - imageDescriptor = getImageDesc(getImageName()); - } - return imageDescriptor; - - } - - //return FacesConfigPlugin relative image descriptor - private ImageDescriptor getImageDesc(String img) { - Bundle bundle = FacesConfigPlugin.getPlugin().getBundle(); - URL url = FileLocator.find(bundle, new Path(img), null); - ImageDescriptor desc = ImageDescriptor.createFromURL(url); - if (desc == MISSING_IMAGE){ - return null; - } - return desc; - } - - /** - * @param value - * @param displayName - * @param description - * @return PossibleValue object - */ - protected PossibleValue createProposal(String value, EList displayName, EList description) { - String display = value; - if (displayName.size() > 0) { - DisplayNameType displayNameType= (DisplayNameType) displayName.get(0); - display = displayNameType.getTextContent(); - } - String desc = null; - if (description.size() > 0) { - DescriptionType descType= (DescriptionType) description.get(0); - desc = descType.getTextContent(); - } - PossibleValue pv = new PossibleValue(value, display); - if (desc != null) - pv.setAdditionalInformation(desc); - - return pv; - - } - - private List getConfigTypes() { - return getTraitValueAsListOfStrings(ID_TYPE_PROP_NAME); - -// return CMAnnotationHelper.getCMAttributePropertyValues(getMetaDataContext().getBundleId(), -// getMetaDataContext().getUri(), getMetaDataContext().getElementName(), -// getMetaDataContext().getAttributeName(), ID_TYPE_PROP_NAME); - } - - private JSFAppConfigManager getJSFAppConfigMgr(){ - return JSFAppConfigManager.getInstance(getProject()); - } - - private IProject getProject() { - IWorkspaceContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(getStructuredDocumentContext()); - if (resolver != null) - return resolver.getProject(); - - return null; - } - - /** - * @param jsfAppConfigManager - * @return list of identifier Strings for config-type - */ - protected abstract List getElementIDs(JSFAppConfigManager jsfAppConfigManager); - - /** - * @return the config-type - */ - protected abstract String getReturnType(); - /** - * @return int value of {@link IAssignable}.ASSIGNMENT_TYPE_RHS & {@link IAssignable}.ASSIGNMENT_TYPE_LHS - */ - protected int getAssignmentType(){ - //TODO: fix me to get from meta-data(?) - return IAssignable.ASSIGNMENT_TYPE_RHS & IAssignable.ASSIGNMENT_TYPE_LHS; - } - public CompositeType getExpectedRuntimeType() throws ELIsNotValidException { - String type = Signature.createTypeSignature(getReturnType(), true); - return new CompositeType(type, getAssignmentType()); - } - - /** - * @return String value of {@link IValidValues}.VALID_VALUES_MESSAGE_PROP_NAME trait - */ - protected String getCMValidationMessage() { - //TODO: Standard Validation stuff - should be moved somewhere else - return getTraitValueAsString(IValidValues.VALID_VALUES_MESSAGE_PROP_NAME); - } - - /** - * @return int value of {@link IValidValues}.VALID_VALUES_SEVERITY_PROP_NAME trait - */ - protected int getCMValidationSeverity() { - String val = getTraitValueAsString(IValidValues.VALID_VALUES_SEVERITY_PROP_NAME); - if (val == null) - return IStatus.WARNING; - - int severity = Integer.valueOf(val).intValue(); - return severity; - } - - /** - * @return String value of {@link IValidValues}.VALID_VALUES_CODE_PROP_NAME trait - */ - protected String getCMValidationCode() { - return getTraitValueAsString(IValidValues.VALID_VALUES_CODE_PROP_NAME); - } - -} - - diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigIdentifierType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigIdentifierType.java deleted file mode 100644 index 5ac934d7c..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigIdentifierType.java +++ /dev/null @@ -1,26 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -/** - * Meta-data processing type representing a faces-config type - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public abstract class FacesConfigIdentifierType extends IdentifierType { - // FIXME: why do we have an empty class? -} - - - - diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigValidatorIDFeatures.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigValidatorIDFeatures.java deleted file mode 100644 index 2a2711ab0..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigValidatorIDFeatures.java +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager; -import org.eclipse.jst.jsf.facesconfig.emf.ValidatorType; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; -import org.eclipse.osgi.util.NLS; - -/** - * ValidatorID attribute feature - * - * <p><b>Provisional API - subject to change</b></p> - * - */ -public class FacesConfigValidatorIDFeatures extends FacesConfigIdentifierFeatures { - - /** - * Faces validator classname - */ - protected static final String VALIDATOR = "javax.faces.validator.Validator"; //$NON-NLS-1$ - /** - * Imagename to use when displaying validator - */ - protected static final String IMAGE_NAME = "/icons/full/obj16/FacesConfig_Validator.gif"; //$NON-NLS-1$ - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getReturnType() - */ - protected String getReturnType(){ return VALIDATOR;} - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getElements(org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager) - */ - protected List getElements(JSFAppConfigManager mgr) { - if (mgr != null) - return mgr.getValidators(); - return new ArrayList(0); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getPossibleValueProposals(java.util.List) - */ - protected List getPossibleValueProposals(List elements) { - List ret = new ArrayList(); - Collections.sort(elements, new ValidatorSorter()); - for (Iterator it = elements.iterator();it.hasNext();){ - ValidatorType obj = (ValidatorType)it.next(); - if (obj.getValidatorId() != null && obj.getValidatorId().getTextContent() != null){ - PossibleValue pv = createProposal(obj.getValidatorId().getTextContent(), obj.getDisplayName(), obj.getDescription()); - if (pv != null){ - pv.setIcon(getImage()); - ret.add(pv); - } - } - } - return ret; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getImageName() - */ - protected String getImageName() { - return IMAGE_NAME; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getMyValidationMessage(java.lang.String) - */ - protected String getMyValidationMessage(String value) { - if (value == null || value.trim().equals("")) //$NON-NLS-1$ - return Messages.FacesConfigValidatorIDFeatures_validatorid_empty; - - return NLS.bind(Messages.FacesConfigIdentifierType_invalid_validator_id, new String[]{singleQuote(value)}); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.FacesConfigIdentifierFeatures#getElementIDs(org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigManager) - */ - protected List getElementIDs(JSFAppConfigManager mgr) { - List elements = getElements(mgr); - List ret = new ArrayList(elements.size()); - for (Iterator it = elements.iterator();it.hasNext();){ - ValidatorType aType = (ValidatorType)it.next(); - if (aType.getValidatorId() != null && aType.getValidatorId().getTextContent() != null){ - String id = aType.getValidatorId().getTextContent(); - if (id != null) - ret.add(id.trim()); - } - } - return ret; - } - - /** - * Validator id sorter - incomplete - */ - private static class ValidatorSorter implements Comparator, Serializable { - /** - * - */ - private static final long serialVersionUID = -398026037193914126L; - - public int compare(Object o1, Object o2) { - //TODO - return 0; - - } - - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigValidatorIDType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigValidatorIDType.java deleted file mode 100644 index 65f0504e8..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/FacesConfigValidatorIDType.java +++ /dev/null @@ -1,20 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2007 Oracle Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -/** - * Type representing a FacesConfig Validator attribute - * - * <p><b>Provisional API - subject to change</b></p> - */ -public class FacesConfigValidatorIDType extends FacesConfigIdentifierType { - // FIXME: why do we have an empty class? -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/IdentifierType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/IdentifierType.java deleted file mode 100644 index 134e23d9a..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/IdentifierType.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -/** - * Abstract meta-data processing type representing an identifier binding type - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public abstract class IdentifierType extends DirectBindingType { - // TODO: parent is already abstract; what's the point? -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/IntegerType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/IntegerType.java deleted file mode 100644 index 6fcbdb747..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/IntegerType.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.List; - -import org.eclipse.osgi.util.NLS; - -/** - * Meta-data processing type representing an integer attribute value runtime type - * that implements IValidValues, IDefaultValue, IValidELValues - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public class IntegerType extends NumberType { - private static final String INVALID_INTEGER = Messages.IntegerType_invalid_integer; - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType() - */ - protected String getReturnType(){ return "int";} //$NON-NLS-1$ - - /** - * Type coercion according to JSP 2.0 spec: JSP.1.14.2.1 Conversions from String values - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - **/ - public boolean isValidValue(String value) { - try { - Integer anInt = Integer.valueOf(value); - exceedsMaxValue(anInt.intValue()); - lessThanMinValue(anInt.intValue()); - if (!(minFound || maxFound)){ - List validVals = getMDValidValues(); - if (!validVals.isEmpty()){ - if (!validVals.contains(value)){ - addNewValidationMessage(Messages.IntegerType_invalid_member);//fix me - } - } - } - return getValidationMessages().isEmpty(); - } catch (NumberFormatException e) { - addNewValidationMessage(INVALID_INTEGER); - return false; - } - - } - - private void exceedsMaxValue(int anInt) { - String strMax = getValidMaximumValue(); - if (strMax != null){ - try { - int max = Integer.valueOf(strMax).intValue(); - maxFound = true; - if (anInt > max){ - addNewValidationMessage(NLS.bind(EXCEEDS_MAX, strMax)); - } - } catch (NumberFormatException e) { - //TODO: ignore error???? or log it???? - } - } - - } - - private void lessThanMinValue(int anInt) { - String strMin = getValidMinimumValue(); - if (strMin != null){ - try { - int max = Integer.valueOf(strMin).intValue(); - minFound = true; - if (anInt < max){ - addNewValidationMessage(NLS.bind(LESS_THAN_MIN, strMin)); - } - } catch (NumberFormatException e) { - //TODO: ignore error???? or log it???? - } - } - - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/JavaClassType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/JavaClassType.java deleted file mode 100644 index 912c81808..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/JavaClassType.java +++ /dev/null @@ -1,498 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jdt.core.Flags; -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.IJavaElement; -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jdt.core.IPackageFragment; -import org.eclipse.jdt.core.IPackageFragmentRoot; -import org.eclipse.jdt.core.IType; -import org.eclipse.jdt.core.ITypeHierarchy; -import org.eclipse.jdt.core.JavaCore; -import org.eclipse.jdt.core.JavaModelException; -import org.eclipse.jdt.core.search.IJavaSearchConstants; -import org.eclipse.jdt.core.search.IJavaSearchScope; -import org.eclipse.jdt.core.search.SearchEngine; -import org.eclipse.jdt.core.search.SearchMatch; -import org.eclipse.jdt.core.search.SearchParticipant; -import org.eclipse.jdt.core.search.SearchPattern; -import org.eclipse.jdt.core.search.SearchRequestor; -import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory; -import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver; -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; -import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage; - -/** - * Provides possible values and validates attribute values that should be fully qualified Java types. - * A type can be verified against multiple "valid-interfaces" and/or a "valid-superclass" from meta-data. - * Code checks to ensure the class can be instantiated (i.e. not abstract, anonymous or inner class) - * Search is scoped to within the current project only. - * - * (Until https://bugs.eclipse.org/bugs/show_bug.cgi?id=142044 is fixed, only the first found will be used) - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - * - */ -public class JavaClassType extends ObjectType implements IPossibleValues, IValidValues{ - /** - * Trait name for valid interfaces - */ - public static final String POSSIBLE_VALUES_INTERFACES_PROP_NAME = "valid-interfaces"; //$NON-NLS-1$ - /** - * Trait name for valid superclass - */ - public static final String POSSIBLE_VALUES_SUPERCLASS_PROP_NAME = "valid-superclass"; //$NON-NLS-1$ - - private List validationMsgs; - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues#getPossibleValues() - */ - public List getPossibleValues() { - List results = getTypes(); - if (results != null && !results.isEmpty()){ - - Set vals = new HashSet(results.size()); - Set checkedTypes = new HashSet(); - for (Iterator it = results.iterator();it.hasNext();){ - SearchMatch match = (SearchMatch)it.next(); - IType res = (IType)match.getElement(); - addValidSubClasses(res, vals, checkedTypes); - } - return createPossibleValues(vals); - } - return new ArrayList(0); - } - - private List createPossibleValues(Set vals) { - List list = new ArrayList(vals.size()); - Iterator it = vals.iterator(); - while(it.hasNext()){ - IJavaElement elem = (IJavaElement)it.next(); - list.add(createPossibleValue(elem)); - } - return list; - } - - private void addValidSubClasses(IType res, Set vals, Set checkedTypes) { - - try { - //check to see if we have already checked the hiearchy - if (checkedTypes.contains(res)) - return; - - //should we add itself? - if (isInnerOrAnonymousClass(res)) - return; - if (!isAbstractClass(res)) - vals.add(res); //since it is a set, dupes will not be added - - - ITypeHierarchy hierarchy = res.newTypeHierarchy(getJavaProject(), null); - IType[] subclasses = hierarchy.getSubclasses(res); - checkedTypes.add(res); - for (int i=0;i<subclasses.length;i++){ - addValidSubClasses(subclasses[i], vals, checkedTypes); - } - } catch (JavaModelException e) { - //ignore - } - } - - private IWorkspaceContextResolver getWorkspaceContextResolver(){ - if (getStructuredDocumentContext() == null) - return null; - - return IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(getStructuredDocumentContext()); - } - - private List getTypes(){ - IJavaProject jp = getJavaProject(); - if (jp == null) - return null; - - List elems = new ArrayList(); - elems.addAll(getInterfaces(jp)); - IType sc = getSuperClass(jp); - if (sc != null) - elems.add(sc); - - if (elems.size() > 0){ - SearchRequestor requestor = new Searcher(); - SearchEngine engine = new SearchEngine(); - - IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[]{jp});//, IJavaSearchScope.SOURCES | IJavaSearchScope.APPLICATION_LIBRARIES | IJavaSearchScope.); - SearchPattern combined = SearchPattern.createPattern((IJavaElement)elems.get(0), IJavaSearchConstants.IMPLEMENTORS, 0); - -// Until this bug is fixed, stub it out... only the first interface/superclass will be used. -// https://bugs.eclipse.org/bugs/show_bug.cgi?id=142044 -// for(int i=1;i<elems.size();i++){ -// final SearchPattern other = SearchPattern.createPattern((IJavaElement)elems.get(i), IJavaSearchConstants.IMPLEMENTORS, 0); -// combined = SearchPattern.createAndPattern(combined, other); -// } - - try { - engine.search(combined, new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, scope, requestor, null); - - } catch (CoreException e) { - //ignore - } - - return ((Searcher)requestor).getResults(); - } - - return Collections.EMPTY_LIST; - } - - private IJavaProject getJavaProject() { - IWorkspaceContextResolver resolver = getWorkspaceContextResolver(); - if (resolver != null){ - IProject proj = resolver.getProject(); - if (proj != null) - return JavaCore.create(proj); - } - return null; - } - - private List getInterfaces(IJavaProject jp) { - List ret = new ArrayList(); - List propVals = getInterfaceNames(); - - for (Iterator it = propVals.iterator();it.hasNext();){ - String propVal = (String)it.next(); - IType interfase = null; - try { - interfase = findType(jp, propVal); - if (interfase != null){ - ret.add(interfase); - } - } catch (JavaModelException e) { - // suppress and fall-through to return empty list - } - - } - return ret; - } - - private IType getSuperClass(IJavaProject jp){ - IType superclass = null; - try { - String sc = getSuperClassName(); - if (sc != null && !sc.trim().equals("")){ //$NON-NLS-1$ - superclass = findType(jp, sc ); - if (superclass != null){ - return superclass; - } - } - } catch (JavaModelException e) { - //ignore - } - return null; - } - - private PossibleValue createPossibleValue(IJavaElement val) { - return new PossibleValue(((IType)val).getFullyQualifiedName()); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#getValidationMessages() - */ - public List getValidationMessages() { - if (validationMsgs == null){ - validationMsgs = new ArrayList(); - } - return validationMsgs; - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - */ - public boolean isValidValue(String value) { - if (value == null || value.trim().equals("")){ //$NON-NLS-1$ - getValidationMessages().add(new ValidationMessage(Messages.JavaClassType_invalid_type)); - return false; - } - IJavaProject jp = getJavaProject(); - if (jp == null) - return false; - - //first verify that the value specified is a resolvable type - IType type = getTypeForValue(jp, value); - if (type != null){ - //ensure that it is not abstract or anonymous - if (!isInnerOrAnonymousClass(type) && !isAbstractClass(type)){ - //now verify that it meets the criteria - ITypeHierarchy hierarchy; - try { - hierarchy = type.newTypeHierarchy(jp, null); - } catch (JavaModelException e) { - return false; - } - - //check that all interfaces - List<String> interfaceNames = getInterfaceNames(); - for (Iterator<String> it=interfaceNames.iterator();it.hasNext();){ - //check that all interfaces are satisfied by type - IType interfase = getTypeForValue(jp, it.next()); - if (interfase == null){ - addNewValidationMessage(Messages.JavaClassType_not_found); - return false; - } - else if (! containsType(hierarchy.getAllSupertypes(type), interfase)){ - addNewValidationMessage(Messages.JavaClassType_not_found); - return false; - } - } - //interfaces have been satisfied now check the superclass if specified - IType superClass = getSuperClass(jp); - if (superClass != null && superClass.equals(type)) - return true; - else if (superClass != null && !containsType(hierarchy.getAllSuperclasses(type), superClass )){ - addNewValidationMessage(Messages.JavaClassType_not_found); - return false; - } - return true; -// List results = getTypes(); -// if (!results.isEmpty()){ -// for (Iterator it = results.iterator();it.hasNext();){ -// SearchMatch match = (SearchMatch)it.next(); -// IType res = (IType)match.getElement(); -// if (!isInnerOrAnonymousClass(res) ){ -// //if this is the class, then optimize to reduce expense of creating hierarchy -// if (!isAbstractClass(type) && (res.getFullyQualifiedName().equals(value)) ) -// return true; -// //check to see if value is a subtype in the hierarchy -// try { -// ITypeHierarchy hierarchy = res.newTypeHierarchy(jp, null); -// if (containsType(hierarchy.getAllSubtypes(res), type)) -// return true; -// -// } catch (JavaModelException e) { -// //ignore -// } -// } -// } -// } - } - } - addNewValidationMessage(Messages.JavaClassType_not_found); - return false; - } - - private boolean containsType(IType[] types, IType type) { - for (int i=0;i < types.length;i++) { - if (type.equals(types[i])) - return true; - } - return false; - } - - private IType getTypeForValue(IJavaProject jp, String value) { - try { - return findType(jp, value); - } catch (JavaModelException e) { - // suppress and fall through to return null - } - return null; - } - - /** - * @return String value of {@link #POSSIBLE_VALUES_SUPERCLASS_PROP_NAME} - */ - protected String getSuperClassName(){ - return getTraitValueAsString(POSSIBLE_VALUES_SUPERCLASS_PROP_NAME); -// return CMAnnotationHelper.getCMAttributePropertyValue(getMetaDataContext().getBundleId(), getMetaDataContext().getUri(), -// getMetaDataContext().getElementName(), getMetaDataContext().getAttributeName(), -// POSSIBLE_VALUES_SUPERCLASS_PROP_NAME); - - } - - /** - * @return List of values from {@link #POSSIBLE_VALUES_INTERFACES_PROP_NAME} - */ - protected List getInterfaceNames(){ - return getTraitValueAsListOfStrings(POSSIBLE_VALUES_INTERFACES_PROP_NAME); - -// return CMAnnotationHelper.getCMAttributePropertyValues(getMetaDataContext().getBundleId(), getMetaDataContext().getUri(), -// getMetaDataContext().getElementName(), getMetaDataContext().getAttributeName(), -// POSSIBLE_VALUES_INTERFACES_PROP_NAME); - - } - - /** - * Create a {@link ValidationMessage} from metadata or use default message - * and add it to the collection of validation messages - * @param defaultMsg - */ - protected void addNewValidationMessage(String defaultMsg) { - //TODO: need to refactor below as this as also in Enumeration - String msg = getCMValidationMessage(); - if (msg == null || msg.equals("")) //$NON-NLS-1$ - msg = defaultMsg; - - String code = getValidationCode(); - int severity = getValidationSeverity(); - ValidationMessage val = new ValidationMessage(msg, code, severity); - getValidationMessages().add(val); - } - - - /** - * @return validation message from meta-data using {@link IValidValues}.VALID_VALUES_MESSAGE_PROP_NAME trait. Can be null. - */ - protected String getCMValidationMessage() { - return getTraitValueAsString(IValidValues.VALID_VALUES_MESSAGE_PROP_NAME); - } - - /** - * @return validation severity as int from meta-data using {@link IValidValues}.VALID_VALUES_SEVERITY_PROP_NAME trait. IStatus.WARNING is default. - */ - protected int getValidationSeverity() { - String val = getTraitValueAsString(IValidValues.VALID_VALUES_SEVERITY_PROP_NAME); - if (val == null) - return IStatus.WARNING; - - int severity = Integer.valueOf(val).intValue(); - return severity; - } - - /** - * @return validation code as String from meta-data. Can be null. - */ - protected String getValidationCode() { - return getTraitValueAsString(IValidValues.VALID_VALUES_CODE_PROP_NAME); - } - - private boolean isInnerOrAnonymousClass(IType res) { - try { - if (res.isClass() && (res.isAnonymous() || - (Flags.isPrivate(res.getFlags())) || - res.getFullyQualifiedName().indexOf("$") > 0)) //must be better way to discover if it is an inner class //$NON-NLS-1$ - return true; - } catch (JavaModelException e) { - //ignore - } - return false; - } - - - private boolean isAbstractClass(IType res) { - try { - if (res.isClass() && Flags.isAbstract(res.getFlags())) - return true; - } catch (JavaModelException e) { - //ignore - } - return false; - } - - private static class Searcher extends SearchRequestor{ - private List results = new ArrayList(); - public void acceptSearchMatch(SearchMatch match) throws CoreException { - results.add(match); - } - - /** - * @return list of serach results - */ - public List getResults(){ - return results; - } - } - -///////////////// /////////////////////////////////////////////////////////////////////// -//remainder of this class copied from org.eclipse.jdt.internal.corext.util.JavaCoreUtil // -//TODO: find public version of this functionality // -////////////////////////////////////////////////////////////////////////////////////////// - private IType findType(IJavaProject jproject, String fullyQualifiedName) throws JavaModelException { - //workaround for bug 22883 - IType type= jproject.findType(fullyQualifiedName); - if (type != null) - return type; - - IPackageFragmentRoot[] roots= jproject.getPackageFragmentRoots(); - for (int i= 0; i < roots.length; i++) { - IPackageFragmentRoot root= roots[i]; - type= findType(root, fullyQualifiedName); - if (type != null && type.exists()) - return type; - } - return null; - } - - private IType findType(IPackageFragmentRoot root, String fullyQualifiedName) throws JavaModelException{ - IJavaElement[] children= root.getChildren(); - for (int i= 0; i < children.length; i++) { - IJavaElement element= children[i]; - if (element.getElementType() == IJavaElement.PACKAGE_FRAGMENT){ - IPackageFragment pack= (IPackageFragment)element; - if (! fullyQualifiedName.startsWith(pack.getElementName())) - continue; - IType type= findType(pack, fullyQualifiedName); - if (type != null && type.exists()) - return type; - } - } - return null; - } - - private IType findType(IPackageFragment pack, String fullyQualifiedName) throws JavaModelException{ - ICompilationUnit[] cus= pack.getCompilationUnits(); - for (int i= 0; i < cus.length; i++) { - ICompilationUnit unit= cus[i]; - IType type= findType(unit, fullyQualifiedName); - if (type != null && type.exists()) - return type; - } - return null; - } - - private IType findType(ICompilationUnit cu, String fullyQualifiedName) throws JavaModelException{ - IType[] types= cu.getAllTypes(); - for (int i= 0; i < types.length; i++) { - IType type= types[i]; - if (getFullyQualifiedName(type).equals(fullyQualifiedName)) - return type; - } - return null; - } - - private String getFullyQualifiedName(IType type) { - try { - if (type.isBinary() && !type.isAnonymous()) { - IType declaringType= type.getDeclaringType(); - if (declaringType != null) { - return getFullyQualifiedName(declaringType) + '.' + type.getElementName(); - } - } - } catch (JavaModelException e) { - // ignore - } - return type.getFullyQualifiedName('.'); - } -//////////////////////////////////////////////////////////////////////// -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LanguageCodeType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LanguageCodeType.java deleted file mode 100644 index 102df5abb..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LanguageCodeType.java +++ /dev/null @@ -1,127 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation., and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; - -/** - * Meta-data processing type representing a Language Code type. - * A Language code is defined as in html spec http://www.w3.org/TR/html4/types.html#h-6.8 - * - * <p><b>Provisional API - subject to change</b></p> - * - */ - -public class LanguageCodeType extends EnumerationType implements IPossibleValues { - private static final LanguageCodeMap _map = new LanguageCodeMap(); - - @Override - protected String getReturnType() { - return "java.lang.String"; //$NON-NLS-1$ - } - - public List getPossibleValues() { - List ret = new ArrayList(); - for(Iterator it = _map.keySet().iterator();it.hasNext();){ - String key = (String)it.next(); - String value = _map.get(key); - PossibleValue pv = new PossibleValue(key, value); - ret.add(pv); - } - return ret; - } - - public boolean isValidValue(String value) { - if(!_map.containsKey(value)) { - addNewValidationMessage(Messages.LanguageCodeType_1); - } - - return getValidationMessages().isEmpty(); - } - - /** - * Defines language code map - * - */ - private static class LanguageCodeMap extends HashMap<String, String> { - private static final long serialVersionUID = 1L; - - LanguageCodeMap() { - put("af", Messages.LanguageCodeType_118); //$NON-NLS-1$ - put("ar", Messages.LanguageCodeType_0); //$NON-NLS-1$ - put("be", Messages.LanguageCodeType_7); //$NON-NLS-1$ - put("bg", Messages.LanguageCodeType_9); //$NON-NLS-1$ - put("br", Messages.LanguageCodeType_11); //$NON-NLS-1$ - put("ca", Messages.LanguageCodeType_13); //$NON-NLS-1$ - put("cs", Messages.LanguageCodeType_15); //$NON-NLS-1$ - put("da", Messages.LanguageCodeType_17); //$NON-NLS-1$ - put("de", Messages.LanguageCodeType_19); //$NON-NLS-1$ - put("el", Messages.LanguageCodeType_21); //$NON-NLS-1$ - put("en", Messages.LanguageCodeType_23); //$NON-NLS-1$ - put("es", Messages.LanguageCodeType_25); //$NON-NLS-1$ - put("et", Messages.LanguageCodeType_27); //$NON-NLS-1$ - put("eu", Messages.LanguageCodeType_29); //$NON-NLS-1$ - put("fa", Messages.LanguageCodeType_31); //$NON-NLS-1$ - put("fi", Messages.LanguageCodeType_33); //$NON-NLS-1$ - put("fo", Messages.LanguageCodeType_35); //$NON-NLS-1$ - put("fr", Messages.LanguageCodeType_37); //$NON-NLS-1$ - put("gd", Messages.LanguageCodeType_39); //$NON-NLS-1$ - put("he", Messages.LanguageCodeType_41); //$NON-NLS-1$ - put("hi", Messages.LanguageCodeType_43); //$NON-NLS-1$ - put("hr", Messages.LanguageCodeType_45); //$NON-NLS-1$ - put("hu", Messages.LanguageCodeType_47); //$NON-NLS-1$ - put("id", Messages.LanguageCodeType_49); //$NON-NLS-1$ - put("is", Messages.LanguageCodeType_51); //$NON-NLS-1$ - put("it", Messages.LanguageCodeType_53); //$NON-NLS-1$ - put("ja", Messages.LanguageCodeType_55); //$NON-NLS-1$ - put("ko", Messages.LanguageCodeType_57); //$NON-NLS-1$ - put("lt", Messages.LanguageCodeType_59); //$NON-NLS-1$ - put("lv", Messages.LanguageCodeType_61); //$NON-NLS-1$ - put("mk", Messages.LanguageCodeType_63); //$NON-NLS-1$ - put("ms", Messages.LanguageCodeType_65); //$NON-NLS-1$ - put("mt", Messages.LanguageCodeType_67); //$NON-NLS-1$ - put("nl", Messages.LanguageCodeType_69); //$NON-NLS-1$ - put("no", Messages.LanguageCodeType_71); //$NON-NLS-1$ - put("pl", Messages.LanguageCodeType_73); //$NON-NLS-1$ - put("pt", Messages.LanguageCodeType_75); //$NON-NLS-1$ - put("rm", Messages.LanguageCodeType_77); //$NON-NLS-1$ - put("ro", Messages.LanguageCodeType_79); //$NON-NLS-1$ - put("ru", Messages.LanguageCodeType_81); //$NON-NLS-1$ - put("sk", Messages.LanguageCodeType_83); //$NON-NLS-1$ - put("sl", Messages.LanguageCodeType_85); //$NON-NLS-1$ - put("sq", Messages.LanguageCodeType_87); //$NON-NLS-1$ - put("sr", Messages.LanguageCodeType_89); //$NON-NLS-1$ - put("sv", Messages.LanguageCodeType_91); //$NON-NLS-1$ - put("sx", Messages.LanguageCodeType_93); //$NON-NLS-1$ - put("sz", Messages.LanguageCodeType_95); //$NON-NLS-1$ - put("th", Messages.LanguageCodeType_97); //$NON-NLS-1$ - put("tn", Messages.LanguageCodeType_99); //$NON-NLS-1$ - put("tr", Messages.LanguageCodeType_101); //$NON-NLS-1$ - put("ts", Messages.LanguageCodeType_103); //$NON-NLS-1$ - put("uk", Messages.LanguageCodeType_105); //$NON-NLS-1$ - put("ur", Messages.LanguageCodeType_107); //$NON-NLS-1$ - put("vi", Messages.LanguageCodeType_109); //$NON-NLS-1$ - put("xh", Messages.LanguageCodeType_111); //$NON-NLS-1$ - put("yi", Messages.LanguageCodeType_113); //$NON-NLS-1$ - put("zh", Messages.LanguageCodeType_115); //$NON-NLS-1$ - put("zu", Messages.LanguageCodeType_117); //$NON-NLS-1$ - } - - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LengthType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LengthType.java deleted file mode 100644 index 70c5069fd..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LengthType.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ - -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -/** - * Meta-data processing type representing an length attribute value runtime type. - * Does not support min and max values from MD. Length must be positive. - * that implements IValidValues, IDefaultValue, IValidELValues. - */ -public class LengthType extends IntegerType { - private static final String INVALID_LENGTH = Messages.LengthType_invalid_integer; - /** - * Type coercion according to JSP 2.0 spec: JSP.1.14.2.1 Conversions from String values - * Allows a percentage. - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - **/ - public boolean isValidValue(String value) { - //FIXME: this is not right... px, em, etc. are also valid... and spaces between # and units are not - //see http://www.w3.org/TR/html401/types.html#h-6.6 - if (value == null) return true; - String aValue = stripPercentIfPresent(value); - try { - int anInt = Integer.valueOf(aValue).intValue(); - if (anInt < 0) - addNewValidationMessage(INVALID_LENGTH); - - return getValidationMessages().isEmpty(); - } catch (NumberFormatException e) { - addNewValidationMessage(INVALID_LENGTH); - return false; - } - - } - //will strip '%' if at end of string. If string is only '%', then will return empty which will be invalid. - private String stripPercentIfPresent(String value) { - //"%" is allowed at end - if (value.length() > 0 - && value.lastIndexOf('%') == value.length() - 1) - return value.replaceFirst("%",""); //$NON-NLS-1$ //$NON-NLS-2$ - - return value; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LinkType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LinkType.java deleted file mode 100644 index ead9b79ce..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LinkType.java +++ /dev/null @@ -1,73 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation., and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; - -/** - * Meta-data processing type representing a Link type. - * - * Possible values are only common types; not all - * Valid values just checks for a non-empty value, and not against known link types - * - * <p><b>Provisional API - subject to change</b></p> - * - */ - -public class LinkType extends EnumerationType implements IPossibleValues{ - //common link types - private String[] _linkTypes = new String[]{ - "Alternate", //$NON-NLS-1$ - "Stylesheet", //$NON-NLS-1$ - "Start", //$NON-NLS-1$ - "Next", //$NON-NLS-1$ - "Prev", //$NON-NLS-1$ - "Contents", //$NON-NLS-1$ - "Index", //$NON-NLS-1$ - "Glossary", //$NON-NLS-1$ - "Copyright", //$NON-NLS-1$ - "Chapter", //$NON-NLS-1$ - "Section", //$NON-NLS-1$ - "Subsection", //$NON-NLS-1$ - "Appendix", //$NON-NLS-1$ - "Help", //$NON-NLS-1$ - "Bookmark" //$NON-NLS-1$ - }; - - - @Override - protected String getReturnType() { - return "java.lang.String"; //$NON-NLS-1$ - } - - public List getPossibleValues() { - List ret = new ArrayList(); - for(int i=0;i<_linkTypes.length;i++){ - PossibleValue pv = new PossibleValue(_linkTypes[i].toString(), _linkTypes[i].toString()); - ret.add(pv); - } - return ret; - } - - public boolean isValidValue(String value) { - if (value == null || value.trim().length() == 0){ - addNewValidationMessage(Messages.LinkType_16); - return false; - } - return true; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LocaleType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LocaleType.java deleted file mode 100644 index 29607ca36..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LocaleType.java +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation., and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * Vadim Dmitriev - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.List; -import java.util.Locale; - -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue; -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; -import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage; - -/** - * Meta-data processing type representing a Locale Code type. - * - * <p><b>Provisional API - subject to change</b></p> - * - */ - -public class LocaleType extends MultiSignatureEnumerationType implements IPossibleValues, IValidValues, IValidELValues{ - private List<IPossibleValue> _pvs; - @Override - protected String[] getReturnTypes() { - return new String[]{"java.util.Locale", "java.lang.String"}; //$NON-NLS-1$ //$NON-NLS-2$ - } - - public List getPossibleValues() { - if (_pvs == null){ - _pvs = new ArrayList(); - Locale[]_locales = getLocales(); - for(int i=0;i<_locales.length;i++){ - PossibleValue pv = new PossibleValue(_locales[i].toString(), _locales[i].getDisplayName()); - _pvs.add(pv); - } - Collections.sort(_pvs, new Comparator(){ - public int compare(Object o1, Object o2) { - PossibleValue pv1 = (PossibleValue)o1; - PossibleValue pv2 = (PossibleValue)o2; - return (pv1.getDisplayValue().compareTo(pv2.getDisplayValue())); - } - - }); - } - return _pvs; - } - - private Locale[] getLocales() { - return Locale.getAvailableLocales(); - } - - public boolean isValidValue(String value) { - Locale[]_locales = getLocales(); - for(int i=0;i<_locales.length;i++){ - Locale local = getLocales()[i]; - if (local.toString().equals(value)) - return true; - } - getValidationMessages().add(new ValidationMessage(Messages.LocaleType_1)); - return false; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LongType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LongType.java deleted file mode 100644 index a7791e974..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/LongType.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.List; - -import org.eclipse.osgi.util.NLS; - -/** - * Meta-data processing type representing a long attribute value runtime type - * that implements IValidValues, IDefaultValue, IValidELValues - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public class LongType extends NumberType { - private static final String INVALID_LONG = Messages.LongType_invalid_long; - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType() - */ - protected String getReturnType(){ return "long";} //$NON-NLS-1$ - - /** - * Type coercion according to JSP 2.0 spec: JSP.1.14.2.1 Conversions from String values - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - **/ - public boolean isValidValue(String value) { - try { - Long aLong = Long.valueOf(value); - exceedsMaxValue(aLong.longValue()); - lessThanMinValue(aLong.longValue()); - if (!(minFound || maxFound)){ - List validVals = getMDValidValues(); - if (!validVals.isEmpty()){ - if (!validVals.contains(value)){ - addNewValidationMessage(Messages.LongType_invalid_member); - } - } - } - return getValidationMessages().isEmpty(); - } catch (NumberFormatException e) { - addNewValidationMessage(INVALID_LONG); - return false; - } - - } - - private void exceedsMaxValue(long aLong) { - String strMax = getValidMaximumValue(); - if (strMax != null){ - try { - long max = Long.valueOf(strMax).longValue(); - maxFound = true; - if (aLong > max){ - addNewValidationMessage(NLS.bind(EXCEEDS_MAX, strMax)); - } - } catch (NumberFormatException e) { - //TODO: ignore error???? or log it???? - } - } - - } - - private void lessThanMinValue(long aLong) { - String strMin = getValidMinimumValue(); - if (strMin != null){ - try { - long min = Long.valueOf(strMin).longValue(); - minFound = true; - if (aLong < min){ - addNewValidationMessage(NLS.bind(LESS_THAN_MIN, strMin)); - } - } catch (NumberFormatException e) { - //TODO: ignore error???? or log it???? - } - } - - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/Messages.java deleted file mode 100644 index 447ef788f..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/Messages.java +++ /dev/null @@ -1,1101 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import org.eclipse.osgi.util.NLS; - -/** - * Message bundle for attributevalue types/features - * - * <p> - * <b>Provisional API - subject to change</b> - * </p> - */ -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.taglibprocessing.attributevalues.messages"; //$NON-NLS-1$ - static { - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - /** - * see messages.properties - */ - public static String ActionType_navcase_display; - /** - * see messages.properties - */ - public static String ActionType_invalid_value; - /** - * see messages.properties - */ - public static String ActionType_invalid_empty_value; - /** - * see messages.properties - */ - public static String BooleanType_invalid_values; - /** - * see messages.properties - */ - public static String ContentType_MIME_not_empty; - /** - * see messages.properties - */ - public static String ComponentBindingType_invalid_value; - /** - * see messages.properties - */ - public static String ComponentIDType_invalid_as_el; - /** - * see messages.properties - */ - public static String ComponentIDType_invalid_value; - /** - * see messages.properties - */ - public static String DoubleType_invalid_double; - /** - * see messages.properties - */ - public static String DoubleType_invalid_member; - /** - * see messages.properties - */ - public static String FacesConfigConverterIDFeatures_converterid_empty; - /** - * see messages.properties - */ - public static String FacesConfigIdentifierType_invalid_converter_id; - /** - * see messages.properties - */ - public static String FacesConfigIdentifierType_invalid_validator_id; - /** - * see messages.properties - */ - public static String FacesConfigValidatorIDFeatures_validatorid_empty; - /** - * see messages.properties - */ - public static String IntegerType_invalid_integer; - /** - * see messages.properties - */ - public static String IntegerType_invalid_member; - /** - * see messages.properties - */ - public static String JavaClassType_invalid_type; - /** - * see messages.properties - */ - public static String JavaClassType_not_found; - /** - * see messages.properties - */ - public static String LongType_invalid_long; - /** - * see messages.properties - */ - public static String LongType_invalid_member; - /** - * see messages.properties - */ - public static String MethodBindingType_invalid_value; - /** - * see messages.properties - */ - public static String CurrencyCodeType_invalid; - /** - * see messages.properties - */ - public static String CurrencyCodeType_10; - /** - * see messages.properties - */ - public static String CurrencyCodeType_100; - /** - * see messages.properties - */ - public static String CurrencyCodeType_101; - /** - * see messages.properties - */ - public static String CurrencyCodeType_102; - /** - * see messages.properties - */ - public static String CurrencyCodeType_103; - /** - * see messages.properties - */ - public static String CurrencyCodeType_104; - /** - * see messages.properties - */ - public static String CurrencyCodeType_105; - /** - * see messages.properties - */ - public static String CurrencyCodeType_106; - /** - * see messages.properties - */ - public static String CurrencyCodeType_107; - /** - * see messages.properties - */ - public static String CurrencyCodeType_108; - /** - * see messages.properties - */ - public static String CurrencyCodeType_109; - /** - * see messages.properties - */ - public static String CurrencyCodeType_11; - /** - * see messages.properties - */ - public static String CurrencyCodeType_110; - /** - * see messages.properties - */ - public static String CurrencyCodeType_111; - /** - * see messages.properties - */ - public static String CurrencyCodeType_112; - /** - * see messages.properties - */ - public static String CurrencyCodeType_113; - /** - * see messages.properties - */ - public static String CurrencyCodeType_114; - /** - * see messages.properties - */ - public static String CurrencyCodeType_115; - /** - * see messages.properties - */ - public static String CurrencyCodeType_116; - /** - * see messages.properties - */ - public static String CurrencyCodeType_117; - /** - * see messages.properties - */ - public static String CurrencyCodeType_118; - /** - * see messages.properties - */ - public static String CurrencyCodeType_119; - /** - * see messages.properties - */ - public static String CurrencyCodeType_12; - /** - * see messages.properties - */ - public static String CurrencyCodeType_120; - /** - * see messages.properties - */ - public static String CurrencyCodeType_121; - /** - * see messages.properties - */ - public static String CurrencyCodeType_122; - /** - * see messages.properties - */ - public static String CurrencyCodeType_123; - /** - * see messages.properties - */ - public static String CurrencyCodeType_124; - /** - * see messages.properties - */ - public static String CurrencyCodeType_125; - /** - * see messages.properties - */ - public static String CurrencyCodeType_126; - /** - * see messages.properties - */ - public static String CurrencyCodeType_127; - /** - * see messages.properties - */ - public static String CurrencyCodeType_128; - /** - * see messages.properties - */ - public static String CurrencyCodeType_129; - /** - * see messages.properties - */ - public static String CurrencyCodeType_13; - /** - * see messages.properties - */ - public static String CurrencyCodeType_130; - /** - * see messages.properties - */ - public static String CurrencyCodeType_131; - /** - * see messages.properties - */ - public static String CurrencyCodeType_132; - /** - * see messages.properties - */ - public static String CurrencyCodeType_133; - /** - * see messages.properties - */ - public static String CurrencyCodeType_134; - /** - * see messages.properties - */ - public static String CurrencyCodeType_135; - /** - * see messages.properties - */ - public static String CurrencyCodeType_136; - /** - * see messages.properties - */ - public static String CurrencyCodeType_137; - /** - * see messages.properties - */ - public static String CurrencyCodeType_138; - /** - * see messages.properties - */ - public static String CurrencyCodeType_139; - /** - * see messages.properties - */ - public static String CurrencyCodeType_14; - /** - * see messages.properties - */ - public static String CurrencyCodeType_140; - /** - * see messages.properties - */ - public static String CurrencyCodeType_141; - /** - * see messages.properties - */ - public static String CurrencyCodeType_142; - /** - * see messages.properties - */ - public static String CurrencyCodeType_143; - /** - * see messages.properties - */ - public static String CurrencyCodeType_144; - /** - * see messages.properties - */ - public static String CurrencyCodeType_145; - /** - * see messages.properties - */ - public static String CurrencyCodeType_146; - /** - * see messages.properties - */ - public static String CurrencyCodeType_147; - /** - * see messages.properties - */ - public static String CurrencyCodeType_148; - /** - * see messages.properties - */ - public static String CurrencyCodeType_149; - /** - * see messages.properties - */ - public static String CurrencyCodeType_15; - /** - * see messages.properties - */ - public static String CurrencyCodeType_150; - /** - * see messages.properties - */ - public static String CurrencyCodeType_151; - /** - * see messages.properties - */ - public static String CurrencyCodeType_152; - /** - * see messages.properties - */ - public static String CurrencyCodeType_153; - /** - * see messages.properties - */ - public static String CurrencyCodeType_154; - /** - * see messages.properties - */ - public static String CurrencyCodeType_155; - /** - * see messages.properties - */ - public static String CurrencyCodeType_156; - /** - * see messages.properties - */ - public static String CurrencyCodeType_157; - /** - * see messages.properties - */ - public static String CurrencyCodeType_158; - /** - * see messages.properties - */ - public static String CurrencyCodeType_159; - /** - * see messages.properties - */ - public static String CurrencyCodeType_16; - /** - * see messages.properties - */ - public static String CurrencyCodeType_160; - /** - * see messages.properties - */ - public static String CurrencyCodeType_161; - /** - * see messages.properties - */ - public static String CurrencyCodeType_162; - /** - * see messages.properties - */ - public static String CurrencyCodeType_163; - /** - * see messages.properties - */ - public static String CurrencyCodeType_164; - /** - * see messages.properties - */ - public static String CurrencyCodeType_165; - /** - * see messages.properties - */ - public static String CurrencyCodeType_166; - /** - * see messages.properties - */ - public static String CurrencyCodeType_167; - /** - * see messages.properties - */ - public static String CurrencyCodeType_168; - /** - * see messages.properties - */ - public static String CurrencyCodeType_169; - /** - * see messages.properties - */ - public static String CurrencyCodeType_17; - /** - * see messages.properties - */ - public static String CurrencyCodeType_170; - /** - * see messages.properties - */ - public static String CurrencyCodeType_171; - /** - * see messages.properties - */ - public static String CurrencyCodeType_172; - /** - * see messages.properties - */ - public static String CurrencyCodeType_173; - /** - * see messages.properties - */ - public static String CurrencyCodeType_174; - /** - * see messages.properties - */ - public static String CurrencyCodeType_18; - /** - * see messages.properties - */ - public static String CurrencyCodeType_19; - /** - * see messages.properties - */ - public static String CharacterType_0; - /** - * see messages.properties - */ - public static String CurrencyCodeType_2; - /** - * see messages.properties - */ - public static String CurrencyCodeType_20; - /** - * see messages.properties - */ - public static String CurrencyCodeType_21; - /** - * see messages.properties - */ - public static String CurrencyCodeType_22; - /** - * see messages.properties - */ - public static String CurrencyCodeType_23; - /** - * see messages.properties - */ - public static String CurrencyCodeType_24; - /** - * see messages.properties - */ - public static String CurrencyCodeType_25; - /** - * see messages.properties - */ - public static String CurrencyCodeType_26; - /** - * see messages.properties - */ - public static String CurrencyCodeType_27; - /** - * see messages.properties - */ - public static String CurrencyCodeType_28; - /** - * see messages.properties - */ - public static String CurrencyCodeType_29; - /** - * see messages.properties - */ - public static String CurrencyCodeType_3; - /** - * see messages.properties - */ - public static String CurrencyCodeType_30; - /** - * see messages.properties - */ - public static String CurrencyCodeType_31; - /** - * see messages.properties - */ - public static String CurrencyCodeType_32; - /** - * see messages.properties - */ - public static String CurrencyCodeType_33; - /** - * see messages.properties - */ - public static String CurrencyCodeType_34; - /** - * see messages.properties - */ - public static String CurrencyCodeType_35; - /** - * see messages.properties - */ - public static String CurrencyCodeType_36; - /** - * see messages.properties - */ - public static String CurrencyCodeType_37; - /** - * see messages.properties - */ - public static String CurrencyCodeType_38; - /** - * see messages.properties - */ - public static String CurrencyCodeType_39; - /** - * see messages.properties - */ - public static String CurrencyCodeType_4; - /** - * see messages.properties - */ - public static String CurrencyCodeType_40; - /** - * see messages.properties - */ - public static String CurrencyCodeType_41; - /** - * see messages.properties - */ - public static String CurrencyCodeType_42; - /** - * see messages.properties - */ - public static String CurrencyCodeType_43; - /** - * see messages.properties - */ - public static String CurrencyCodeType_44; - /** - * see messages.properties - */ - public static String CurrencyCodeType_45; - /** - * see messages.properties - */ - public static String CurrencyCodeType_46; - /** - * see messages.properties - */ - public static String CurrencyCodeType_47; - /** - * see messages.properties - */ - public static String CurrencyCodeType_48; - /** - * see messages.properties - */ - public static String CurrencyCodeType_49; - /** - * see messages.properties - */ - public static String CurrencyCodeType_5; - /** - * see messages.properties - */ - public static String CurrencyCodeType_50; - /** - * see messages.properties - */ - public static String CurrencyCodeType_51; - /** - * see messages.properties - */ - public static String CurrencyCodeType_52; - /** - * see messages.properties - */ - public static String CurrencyCodeType_53; - /** - * see messages.properties - */ - public static String CurrencyCodeType_54; - /** - * see messages.properties - */ - public static String CurrencyCodeType_55; - /** - * see messages.properties - */ - public static String CurrencyCodeType_56; - /** - * see messages.properties - */ - public static String CurrencyCodeType_57; - /** - * see messages.properties - */ - public static String CurrencyCodeType_58; - /** - * see messages.properties - */ - public static String CurrencyCodeType_59; - /** - * see messages.properties - */ - public static String CurrencyCodeType_6; - /** - * see messages.properties - */ - public static String CurrencyCodeType_60; - /** - * see messages.properties - */ - public static String CurrencyCodeType_61; - /** - * see messages.properties - */ - public static String CurrencyCodeType_62; - /** - * see messages.properties - */ - public static String CurrencyCodeType_63; - /** - * see messages.properties - */ - public static String CurrencyCodeType_64; - /** - * see messages.properties - */ - public static String CurrencyCodeType_65; - /** - * see messages.properties - */ - public static String CurrencyCodeType_66; - /** - * see messages.properties - */ - public static String CurrencyCodeType_67; - /** - * see messages.properties - */ - public static String CurrencyCodeType_68; - /** - * see messages.properties - */ - public static String CurrencyCodeType_69; - /** - * see messages.properties - */ - public static String CurrencyCodeType_7; - /** - * see messages.properties - */ - public static String CurrencyCodeType_70; - /** - * see messages.properties - */ - public static String CurrencyCodeType_71; - /** - * see messages.properties - */ - public static String CurrencyCodeType_72; - /** - * see messages.properties - */ - public static String CurrencyCodeType_73; - /** - * see messages.properties - */ - public static String CurrencyCodeType_74; - /** - * see messages.properties - */ - public static String CurrencyCodeType_75; - /** - * see messages.properties - */ - public static String CurrencyCodeType_76; - /** - * see messages.properties - */ - public static String CurrencyCodeType_77; - /** - * see messages.properties - */ - public static String CurrencyCodeType_78; - /** - * see messages.properties - */ - public static String CurrencyCodeType_79; - /** - * see messages.properties - */ - public static String CurrencyCodeType_8; - /** - * see messages.properties - */ - public static String CurrencyCodeType_80; - /** - * see messages.properties - */ - public static String CurrencyCodeType_81; - /** - * see messages.properties - */ - public static String CurrencyCodeType_82; - /** - * see messages.properties - */ - public static String CurrencyCodeType_83; - /** - * see messages.properties - */ - public static String CurrencyCodeType_84; - /** - * see messages.properties - */ - public static String CurrencyCodeType_85; - /** - * see messages.properties - */ - public static String CurrencyCodeType_86; - /** - * see messages.properties - */ - public static String CurrencyCodeType_87; - /** - * see messages.properties - */ - public static String CurrencyCodeType_88; - /** - * see messages.properties - */ - public static String CurrencyCodeType_89; - /** - * see messages.properties - */ - public static String CurrencyCodeType_9; - /** - * see messages.properties - */ - public static String LanguageCodeType_0; - /** - * see messages.properties - */ - public static String LanguageCodeType_1; - /** - * see messages.properties - */ - public static String LanguageCodeType_7; - /** - * see messages.properties - */ - public static String LanguageCodeType_9; - /** - * see messages.properties - */ - public static String LinkType_16; - /** - * see messages.properties - */ - public static String LocaleType_1; - /** - * see messages.properties - */ - public static String WebPathType_1; - /** - * see messages.properties - */ - public static String WebPathType_2; - /** - * see messages.properties - */ - public static String LanguageCodeType_11; - /** - * see messages.properties - */ - public static String LanguageCodeType_13; - /** - * see messages.properties - */ - public static String LanguageCodeType_15; - /** - * see messages.properties - */ - public static String LanguageCodeType_17; - /** - * see messages.properties - */ - public static String LanguageCodeType_19; - /** - * see messages.properties - */ - public static String LanguageCodeType_21; - /** - * see messages.properties - */ - public static String LanguageCodeType_23; - /** - * see messages.properties - */ - public static String LanguageCodeType_25; - /** - * see messages.properties - */ - public static String LanguageCodeType_27; - /** - * see messages.properties - */ - public static String LanguageCodeType_29; - /** - * see messages.properties - */ - public static String LanguageCodeType_31; - /** - * see messages.properties - */ - public static String LanguageCodeType_33; - /** - * see messages.properties - */ - public static String LanguageCodeType_35; - /** - * see messages.properties - */ - public static String LanguageCodeType_37; - /** - * see messages.properties - */ - public static String LanguageCodeType_39; - /** - * see messages.properties - */ - public static String LanguageCodeType_41; - /** - * see messages.properties - */ - public static String LanguageCodeType_43; - /** - * see messages.properties - */ - public static String LanguageCodeType_45; - /** - * see messages.properties - */ - public static String LanguageCodeType_47; - /** - * see messages.properties - */ - public static String LanguageCodeType_49; - /** - * see messages.properties - */ - public static String LanguageCodeType_51; - /** - * see messages.properties - */ - public static String LanguageCodeType_53; - /** - * see messages.properties - */ - public static String LanguageCodeType_55; - /** - * see messages.properties - */ - public static String LanguageCodeType_57; - /** - * see messages.properties - */ - public static String LanguageCodeType_59; - /** - * see messages.properties - */ - public static String LanguageCodeType_61; - /** - * see messages.properties - */ - public static String LanguageCodeType_63; - /** - * see messages.properties - */ - public static String LanguageCodeType_65; - /** - * see messages.properties - */ - public static String LanguageCodeType_67; - /** - * see messages.properties - */ - public static String LanguageCodeType_69; - /** - * see messages.properties - */ - public static String LanguageCodeType_71; - /** - * see messages.properties - */ - public static String LanguageCodeType_73; - /** - * see messages.properties - */ - public static String LanguageCodeType_75; - /** - * see messages.properties - */ - public static String LanguageCodeType_77; - /** - * see messages.properties - */ - public static String LanguageCodeType_79; - /** - * see messages.properties - */ - public static String LanguageCodeType_81; - /** - * see messages.properties - */ - public static String LanguageCodeType_83; - /** - * see messages.properties - */ - public static String LanguageCodeType_85; - /** - * see messages.properties - */ - public static String LanguageCodeType_87; - /** - * see messages.properties - */ - public static String LanguageCodeType_89; - /** - * see messages.properties - */ - public static String LanguageCodeType_91; - /** - * see messages.properties - */ - public static String LanguageCodeType_93; - /** - * see messages.properties - */ - public static String LanguageCodeType_95; - /** - * see messages.properties - */ - public static String LanguageCodeType_97; - /** - * see messages.properties - */ - public static String LanguageCodeType_99; - /** - * see messages.properties - */ - public static String LanguageCodeType_101; - /** - * see messages.properties - */ - public static String LanguageCodeType_103; - /** - * see messages.properties - */ - public static String LanguageCodeType_105; - /** - * see messages.properties - */ - public static String LanguageCodeType_107; - /** - * see messages.properties - */ - public static String LanguageCodeType_109; - /** - * see messages.properties - */ - public static String LanguageCodeType_111; - /** - * see messages.properties - */ - public static String LanguageCodeType_113; - /** - * see messages.properties - */ - public static String LanguageCodeType_115; - /** - * see messages.properties - */ - public static String LanguageCodeType_117; - /** - * see messages.properties - */ - public static String LanguageCodeType_118; - /** - * see messages.properties - */ - public static String CurrencyCodeType_90; - /** - * see messages.properties - */ - public static String CurrencyCodeType_91; - /** - * see messages.properties - */ - public static String CurrencyCodeType_92; - /** - * see messages.properties - */ - public static String CurrencyCodeType_93; - /** - * see messages.properties - */ - public static String CurrencyCodeType_94; - /** - * see messages.properties - */ - public static String CurrencyCodeType_95; - /** - * see messages.properties - */ - public static String CurrencyCodeType_96; - /** - * see messages.properties - */ - public static String CurrencyCodeType_97; - /** - * see messages.properties - */ - public static String CurrencyCodeType_98; - /** - * see messages.properties - */ - public static String CurrencyCodeType_99; - /** - * see messages.properties - */ - public static String NumberType_max_val; - /** - * see messages.properties - */ - public static String NumberType_min_val; - /** - * see messages.properties - */ - public static String RelativePathType_0; - /** - * see messages.properties - */ - public static String StringType_invalid_value; - /** - * see messages.properties - */ - public static String ValueType_invalid_value; - /** - * see messages.properties - */ - public static String ValueType_invalid_value_without_setter; - /** - * see messages.properties - */ - public static String LengthType_invalid_integer; - /** - * see messages.properties - */ - public static String ColorType_invalid_color; - - /** - * see messages.properties - */ - public static String Bundle_not_found_rb; -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/MethodBindingType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/MethodBindingType.java deleted file mode 100644 index 3409958d5..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/MethodBindingType.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jdt.core.Signature; -import org.eclipse.jst.jsf.common.internal.types.CompositeType; -import org.eclipse.jst.jsf.common.internal.types.IAssignable; -import org.eclipse.jst.jsf.core.internal.JSFCorePlugin; -import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage; -import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage; - -/** - * Meta-data processing type representing an method-binding attribute value runtime type - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public class MethodBindingType extends ExpressionBindingType implements IValidELValues, IValidValues{ - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues#getExpectedRuntimeType() - */ - public CompositeType getExpectedRuntimeType() throws ELIsNotValidException { - String[] params = getParams(); - - // need to "signaturize" each parameter - for (int param = 0; param < params.length; param++) - { - params[param] = Signature.createTypeSignature(params[param],true); - } - final String runtimeType = getReturnType(); - - String returnTypeSignature = null; - - if (runtimeType != null) - { - returnTypeSignature = Signature.createTypeSignature(runtimeType, true); - } - else - { - JSFCorePlugin.log(IStatus.INFO, "Missing metadata for trait "+RUNTIME_RETURN_TYPE+" for entity "+getMetaDataContext().getEntity()); //$NON-NLS-1$ //$NON-NLS-2$ - } - - if (returnTypeSignature == null) - { - return null; - } - - String methodSig = Signature.createMethodSignature(params, returnTypeSignature); - return new CompositeType(methodSig, IAssignable.ASSIGNMENT_TYPE_NONE); - } - - /** - * Non-EL values are invalid for method bound attribute values - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - */ - public boolean isValidValue(String value) { - //if this is being called, we are being called in an non-EL context which is invalid. - IValidationMessage msg = new ValidationMessage(Messages.MethodBindingType_invalid_value); - getValidationMessages().add(msg); - return false; - } - - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/MultiSignatureEnumerationType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/MultiSignatureEnumerationType.java deleted file mode 100644 index 5b84c4b03..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/MultiSignatureEnumerationType.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Vadim Dmitriev and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vadim Dmitriev - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import org.eclipse.jdt.core.Signature; -import org.eclipse.jst.jsf.common.internal.types.CompositeType; -import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException; - -/** - * Abstract meta-data processing type representing an enumeration attribute value - * of multiple runtime types - * - * @author Vadim Dmitriev - */ -public abstract class MultiSignatureEnumerationType extends AbstractEnumerationType { - - /** - * @return return Java types as array of strings (i.e. - * new String[]{"boolean", "java.lang.String"}, etc.) - * Must not be null. - */ - protected abstract String[] getReturnTypes(); - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues#getExpectedRuntimeType() - */ - public CompositeType getExpectedRuntimeType() throws ELIsNotValidException { - String[] types = getReturnTypes(); - int len = types.length; - - String[] signaturedTypes = new String[ len ]; - for( int i = 0; i < len; i++ ) - { - signaturedTypes[ i ] = Signature.createTypeSignature(types[ i ], true); - } - return new CompositeType( signaturedTypes, getAssignmentType()); - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/NumberPatternType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/NumberPatternType.java deleted file mode 100644 index b5add42cb..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/NumberPatternType.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation., and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor; -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; - -/** - * Meta-data processing type representing a numeric pattern type. - * - * <p><b>Provisional API - subject to change</b></p> - * - */ - -public class NumberPatternType extends AbstractRootTypeDescriptor implements IPossibleValues{ - //should we ever decide to validate the patterns, extend EnumerationType - final private static String[] PATTERNS = { - "0.00", //$NON-NLS-1$ - "#,##0", //$NON-NLS-1$ - "#,##0.00", //$NON-NLS-1$ - "#,##0;(#,##0)", //$NON-NLS-1$ - "#,##0.00;(#,##0.00)", //$NON-NLS-1$ - "0.##E0", //$NON-NLS-1$ - "0%", //$NON-NLS-1$ - "0.00%" //$NON-NLS-1$ - }; - - public List getPossibleValues() { - List ret = new ArrayList(); - for (int i=0;i<PATTERNS.length;i++){ - ret.add(new PossibleValue(PATTERNS[i])); - } - return ret; - } - - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/NumberType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/NumberType.java deleted file mode 100644 index 4ee78b9c8..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/NumberType.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; - -/** - * Abstract meta-data processing type representing a numeric attribute value runtime type - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public abstract class NumberType extends EnumerationType{ - /** - * flag indicating max value metadata was found - */ - protected boolean maxFound = false; - /** - * flag indicating min value metadata was found - */ - protected boolean minFound = false; - - /** - * Validation message when value has exceeded maximum - */ - protected String EXCEEDS_MAX = Messages.NumberType_max_val; - /** - * Validation message when value is less than minimum - */ - protected String LESS_THAN_MIN = Messages.NumberType_min_val; - - /** - * @return maximum value from property named IValidValues.VALID_VALUES_MAX_PROP_NAME - */ - protected String getValidMaximumValue(){ - return getTraitValueAsString(IValidValues.VALID_VALUES_MAX_PROP_NAME); - } - - /** - * @return minimum value from property named IValidValues.VALID_VALUES_MIN_PROP_NAME - */ - protected String getValidMinimumValue(){ - return getTraitValueAsString(IValidValues.VALID_VALUES_MIN_PROP_NAME); - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ObjectType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ObjectType.java deleted file mode 100644 index 07120d4a6..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ObjectType.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -/** - * Abstract meta-data processing type representing an Object attribute value runtime type - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public abstract class ObjectType extends DirectBindingType { - // TODO: ???? -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/PathType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/PathType.java deleted file mode 100644 index 5f4f31142..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/PathType.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory; -import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver; -import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidationMessage; - -/** - * EXPERIMENTAL - may change or dissappear - * - */ -public abstract class PathType extends AbstractRootTypeDescriptor { - - private IProject _project = null; - private final List<IValidationMessage> _validationMsgs = new ArrayList<IValidationMessage>(1); - - /** - * Constructor - */ - public PathType() { - super(); - } - - /** - * @return IProject - */ - protected IProject getProject() { - if( _project == null ) - { - final IWorkspaceContextResolver wkspaceResolver = - IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver( getStructuredDocumentContext() ); - _project = wkspaceResolver.getProject(); - } - - return _project; - } - - /** - * @return list of {@link IValidationMessage} - */ - public List<IValidationMessage> getValidationMessages() { - return _validationMsgs; - } - -}
\ No newline at end of file diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/RelativePathType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/RelativePathType.java deleted file mode 100644 index 82dd38068..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/RelativePathType.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.net.MalformedURLException; -import java.net.URL; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage; - -/** - * Path is relative to project - * <b>EXPERIMENTAL</b> - may change or dissappear - * - */ -public class RelativePathType extends PathType implements - IMetaDataEnabledFeature, IValidValues{ - - public boolean isValidValue(String value) { - //is this a relative path, or absolute url? - try { - new URL(value); - //not much else we what to do for now - return true; - } catch (MalformedURLException e) { - //is this a valid path relative to the - IProject project = getProject(); - IFile file= project.getFile(new Path(value)); - if (! file.exists()) - getValidationMessages().add(new ValidationMessage( value+Messages.RelativePathType_0)); - - return getValidationMessages().size() == 0; - } - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ResourceBundleType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ResourceBundleType.java deleted file mode 100644 index 65f2fc973..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ResourceBundleType.java +++ /dev/null @@ -1,57 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Vadim Dmitriev - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.text.MessageFormat; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jst.jsf.core.internal.tld.LoadBundleUtil; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage; - -/** - * Meta-data processing type representing a path to resource bundle on classpath - * Patch by Vadim Dmitriev. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=203307. - * - * <p><b>Provisional API - subject to change</b></p> - * - * @author Vadim Dmitriev - * - * - */ -public class ResourceBundleType extends PathType implements IValidValues -{ - public boolean isValidValue( String value ) - { - try - { - IProject project = getProject(); - IStorage bundle = LoadBundleUtil.getLoadBundleResource( project , value ); - if( bundle != null ) - { - return true; - } - } - catch (CoreException e) - { - //error message is generated later - } - - final String message = - MessageFormat.format(Messages.Bundle_not_found_rb, value); - getValidationMessages().add(new ValidationMessage(message, "", IStatus.ERROR)); //$NON-NLS-1$ - return false; - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ScriptType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ScriptType.java deleted file mode 100644 index 9df83d411..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ScriptType.java +++ /dev/null @@ -1,22 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import org.eclipse.jst.jsf.metadataprocessors.AbstractRootTypeDescriptor; - -/** - * Represents script type - * <p><b>Provisional API - subject to change</b></p> - */ -public class ScriptType extends AbstractRootTypeDescriptor { -// -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/StringType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/StringType.java deleted file mode 100644 index fa8f3af84..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/StringType.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jst.jsf.metadataprocessors.features.IDefaultValue; -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; - -/** - * Meta-data processing type representing a String attribute value runtime type - * that implements IPossibleValues, IValidValues and IDefaultValues - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public class StringType extends EnumerationType implements IValidValues, - IPossibleValues, IDefaultValue { - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.taglibprocessing.attributevalues.EnumerationType#getReturnType() - */ - protected String getReturnType(){ return "java.lang.String";} //$NON-NLS-1$ - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - */ - public boolean isValidValue(String value) { - List vals = getMDValidValues(); - if (vals.isEmpty()) - return true; - - //if the value is empty but there is a default value, consider it valid - if (getDefaultValue() != null && (value == null || value.trim().equals(""))) //$NON-NLS-1$ - return true; - - if(! vals.contains(value)){ - addNewValidationMessage(Messages.StringType_invalid_value); - } - return getValidationMessages().isEmpty(); - } - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues#getPossibleValues() - */ - public List getPossibleValues() { - List pvs = getMDPossibleValues(); - if (pvs.isEmpty()) - return EMPTY_LIST; - - List pdvs = getMDPossibleValuesForDisplay(); - - //if there are no display vals or the meta-data list sizes are different, use the values list for display also - if (pdvs.isEmpty() || pvs.size() != pdvs.size()) - pdvs = pvs; - - ImageDescriptor icon = getImage(); - - String defaultValue = getDefaultValue(); - List ret = new ArrayList(pvs.size()); - for(int i=0;i<pvs.size();i++){ - PossibleValue pv = new PossibleValue((String)pvs.get(i), (String)pdvs.get(i)); - pv.setIcon(icon); - pv.setIsDefault(((String)pvs.get(i)).equals(defaultValue)); - ret.add(pv); - } - return ret; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/TimeZoneType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/TimeZoneType.java deleted file mode 100644 index 56af13dc8..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/TimeZoneType.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation., and others - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.util.ArrayList; -import java.util.List; -import java.util.TimeZone; - -import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.PossibleValue; - -/** - * Meta-data processing type representing a TimeZone Code type. - * - * <p><b>Provisional API - subject to change</b></p> - * - */ - -public class TimeZoneType extends EnumerationType implements IPossibleValues, IValidValues{ - private String[] _timezones; - - @Override - protected String getReturnType() { - return "java.lang.String"; //$NON-NLS-1$ - } - - public List getPossibleValues() { - List ret = new ArrayList(); - for(int i=0;i<getTimeZones().length;i++){ - PossibleValue pv = new PossibleValue(_timezones[i], _timezones[i]); - ret.add(pv); - } - return ret; - } - - private String[] getTimeZones() { - if (_timezones == null) - _timezones = TimeZone.getAvailableIDs(); - return _timezones; - } - - public boolean isValidValue(String value) { - for(int i=0;i<getTimeZones().length;i++){ - if (getTimeZones()[i].equals(value)) - return true; - } - return false; - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/URIType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/URIType.java deleted file mode 100644 index 889959be5..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/URIType.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature; - -/** - * URI Type: attribute values are Uniform Resource Identifiers (URIs), as defined in RFC 2396. - * URI attribute values may include full URIs such as http://www.foobar.com/ as well as relative URIs such as foo.html and ../foo/. - * EXPERIMENTAL - will change or dissappear - */ -public class URIType extends PathType implements IMetaDataEnabledFeature{ - //TODO: add validation... refactor or WebPath, RelativePath, etc. - - /** - * Constructor - */ - public URIType() { - // - } - -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ValueBindingType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ValueBindingType.java deleted file mode 100644 index ef9c45535..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ValueBindingType.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import org.eclipse.jdt.core.Signature; -import org.eclipse.jst.jsf.common.internal.types.CompositeType; -import org.eclipse.jst.jsf.common.internal.types.IAssignable; -import org.eclipse.jst.jsf.metadataprocessors.features.ELIsNotValidException; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues; - -/** - * Meta-data processing type representing a Value Bound attribute value runtime type - * that implements IValidValues - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public class ValueBindingType extends ExpressionBindingType implements IValidELValues{ - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues#getExpectedRuntimeType() - */ - public CompositeType getExpectedRuntimeType() throws ELIsNotValidException { - String returnType = getReturnType(); - if (returnType == null) - return null; - - String methodSig = Signature.createTypeSignature(returnType, true); - return new CompositeType(methodSig, getAssignmentValue()); - } - - /** - * @return {@link IAssignable}.LHS or {@link IAssignable}.RHS - */ - protected int getAssignmentValue(){ - return (getIsSetValueRequired() ? IAssignable.ASSIGNMENT_TYPE_LHS : 0) | IAssignable.ASSIGNMENT_TYPE_RHS; - - } - - /** - * @return is runtime setter required? - */ - protected boolean getIsSetValueRequired(){ - String value = getTraitValueAsString(RUNTIME_SETTER_REQUIRED); - if (value == null || value.trim().length() == 0) - return false; - else if (value.trim().equals("true")) //$NON-NLS-1$ - return true; - else - return false; - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ValueType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ValueType.java deleted file mode 100644 index 7c03faef2..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/ValueType.java +++ /dev/null @@ -1,34 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - - -import org.eclipse.jst.jsf.metadataprocessors.features.IValidELValues; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; - -/** - * Meta-data processing type representing a "value" attribute - * that implements IValidValues and IValidELValues - * - * <p><b>Provisional API - subject to change</b></p> - * @author Gerry Kessler - Oracle - */ -public class ValueType extends ValueBindingType implements IValidValues, IValidELValues { - - /* (non-Javadoc) - * @see org.eclipse.jst.jsf.metadataprocessors.features.IValidValues#isValidValue(java.lang.String) - */ - public boolean isValidValue(String value){ - //value can be a string or a value binding expression - return true; - } -} diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/WebPathType.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/WebPathType.java deleted file mode 100644 index c1c8c0dc4..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/WebPathType.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - * - ********************************************************************************/ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; - -import java.net.MalformedURLException; -import java.net.URL; - -import org.eclipse.core.runtime.Path; -import org.eclipse.jst.jsf.metadataprocessors.IMetaDataEnabledFeature; -import org.eclipse.jst.jsf.metadataprocessors.features.IValidValues; -import org.eclipse.jst.jsf.metadataprocessors.features.ValidationMessage; -import org.eclipse.wst.common.componentcore.ComponentCore; -import org.eclipse.wst.common.componentcore.resources.IVirtualContainer; -import org.eclipse.wst.common.componentcore.resources.IVirtualFile; - -/** - * Path relative to web root - * <b>EXPERIMENTAL</b> - may change or dissappear - * - */ -public class WebPathType extends PathType implements - IMetaDataEnabledFeature, IValidValues{ - - public boolean isValidValue(String value) { - //is this a relative path, or absolute url? - try { - URL url = new URL(value); - //if file protocol, see if it is valid? Otherwise assume ok. - if (url.getProtocol().equals("file")){ //$NON-NLS-1$ - validateFileRelativeToWebRoot(url.getPath()); - } - } catch (MalformedURLException e) { - //is this a valid path relative to the - validateFileRelativeToWebRoot(value); - } - return getValidationMessages().size() == 0; - - } - - private void validateFileRelativeToWebRoot(String value) { - IVirtualContainer webRoot = getWebRoot(); - if (! webRoot.exists()){ - getValidationMessages().add(new ValidationMessage( Messages.WebPathType_1)); - } - else { - IVirtualFile file = webRoot.getFile(new Path(value)); - if (!file.exists()) { - //was this a valid file path string, or bogus url? - getValidationMessages().add(new ValidationMessage(Messages.WebPathType_2)); - } - //we could also validate the expected file-extensions from meta data - } - - } - - private IVirtualContainer getWebRoot() - { - IVirtualContainer webRoot = - ComponentCore.createComponent(getProject()).getRootFolder(); - - return webRoot; - } -}
\ No newline at end of file diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/messages.properties deleted file mode 100644 index 22ddc87e5..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/messages.properties +++ /dev/null @@ -1,278 +0,0 @@ -############################################################################### -# Copyright (c) 2001, 2007 Oracle Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# Oracle Corporation - initial API and implementation -############################################################################### -IntegerType_invalid_integer=Value is not a valid integer. -IntegerType_invalid_member=Value is not a member of the provided valid values -LengthType_invalid_integer=Value is not a valid positive integer or positive integer percentage. -LongType_invalid_long=Value is not a valid Long. -LongType_invalid_member=Value is not a member of the provided valid values -BooleanType_invalid_values=Valid values are "true" or "false" -CurrencyCodeType_invalid=Invalid currency code -CurrencyCodeType_10=Aruba, Guilders (also called Florins) -CurrencyCodeType_100=Malta, Liri -CurrencyCodeType_101=Mauritius, Rupees -CurrencyCodeType_102=Maldives (Maldive Islands), Rufiyaa -CurrencyCodeType_103=Malawi, Kwachas -CurrencyCodeType_104=Mexico, Pesos -CurrencyCodeType_105=Malaysia, Ringgits -CurrencyCodeType_106=Mozambique, Meticais -CurrencyCodeType_107=Namibia, Dollars -CurrencyCodeType_108=Nigeria, Nairas -CurrencyCodeType_109=Nicaragua, Cordobas -CurrencyCodeType_11=Azerbaijan, Manats -CurrencyCodeType_110=Norway, Krone -CurrencyCodeType_111=Nepal, Nepal Rupees -CurrencyCodeType_112=New Zealand, Dollars -CurrencyCodeType_113=Oman, Rials -CurrencyCodeType_114=Panama, Balboa -CurrencyCodeType_115=Peru, Nuevos Soles -CurrencyCodeType_116=Papua New Guinea, Kina -CurrencyCodeType_117=Philippines, Pesos -CurrencyCodeType_118=Pakistan, Rupees -CurrencyCodeType_119=Poland, Zlotych -CurrencyCodeType_12=Bosnia and Herzegovina, Convertible Marka -CurrencyCodeType_120=Paraguay, Guarani -CurrencyCodeType_121=Qatar, Rials -CurrencyCodeType_122=Romania, Lei -CurrencyCodeType_123=Russia, Rubles -CurrencyCodeType_124=Rwanda, Rwanda Francs -CurrencyCodeType_125=Saudi Arabia, Riyals -CurrencyCodeType_126=Solomon Islands, Dollars -CurrencyCodeType_127=Seychelles, Rupees -CurrencyCodeType_128=Sudan, Dinars -CurrencyCodeType_129=Sweden, Kronor -CurrencyCodeType_13=Barbados, Dollars -CurrencyCodeType_130=Singapore, Dollars -CurrencyCodeType_131=Saint Helena, Pounds -CurrencyCodeType_132=Slovenia, Tolars -CurrencyCodeType_133=Slovakia, Koruny -CurrencyCodeType_134=Sierra Leone, Leones -CurrencyCodeType_135=Somalia, Shillings -CurrencyCodeType_136=Seborga, Luigini -CurrencyCodeType_137=Suriname, Dollars -CurrencyCodeType_138=Principe and S\u00E3o Tome, Dobras -CurrencyCodeType_139=El Salvador, Colones -CurrencyCodeType_14=Bangladesh, Taka -CurrencyCodeType_140=Syria, Pounds -CurrencyCodeType_141=Swaziland, Emalangeni -CurrencyCodeType_142=Thailand, Baht -CurrencyCodeType_143=Tajikistan, Somoni -CurrencyCodeType_144=Turkmenistan, Manats -CurrencyCodeType_145=Tunisia, Dinars -CurrencyCodeType_146=Tonga, Pa'anga -CurrencyCodeType_147=Turkey, Liras [being phased out] -CurrencyCodeType_148=Turkey, New Lira -CurrencyCodeType_149=Trinidad and Tobago, Dollars -CurrencyCodeType_15=Bulgaria, Leva -CurrencyCodeType_150=Tuvalu, Tuvalu Dollars -CurrencyCodeType_151=Taiwan, New Dollars -CurrencyCodeType_152=Tanzania, Shillings -CurrencyCodeType_153=Ukraine, Hryvnia -CurrencyCodeType_154=Uganda, Shillings -CurrencyCodeType_155=United States of America, Dollars -CurrencyCodeType_156=Uruguay, Pesos -CurrencyCodeType_157=Uzbekistan, Sums -CurrencyCodeType_158=Venezuela, Bolivares -CurrencyCodeType_159=Viet Nam, Dong -CurrencyCodeType_16=Bahrain, Dinars -CurrencyCodeType_160=Vanuatu, Vatu -CurrencyCodeType_161=Samoa, Tala -CurrencyCodeType_162=Communaut\u00E9 Financi\u00E8re Africaine BEAC Franc , Francs -CurrencyCodeType_163=Silver, Ounces -CurrencyCodeType_164=Gold, Ounces -CurrencyCodeType_165=East Caribbean Dollars -CurrencyCodeType_166=International Monetary Fund (IMF) Special Drawing Rights -CurrencyCodeType_167=Communaut\u00E9 Financi\u00E8re Africaine BCEAO, Francs -CurrencyCodeType_168=Palladium Ounces -CurrencyCodeType_169=Comptoirs Francais du Pacifique, Francs -CurrencyCodeType_17=Burundi, Francs -CurrencyCodeType_170=Platinum, Ounces -CurrencyCodeType_171=Yemen, Rials -CurrencyCodeType_172=South Africa, Rand -CurrencyCodeType_173=Zambia, Kwacha -CurrencyCodeType_174=Zimbabwe, Zimbabwe Dollars -CurrencyCodeType_18=Bermuda, Dollars -CurrencyCodeType_19=Brunei Darussalam, Dollars -CharacterType_0=Single unicode character is required -CurrencyCodeType_2=United Arab Emirates, Dirhams -CurrencyCodeType_20=Bolivia, Bolivianos -CurrencyCodeType_21=Brazil, Brazil Real -CurrencyCodeType_22=Bahamas, Dollars -CurrencyCodeType_23=Bhutan, Ngultrum -CurrencyCodeType_24=Botswana, Pulas -CurrencyCodeType_25=Belarus, Rubles -CurrencyCodeType_26=Belize, Dollars -CurrencyCodeType_27=Canada, Dollars -CurrencyCodeType_28=Congo/Kinshasa, Congolese Francs -CurrencyCodeType_29=Switzerland, Francs -CurrencyCodeType_3=Afghanistan, Afghanis -CurrencyCodeType_30=Chile, Pesos -CurrencyCodeType_31=China, Yuan Renminbi -CurrencyCodeType_32=Colombia, Pesos -CurrencyCodeType_33=Costa Rica, Colones -CurrencyCodeType_34=Serbia, Dinars -CurrencyCodeType_35=Cuba, Pesos -CurrencyCodeType_36=Cape Verde, Escudos -CurrencyCodeType_37=Cyprus, Pounds -CurrencyCodeType_38=Czech Republic, Koruny -CurrencyCodeType_39=Djibouti, Francs -CurrencyCodeType_4=Albania, Leke -CurrencyCodeType_40=Denmark, Kroner -CurrencyCodeType_41=Dominican Republic, Pesos -CurrencyCodeType_42=Algeria, Algeria Dinars -CurrencyCodeType_43=Estonia, Krooni -CurrencyCodeType_44=Egypt, Pounds -CurrencyCodeType_45=Eritrea, Nakfa -CurrencyCodeType_46=Ethiopia, Birr -CurrencyCodeType_47=Euro Member Countries, Euro -CurrencyCodeType_48=Fiji, Dollars -CurrencyCodeType_49=Falkland Islands (Malvinas), Pounds -CurrencyCodeType_5=Armenia, Drams -CurrencyCodeType_50=United Kingdom, Pounds -CurrencyCodeType_51=Georgia, Lari -CurrencyCodeType_52=Guernsey, Pounds -CurrencyCodeType_53=Ghana, Cedis -CurrencyCodeType_54=Gibraltar, Pounds -CurrencyCodeType_55=Gambia, Dalasi -CurrencyCodeType_56=Guinea, Francs -CurrencyCodeType_57=Guatemala, Quetzales -CurrencyCodeType_58=Guyana, Dollars -CurrencyCodeType_59=Hong Kong, Dollars -CurrencyCodeType_6=Netherlands Antilles, Guilders (also called Florins) -CurrencyCodeType_60=Honduras, Lempiras -CurrencyCodeType_61=Croatia, Kuna -CurrencyCodeType_62=Haiti, Gourdes -CurrencyCodeType_63=Hungary, Forint -CurrencyCodeType_64=Indonesia, Rupiahs -CurrencyCodeType_65=Israel, New Shekels -CurrencyCodeType_66=Isle of Man, Pounds -CurrencyCodeType_67=India, Rupees -CurrencyCodeType_68=Iraq, Dinars -CurrencyCodeType_69=Iran, Rials -CurrencyCodeType_7=Angola, Kwanza -CurrencyCodeType_70=Iceland, Kronur -CurrencyCodeType_71=Jersey, Pounds -CurrencyCodeType_72=Jamaica, Dollars -CurrencyCodeType_73=Jordan, Dinars -CurrencyCodeType_74=Japan, Yen -CurrencyCodeType_75=Kenya, Shillings -CurrencyCodeType_76=Kyrgyzstan, Soms -CurrencyCodeType_77=Cambodia, Riels -CurrencyCodeType_78=Comoros, Francs -CurrencyCodeType_79=Korea (North), Won -CurrencyCodeType_8=Argentina, Pesos -CurrencyCodeType_80=Korea (South), Won -CurrencyCodeType_81=Kuwait, Dinars -CurrencyCodeType_82=Cayman Islands, Dollars -CurrencyCodeType_83=Kazakhstan, Tenge -CurrencyCodeType_84=Laos, Kips -CurrencyCodeType_85=Lebanon, Pounds -CurrencyCodeType_86=Sri Lanka, Rupees -CurrencyCodeType_87=Liberia, Dollars -CurrencyCodeType_88=Lesotho, Maloti -CurrencyCodeType_89=Lithuania, Litai -CurrencyCodeType_9=Australia, Dollars -LanguageCodeType_0=ar Arabic (needs subtype) -LanguageCodeType_1=Invalid language code -LanguageCodeType_101=tr Turkish -LanguageCodeType_103=ts Tsonga -LanguageCodeType_105=uk Ukrainian -LanguageCodeType_107=ur Urdu -LanguageCodeType_109=vi Vietnamese -LanguageCodeType_11=br Breton -LanguageCodeType_111=xh Xhosa -LanguageCodeType_113=yi Yiddish -LanguageCodeType_115=zh Chinese (needs subtype) -LanguageCodeType_117=zu Zulu -LanguageCodeType_118=af Afrikaans -LanguageCodeType_13=ca Catalan -LanguageCodeType_15=cs Czech -LanguageCodeType_17=da Danish -LanguageCodeType_19=de German (Standard) -LanguageCodeType_21=el Greek -LanguageCodeType_23=en English -LanguageCodeType_25=es Spanish (Spain) -LanguageCodeType_27=et Estonian -LanguageCodeType_29=eu Basque -LanguageCodeType_31=fa Farsi -LanguageCodeType_33=fi Finnish -LanguageCodeType_35=fo Faeroese -LanguageCodeType_37=fr French (Standard) -LanguageCodeType_39=gd Gaelic (Scotland) -LanguageCodeType_41=he Hebrew -LanguageCodeType_43=hi Hindi -LanguageCodeType_45=hr Croatian -LanguageCodeType_47=hu Hungarian -LanguageCodeType_49=id Indonesian -LanguageCodeType_51=is Icelandic -LanguageCodeType_53=it Italian (Standard) -LanguageCodeType_55=ja Japanese -LanguageCodeType_57=ko Korean -LanguageCodeType_59=lt Lithuanian -LanguageCodeType_61=lv Latvian -LanguageCodeType_63=mk Macedonian -LanguageCodeType_65=ms Malaysian -LanguageCodeType_67=mt Maltese -LanguageCodeType_69=nl Dutch (Standard) -LanguageCodeType_7=be Belarusian -LanguageCodeType_71=no Norwegian (Bokmal/Nynorsk) -LanguageCodeType_73=pl Polish -LanguageCodeType_75=pt Portuguese (Standard) -LanguageCodeType_77=rm Rhaeto-Romanic -LanguageCodeType_79=ro Romanian -LanguageCodeType_81=ru Russian -LanguageCodeType_83=sk Slovak -LanguageCodeType_85=sl Slovenian -LanguageCodeType_87=sq Albanian -LanguageCodeType_89=sr Serbian (Cyrillic/Latin) -LanguageCodeType_9=bg Bulgarian -LinkType_16=Link type value must not be empty -LocaleType_1=Invalid locale value -WebPathType_1=Web root path not found -WebPathType_2=Invalid value -LanguageCodeType_91=sv Swedish -LanguageCodeType_93=sx Sutu -LanguageCodeType_95=sz Sami (Lappish) -LanguageCodeType_97=th Thai -LanguageCodeType_99=tn Setswana -CurrencyCodeType_90=Latvia, Lati -CurrencyCodeType_91=Libya, Dinars -CurrencyCodeType_92=Morocco, Dirhams -CurrencyCodeType_93=Moldova, Lei -CurrencyCodeType_94=Madagascar, Ariary -CurrencyCodeType_95=Macedonia, Denars -CurrencyCodeType_96=Myanmar (Burma), Kyats -CurrencyCodeType_97=Mongolia, Tugriks -CurrencyCodeType_98=Macau, Patacas -CurrencyCodeType_99=Mauritania, Ouguiyas -NumberType_max_val=Value exceeds maximum of {0} -NumberType_min_val=Value is less than minimum of {0} -RelativePathType_0=: path not found -DoubleType_invalid_double=Value is not a valid double. -DoubleType_invalid_member=Value is not a member of the provided valid values -StringType_invalid_value=Value is not valid. -FacesConfigIdentifierType_invalid_validator_id= {0} validator id is is not registered. -FacesConfigIdentifierType_invalid_converter_id= {0} converter id is not registered. -FacesConfigConverterIDFeatures_converterid_empty=Converter ids must not be null or empty. -FacesConfigValidatorIDFeatures_validatorid_empty=Validator ids must not be null or empty. -ValueType_invalid_value_without_setter=This 'value' attribute value must be a value binding expression that can take a value assignment. -ValueType_invalid_value=The 'value' attribute must be a non-zero length String or be a value binding expression. -ComponentBindingType_invalid_value=The 'binding' attribute requires an EL value binding reference to a UIComponent. -ComponentIDType_invalid_as_el='id' attributes must be Strings. Consider using 'binding' attribute instead. -ComponentIDType_invalid_value=The 'id' attribute must be a non-zero length String and be uniquely defined on the page. -ActionType_invalid_value=The action value does not match a navigation case outcome. -ActionType_invalid_empty_value=The action attribute must be a non-zero length String or a method binding matching a navigation case outcome. -ActionType_navcase_display={0}: goto {1} -ContentType_MIME_not_empty=Content (MIME) type must not be empty -MethodBindingType_invalid_value=MethodBinding attribute values must be EL expressions. -JavaClassType_invalid_type=Value for type attribute must be valid Java class and not empty. -JavaClassType_not_found=Java type not found, not instantiable, or does implement correct interfaces or extend correct superclass. -ColorType_invalid_color=Value is not a valid color. -Bundle_not_found_rb=Resource bundle {0} cannot be found on classpath diff --git a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/package-info.java b/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/package-info.java deleted file mode 100644 index 468104b7d..000000000 --- a/jsf/plugins/org.eclipse.jst.jsf.core/src/org/eclipse/jst/jsf/taglibprocessing/attributevalues/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006 Oracle Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Gerry Kessler/Oracle - initial API and implementation - * - ********************************************************************************/ - -/** - * Provides type system for tag attribute values so that the - * org.eclipse.jst.jsf.core.metadataprocessors.features can be applied. - * - * A type is added using the org.eclipse.jst.jsf.core.AttributeValueRuntimeTypes extension point. - * These types are referenced using the design-time metadata framework in org.eclipse.jst.jsf.common - * The org.eclipse.jst.jsf.metadataprocessors.features provides the interesting tooling services based upon the type. - * - * <p><b>Provisional API - subject to change</b></p> - */ -package org.eclipse.jst.jsf.taglibprocessing.attributevalues; |