[jbosstools-commits] JBoss Tools SVN: r22116 - in workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces: src/org/jboss/tools/jsf/vpe/template/mock/impl and 1 other directories.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Mon May 17 06:26:09 EDT 2010
Author: mareshkau
Date: 2010-05-17 06:26:09 -0400 (Mon, 17 May 2010)
New Revision: 22116
Added:
workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/icefaces/template/IceInputSecretTemplate.java
workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/template/mock/impl/VpeHtmlInputSecret.java
Modified:
workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/template/mock/impl/VpeExternalContext.java
workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/templates/vpe-templates-icefaces.xml
Log:
https://jira.jboss.org/browse/JBIDE-4710 ice input secree has been added
Added: workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/icefaces/template/IceInputSecretTemplate.java
===================================================================
--- workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/icefaces/template/IceInputSecretTemplate.java (rev 0)
+++ workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/icefaces/template/IceInputSecretTemplate.java 2010-05-17 10:26:09 UTC (rev 22116)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.icefaces.template;
+
+import javax.faces.render.Renderer;
+
+import org.jboss.tools.jsf.vpe.icefaces.utill.VpeRendererUtil;
+import org.jboss.tools.jsf.vpe.template.mock.impl.VpeFacesContext;
+import org.jboss.tools.jsf.vpe.template.mock.impl.VpeHtmlInputSecret;
+import org.jboss.tools.jsf.vpe.template.mock.impl.VpeHtmlInputText;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class IceInputSecretTemplate extends VpeAbstractTemplate{
+
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ VpeFacesContext.getInstance().setResponseWriter(null);
+ Renderer render = new com.icesoft.faces.component.ext.renderkit.SecretRenderer();
+ VpeHtmlInputSecret uiComponent = new VpeHtmlInputSecret(
+ (Element) sourceNode);
+ return VpeRendererUtil.createVisualEditorDate(pageContext, sourceNode, visualDocument, render, uiComponent);
+ }
+
+}
Modified: workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/template/mock/impl/VpeExternalContext.java
===================================================================
--- workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/template/mock/impl/VpeExternalContext.java 2010-05-17 10:23:52 UTC (rev 22115)
+++ workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/template/mock/impl/VpeExternalContext.java 2010-05-17 10:26:09 UTC (rev 22116)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.template.mock.impl;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.jboss.tools.jsf.vpe.template.mock.abstr.VpeAbstractExternalContext;
@@ -37,7 +38,12 @@
*/
@Override
public Map getRequestMap() {
- // TODO Auto-generated method stub
+ //this map used to add js support
return new HashMap();
}
+ @Override
+ public Map getRequestParameterMap() {
+ return Collections.EMPTY_MAP;
+ }
+
}
Added: workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/template/mock/impl/VpeHtmlInputSecret.java
===================================================================
--- workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/template/mock/impl/VpeHtmlInputSecret.java (rev 0)
+++ workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/src/org/jboss/tools/jsf/vpe/template/mock/impl/VpeHtmlInputSecret.java 2010-05-17 10:26:09 UTC (rev 22116)
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.template.mock.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.PropertyNotFoundException;
+import javax.el.PropertyNotWritableException;
+import javax.el.ValueExpression;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+import com.icesoft.faces.component.ext.HtmlInputSecret;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeHtmlInputSecret extends HtmlInputSecret {
+ private Map attributesMap;
+
+ public VpeHtmlInputSecret(Element sourceElement) {
+ attributesMap = new HashMap();
+ NamedNodeMap attributes = sourceElement.getAttributes();
+ for(int i=0;i<attributes.getLength();i++){
+ Node item = attributes.item(i);
+ attributesMap.put(item.getNodeName(), item.getNodeValue());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.component.UIComponentBase#getRendererType()
+ */
+ @Override
+ public String getRendererType() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.component.UIComponent#getAttributes()
+ */
+ @Override
+ public Map getAttributes() {
+ return attributesMap;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.faces.component.UIComponent#getValueExpression(java.lang.String)
+ */
+ @Override
+ public ValueExpression getValueExpression(final String name) {
+ return new ValueExpression(){
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 4723033247685328768L;
+
+ @Override
+ public Class<?> getExpectedType() {
+ // TODO Auto-generated method stub
+ return String.class;
+ }
+
+ @Override
+ public Class<?> getType(ELContext arg0)
+ throws NullPointerException, PropertyNotFoundException,
+ ELException {
+ // TODO Auto-generated method stub
+ return String.class;
+ }
+
+ @Override
+ public Object getValue(ELContext arg0) throws NullPointerException,
+ PropertyNotFoundException, ELException {
+ return getAttributes().get(name);
+ }
+
+ @Override
+ public boolean isReadOnly(ELContext arg0)
+ throws NullPointerException, PropertyNotFoundException,
+ ELException {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void setValue(ELContext arg0, Object arg1)
+ throws NullPointerException, PropertyNotFoundException,
+ PropertyNotWritableException, ELException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean equals(Object arg0) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public String getExpressionString() {
+ // TODO Auto-generated method stub
+ return (String) getAttributes().get(name);
+ }
+
+ @Override
+ public int hashCode() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public boolean isLiteralText() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ };
+ }
+}
Modified: workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/templates/vpe-templates-icefaces.xml
===================================================================
--- workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/templates/vpe-templates-icefaces.xml 2010-05-17 10:23:52 UTC (rev 22115)
+++ workspace/mareshkau/org.jboss.tools.jsf.vpe.icefaces/templates/vpe-templates-icefaces.xml 2010-05-17 10:26:09 UTC (rev 22116)
@@ -57,4 +57,17 @@
</vpe:dnd>
</vpe:template>
</vpe:tag>
+ <vpe:tag name="ice:inputSecret" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.icefaces.template.IceInputSecretTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="style.width" />
+ <vpe:height height-attr="style.height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="no"></vpe:drop>
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
</vpe:templates>
More information about the jbosstools-commits
mailing list