JBoss Tools SVN: r4213 - branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2007-10-16 06:08:58 -0400 (Tue, 16 Oct 2007)
New Revision: 4213
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-847 add RichFaces treeNodesAdaptor,recursiveTreeNodesAdaptor
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java 2007-10-16 10:07:54 UTC (rev 4212)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java 2007-10-16 10:08:58 UTC (rev 4213)
@@ -10,10 +10,8 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.RichFacesTemplatesActivator;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
@@ -143,19 +141,20 @@
*/
private void setAttributeToTree(nsIDOMNode node, String attrName,
String attrValue) {
- if (!(node instanceof Element)) {
+ try {
+ nsIDOMElement element = (nsIDOMElement) node
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ if (node.getNodeName().equalsIgnoreCase(
+ HtmlComponentUtil.HTML_TAG_TABLE)) {
+ element.setAttribute(attrName, attrValue);
+ }
+ nsIDOMNodeList list2 = node.getChildNodes();
+ for (int i = 0; i < list2.getLength(); i++) {
+ setAttributeToTree(list2.item(i), attrName, attrValue);
+ }
+ } catch (XPCOMException exception) {
return;
}
- if (node.getNodeName().equalsIgnoreCase(
- HtmlComponentUtil.HTML_TAG_TABLE)) {
- ((nsIDOMElement) node
- .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID))
- .setAttribute(attrName, attrValue);
- }
- nsIDOMNodeList list2 = node.getChildNodes();
- for (int i = 0; i < list2.getLength(); i++) {
- setAttributeToTree(list2.item(i), attrName, attrValue);
- }
}
/**
17 years, 3 months
JBoss Tools SVN: r4212 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2007-10-16 06:07:54 -0400 (Tue, 16 Oct 2007)
New Revision: 4212
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java
Log:
Fix RichFaces treeNodesAdaptor and recursiveTreeNodesAdaptor templates
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java 2007-10-16 08:47:59 UTC (rev 4211)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java 2007-10-16 10:07:54 UTC (rev 4212)
@@ -162,6 +162,7 @@
* Object <code>VpeCreationData</code>, built by a method
* <code>create</code>
*/
+ @Override
public void validate(VpePageContext pageContext, Node sourceNode,
Document visualDocument, VpeCreationData data) {
super.validate(pageContext, sourceNode, visualDocument, data);
17 years, 3 months
JBoss Tools SVN: r4210 - in branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor: template and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2007-10-16 04:44:29 -0400 (Tue, 16 Oct 2007)
New Revision: 4210
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAttributeCreator.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreator.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeDebugUtil.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1091, some Maps and list was mode parameterized
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-10-16 08:15:47 UTC (rev 4209)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2007-10-16 08:44:29 UTC (rev 4210)
@@ -324,9 +324,9 @@
}
public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int pos) {
-// if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
-// return;
-// }
+ if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+ return;
+ }
if (VpeDebug.PRINT_SOURCE_MUTATION_EVENT) {
printSourceEvent(notifier, eventType, feature, oldValue, newValue, pos);
}
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-10-16 08:15:47 UTC (rev 4209)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2007-10-16 08:44:29 UTC (rev 4210)
@@ -348,7 +348,7 @@
switch (sourceNode.getNodeType()) {
case Node.ELEMENT_NODE:
Map<?, ?> xmlnsMap = createXmlns((Element) sourceNode);
- Set<?> ifDependencySet = new HashSet();
+ Set<Node> ifDependencySet = new HashSet<Node>();
pageContext.setCurrentVisualNode(visualOldContainer);
VpeTemplate template = templateManager.getTemplate(pageContext,
(Element) sourceNode, ifDependencySet);
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAttributeCreator.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAttributeCreator.java 2007-10-16 08:15:47 UTC (rev 4209)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAttributeCreator.java 2007-10-16 08:44:29 UTC (rev 4210)
@@ -71,7 +71,7 @@
private void setValue(VpePageContext pageContext, Element sourceElement, Map visualNodeMap) {
if (expression != null) {
- Element visualElement = (Element) visualNodeMap.get(this);
+ nsIDOMElement visualElement = (nsIDOMElement) visualNodeMap.get(this);
VpeValue vpeValue = expression.exec(pageContext, sourceElement);
if (vpeValue != null && vpeValue.stringValue().length() > 0) {
visualElement.setAttribute(this.name, vpeValue.stringValue());
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreator.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreator.java 2007-10-16 08:15:47 UTC (rev 4209)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreator.java 2007-10-16 08:44:29 UTC (rev 4210)
@@ -35,7 +35,7 @@
* @param visualNodeMap Is used for a storage padding information.
* @return The information on the created node of the visual tree.
*/
- VpeCreatorInfo create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument, nsIDOMElement visualElement, Map visualNodeMap);
+ VpeCreatorInfo create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument, nsIDOMElement visualElement, Map<VpeTemplate,?> visualNodeMap);
/**
* Is invoked after construction of all child nodes of the current visual node.
@@ -46,7 +46,7 @@
* @param visualElement The current element of the visual tree.
* @param visualNodeMap Is used for a storage padding information.
*/
- void validate(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement visualParent, nsIDOMElement visualElement, Map visualNodeMap);
+ void validate(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement visualParent, nsIDOMElement visualElement, Map<VpeTemplate,?> visualNodeMap);
/**
* Informs on remove of an element of the visual tree.
@@ -54,7 +54,7 @@
* @param sourceElement The current element of the source tree.
* @param visualNodeMap Is used for a storage padding information.
*/
- void removeElement(VpePageContext pageContext, Element sourceElement, Map visualNodeMap);
+ void removeElement(VpePageContext pageContext, Element sourceElement, Map<VpeTemplate,?> visualNodeMap);
/**
* Is used for refresh the current element of visual tree.
@@ -62,7 +62,7 @@
* @param sourceElement The current element of the source tree.
* @param visualNodeMap Is used for a storage padding information.
*/
- void refreshElement(VpePageContext pageContext, Element sourceElement, Map visualNodeMap);
+ void refreshElement(VpePageContext pageContext, Element sourceElement, Map<VpeTemplate,?> visualNodeMap);
/**
* Sets value of attribute of the current visual element.
@@ -73,7 +73,7 @@
* @param name Attribute name.
* @param value Attribute value.
*/
- void setAttribute(VpePageContext pageContext, Element sourceElement, Map visualNodeMap, String name, String value);
+ void setAttribute(VpePageContext pageContext, Element sourceElement, Map<VpeTemplate,?> visualNodeMap, String name, String value);
/**
* Informs on remove of attribute of the current source element.
@@ -82,7 +82,7 @@
* @param visualNodeMap Is used for a storage padding information.
* @param name Attribute name.
*/
- void removeAttribute(VpePageContext pageContext, Element sourceElement, Map visualNodeMap, String name);
+ void removeAttribute(VpePageContext pageContext, Element sourceElement, Map<VpeTemplate,?> visualNodeMap, String name);
/**
* Returns <code>true</code> if it is required to re-create an element at a modification of attribute, <code>false</code> otherwise.
@@ -110,5 +110,5 @@
*/
boolean nonctrlKeyPressHandler(VpePageContext pageContext, Document sourceDocument, Node sourceNode, Object data, long charCode, VpeSourceSelection selection, ITextFormatter formatter);
- Node getNodeForUptate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Map visualNodeMap);
+ Node getNodeForUptate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Map<VpeTemplate,?> visualNodeMap);
}
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java 2007-10-16 08:15:47 UTC (rev 4209)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeHtmlTemplate.java 2007-10-16 08:44:29 UTC (rev 4210)
@@ -65,14 +65,14 @@
private VpeCreator creator = null;
private VpeDependencyMap dependencyMap;
private boolean dependencyFromBundle;
-
+ @Override
protected void init(Element templateElement) {
dependencyMap = new VpeDependencyMap(caseSensitive);
super.init(templateElement);
dependencyMap.validate();
dependencyFromBundle = dependencyMap.contains(VpeExpressionBuilder.SIGNATURE_JSF_VALUE);
}
-
+ @Override
protected void initTemplateSection(Element templateSection) {
if (creator == null) {
String name = templateSection.getNodeName();
@@ -139,7 +139,7 @@
}
public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
- Map visualNodeMap = new HashMap();
+ Map<VpeTemplate, ModifyInfo> visualNodeMap = new HashMap<VpeTemplate, ModifyInfo> ();
VpeCreatorInfo creatorInfo = createVisualElement(pageContext, (Element)sourceNode, visualDocument, null, visualNodeMap);
nsIDOMElement newVisualElement = null;
if (creatorInfo != null) {
@@ -147,7 +147,7 @@
}
VpeCreationData creationData = new VpeCreationData(newVisualElement);
if (creatorInfo != null) {
- List childrenInfoList = creatorInfo.getChildrenInfoList();
+ List<VpeChildrenInfo> childrenInfoList = creatorInfo.getChildrenInfoList();
if (childrenInfoList != null) {
for (int i = 0; i < childrenInfoList.size(); i++) {
creationData.addChildrenInfo((VpeChildrenInfo)childrenInfoList.get(i));
@@ -157,28 +157,28 @@
creationData.setData(visualNodeMap);
return creationData;
}
-
+ @Override
public void validate(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument, VpeCreationData creationdata) {
- validateVisualElement(pageContext, (Element)sourceNode, visualDocument, null, (nsIDOMElement)creationdata.getNode(), (Map)creationdata.getData());
+ validateVisualElement(pageContext, (Element)sourceNode, visualDocument, null, (nsIDOMElement)creationdata.getNode(), (Map<VpeTemplate,ModifyInfo>)creationdata.getData());
}
-
- public void setAttribute(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
+ @Override
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
setAttribute(pageContext, sourceElement, (Map<?,?>)data, name, value);
}
-
+ @Override
public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
- removeAttribute(pageContext, sourceElement, (Map)data, name);
+ removeAttribute(pageContext, sourceElement, (Map<?,?>)data, name);
}
-
+ @Override
public void beforeRemove(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
- removeElement(pageContext, (Element)sourceNode, (Map) data);
+ removeElement(pageContext, (Element)sourceNode, (Map<VpeTemplate,?>) data);
}
-
+ @Override
public boolean isChildren() {
return creator == null ? false : children;
}
- private VpeCreatorInfo createVisualElement(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement visualParent, Map visualNodeMap) {
+ private VpeCreatorInfo createVisualElement(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement visualParent, Map<VpeTemplate,ModifyInfo> visualNodeMap) {
if (creator == null) {
return null;
}
@@ -202,12 +202,12 @@
return elementInfo;
}
- private void validateVisualElement(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement visualParent, nsIDOMElement visualElement, Map visualNodeMap) {
+ private void validateVisualElement(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement visualParent, nsIDOMElement visualElement, Map<VpeTemplate,ModifyInfo> visualNodeMap) {
if (creator != null) {
creator.validate(pageContext, sourceElement, visualDocument, visualParent, visualElement, visualNodeMap);
}
}
-
+ @Override
public boolean nonctrlKeyPressHandler(VpePageContext pageContext, Document sourceDocument, Node sourceNode, nsIDOMNode visualNode, Object data, long charCode, VpeSourceSelection selection, ITextFormatter formatter) {
if (creator != null) {
boolean done = creator.nonctrlKeyPressHandler(pageContext, sourceDocument, sourceNode, data, charCode, selection, formatter);
@@ -227,11 +227,12 @@
*
* Deprecated
*/
+ @Override
public void refreshBundleValues(VpePageContext pageContext, Element sourceElement, Object data) {
- refreshBundleValues(pageContext, sourceElement, (Map<?,?>) data);
+ refreshBundleValues(pageContext, sourceElement, (Map<VpeTemplate,ModifyInfo>) data);
}
- private void refreshBundleValues(VpePageContext pageContext, Element sourceElement, Map visualNodeMap) {
+ private void refreshBundleValues(VpePageContext pageContext, Element sourceElement, Map<VpeTemplate,ModifyInfo> visualNodeMap) {
if (dependencyFromBundle) {
VpeCreator[] creators = dependencyMap.getCreators(VpeExpressionBuilder.SIGNATURE_JSF_VALUE);
for (int i = 0; i < creators.length; i++) {
@@ -245,6 +246,7 @@
*
* Deprecated
*/
+ @Override
public int getType() {
return type;
}
@@ -253,6 +255,7 @@
*
* Deprecated
*/
+ @Override
public VpeAnyData getAnyData() {
VpeAnyData data = null;
if (getType() == TYPE_ANY && creator != null) {
@@ -276,11 +279,12 @@
*
* Deprecated
*/
+ @Override
public void openBundleEditors(VpePageContext pageContext, Element sourceElement, Object data) {
- openBundleEditors(pageContext, sourceElement, (Map) data);
+ openBundleEditors(pageContext, sourceElement, (Map<VpeTemplate,nsIDOMElement>) data);
}
- private void openBundleEditors(VpePageContext pageContext, Element sourceElement, Map visualNodeMap) {
+ private void openBundleEditors(VpePageContext pageContext, Element sourceElement, Map<VpeTemplate,nsIDOMElement> visualNodeMap) {
if (dependencyFromBundle) {
VpeCreator[] creators = dependencyMap.getCreators(VpeExpressionBuilder.SIGNATURE_JSF_VALUE);
for (int i = 0; i < creators.length; i++) {
@@ -352,6 +356,7 @@
*
* Deprecated
*/
+ @Override
public void openIncludeEditor(VpePageContext pageContext, Element sourceElement, Object data) {
openIncludeEditor(pageContext, sourceElement, (Map) data);
}
@@ -374,11 +379,12 @@
*
* Deprecated
*/
+ @Override
public void setSourceAttributeValue(VpePageContext pageContext, Element sourceElement, Object data) {
- setSourceAttributeValue(pageContext, sourceElement, (Map)data);
+ setSourceAttributeValue(pageContext, sourceElement, (Map<?,?>)data);
}
- private void setSourceAttributeValue(VpePageContext pageContext, Element sourceElement, Map visualNodeMap) {
+ private void setSourceAttributeValue(VpePageContext pageContext, Element sourceElement, Map<?,?> visualNodeMap) {
VpeCreator[] creators = dependencyMap.getCreators(VpeValueCreator.SIGNATURE_VPE_VALUE);
for (int i = 0; i < creators.length; i++) {
if (creators[i] instanceof VpeOutputAttributes) {
@@ -387,7 +393,7 @@
}
changeModify(pageContext, sourceElement, visualNodeMap);
}
-
+ @Override
public String[] getOutputAtributeNames() {
VpeCreator[] creators = dependencyMap.getCreators(VpeValueCreator.SIGNATURE_VPE_VALUE);
for (int i = 0; i < creators.length; i++) {
@@ -397,12 +403,12 @@
}
return null;
}
-
+ @Override
public nsIDOMText getOutputTextNode(VpePageContext pageContext, Element sourceElement, Object data) {
VpeCreator[] creators = dependencyMap.getCreators(VpeValueCreator.SIGNATURE_VPE_VALUE);
for (int i = 0; i < creators.length; i++) {
if (creators[i] instanceof VpeOutputAttributes) {
- return ((VpeOutputAttributes)creators[i]).getOutputTextNode(pageContext, sourceElement, (Map)data);
+ return ((VpeOutputAttributes)creators[i]).getOutputTextNode(pageContext, sourceElement, (Map<?,?>)data);
}
}
return null;
@@ -412,6 +418,7 @@
*
* Deprecated
*/
+ @Override
public void setSourceAttributeSelection(VpePageContext pageContext, Element sourceElement, int offset, int length, Object data) {
setSourceAttributeSelection(pageContext, sourceElement, offset, length, (Map) data);
}
@@ -510,6 +517,7 @@
*
* Deprecated
*/
+ @Override
public boolean isOutputAttributes() {
VpeCreator[] creators = dependencyMap.getCreators(VpeValueCreator.SIGNATURE_VPE_VALUE);
for (int i = 0; i < creators.length; i++) {
@@ -522,7 +530,7 @@
//////////////////////////////////////////////
- private void removeElement(VpePageContext pageContext, Element sourceElement, Map visualNodeMap) {
+ private void removeElement(VpePageContext pageContext, Element sourceElement, Map<VpeTemplate,?> visualNodeMap) {
if (creator != null) {
if (dependencyFromBundle) {
pageContext.removeBundleDependency(sourceElement);
@@ -547,25 +555,25 @@
}
}
- private void setAttribute(VpeCreator[] creators, VpePageContext pageContext, Element sourceElement, Map visualNodeMap, String name, String value) {
+ private void setAttribute(VpeCreator[] creators, VpePageContext pageContext, Element sourceElement, Map<VpeTemplate,?> visualNodeMap, String name, String value) {
for (int i = 0; i < creators.length; i++) {
creators[i].setAttribute(pageContext, sourceElement, visualNodeMap, name, value);
}
}
- private void removeAttribute(VpeCreator[] creators, VpePageContext pageContext, Element sourceElement, Map visualNodeMap, String name) {
+ private void removeAttribute(VpeCreator[] creators, VpePageContext pageContext, Element sourceElement, Map<VpeTemplate,?> visualNodeMap, String name) {
for (int i = 0; i < creators.length; i++) {
creators[i].removeAttribute(pageContext, sourceElement, visualNodeMap, name);
}
}
-
+ @Override
public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement visualNode, Object data, String name, String value) {
if (creator != null) {
return creator.isRecreateAtAttrChange(pageContext, sourceElement, visualDocument, visualNode, data, name, value);
}
return false;
}
-
+ @Override
public Node getNodeForUptate(VpePageContext pageContext, Node sourceNode, nsIDOMNode visualNode, Object data) {
// TODO Sergey Vasilyev redevelop JSF's facet template
if (sourceNode.getNodeName().endsWith(":facet")) {
@@ -573,7 +581,7 @@
}
if (creator != null) {
- return creator.getNodeForUptate(pageContext, sourceNode, visualNode, (Map)data);
+ return creator.getNodeForUptate(pageContext, sourceNode, visualNode, (Map<VpeTemplate,?>)data);
}
return null;
}
Modified: branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeDebugUtil.java
===================================================================
--- branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeDebugUtil.java 2007-10-16 08:15:47 UTC (rev 4209)
+++ branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeDebugUtil.java 2007-10-16 08:44:29 UTC (rev 4210)
@@ -14,6 +14,7 @@
import java.text.SimpleDateFormat;
import java.util.Date;
import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.vpe.VpeDebug;
/**
* @author Max Areshkau (mareshkau(a)exadel.com)
@@ -37,4 +38,13 @@
System.out.print(formatter.format(new Date())+":"+ msg);
}
}
+ /**
+ *
+ */
+ public static void debugVPEDnDEvents(String msg) {
+ if(VpeDebug.PRINT_VISUAL_DRAGDROP_EVENT) {
+
+ System.out.println(formatter.format(new Date())+":"+ msg);
+ }
+ }
}
17 years, 3 months
JBoss Tools SVN: r4209 - in trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui: widget/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-10-16 04:15:47 -0400 (Tue, 16 Oct 2007)
New Revision: 4209
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-758
Combo with all dialects is added, after DB type is changed default dialect for DB type is selectd
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-10-15 19:04:24 UTC (rev 4208)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-10-16 08:15:47 UTC (rev 4209)
@@ -77,7 +77,9 @@
/**
*
*/
- private DriverClassHelpers HIBERNATE_HELPER = new DriverClassHelpers();
+ private static final DriverClassHelpers HIBERNATE_HELPER = new DriverClassHelpers();
+
+ private static final List<String> DIALECT_CLASSES = getDialectClasses();
/**
*
@@ -120,10 +122,10 @@
.getDialectNames()), getDefaultDbType(), false);
private IFieldEditor jBossHibernateDialectEditor = IFieldEditorFactory.INSTANCE
- .createUneditableTextEditor(
+ .createComboEditor(
ISeamFacetDataModelProperties.HIBERNATE_DIALECT,
- SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_HIBERNATE_DIALECT, HIBERNATE_HELPER
- .getDialectClass(getDefaultDbType()));
+ SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_HIBERNATE_DIALECT,DIALECT_CLASSES, HIBERNATE_HELPER
+ .getDialectClass(getDefaultDbType()),true);
private IFieldEditor dbSchemaName = IFieldEditorFactory.INSTANCE.createTextEditor(
ISeamFacetDataModelProperties.DB_SCHEMA_NAME,
@@ -173,6 +175,17 @@
/**
* @return
*/
+ private static List getDialectClasses() {
+ List<String> dialects = new ArrayList<String>();
+ for (String dialectName : HIBERNATE_HELPER.getDialectNames()) {
+ dialects.add(HIBERNATE_HELPER.getDialectClass(dialectName));
+ }
+ return dialects;
+ }
+
+ /**
+ * @return
+ */
private String getDefaultDbType() {
// TODO Auto-generated method stub
return SeamFacetPreference.getStringPreference(
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2007-10-15 19:04:24 UTC (rev 4208)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2007-10-16 08:15:47 UTC (rev 4209)
@@ -100,4 +100,14 @@
super.setEditable(ediatble);
comboField.setEditable(ediatble);
}
+
+ public void setValue(Object newValue) {
+ super.setValue(newValue);
+ if(comboField!=null) {
+ comboField.removePropertyChangeListener(this);
+ comboField.setValue(newValue.toString());
+ comboField.addPropertyChangeListener(this);
+ }
+
+ }
}
\ No newline at end of file
17 years, 3 months
JBoss Tools SVN: r4208 - trunk/seam/features/org.jboss.tools.seam.feature.
by jbosstools-commits@lists.jboss.org
Author: mculpepper(a)jboss.com
Date: 2007-10-15 15:04:24 -0400 (Mon, 15 Oct 2007)
New Revision: 4208
Modified:
trunk/seam/features/org.jboss.tools.seam.feature/feature.xml
Log:
[JBIDE-925] removed seam gen plugin
Modified: trunk/seam/features/org.jboss.tools.seam.feature/feature.xml
===================================================================
--- trunk/seam/features/org.jboss.tools.seam.feature/feature.xml 2007-10-15 17:29:09 UTC (rev 4207)
+++ trunk/seam/features/org.jboss.tools.seam.feature/feature.xml 2007-10-15 19:04:24 UTC (rev 4208)
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.jboss.tools.seam.feature"
- label="SeamTools Feature"
- version="1.0.0"
- provider-name="RedHat, Inc.">
-
- <description url="http://www.jboss.org/tools">
- JBossTools Seam Feature
- </description>
-
- <copyright>
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.seam.feature"
+ label="SeamTools Feature"
+ version="1.0.0"
+ provider-name="RedHat, Inc.">
+
+ <description url="http://www.jboss.org/tools">
+ JBossTools Seam Feature
+ </description>
+
+ <copyright>
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
- </copyright>
-
- <license url="http://www.eclipse.org/legal/epl-v10.html">
+Red Hat, Inc. - initial API and implementation
+ </copyright>
+
+ <license url="http://www.eclipse.org/legal/epl-v10.html">
Eclipse Public License - v 1.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS
ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR
@@ -215,52 +215,46 @@
No party to this Agreement will bring a legal action under this
Agreement more than one year after the cause of action arose.
Each party waives its rights to a jury trial in any resulting
-litigation.
- </license>
-
- <requires>
- <import feature="org.jboss.tools.richfaces.feature"/>
- <import feature="org.jboss.ide.eclipse.as.feature"/>
- <import feature="org.hibernate.eclipse.feature"/>
- <import feature="org.eclipse.datatools.connectivity.feature"/>
- <import feature="org.eclipse.datatools.enablement.jdbc.feature"/>
- </requires>
-
- <plugin
- id="org.jboss.tools.seam.core"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.seam.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.jboss.tools.seam.xml"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.seam.xml.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.seam.text.ext"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.ide.seam.gen"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
+litigation.
+ </license>
+
+ <requires>
+ <import feature="org.jboss.tools.richfaces.feature"/>
+ <import feature="org.jboss.ide.eclipse.as.feature"/>
+ <import feature="org.hibernate.eclipse.feature"/>
+ <import feature="org.eclipse.datatools.connectivity.feature"/>
+ <import feature="org.eclipse.datatools.enablement.jdbc.feature"/>
+ </requires>
+
+ <plugin
+ id="org.jboss.tools.seam.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.seam.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.jboss.tools.seam.xml"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.seam.xml.ui"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+ <plugin
+ id="org.jboss.tools.seam.text.ext"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
+</feature>
17 years, 3 months
JBoss Tools SVN: r4207 - in branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: src/org/jboss/tools/jsf/vpe/richfaces/template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2007-10-15 13:29:09 -0400 (Mon, 15 Oct 2007)
New Revision: 4207
Added:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tree/divLine.gif
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tree/tree.css
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesRecursiveTreeNodesAdaptorTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodeTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodesAdaptorTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-847 add RichFaces treeNodesAdaptor,recursiveTreeNodesAdaptor
Added: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tree/divLine.gif
===================================================================
(Binary files differ)
Property changes on: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tree/divLine.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tree/tree.css
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tree/tree.css 2007-10-15 17:25:04 UTC (rev 4206)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/tree/tree.css 2007-10-15 17:29:09 UTC (rev 4207)
@@ -10,8 +10,8 @@
}
.dr-tree-h-ic-div {
- margin-left: 8px;
- padding-left: 14px;
+ margin-left: 10px;
+ padding-left: 12px;
}
.dr-tree-full-width {
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesRecursiveTreeNodesAdaptorTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesRecursiveTreeNodesAdaptorTemplate.java 2007-10-15 17:25:04 UTC (rev 4206)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesRecursiveTreeNodesAdaptorTemplate.java 2007-10-15 17:29:09 UTC (rev 4207)
@@ -1,106 +1,202 @@
-/*******************************************************************************
- * 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.richfaces.template;
-
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
-import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
-import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
-import org.jboss.tools.vpe.editor.template.VpeCreationData;
-import org.mozilla.interfaces.nsIDOMDocument;
-import org.mozilla.interfaces.nsIDOMElement;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Create template for rich:recursiveTreeNodesAdaptor element
- *
- * @author dsakovich(a)exadel.com
- *
- */
-public class RichFacesRecursiveTreeNodesAdaptorTemplate extends
- VpeAbstractTemplate {
- private final static String TREE_NODE_NAME = "treeNode";
-
- private static final String TREE_TABLE_ATR_CELLSPACING_VALUE = "0px";
-
- private static final String TREE_TABLE_ATR_CELLPADDING_VALUE = "0px";
-
- private static final String TREE_TABLE_ATR_BORDER_VALUE = "0px";
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- nsIDOMElement visualElement = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- addBasicTreeNodeAttributes(visualElement);
- VpeCreationData vpeCreationData = new VpeCreationData(visualElement);
- parseTree(pageContext, sourceNode, visualDocument, vpeCreationData,
- visualElement);
- return vpeCreationData;
- }
-
- /**
- *
- * Function for parsing tree by tree nodes;
- *
- * @param pageContext
- * @param sourceNode
- * @param visualDocument
- * @return
- */
- public void parseTree(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument, VpeCreationData vpeCreationData,
- nsIDOMElement parentElement) {
- NodeList nodeList = sourceNode.getChildNodes();
- Element element = null;
- int lenght = nodeList.getLength();
- String treeNodeName = sourceNode.getPrefix() + ":" + TREE_NODE_NAME;
- VpeChildrenInfo vpeChildrenInfo = null;
- for (int i = 0; i < lenght; i++) {
- if (!(nodeList.item(i) instanceof Element)) {
- continue;
- }
- element = (Element) nodeList.item(i);
- if (element.getNodeName().equals(treeNodeName)) {
- nsIDOMElement tr = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
- nsIDOMElement td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- tr.appendChild(td);
- vpeChildrenInfo = new VpeChildrenInfo(td);
- vpeCreationData.addChildrenInfo(vpeChildrenInfo);
- vpeChildrenInfo.addSourceChild(element);
- parentElement.appendChild(tr);
- }
- }
- }
-
- /**
- * Set attributes for treeNode
- *
- * @param table
- */
- private void addBasicTreeNodeAttributes(nsIDOMElement table) {
- if (table == null) {
- return;
- }
- table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR,
- TREE_TABLE_ATR_CELLPADDING_VALUE);
- table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR,
- TREE_TABLE_ATR_CELLSPACING_VALUE);
- table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR,
- TREE_TABLE_ATR_BORDER_VALUE);
- table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- "dr-tree-full-width");
- }
-
-}
+/*******************************************************************************
+ * 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.richfaces.template;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.RichFacesTemplatesActivator;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Create template for rich:recursiveTreeNodesAdaptor element
+ *
+ * @author dsakovich(a)exadel.com
+ *
+ */
+public class RichFacesRecursiveTreeNodesAdaptorTemplate extends
+ VpeAbstractTemplate {
+
+ private static final String TREE_NAME = "tree";
+
+ private final static String TREE_NODE_NAME = "treeNode";
+
+ public final static String TREE_NODES_ADAPTOR_NAME = "treeNodesAdaptor";
+
+ public final static String RECURSIVE_TREE_NODES_ADAPTOR_NAME = "recursiveTreeNodesAdaptor";
+
+ private static final String STYLE_PATH = "/tree/tree.css";
+
+ public static final String ICON_DIV_LINE = "/tree/divLine.gif";
+
+ private static final String ADAPTER_LINES_STYLE = "background-position: left center; background-repeat: repeat-y;";
+
+ public static final String ID_ATTR_NAME = "ID";
+
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ ComponentUtil.setCSSLink(pageContext, STYLE_PATH,
+ "recursiveTreeNodesAdaptor");
+ nsIDOMElement visualElement = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ visualElement.setAttribute(ID_ATTR_NAME,
+ RECURSIVE_TREE_NODES_ADAPTOR_NAME);
+ if (isHasParentAdapter(sourceNode)) {
+ visualElement.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ "dr-tree-h-ic-div");
+ if (getShowLinesAttr(sourceNode)
+ && isHasNextParentAdaptorElement(sourceNode)) {
+ String path = RichFacesTemplatesActivator
+ .getPluginResourcePath()
+ + ICON_DIV_LINE;
+ visualElement.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ "background-image: url(file://" + path + "); "
+ + ADAPTER_LINES_STYLE);
+ }
+ }
+ VpeCreationData vpeCreationData = new VpeCreationData(visualElement);
+ parseTree(pageContext, sourceNode, visualDocument, vpeCreationData,
+ visualElement);
+ return vpeCreationData;
+ }
+
+ /**
+ *
+ * Function for parsing tree by tree nodes;
+ *
+ * @param pageContext
+ * @param sourceNode
+ * @param visualDocument
+ * @return
+ */
+ public void parseTree(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData vpeCreationData,
+ nsIDOMElement parentElement) {
+ NodeList nodeList = sourceNode.getChildNodes();
+ Element element = null;
+ int lenght = nodeList.getLength();
+ String treeNodeName = sourceNode.getPrefix() + ":" + TREE_NODE_NAME;
+ String treeNodesAdaptorName = sourceNode.getPrefix() + ":"
+ + TREE_NODES_ADAPTOR_NAME;
+ String recursiveTreeNodesAdaptorName = sourceNode.getPrefix() + ":"
+ + RECURSIVE_TREE_NODES_ADAPTOR_NAME;
+ VpeChildrenInfo vpeChildrenInfo = null;
+ for (int i = 0; i < lenght; i++) {
+ if (!(nodeList.item(i) instanceof Element)) {
+ continue;
+ }
+ element = (Element) nodeList.item(i);
+ if (element.getNodeName().equals(treeNodeName)
+ || element.getNodeName().equals(
+ recursiveTreeNodesAdaptorName)) {
+ vpeChildrenInfo = new VpeChildrenInfo(parentElement);
+ vpeCreationData.addChildrenInfo(vpeChildrenInfo);
+ vpeChildrenInfo.addSourceChild(element);
+ } else if (element.getNodeName().equals(treeNodesAdaptorName)) {
+ vpeChildrenInfo = new VpeChildrenInfo(parentElement);
+ vpeCreationData.addChildrenInfo(vpeChildrenInfo);
+ vpeChildrenInfo.addSourceChild(element);
+ }
+ }
+ }
+
+ /**
+ *
+ * @param sourceNode
+ * @return
+ */
+ public boolean isHasParentAdapter(Node sourceNode) {
+ String treeNodesAdaptorName = sourceNode.getPrefix() + ":"
+ + TREE_NODES_ADAPTOR_NAME;
+ String recursiveTreeNodesAdaptorName = sourceNode.getPrefix() + ":"
+ + RECURSIVE_TREE_NODES_ADAPTOR_NAME;
+ Node node = sourceNode.getParentNode();
+ if (node.getNodeName().equals(treeNodesAdaptorName)
+ || node.getNodeName().equals(recursiveTreeNodesAdaptorName)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Get showConnectingLines attribute
+ *
+ * @param sourceNode
+ * @return
+ */
+ private boolean getShowLinesAttr(Node sourceNode) {
+ String treeName = sourceNode.getPrefix() + ":" + TREE_NAME;
+ do {
+ sourceNode = sourceNode.getParentNode();
+ if (!(sourceNode instanceof Element)) {
+ return true;
+ }
+ } while (!sourceNode.getNodeName().equals(treeName));
+
+ String showLinesParam = ((Element) sourceNode)
+ .getAttribute(RichFacesTreeTemplate.SHOW_LINES_ATTR_NAME);
+
+ boolean showLinesValue = true;
+ if (showLinesParam != null && showLinesParam.equalsIgnoreCase("false")) {
+ showLinesValue = false;
+ }
+ return showLinesValue;
+ }
+
+ /**
+ * Has Next element
+ *
+ * @param sourceNode
+ * @return
+ */
+ private boolean isHasNextParentAdaptorElement(Node sourceNode) {
+ Node parentTree = sourceNode.getParentNode();
+ if (!(parentTree instanceof Element)) {
+ return true;
+ }
+ NodeList childs = parentTree.getChildNodes();
+ String treeNodeName = parentTree.getPrefix() + ":"
+ + RichFacesTreeTemplate.TREE_NODE_NAME;
+ String treeNodesAdaptorName = parentTree.getPrefix() + ":"
+ + RichFacesTreeTemplate.TREE_NODES_ADAPTOR;
+ String treeRecursiveNodesAdaptorName = parentTree.getPrefix() + ":"
+ + RichFacesTreeTemplate.TREE_RECURSIVE_NODES_ADAPTOR;
+ Node lastElement = null;
+ Node el = null;
+
+ for (int i = 0; i < childs.getLength(); i++) {
+ el = childs.item(i);
+ if (!(el instanceof Element)) {
+ continue;
+ }
+
+ if (lastElement != null) {
+ break;
+ }
+ if (el.equals(sourceNode)) {
+ lastElement = el;
+ }
+ }
+ if (el.getNodeName().equals(treeNodeName)
+ || el.getNodeName().equals(treeNodesAdaptorName)
+ || el.getNodeName().equals(treeRecursiveNodesAdaptorName)) {
+ return true;
+ }
+ return false;
+ }
+}
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodeTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodeTemplate.java 2007-10-15 17:25:04 UTC (rev 4206)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodeTemplate.java 2007-10-15 17:29:09 UTC (rev 4207)
@@ -224,9 +224,9 @@
// creates icon with status of node(collapsed or not) node
nsIDOMElement td1 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
-
// sets icon node
- if (!isLastElement(sourceNode) && isAdaptorChild(sourceNode)) {
+ if (!isLastElement(sourceNode) && isAdaptorChild(sourceNode)
+ && !isHasNextAdaptorElement(sourceNode)) {
backgroundLinePath = RichFacesTemplatesActivator
.getPluginResourcePath()
+ ICON_LINE;
@@ -238,7 +238,32 @@
(Element) sourceNode, iconNode, NODE_ICON_ATTR_NAME,
showLinesValue == true ? ICON_NODE_WITH_LINE
: ICON_NODE_WITHOUT_LINES);
- } else if ((isAdaptorChild(sourceNode) && isLastElement(sourceNode) && isLastElementAfterAdaptor(sourceNode))
+ } else if (!isLastElement(sourceNode) && isAdaptorChild(sourceNode)
+ && isHasNextAdaptorElement(sourceNode)) {
+ backgroundLinePath = RichFacesTemplatesActivator
+ .getPluginResourcePath()
+ + ICON_LINE;
+ setAttributeForPictureNode(pageContext, visualDocument,
+ (Element) sourceNode, td1, NODE_ICON_EXPANDED_ATTR_NAME,
+ showLinesValue == true ? ICON_EXPANDED_ADAPTER_WITH_LINES
+ : ICON_EXPANDED_ADAPTER_WITHOUT_LINES);
+ setAttributeForPictureNode(pageContext, visualDocument,
+ (Element) sourceNode, iconNode, NODE_ICON_ATTR_NAME,
+ showLinesValue == true ? ICON_NODE_WITH_LINES
+ : ICON_NODE_WITHOUT_LINES);
+ if (showLinesValue) {
+ String path = RichFacesTemplatesActivator
+ .getPluginResourcePath()
+ + ICON_LEFT_LINE;
+ iconNode.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ "background-image: url(file://" + path + "); "
+ + NODE_LINES_STYLE);
+ }
+ } else if ((isAdaptorChild(sourceNode) && isLastElement(sourceNode) && (isLastElementAfterAdaptor(sourceNode) == isAdaptorInTree(sourceNode)) /*
+ * &&
+ * (isAdaptorInTree(sourceNode) ==
+ * isLastElementAfterAdaptor(sourceNode))
+ */)
|| (!isAdaptorChild(sourceNode) && isLastElement(sourceNode))) {
backgroundLinePath = RichFacesTemplatesActivator
.getPluginResourcePath()
@@ -315,8 +340,8 @@
nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data,
String name, String value) {
/*
- * processed only next attributes iconExpanded and icon, becouse tree
- * allways shows as expanded and information is it leaf or not contains
+ * processed only next attributes iconExpanded and icon, because tree
+ * always shows as expanded and information is it leaf or not contains
* in model
*/
if (NODE_ICON_EXPANDED_ATTR_NAME.equalsIgnoreCase(name)) {
@@ -326,7 +351,6 @@
nsIDOMElement img = (nsIDOMElement) expandedIconCell
.getChildNodes().item(0).queryInterface(
nsIDOMElement.NS_IDOMELEMENT_IID);
-
ComponentUtil.setImgFromResources(pageContext, img, value,
UNDEFINED_ICON);
img.setAttribute(ICON_PARAM_NAME, "");
@@ -336,7 +360,6 @@
.item(1).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
nsIDOMElement img = (nsIDOMElement) iconCell.getChildNodes()
.item(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
-
ComponentUtil.setImgFromResources(pageContext, img, value,
UNDEFINED_ICON);
img.setAttribute(ICON_PARAM_NAME, "");
@@ -346,7 +369,6 @@
.item(1).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
nsIDOMElement img = (nsIDOMElement) iconCell.getChildNodes()
.item(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
-
ComponentUtil.setImgFromResources(pageContext, img, value,
UNDEFINED_ICON);
img.setAttribute(ICON_PARAM_NAME, "");
@@ -358,8 +380,8 @@
Element sourceElement, nsIDOMDocument visualDocument,
nsIDOMNode visualNode, Object data, String name) {
/*
- * processed only next attributes iconExpanded and icon, becouse tree
- * allways shows as expanded and information is it leaf or not contains
+ * processed only next attributes iconExpanded and icon, because tree
+ * always shows as expanded and information is it leaf or not contains
* in model
*/
@@ -371,7 +393,6 @@
nsIDOMElement img = (nsIDOMElement) expandedIconCell
.getChildNodes().item(0).queryInterface(
nsIDOMElement.NS_IDOMELEMENT_IID);
-
String parentAttrName = ((Element) sourceElement.getParentNode())
.getAttribute(NODE_ICON_EXPANDED_ATTR_NAME);
if (parentAttrName == null || parentAttrName.length() == 0) {
@@ -392,7 +413,6 @@
nsIDOMElement img = (nsIDOMElement) iconCell.getChildNodes()
.item(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
-
String parentAttrName = ((Element) sourceElement.getParentNode())
.getAttribute(NODE_ICON_ATTR_NAME);
if (parentAttrName == null || parentAttrName.length() == 0) {
@@ -411,7 +431,6 @@
.item(1).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
nsIDOMElement img = (nsIDOMElement) iconCell.getChildNodes()
.item(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
-
String parentAttrName = ((Element) sourceElement.getParentNode())
.getAttribute(NODE_ICON_LEAF_ATTR_NAME);
if (parentAttrName == null || parentAttrName.length() == 0) {
@@ -428,9 +447,41 @@
/**
*
+ * @param parentTree
* @param sourceNode
* @return
*/
+ private boolean isLastElement(nsIDOMNode sourceNode) {
+ nsIDOMNode parentTree = sourceNode.getParentNode();
+ if (!(parentTree instanceof Element)) {
+ return true;
+ }
+ nsIDOMNodeList childs = parentTree.getChildNodes();
+ String treeNodeName = parentTree.getPrefix() + ":"
+ + RichFacesTreeTemplate.TREE_NODE_NAME;
+ String treeNodesAdaptorName = parentTree.getPrefix() + ":"
+ + RichFacesTreeTemplate.TREE_NODES_ADAPTOR;
+ String treeRecursiveNodesAdaptorName = parentTree.getPrefix() + ":"
+ + RichFacesTreeTemplate.TREE_RECURSIVE_NODES_ADAPTOR;
+ nsIDOMNode lastElement = null;
+ nsIDOMNode el = null;
+ for (int i = 0; i < childs.getLength(); i++) {
+ el = childs.item(i);
+ if (el.getNodeName().equals(treeNodeName)
+ || el.getNodeName().equals(treeNodesAdaptorName)
+ || el.getNodeName().equals(treeRecursiveNodesAdaptorName)) {
+ lastElement = el;
+ }
+ }
+ return sourceNode.equals(lastElement);
+ }
+
+ /**
+ * Node is Adaptor child
+ *
+ * @param sourceNode
+ * @return
+ */
private boolean isAdaptorChild(Node sourceNode) {
Node parentNode = sourceNode.getParentNode();
if (!(parentNode instanceof Element)) {
@@ -450,6 +501,7 @@
}
/**
+ * Node is last element
*
* @param parentTree
* @param sourceNode
@@ -481,34 +533,42 @@
}
/**
+ * Next element is Adaptor
*
- * @param parentTree
* @param sourceNode
* @return
*/
- private boolean isLastElement(nsIDOMNode sourceNode) {
- nsIDOMNode parentTree = sourceNode.getParentNode();
+ private boolean isHasNextAdaptorElement(Node sourceNode) {
+ Node parentTree = sourceNode.getParentNode();
if (!(parentTree instanceof Element)) {
return true;
}
- nsIDOMNodeList childs = parentTree.getChildNodes();
- String treeNodeName = parentTree.getPrefix() + ":"
- + RichFacesTreeTemplate.TREE_NODE_NAME;
+ NodeList childs = parentTree.getChildNodes();
String treeNodesAdaptorName = parentTree.getPrefix() + ":"
+ RichFacesTreeTemplate.TREE_NODES_ADAPTOR;
String treeRecursiveNodesAdaptorName = parentTree.getPrefix() + ":"
+ RichFacesTreeTemplate.TREE_RECURSIVE_NODES_ADAPTOR;
- nsIDOMNode lastElement = null;
- nsIDOMNode el = null;
+ Node lastElement = null;
+ Node el = null;
+
for (int i = 0; i < childs.getLength(); i++) {
el = childs.item(i);
- if (el.getNodeName().equals(treeNodeName)
- || el.getNodeName().equals(treeNodesAdaptorName)
- || el.getNodeName().equals(treeRecursiveNodesAdaptorName)) {
+ if (!(el instanceof Element)) {
+ continue;
+ }
+
+ if (lastElement != null) {
+ break;
+ }
+ if (el.equals(sourceNode)) {
lastElement = el;
}
}
- return sourceNode.equals(lastElement);
+ if (el.getNodeName().equals(treeNodesAdaptorName)
+ || el.getNodeName().equals(treeRecursiveNodesAdaptorName)) {
+ return true;
+ }
+ return false;
}
/**
@@ -567,6 +627,7 @@
}
/**
+ * Node has element after adaptor
*
* @param sourceNode
* @return
@@ -578,4 +639,30 @@
}
return isLastElement(nodeAdaptor);
}
+
+ /**
+ *
+ * @param sourceNode
+ * @return
+ */
+ private boolean isAdaptorInTree(Node sourceNode) {
+ Node adaptorNode = sourceNode.getParentNode();
+ if (!(adaptorNode instanceof Element)) {
+ return true;
+ }
+ String treeNodesAdaptorName = adaptorNode.getPrefix() + ":"
+ + RichFacesTreeTemplate.TREE_NODES_ADAPTOR;
+ String treeRecursiveNodesAdaptorName = adaptorNode.getPrefix() + ":"
+ + RichFacesTreeTemplate.TREE_RECURSIVE_NODES_ADAPTOR;
+ if (adaptorNode.getNodeName().equals(treeNodesAdaptorName)
+ || adaptorNode.getNodeName().equals(
+ treeRecursiveNodesAdaptorName)) {
+ Node treeNode = adaptorNode.getParentNode();
+ String treeName = treeNode.getPrefix() + ":" + TREE_NAME;
+ if (treeNode.getNodeName().equals(treeName)) {
+ return true;
+ }
+ }
+ return false;
+ }
}
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodesAdaptorTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodesAdaptorTemplate.java 2007-10-15 17:25:04 UTC (rev 4206)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodesAdaptorTemplate.java 2007-10-15 17:29:09 UTC (rev 4207)
@@ -10,7 +10,9 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.RichFacesTemplatesActivator;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
@@ -29,19 +31,41 @@
*/
public class RichFacesTreeNodesAdaptorTemplate extends VpeAbstractTemplate {
+ private static final String TREE_NAME = "tree";
+
private final static String TREE_NODE_NAME = "treeNode";
- private static final String TREE_TABLE_ATR_CELLSPACING_VALUE = "0px";
+ public final static String TREE_NODES_ADAPTOR_NAME = "treeNodesAdaptor";
- private static final String TREE_TABLE_ATR_CELLPADDING_VALUE = "0px";
+ public final static String RECURSIVE_TREE_NODES_ADAPTOR_NAME = "recursiveTreeNodesAdaptor";
- private static final String TREE_TABLE_ATR_BORDER_VALUE = "0px";
+ private static final String STYLE_PATH = "/tree/tree.css";
+ public static final String ICON_DIV_LINE = "/tree/divLine.gif";
+
+ private static final String ADAPTER_LINES_STYLE = "background-position: left center; background-repeat: repeat-y;";
+
+ public static final String ID_ATTR_NAME = "ID";
+
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
+ ComponentUtil.setCSSLink(pageContext, STYLE_PATH, "treeNodesAdaptor");
nsIDOMElement visualElement = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- addBasicTreeNodeAttributes(visualElement);
+ .createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ visualElement.setAttribute(ID_ATTR_NAME, TREE_NODES_ADAPTOR_NAME);
+ if (isHasParentAdapter(sourceNode)) {
+ visualElement.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ "dr-tree-h-ic-div");
+ if (getShowLinesAttr(sourceNode)
+ && isHasNextParentAdaptorElement(sourceNode)) {
+ String path = RichFacesTemplatesActivator
+ .getPluginResourcePath()
+ + ICON_DIV_LINE;
+ visualElement.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ "background-image: url(file://" + path + "); "
+ + ADAPTER_LINES_STYLE);
+ }
+ }
VpeCreationData vpeCreationData = new VpeCreationData(visualElement);
parseTree(pageContext, sourceNode, visualDocument, vpeCreationData,
visualElement);
@@ -64,42 +88,112 @@
Element element = null;
int lenght = nodeList.getLength();
String treeNodeName = sourceNode.getPrefix() + ":" + TREE_NODE_NAME;
+ String treeNodesAdaptorName = sourceNode.getPrefix() + ":"
+ + TREE_NODES_ADAPTOR_NAME;
+ String recursiveTreeNodesAdaptorName = sourceNode.getPrefix() + ":"
+ + RECURSIVE_TREE_NODES_ADAPTOR_NAME;
VpeChildrenInfo vpeChildrenInfo = null;
for (int i = 0; i < lenght; i++) {
if (!(nodeList.item(i) instanceof Element)) {
continue;
}
element = (Element) nodeList.item(i);
- if (element.getNodeName().equals(treeNodeName)) {
- nsIDOMElement tr = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TR);
- nsIDOMElement td = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_TD);
- tr.appendChild(td);
- vpeChildrenInfo = new VpeChildrenInfo(td);
+ if (element.getNodeName().equals(treeNodeName)
+ || element.getNodeName().equals(
+ recursiveTreeNodesAdaptorName)) {
+ vpeChildrenInfo = new VpeChildrenInfo(parentElement);
vpeCreationData.addChildrenInfo(vpeChildrenInfo);
vpeChildrenInfo.addSourceChild(element);
- parentElement.appendChild(tr);
+ } else if (element.getNodeName().equals(treeNodesAdaptorName)) {
+ vpeChildrenInfo = new VpeChildrenInfo(parentElement);
+ vpeCreationData.addChildrenInfo(vpeChildrenInfo);
+ vpeChildrenInfo.addSourceChild(element);
}
}
}
/**
- * Set attributes for treeNode
*
- * @param table
+ * @param sourceNode
+ * @return
*/
- private void addBasicTreeNodeAttributes(nsIDOMElement table) {
- if (table == null) {
- return;
+ public boolean isHasParentAdapter(Node sourceNode) {
+ String treeNodesAdaptorName = sourceNode.getPrefix() + ":"
+ + TREE_NODES_ADAPTOR_NAME;
+ String recursiveTreeNodesAdaptorName = sourceNode.getPrefix() + ":"
+ + RECURSIVE_TREE_NODES_ADAPTOR_NAME;
+ Node node = sourceNode.getParentNode();
+ if (node.getNodeName().equals(treeNodesAdaptorName)
+ || node.getNodeName().equals(recursiveTreeNodesAdaptorName)) {
+ return true;
}
- table.setAttribute(HtmlComponentUtil.HTML_CELLPADDING_ATTR,
- TREE_TABLE_ATR_CELLPADDING_VALUE);
- table.setAttribute(HtmlComponentUtil.HTML_CELLSPACING_ATTR,
- TREE_TABLE_ATR_CELLSPACING_VALUE);
- table.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR,
- TREE_TABLE_ATR_BORDER_VALUE);
- table.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
- "dr-tree-full-width");
+ return false;
}
+
+ /**
+ * Get showConnectingLines attribute
+ *
+ * @param sourceNode
+ * @return
+ */
+ private boolean getShowLinesAttr(Node sourceNode) {
+ String treeName = sourceNode.getPrefix() + ":" + TREE_NAME;
+ do {
+ sourceNode = sourceNode.getParentNode();
+ if (!(sourceNode instanceof Element)) {
+ return true;
+ }
+ } while (!sourceNode.getNodeName().equals(treeName));
+
+ String showLinesParam = ((Element) sourceNode)
+ .getAttribute(RichFacesTreeTemplate.SHOW_LINES_ATTR_NAME);
+
+ boolean showLinesValue = true;
+ if (showLinesParam != null && showLinesParam.equalsIgnoreCase("false")) {
+ showLinesValue = false;
+ }
+ return showLinesValue;
+ }
+
+ /**
+ * Has Next element
+ *
+ * @param sourceNode
+ * @return
+ */
+ private boolean isHasNextParentAdaptorElement(Node sourceNode) {
+ Node parentTree = sourceNode.getParentNode();
+ if (!(parentTree instanceof Element)) {
+ return true;
+ }
+ NodeList childs = parentTree.getChildNodes();
+ String treeNodeName = parentTree.getPrefix() + ":"
+ + RichFacesTreeTemplate.TREE_NODE_NAME;
+ String treeNodesAdaptorName = parentTree.getPrefix() + ":"
+ + RichFacesTreeTemplate.TREE_NODES_ADAPTOR;
+ String treeRecursiveNodesAdaptorName = parentTree.getPrefix() + ":"
+ + RichFacesTreeTemplate.TREE_RECURSIVE_NODES_ADAPTOR;
+ Node lastElement = null;
+ Node el = null;
+
+ for (int i = 0; i < childs.getLength(); i++) {
+ el = childs.item(i);
+ if (!(el instanceof Element)) {
+ continue;
+ }
+
+ if (lastElement != null) {
+ break;
+ }
+ if (el.equals(sourceNode)) {
+ lastElement = el;
+ }
+ }
+ if (el.getNodeName().equals(treeNodeName)
+ || el.getNodeName().equals(treeNodesAdaptorName)
+ || el.getNodeName().equals(treeRecursiveNodesAdaptorName)) {
+ return true;
+ }
+ return false;
+ }
}
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java 2007-10-15 17:25:04 UTC (rev 4206)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java 2007-10-15 17:29:09 UTC (rev 4207)
@@ -10,8 +10,10 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.RichFacesTemplatesActivator;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
@@ -20,6 +22,7 @@
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
+import org.mozilla.xpcom.XPCOMException;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -140,7 +143,7 @@
*/
private void setAttributeToTree(nsIDOMNode node, String attrName,
String attrValue) {
- if (!(node instanceof nsIDOMElement)) {
+ if (!(node instanceof Element)) {
return;
}
if (node.getNodeName().equalsIgnoreCase(
@@ -169,6 +172,8 @@
* Object <code>VpeCreationData</code>, built by a method
* <code>create</code>
*/
+
+ @Override
public void validate(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument, VpeCreationData data) {
super.validate(pageContext, sourceNode, visualDocument, data);
@@ -180,22 +185,41 @@
*
* @param node
*/
+ /**
+ * Revert tree elements in right order.
+ *
+ * @param node
+ */
private void revertTableRows(nsIDOMNode node) {
- nsIDOMNodeList list = node.getChildNodes();
- if (node.getNodeName().equalsIgnoreCase(HtmlComponentUtil.HTML_TAG_DIV)
- && list.getLength() == 2) {
- nsIDOMNode table1 = list.item(0);
- nsIDOMNode table2 = list.item(1);
- node.removeChild(table1);
- node.removeChild(table2);
- node.appendChild(table2);
- node.appendChild(table1);
+ try {
+ nsIDOMNodeList list = node.getChildNodes();
+ nsIDOMElement element = (nsIDOMElement) node
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ String id = element
+ .getAttribute(RichFacesTreeNodesAdaptorTemplate.ID_ATTR_NAME);
+ if (id == null)
+ id = "";
+ if (node.getNodeName().equalsIgnoreCase(
+ HtmlComponentUtil.HTML_TAG_DIV)
+ && list.getLength() == 2
+ && !(id
+ .equalsIgnoreCase(RichFacesTreeNodesAdaptorTemplate.TREE_NODES_ADAPTOR_NAME) || id
+ .equalsIgnoreCase(RichFacesTreeNodesAdaptorTemplate.RECURSIVE_TREE_NODES_ADAPTOR_NAME))) {
+ nsIDOMNode table1 = list.item(0);
+ nsIDOMNode table2 = list.item(1);
+ node.removeChild(table1);
+ node.removeChild(table2);
+ node.appendChild(table2);
+ node.appendChild(table1);
+ }
+ nsIDOMNodeList list2 = node.getChildNodes();
+ for (int i = 0; i < list2.getLength(); i++) {
+ revertTableRows(list2.item(i));
+ }
+ } catch (XPCOMException e) {
+ return;
}
- nsIDOMNodeList list2 = node.getChildNodes();
- for (int i = 0; i < list2.getLength(); i++) {
- revertTableRows(list2.item(i));
- }
}
/**
17 years, 3 months
JBoss Tools SVN: r4206 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-10-15 13:25:04 -0400 (Mon, 15 Oct 2007)
New Revision: 4206
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-926 DataSourceXMLDeployer chooses first server that matches runtime when several may match
Commented.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java 2007-10-15 16:51:43 UTC (rev 4205)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetProjectCreationDataModelProvider.java 2007-10-15 17:25:04 UTC (rev 4206)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * 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.seam.internal.core.project.facet;
import java.util.ArrayList;
@@ -42,10 +53,6 @@
seamFacet.addListener(new IDataModelListener() {
public void propertyChanged(DataModelEvent event) {
if (ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME.equals(event.getPropertyName())) {
-// if (isPropertySet(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME))
-// setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, event.getProperty());
-// else
-//
setProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, event.getProperty());
model.notifyPropertyChange(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_RUNTIME, IDataModel.DEFAULT_CHG);
model.notifyPropertyChange(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER, IDataModel.VALID_VALUES_CHG);
@@ -53,29 +60,6 @@
}
});
-/*
- IDataModel webFacet = DataModelFactory.createDataModel(new WebFacetInstallDataModelProvider());
- map.add(webFacet);
-
- String webRoot = webFacet.getStringProperty(IWebFacetInstallDataModelProperties.CONFIG_FOLDER);
- String webSrc = webFacet.getStringProperty(IWebFacetInstallDataModelProperties.SOURCE_FOLDER);
- javaFacet.setProperty(IJavaFacetInstallDataModelProperties.SOURCE_FOLDER_NAME, webSrc);
- // If using optimized single root structure, set the output folder to "<content folder>/WEB-INF/classes"
- if (ProductManager.shouldUseSingleRootStructure())
- javaFacet.setProperty(IJavaFacetInstallDataModelProperties.DEFAULT_OUTPUT_FOLDER_NAME, webRoot+"/"+J2EEConstants.WEB_INF_CLASSES); //$NON-NLS-1$
- webFacet.addListener(new IDataModelListener() {
- public void propertyChanged(DataModelEvent event) {
- if (IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME.equals(event.getPropertyName())) {
- if (isPropertySet(EAR_PROJECT_NAME))
- setProperty(EAR_PROJECT_NAME, event.getProperty());
- else
- model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.DEFAULT_CHG);
- }else if (IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR.equals(event.getPropertyName())) {
- setProperty(ADD_TO_EAR, event.getProperty());
- }
- }
- });
-*/
Collection requiredFacets = (Collection)getProperty(REQUIRED_FACETS_COLLECTION);
requiredFacets.add(ProjectFacetsManager.getProjectFacet(seamFacet.getStringProperty(IFacetDataModelProperties.FACET_ID)));
setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets);
@@ -147,6 +131,12 @@
}
return list;
}
+
+ /**
+ * Performs the property validation
+ *
+ * returns IStatus status of validation
+ */
public IStatus validate(String propertyName) {
IStatus status = super.validate(propertyName);
if (status != null && !status.isOK())
@@ -168,7 +158,7 @@
return OK_STATUS;
}
- IStatus validateServer(Object serverObject) {
+ private IStatus validateServer(Object serverObject) {
if (serverObject == null) {
return SeamCorePlugin.createErrorStatus(SeamCoreMessages.getString("ERROR_JBOSS_AS_TARGET_SERVER_IS_EMPTY"), null);
}
@@ -217,6 +207,14 @@
return OK_STATUS;
}
+ /**
+ * Returns The server name stored in the
+ * ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER property value
+ * of the model specified
+ *
+ * @param model
+ * @return String Server name
+ */
public static String getServerName(IDataModel model) {
Object serverObject = model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER);
if (!(serverObject instanceof IServer))
@@ -226,6 +224,14 @@
return (server.getName() == null ? "" : server.getName());
}
+ /**
+ * Sets the server by its name as
+ * ISeamFacetDataModelProperties.JBOSS_AS_TARGET_SERVER property value
+ * of the model specified
+ *
+ * @param model
+ * @param serverName
+ */
public static void setServerName(IDataModel model, String serverName) {
if (serverName == null)
return;
17 years, 3 months
JBoss Tools SVN: r4205 - trunk/jst/plugins/org.jboss.tools.jst.web.ui.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-15 12:51:43 -0400 (Mon, 15 Oct 2007)
New Revision: 4205
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
Log:
JBIDE-1054
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2007-10-15 16:36:04 UTC (rev 4204)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2007-10-15 16:51:43 UTC (rev 4205)
@@ -88,10 +88,10 @@
</editor>
</extension>
<extension point="org.eclipse.ui.actionSets">
- <actionSet description="%actionSets.modelActions.description" id="com.redhat.studio.actionSet" label="%actionSets.modelActions.label" visible="true">
+ <!--actionSet description="%actionSets.modelActions.description" id="com.redhat.studio.actionSet" label="%actionSets.modelActions.label" visible="true">
<action class="org.jboss.tools.jst.web.ui.action.RunPageActionDelegate" icon="images/xstudio/actions/run_project.gif" id="org.jboss.tools.jst.web.ui.action.RunPageActionDelegate" label="%actionSets.serverActions.runApplicationFromSelectedElement.label" style="pulldown" toolbarPath="Normal/SSRun" tooltip="%actionSets.serverActions.runApplicationFromSelectedElement.label">
</action>
- </actionSet>
+ </actionSet-->
</extension>
<!--extension id="textproblemmarker" name="%textProblemName" point="org.eclipse.core.resources.markers">
<super type="org.eclipse.core.resources.problemmarker">
17 years, 3 months
JBoss Tools SVN: r4204 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-10-15 12:36:04 -0400 (Mon, 15 Oct 2007)
New Revision: 4204
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/AbstractMultiPageContributor.java
Log:
JBIDE-1065
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/AbstractMultiPageContributor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/AbstractMultiPageContributor.java 2007-10-15 16:24:41 UTC (rev 4203)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/AbstractMultiPageContributor.java 2007-10-15 16:36:04 UTC (rev 4204)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.model.ui.texteditors;
import java.util.*;
+
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.*;
@@ -217,12 +218,19 @@
ITextEditorActionConstants.UNDO,
ITextEditorActionConstants.REDO
};
+
+ Map<IAction, ActionHandler> used = new HashMap<IAction, ActionHandler>();
- public static void registerKeyBindings(IHandlerService handler, String[] actions, ITextEditor editor) {
+ public void registerKeyBindings(IHandlerService handler, String[] actions, ITextEditor editor) {
for (int i = 0; i < actions.length; i++) {
IAction action = editor.getAction(actions[i]);
if(action == null) continue;
- handler.activateHandler(actions[i], new ActionHandler(action));
+ ActionHandler h = used.get(action);
+ if(h == null) {
+ h = new ActionHandler(action);
+ used.put(action, h);
+ }
+ handler.activateHandler(actions[i], h);
}
}
17 years, 3 months