Author: dgolovin
Date: 2011-08-04 02:46:41 -0400 (Thu, 04 Aug 2011)
New Revision: 33582
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/Jstl.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlUtil.java
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlAbstractForEachTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlImportTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlXOutTemplate.java
Log:
small refactoring to eliminate package with only two classes
Deleted:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/ComponentUtil.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/ComponentUtil.java 2011-08-04
06:32:57 UTC (rev 33581)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/ComponentUtil.java 2011-08-04
06:46:41 UTC (rev 33582)
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.jsf.vpe.jstl;
-
-
-import org.jboss.tools.vpe.editor.util.Constants;
-import org.mozilla.interfaces.nsIDOMElement;
-import org.w3c.dom.Element;
-
-
-/**
- * The Class ComponentUtil.
- */
-public class ComponentUtil {
-
- /**
- * Returns value of attribute.
- *
- * @param attributeName the attribute name
- * @param sourceElement the source element
- *
- * @return the attribute
- */
- public static String getAttribute(Element sourceElement, String attributeName) {
- return getAttribute(sourceElement, attributeName, Constants.EMPTY);
- }
-
- /**
- * Returns value of attribute.
- *
- * @param attributeName the attribute name
- * @param sourceElement the source element
- * @param defaultValue the default value
- *
- * @return the attribute
- */
- public static String getAttribute(Element sourceElement, String attributeName, String
defaultValue) {
- return sourceElement.hasAttribute(attributeName) ?
- sourceElement.getAttribute(attributeName) : defaultValue;
- }
-
- /**
- * Returns value of attribute.
- *
- * @param attributeName the attribute name
- * @param sourceElement the source element
- *
- * @return the attribute
- */
- public static String getAttribute(nsIDOMElement sourceElement, String attributeName)
{
- return sourceElement.hasAttribute(attributeName) ?
- sourceElement.getAttribute(attributeName) : Constants.EMPTY;
- }
-}
\ No newline at end of file
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/Jstl.java
(from rev 33581,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/Jstl.java)
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/Jstl.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/Jstl.java 2011-08-04
06:46:41 UTC (rev 33582)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jsf.vpe.jstl.template;
+
+
+/**
+ * Contains JSTL tags and general attributes.
+ *
+ * @author Igor Zhukov
+ */
+public interface Jstl {
+
+ static final String ATTR_ADD_CONTROL_LABEL = "addControlLabel"; //$NON-NLS-1$
+
+ static final String TAG_OUT = "out"; //$NON-NLS-1$
+
+ static final String ATTR_URL = "url"; //$NON-NLS-1$
+
+ static final String ATTR_SELECT = "select"; //$NON-NLS-1$
+}
\ No newline at end of file
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlAbstractForEachTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlAbstractForEachTemplate.java 2011-08-04
06:32:57 UTC (rev 33581)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlAbstractForEachTemplate.java 2011-08-04
06:46:41 UTC (rev 33582)
@@ -12,7 +12,6 @@
import java.util.List;
-import org.jboss.tools.jsf.vpe.jstl.template.util.JstlUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlImportTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlImportTemplate.java 2011-08-04
06:32:57 UTC (rev 33581)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlImportTemplate.java 2011-08-04
06:46:41 UTC (rev 33582)
@@ -12,7 +12,6 @@
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
-import org.jboss.tools.jsf.vpe.jstl.template.util.Jstl;
import org.jboss.tools.jst.jsp.util.NodesManagingUtil;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
Copied:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlUtil.java
(from rev 33581,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/util/JstlUtil.java)
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlUtil.java
(rev 0)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlUtil.java 2011-08-04
06:46:41 UTC (rev 33582)
@@ -0,0 +1,36 @@
+package org.jboss.tools.jsf.vpe.jstl.template;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Class encapsulates JSTL utils.
+ *
+ * @author dmaliarevich
+ *
+ */
+public class JstlUtil {
+
+ /**
+ * Gets all children of the source element
+ * including text nodes.
+ *
+ * @param sourceElement
+ * the source element
+ *
+ * @return the children
+ */
+ public static List<Node> getChildren(Element sourceElement) {
+ ArrayList<Node> children = new ArrayList<Node>();
+ NodeList nodeList = sourceElement.getChildNodes();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node child = nodeList.item(i);
+ children.add(child);
+ }
+ return children;
+ }
+}
Property changes on:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlUtil.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Author Id Revision Date
Added: svn:eol-style
+ native
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlXOutTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlXOutTemplate.java 2011-08-04
06:32:57 UTC (rev 33581)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jstl/src/org/jboss/tools/jsf/vpe/jstl/template/JstlXOutTemplate.java 2011-08-04
06:46:41 UTC (rev 33582)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jstl.template;
-import org.jboss.tools.jsf.vpe.jstl.template.util.Jstl;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;