Author: yradtsevich
Date: 2008-10-10 12:18:15 -0400 (Fri, 10 Oct 2008)
New Revision: 10778
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
Log:
Minor changes.
Class AttributeMap moved to org.jboss.tools.jsf.vpe.richfaces.template.util package
Deleted:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java 2008-10-10
15:25:59 UTC (rev 10777)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java 2008-10-10
16:18:15 UTC (rev 10778)
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.vpe.richfaces;
-
-import org.w3c.dom.Element;
-
-/**
- * A wrapper of DOM Element that can extract its attributes as objects of different
types.
- * The methods of the class never throw exceptions. In case if parsing is impossible
they
- * always return a correct value.
- *
- * @author yradtsevich
- * @see Element
- */
-public class AttributeMap {
- private Element element;
-
- public AttributeMap(Element element) {
- this.element = element;
- }
-
- /**
- * A wrapper of <code>ComponentUtil.getAttribute(sourceElement,
attributeName)</code>
- *
- * @param attributeName attribute name
- * @return <code>ComponentUtil.getAttribute(sourceElement,
attributeName)</code>
- *
- * @see ComponentUtil
- */
- public String getString(String attributeName) {
- return ComponentUtil.getAttribute(element, attributeName);
- }
-
- /**
- * Returns Boolean representation of the attribute.
- *
- * @param attributeName attribute name
- * @return attribute value.
- * <code>Boolean.TRUE</code>, if the attribute equals "true",
- * <code>Boolean.False</code>, if the attribute equals "false",
- * <code>null</code> otherwise.
- */
- public Boolean getBoolean(String attributeName) {
- String attribute = element.getAttribute(attributeName);
-
- Boolean ret;
-
- if ("true".equals(attribute)) {
- ret = Boolean.TRUE;
- } else if ("false".equals(attribute)) {
- ret = Boolean.FALSE;
- } else {
- ret = null;
- }
-
- return ret;
- }
-
- public boolean isBlank(String attributeName) {
- String value = getString(attributeName);
- return ComponentUtil.isBlank(value);
- }
-}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-10
15:25:59 UTC (rev 10777)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-10
16:18:15 UTC (rev 10778)
@@ -17,8 +17,8 @@
import java.util.List;
import java.util.Map;
-import org.jboss.tools.jsf.vpe.richfaces.AttributeMap;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.AttributeMap;
import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java
(from rev 10777,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java)
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java 2008-10-10
16:18:15 UTC (rev 10778)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template.util;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.w3c.dom.Element;
+
+/**
+ * A wrapper of DOM Element that can extract its attributes as objects of different
types.
+ * The methods of the class never throw exceptions. In case if parsing is impossible
they
+ * always return a correct value.
+ *
+ * @author yradtsevich
+ * @see Element
+ */
+public class AttributeMap {
+ private Element element;
+
+ public AttributeMap(Element element) {
+ this.element = element;
+ }
+
+ /**
+ * A wrapper of <code>ComponentUtil.getAttribute(sourceElement,
attributeName)</code>
+ *
+ * @param attributeName attribute name
+ * @return <code>ComponentUtil.getAttribute(sourceElement,
attributeName)</code>
+ *
+ * @see ComponentUtil
+ */
+ public String getString(String attributeName) {
+ return ComponentUtil.getAttribute(element, attributeName);
+ }
+
+ /**
+ * Returns Boolean representation of the attribute.
+ *
+ * @param attributeName attribute name
+ * @return attribute value.
+ * <code>Boolean.TRUE</code>, if the attribute equals "true",
+ * <code>Boolean.False</code>, if the attribute equals "false",
+ * <code>null</code> otherwise.
+ */
+ public Boolean getBoolean(String attributeName) {
+ String attribute = element.getAttribute(attributeName);
+
+ Boolean ret;
+
+ if ("true".equals(attribute)) {
+ ret = Boolean.TRUE;
+ } else if ("false".equals(attribute)) {
+ ret = Boolean.FALSE;
+ } else {
+ ret = null;
+ }
+
+ return ret;
+ }
+
+ public boolean isBlank(String attributeName) {
+ String value = getString(attributeName);
+ return ComponentUtil.isBlank(value);
+ }
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java
___________________________________________________________________
Name: svn:mergeinfo
+