Author: sdzmitrovich
Date: 2008-08-28 06:15:38 -0400 (Thu, 28 Aug 2008)
New Revision: 9939
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/InvisibleTemplate.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_eclipse_option.meta
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreference.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-1805
Modified:
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_eclipse_option.meta
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_eclipse_option.meta 2008-08-28
10:15:09 UTC (rev 9938)
+++
trunk/common/plugins/org.jboss.tools.common.model/resources/meta/studio_eclipse_option.meta 2008-08-28
10:15:38 UTC (rev 9939)
@@ -1193,6 +1193,13 @@
</Constraint>
<Editor name="CheckBox"/>
</XModelAttribute>
+ <XModelAttribute default="no" name="show invisible tags"
xmlname="show_invisible_tags">
+ <Constraint loader="List">
+ <value name="yes"/>
+ <value name="no"/>
+ </Constraint>
+ <Editor name="CheckBox"/>
+ </XModelAttribute>
<XModelAttribute default="no"
name="show resource bundles usage as EL expressions"
xmlname="show_resource_bundles_usage_as_el_expressions">
<Constraint loader="List">
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-08-28
10:15:09 UTC (rev 9938)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-08-28
10:15:38 UTC (rev 9939)
@@ -101,9 +101,10 @@
</vpe:tag>
<vpe:tag name="h:inputHidden" case-sensitive="yes">
- <vpe:template children="no" modify="no">
+ <vpe:template children="no" modify="no"
invisible="yes" >
<input type="text" value="{jsfvalue(@value)}"
title="{tagstring()}" />
+
<vpe:dnd>
<vpe:drag start-enable="yes" />
<vpe:drop container="yes">
@@ -720,55 +721,51 @@
</vpe:tag>
<vpe:tag name="f:attribute" case-sensitive="yes">
- <vpe:template children="no" modify="no" />
+ <vpe:template children="no" modify="no"
invisible="yes" />
</vpe:tag>
<vpe:tag name="f:param">
- <vpe:template children="no" modify="no" />
+ <vpe:template children="no" modify="no"
invisible="yes" />
</vpe:tag>
<vpe:tag name="f:phaseListener">
- <vpe:template children="no" modify="no" />
+ <vpe:template children="no" modify="no"
invisible="yes" />
</vpe:tag>
- <vpe:tag name="f:phaseListener">
- <vpe:template children="no" modify="no" />
- </vpe:tag>
-
<vpe:tag name="f:setPropertyActionListener">
- <vpe:template children="no" modify="no" />
+ <vpe:template children="no" modify="no"
invisible="yes" />
</vpe:tag>
<vpe:tag name="f:valueChangeListener">
- <vpe:template children="no" modify="no" />
+ <vpe:template children="no" modify="no"
invisible="yes" />
</vpe:tag>
<vpe:tag name="f:convertDateTime">
- <vpe:template children="no" modify="no" />
+ <vpe:template children="no" modify="no"
invisible="yes" />
</vpe:tag>
<vpe:tag name="f:converter">
- <vpe:template children="no" modify="no" />
+ <vpe:template children="no" modify="no"
invisible="yes" />
</vpe:tag>
<vpe:tag name="f:convertNumber">
- <vpe:template children="no" modify="no" />
+ <vpe:template children="no" modify="no"
invisible="yes" />
</vpe:tag>
<vpe:tag name="f:validator">
- <vpe:template children="no" modify="no" />
+ <vpe:template children="no" modify="no"
invisible="yes" />
</vpe:tag>
<vpe:tag name="f:validateDoubleRange">
- <vpe:template children="no" modify="no" />
+ <vpe:template children="no" modify="no"
invisible="yes" />
</vpe:tag>
<vpe:tag name="f:validateLength">
- <vpe:template children="no" modify="no" />
+ <vpe:template children="no" modify="no"
invisible="yes" />
</vpe:tag>
<vpe:tag name="f:validateLongRange">
- <vpe:template children="no" modify="no" />
+ <vpe:template children="no" modify="no"
invisible="yes" />
</vpe:tag>
<vpe:tag name="h:message">
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-08-28
10:15:09 UTC (rev 9938)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-08-28
10:15:38 UTC (rev 9939)
@@ -207,7 +207,7 @@
</vpe:tag>
<vpe:tag name="rich:modalPanel" case-sensitive="yes">
- <vpe:template children="no" modify="yes">
+ <vpe:template children="no" modify="yes"
invisible="yes" >
<div style="display:none">
</div>
</vpe:template>
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreference.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreference.java 2008-08-28
10:15:09 UTC (rev 9938)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/preferences/VpePreference.java 2008-08-28
10:15:38 UTC (rev 9939)
@@ -24,6 +24,7 @@
public static String ATT_SOURCE_VISUAL_EDITORS_WEIGHTS = "Size of Visual Editor
pane 0-100%";
public static String ATT_SHOW_SELECTION_TAG_BAR = "show selection tag bar";
public static String ATT_ALWAYS_HIDE_SELECTION_BAR_WITHOUT_PROMT="always hide
selection bar without prompt";
+ public static String ATT_SHOW_INVISIBLE_TAGS="show invisible tags";
public static String SHOW_COMMENTS_VALUE;
public static String VPE_EDITOR_PATH = "%Options%/Struts Studio/Editors/Visual Page
Editor"; //$NON-NLS-1$
public static final Preference SHOW_COMMENTS = new VpePreference(VPE_EDITOR_PATH,
ATT_SHOW_COMMENTS);
@@ -37,6 +38,7 @@
public static final Preference SOURCE_VISUAL_EDITORS_WEIGHTS= new
VpePreference(VPE_EDITOR_PATH, ATT_SOURCE_VISUAL_EDITORS_WEIGHTS);
public static final Preference SHOW_SELECTION_TAG_BAR = new
VpePreference(VPE_EDITOR_PATH,ATT_SHOW_SELECTION_TAG_BAR);
public static final Preference ALWAYS_HIDE_SELECTION_BAR_WITHOUT_PROMT = new
VpePreference(VPE_EDITOR_PATH,ATT_ALWAYS_HIDE_SELECTION_BAR_WITHOUT_PROMT);
+ public static final Preference SHOW_INVISIBLE_TAGS = new
VpePreference(VPE_EDITOR_PATH,ATT_SHOW_INVISIBLE_TAGS);
static {
SHOW_COMMENTS_VALUE =SHOW_COMMENTS.getValue();
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-28
10:15:09 UTC (rev 9938)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-28
10:15:38 UTC (rev 9939)
@@ -1557,6 +1557,9 @@
}
});
}
+
+ manager.add(new Separator());
+ manager.add(new ShowInvisbleTagAction());
if (VpeDebug.VISUAL_CONTEXTMENU_DUMP_SOURCE) {
manager.add(new Action("Dump Source") { //$NON-NLS-1$
@@ -3317,5 +3320,20 @@
public VpeSourceDomBuilder getSourceBuilder() {
return sourceBuilder;
}
+
+ class ShowInvisbleTagAction extends Action{
+
+ public ShowInvisbleTagAction() {
+ super("Show Invisible Tags", AS_CHECK_BOX);
+ setChecked(visualBuilder.isShowInvisibleTags());
+ }
+
+ public void run() {
+ visualBuilder.setShowInvisibleTags(isChecked());
+ visualRefresh();
+ }
+
+ }
+
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-08-28
10:15:09 UTC (rev 9938)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-08-28
10:15:38 UTC (rev 9939)
@@ -55,6 +55,7 @@
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
import org.jboss.tools.vpe.editor.template.IEditableTemplate;
+import org.jboss.tools.vpe.editor.template.InvisibleTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
@@ -66,6 +67,7 @@
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
import org.jboss.tools.vpe.editor.template.dnd.VpeDnd;
import org.jboss.tools.vpe.editor.template.expression.VpeExpressionException;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.ElService;
import org.jboss.tools.vpe.editor.util.FaceletUtil;
import org.jboss.tools.vpe.editor.util.HTML;
@@ -168,10 +170,12 @@
private VpeDnd dropper;
private Map<IFile, Document> includeDocuments = new HashMap<IFile,
Document>();
+ private boolean showInvisibleTags;
public VpeVisualDomBuilder(VpeDomMapping domMapping,
INodeAdapter sorceAdapter, VpeTemplateManager templateManager,
MozillaEditor visualEditor, VpePageContext pageContext) {
+
super(domMapping, sorceAdapter, templateManager);
this.visualEditor = visualEditor;
xulRunnerEditor = visualEditor.getXulRunnerEditor();
@@ -188,6 +192,9 @@
} else {
faceletFile = false;
}
+
+ this.showInvisibleTags = Constants.YES_STRING
+ .equals(VpePreference.SHOW_INVISIBLE_TAGS.getValue());
}
@@ -206,6 +213,7 @@
.getSourceBuilder().getSourceDocument()));
}
}
+
pageContext.refreshConnector();
pageContext.installIncludeElements();
if (isFacelet()) {
@@ -523,6 +531,13 @@
visualDocument, creationData);
getPageContext().setCurrentVisualNode(null);
+ // if showInvisibleTags mode
+ if (isShowInvisibleTags() && (visualNewNode != null)
+ && (sourceNode.getNodeType() == Node.ELEMENT_NODE)) {
+ // add invisible children to node
+ visualNewNode = addInvisibleChildren(sourceNode, visualNewNode);
+ }
+
if (border != null)
return border;
else
@@ -573,7 +588,8 @@
int childrenCount = 0;
for (int i = 0; i < len; i++) {
Node sourceNode = sourceNodes.item(i);
- if (addNode(sourceNode, null, visualContainer)) {
+ if ((!isInvisibleNode(sourceNode))
+ && (addNode(sourceNode, null, visualContainer))) {
if (Node.ELEMENT_NODE == sourceNode.getNodeType()) {
}
childrenCount++;
@@ -598,10 +614,12 @@
int childrenCount = 0;
if (sourceChildren != null) {
for (int j = 0; j < sourceChildren.size(); j++) {
- if (addNode((Node) sourceChildren.get(j), null,
- visualParent)) {
- childrenCount++;
- }
+ Node child = (Node) sourceChildren.get(j);
+ if ((!isInvisibleNode(child))
+ && addNode((Node) sourceChildren.get(j), null,
+ visualParent)) {
+ childrenCount++;
+ }
}
}
if (childrenCount == 0 && childrenInfoList.size() == 0) {
@@ -610,7 +628,61 @@
}
}
}
+
+ /**
+ *
+ * @param containerTemplate
+ * @param sourceContainer
+ * @param visualContainer
+ */
+ protected nsIDOMNode addInvisibleChildren(Node sourceContainer,
+ nsIDOMNode visualContainer) {
+ nsIDOMElement wrapper = null;
+ int count = 0;
+ // node is not null
+ if (visualContainer != null) {
+ // wrap node to span
+ wrapper = visualDocument.createElement(HTML.TAG_SPAN);
+ wrapper.appendChild(visualContainer);
+
+ // add all invisible tags to wrapper
+ NodeList sourceNodes = sourceContainer.getChildNodes();
+
+
+ for (int i = 0; i < sourceNodes.getLength(); i++) {
+
+ Node child = sourceNodes.item(i);
+
+ if (isInvisibleNode(child)) {
+ addNode(child, null, wrapper);
+ count++ ;
+ }
+ }
+ }
+
+ return count > 0 ? wrapper : visualContainer;
+
+ }
+
+ /**
+ *
+ * @param node
+ * @return
+ */
+ private boolean isInvisibleNode(Node node) {
+
+ // get template
+ Set<Node> ifDependencySet = new HashSet<Node>();
+ VpeTemplate template = templateManager.getTemplate(pageContext, node,
+ ifDependencySet);
+ // check if invisible tag
+ if (template.isInvisible())
+ return true;
+ return false;
+
+ }
+
// /////////////////////////////////////////////////////////////////////////
public nsIDOMNode addStyleNodeToHead(String styleText) {
nsIDOMNode newStyle = visualDocument
@@ -2335,4 +2407,12 @@
public nsIDOMNode getHeadNode() {
return visualEditor.getHeadNode();
}
+
+ public boolean isShowInvisibleTags() {
+ return showInvisibleTags;
+ }
+
+ public void setShowInvisibleTags(boolean showInvisibleTags) {
+ this.showInvisibleTags = showInvisibleTags;
+ }
}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/InvisibleTemplate.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/InvisibleTemplate.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/InvisibleTemplate.java 2008-08-28
10:15:38 UTC (rev 9939)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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.vpe.editor.template;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMText;
+import org.w3c.dom.Node;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class InvisibleTemplate extends VpeAbstractTemplate {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools
+ * .vpe.editor.context.VpePageContext, org.w3c.dom.Node,
+ * org.mozilla.interfaces.nsIDOMDocument) #0037FF #ACBECE
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+
+ nsIDOMElement div = visualDocument.createElement(HTML.TAG_SPAN);
+
+ div.setAttribute(HTML.TAG_STYLE,
+ "border: solid 1px #0037FF;color:#0037FF;font-size:12px;");
+
+ nsIDOMText text = visualDocument.createTextNode(sourceNode
+ .getNodeName());
+
+ div.appendChild(text);
+
+ return new VpeCreationData(div);
+ }
+
+}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2008-08-28
10:15:09 UTC (rev 9938)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAbstractTemplate.java 2008-08-28
10:15:38 UTC (rev 9939)
@@ -36,6 +36,7 @@
import org.jboss.tools.vpe.editor.template.expression.VpeExpressionException;
import org.jboss.tools.vpe.editor.template.resize.VpeResizer;
import org.jboss.tools.vpe.editor.template.textformating.TextFormatingData;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.ElService;
import org.jboss.tools.vpe.editor.util.NodesManagingUtil;
import org.jboss.tools.vpe.editor.util.SelectionUtil;
@@ -70,6 +71,9 @@
/** The has imaginary border. */
protected boolean hasImaginaryBorder;
+
+ /** the invisible */
+ protected boolean invisible;
/** a resizer instance. */
private VpeResizer resizer;
@@ -230,15 +234,16 @@
*/
public void init(Element templateElement, boolean caseSensitive) {
this.caseSensitive = caseSensitive;
- children =
"yes".equals(templateElement.getAttribute(VpeTemplateManager.ATTR_TEMPLATE_CHILDREN));
//$NON-NLS-1$
- modify =
"yes".equals(templateElement.getAttribute(VpeTemplateManager.ATTR_TEMPLATE_MODIFY));
//$NON-NLS-1$
+ children =
Constants.YES_STRING.equals(templateElement.getAttribute(VpeTemplateManager.ATTR_TEMPLATE_CHILDREN));
//$NON-NLS-1$
+ modify =
Constants.YES_STRING.equals(templateElement.getAttribute(VpeTemplateManager.ATTR_TEMPLATE_MODIFY));
//$NON-NLS-1$
+ invisible =
Constants.YES_STRING.equals(templateElement.getAttribute(VpeTemplateManager.ATTR_TEMPLATE_INVISIBLE));
//$NON-NLS-1$
String strHasImaginaryBorder = templateElement
.getAttribute(VpeTemplateManager.ATTR_TEMPLATE_HAS_IMAGINARY_BORDER);
if (strHasImaginaryBorder != null
&& strHasImaginaryBorder.length() != 0) {
- hasImaginaryBorder = "yes".equalsIgnoreCase(strHasImaginaryBorder);
//$NON-NLS-1$
+ hasImaginaryBorder = Constants.YES_STRING.equalsIgnoreCase(strHasImaginaryBorder);
//$NON-NLS-1$
} else {
hasImaginaryBorder = false;
}
@@ -1518,4 +1523,13 @@
}
}
+
+ public boolean isInvisible() {
+ return invisible;
+ }
+
+ public void setInvisible(boolean invisible) {
+ this.invisible = invisible;
+ }
+
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java 2008-08-28
10:15:09 UTC (rev 9938)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplate.java 2008-08-28
10:15:38 UTC (rev 9939)
@@ -486,4 +486,6 @@
VpeElementMapping elementMapping, int focusPosition,
int anchorPosition, VpeDomMapping domMapping);
+ public boolean isInvisible();
+
}
\ No newline at end of file
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-08-28
10:15:09 UTC (rev 9938)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-08-28
10:15:38 UTC (rev 9939)
@@ -31,6 +31,7 @@
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.textformating.TextFormatingData;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.XmlUtil;
import org.osgi.framework.Bundle;
@@ -135,6 +136,8 @@
static final String ATTR_TEMPLATE_MODIFY = "modify"; //$NON-NLS-1$
static final String ATTR_TEMPLATE_HAS_IMAGINARY_BORDER = "hasImaginaryBorder";
//$NON-NLS-1$
+
+ static final String ATTR_TEMPLATE_INVISIBLE = "invisible"; //$NON-NLS-1$
static final String ATTR_COPY_ATTRS = "attrs"; //$NON-NLS-1$
@@ -863,32 +866,42 @@
@SuppressWarnings("unchecked")
private VpeTemplate createTemplate(Element templateElement,IConfigurationElement
confElement, boolean caseSensitive) {
VpeTemplate template = null;
- String templateClassName =
templateElement.getAttribute(VpeTemplateManager.ATTR_TEMPLATE_CLASS);
- String nameSpaceIdentifyer =
templateElement.getAttribute(VpeTemplateManager.NAMESPACE_IDENTIFIER_ATTRIBUTE);
+ String templateClassName = templateElement
+ .getAttribute(VpeTemplateManager.ATTR_TEMPLATE_CLASS);
+ String nameSpaceIdentifyer = templateElement
+ .getAttribute(VpeTemplateManager.NAMESPACE_IDENTIFIER_ATTRIBUTE);
+ String isInvisibleTemplate = templateElement
+ .getAttribute(VpeTemplateManager.ATTR_TEMPLATE_INVISIBLE);
if (templateClassName != null && templateClassName.length() > 0) {
try {
Bundle bundle;
- if(nameSpaceIdentifyer==null||nameSpaceIdentifyer.length()==0) {
+ if (nameSpaceIdentifyer == null
+ || nameSpaceIdentifyer.length() == 0) {
nameSpaceIdentifyer = confElement.getNamespaceIdentifier();
}
bundle = Platform.getBundle(nameSpaceIdentifyer);
-
+
Class templateClass = bundle.loadClass(templateClassName);
- template = (VpeTemplate)templateClass.newInstance();
+ template = (VpeTemplate) templateClass.newInstance();
} catch (ClassNotFoundException e) {
template = handleTemplateClassLoadException(template,
templateClassName, nameSpaceIdentifyer, e);
- } catch(IllegalAccessException e) {
+ } catch (IllegalAccessException e) {
template = handleTemplateClassLoadException(template,
templateClassName, nameSpaceIdentifyer, e);
- } catch(InstantiationException e) {
+ } catch (InstantiationException e) {
template = handleTemplateClassLoadException(template,
templateClassName, nameSpaceIdentifyer, e);
}
+ } else if (isInvisibleTemplate != null
+ && Constants.YES_STRING.equalsIgnoreCase(isInvisibleTemplate)) {
+
+ template = new InvisibleTemplate();
+
} else {
template = new VpeHtmlTemplate();
}
- if(template!=null) {
+ if (template != null) {
template.init(templateElement, caseSensitive);
}
return template;