JBoss Tools SVN: r6937 - trunk/seam/plugins/org.jboss.tools.seam.ui/icons.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-03-14 12:58:03 -0400 (Fri, 14 Mar 2008)
New Revision: 6937
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/find_seam_declarations.gif
trunk/seam/plugins/org.jboss.tools.seam.ui/icons/find_seam_references.gif
Log:
http://jira.jboss.org/jira/browse/JBIDE-1860 Seam find references is not using the right extensionpoint/shortcut
Ctrl-G/Ctrl-Shift-G Seam Find actions are moved to Ctrl-1 quick fix dialog for the Java Editor.
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/find_seam_declarations.gif
===================================================================
(Binary files differ)
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/icons/find_seam_references.gif
===================================================================
(Binary files differ)
16 years, 3 months
JBoss Tools SVN: r6936 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-03-14 11:44:54 -0400 (Fri, 14 Mar 2008)
New Revision: 6936
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAttributeCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreatorUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpePanelGridCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1730
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-03-14 15:20:35 UTC (rev 6935)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-03-14 15:44:54 UTC (rev 6936)
@@ -878,14 +878,14 @@
<vpe:tag name="h:panelGrid" case-sensitive="yes">
<vpe:template children="yes" modify="yes">
- <vpe:panelgrid border="{iif(@border='','0','@border')}"
- style="{@style}" class="{@styleClass}" width="{@width}"
- frame="{@frame}" rules="{@rules}" columnClasses="{@columnClasses}"
- footerClass="{@footerClass}" headerClass="{@headerClass}"
- rowClasses="{@rowClasses}" cellspacing="{@cellspacing}"
+ <vpe:panelgrid border="{iif(@border='','0',@border)}"
+ style="{@style}" class="{@styleClass}" width="{@width}"
+ dir="{@dir}" frame="{@frame}" rules="{jsfvalue(@rules)}" columnClasses="{@columnClasses}"
+ footerClass="{@footerClass}" headerClass="{@headerClass}"
+ captionClass="{@captionClass}" captionStyle="{@captionStyle}" rowClasses="{@rowClasses}" cellspacing="{@cellspacing}"
cellpadding="{@cellpadding}" bgcolor="{@bgcolor}"
title="{tagstring()}" table-size="{@columns}" />
- <vpe:resize>
+ <vpe:resize>
<vpe:width width-attr="width" />
</vpe:resize>
<vpe:dnd>
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2008-03-14 15:20:35 UTC (rev 6935)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.seam/templates/vpe-templates-seam.xml 2008-03-14 15:44:54 UTC (rev 6936)
@@ -116,7 +116,7 @@
<vpe:if test="not(attrpresent('image'))">
<vpe:if test="@type=''">
<vpe:template children="no" modify="no">
- <input type="submit" value="{jsfvalue(@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}"/>
+ <input type="button" value="{jsfvalue(@value)}" class="{@styleClass}" style="{@style}" title="{tagstring()}"/>
<vpe:resize>
<vpe:width width-attr="style.width" />
<vpe:height height-attr="style.height" />
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAttributeCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAttributeCreator.java 2008-03-14 15:20:35 UTC (rev 6935)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeAttributeCreator.java 2008-03-14 15:44:54 UTC (rev 6936)
@@ -53,17 +53,11 @@
visualNodeMap.put(this, visualElement);
}
VpeValue vpeValue = expression.exec(pageContext, sourceNode);
- //FIX FOR JBIDE-1484 added by Max Areshkau
- //commented to fix JBIDE-1484
-// if (vpeValue != null && vpeValue.stringValue().length() > 0) {
-// nsIDOMAttr newVisualAttribute = visualDocument.createAttribute(name);
-// newVisualAttribute.setValue(vpeValue.stringValue());
-// return new VpeCreatorInfo(newVisualAttribute);
-// }
- nsIDOMAttr newVisualDOMAttribute = visualDocument.createAttribute(name);
- newVisualDOMAttribute.setValue(vpeValue==null?null:vpeValue.stringValue());
- return new VpeCreatorInfo(newVisualDOMAttribute);
- //END of FIX JBIDE-1484 code
+ if (vpeValue != null && vpeValue.stringValue().length() > 0) {
+ nsIDOMAttr newVisualAttribute = visualDocument.createAttribute(name);
+ newVisualAttribute.setValue(vpeValue.stringValue());
+ return new VpeCreatorInfo(newVisualAttribute);
+ }
}
return null;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreatorUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreatorUtil.java 2008-03-14 15:20:35 UTC (rev 6935)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeCreatorUtil.java 2008-03-14 15:44:54 UTC (rev 6936)
@@ -24,11 +24,12 @@
import org.w3c.dom.NodeList;
public class VpeCreatorUtil {
- public static final int FASET_TYPE_NONE = 0;
- public static final int FASET_TYPE_HEADER = 1;
- public static final int FASET_TYPE_FOOTER = 2;
- public static final int FASET_TYPE_BODY = 3;
- public static final int FASET_TYPE_NAVIGATION = 4;
+ public static final int FACET_TYPE_NONE = 0;
+ public static final int FACET_TYPE_HEADER = 1;
+ public static final int FACET_TYPE_FOOTER = 2;
+ public static final int FACET_TYPE_BODY = 3;
+ public static final int FACET_TYPE_NAVIGATION = 4;
+ public static final int FACET_TYPE_CAPTION = 5;
public static boolean isFacet(Node node) {
if (node != null && node.getNodeType() == Node.ELEMENT_NODE) {
@@ -48,16 +49,18 @@
String value = getFacetName(node);
if (value != null) {
if ("header".equals(value)) {
- return FASET_TYPE_HEADER;
+ return FACET_TYPE_HEADER;
} else if ("footer".equals(value)) {
- return FASET_TYPE_FOOTER;
+ return FACET_TYPE_FOOTER;
} else if ("body".equals(value)) {
- return FASET_TYPE_BODY;
+ return FACET_TYPE_BODY;
} else if ("navigation".equals(value)) {
- return FASET_TYPE_NAVIGATION;
+ return FACET_TYPE_NAVIGATION;
+ } else if ("caption".equals(value)) {
+ return FACET_TYPE_CAPTION;
}
}
- return FASET_TYPE_NONE;
+ return FACET_TYPE_NONE;
}
public static boolean isInclude(Node node) {
@@ -153,7 +156,7 @@
for (int i = 0; i < cnt; i++) {
Node child = list.item(i);
int type = getFacetType(child, pageContext);
- if (type != FASET_TYPE_NONE) {
+ if (type != FACET_TYPE_NONE) {
return type;
}
}
@@ -162,7 +165,7 @@
}
}
}
- return FASET_TYPE_NONE;
+ return FACET_TYPE_NONE;
}
public static void setAttributes(Element visualElement, Element sourceElement, VpeAttributeInfo[] attrsInfo) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpePanelGridCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpePanelGridCreator.java 2008-03-14 15:20:35 UTC (rev 6935)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpePanelGridCreator.java 2008-03-14 15:44:54 UTC (rev 6936)
@@ -7,7 +7,7 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.vpe.editor.template;
import java.util.ArrayList;
@@ -28,6 +28,7 @@
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -35,87 +36,157 @@
private boolean caseSensitive;
private VpeExpression tableSizeExpr;
+ private VpeExpression captionClassExpr;
+ private VpeExpression captionStyleExpr;
private VpeExpression headerClassExpr;
private VpeExpression footerClassExpr;
private VpeExpression rowClassesExpr;
private VpeExpression columnClassesExpr;
+ private VpeExpression rulesExpr;
+
private List propertyCreators;
-// private Set dependencySet;
-
- VpePanelGridCreator(Element gridElement, VpeDependencyMap dependencyMap, boolean caseSensitive) {
+
+ // private Set dependencySet;
+
+ VpePanelGridCreator(Element gridElement, VpeDependencyMap dependencyMap,
+ boolean caseSensitive) {
this.caseSensitive = caseSensitive;
build(gridElement, dependencyMap);
}
private void build(Element gridElement, VpeDependencyMap dependencyMap) {
- Attr tableSizeAttr = gridElement.getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_TABLE_SIZE);
+
+ NamedNodeMap map = gridElement.getAttributes();
+
+ Attr tableSizeAttr = gridElement
+ .getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_TABLE_SIZE);
if (tableSizeAttr != null) {
try {
- VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(tableSizeAttr.getValue(), caseSensitive);
+ VpeExpressionInfo info = VpeExpressionBuilder
+ .buildCompletedExpression(tableSizeAttr.getValue(),
+ caseSensitive);
tableSizeExpr = info.getExpression();
dependencyMap.setCreator(this, info.getDependencySet());
- } catch(VpeExpressionBuilderException e) {
+ } catch (VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
}
}
- Attr headerClassAttr = gridElement.getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_HEADER_CLASS);
+ Attr headerClassAttr = gridElement
+ .getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_HEADER_CLASS);
if (headerClassAttr != null) {
try {
- VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(headerClassAttr.getValue(), caseSensitive);
+ VpeExpressionInfo info = VpeExpressionBuilder
+ .buildCompletedExpression(headerClassAttr.getValue(),
+ caseSensitive);
headerClassExpr = info.getExpression();
dependencyMap.setCreator(this, info.getDependencySet());
- } catch(VpeExpressionBuilderException e) {
+ } catch (VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
}
}
- Attr footerClassAttr = gridElement.getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_FOOTER_CLASS);
+ Attr footerClassAttr = gridElement
+ .getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_FOOTER_CLASS);
if (footerClassAttr != null) {
try {
- VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(footerClassAttr.getValue(), caseSensitive);
+ VpeExpressionInfo info = VpeExpressionBuilder
+ .buildCompletedExpression(footerClassAttr.getValue(),
+ caseSensitive);
footerClassExpr = info.getExpression();
dependencyMap.setCreator(this, info.getDependencySet());
- } catch(VpeExpressionBuilderException e) {
+ } catch (VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
}
}
- Attr rowClassesAttr = gridElement.getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_ROW_CLASSES);
+ Attr rowClassesAttr = gridElement
+ .getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_ROW_CLASSES);
if (rowClassesAttr != null) {
try {
- VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(rowClassesAttr.getValue(), caseSensitive);
+ VpeExpressionInfo info = VpeExpressionBuilder
+ .buildCompletedExpression(rowClassesAttr.getValue(),
+ caseSensitive);
rowClassesExpr = info.getExpression();
dependencyMap.setCreator(this, info.getDependencySet());
- } catch(VpeExpressionBuilderException e) {
+ } catch (VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
}
}
- Attr columnClassesAttr = gridElement.getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_COLUMN_CLASSES);
+ Attr columnClassesAttr = gridElement
+ .getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_COLUMN_CLASSES);
if (columnClassesAttr != null) {
try {
- VpeExpressionInfo info = VpeExpressionBuilder.buildCompletedExpression(columnClassesAttr.getValue(), caseSensitive);
+ VpeExpressionInfo info = VpeExpressionBuilder
+ .buildCompletedExpression(columnClassesAttr.getValue(),
+ caseSensitive);
columnClassesExpr = info.getExpression();
dependencyMap.setCreator(this, info.getDependencySet());
- } catch(VpeExpressionBuilderException e) {
+ } catch (VpeExpressionBuilderException e) {
VpePlugin.reportProblem(e);
}
}
+ Attr captionClassesAttr = gridElement
+ .getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_CAPTION_CLASS);
+ if (captionClassesAttr != null) {
+ try {
+ VpeExpressionInfo info = VpeExpressionBuilder
+ .buildCompletedExpression(
+ captionClassesAttr.getValue(), caseSensitive);
+ captionClassExpr = info.getExpression();
+ dependencyMap.setCreator(this, info.getDependencySet());
+ } catch (VpeExpressionBuilderException e) {
+ VpePlugin.reportProblem(e);
+ }
+ }
+
+ Attr captionStyleAttr = gridElement
+ .getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_CAPTION_STYLE);
+ if (captionStyleAttr != null) {
+ try {
+ VpeExpressionInfo info = VpeExpressionBuilder
+ .buildCompletedExpression(captionStyleAttr.getValue(),
+ caseSensitive);
+ captionStyleExpr = info.getExpression();
+ dependencyMap.setCreator(this, info.getDependencySet());
+ } catch (VpeExpressionBuilderException e) {
+ VpePlugin.reportProblem(e);
+ }
+ }
+
+ Attr rulesAttr = gridElement
+ .getAttributeNode(VpeTemplateManager.ATTR_PANELGRID_RULES);
+ if (rulesAttr != null) {
+ try {
+ VpeExpressionInfo info = VpeExpressionBuilder
+ .buildCompletedExpression(rulesAttr.getValue(),
+ caseSensitive);
+ rulesExpr = info.getExpression();
+ dependencyMap.setCreator(this, info.getDependencySet());
+ } catch (VpeExpressionBuilderException e) {
+ VpePlugin.reportProblem(e);
+ }
+ }
+
if (VpeTemplateManager.ATTR_GRID_PROPERTIES != null) {
for (int i = 0; i < VpeTemplateManager.ATTR_GRID_PROPERTIES.length; i++) {
String attrName = VpeTemplateManager.ATTR_GRID_PROPERTIES[i];
Attr attr = gridElement.getAttributeNode(attrName);
if (attr != null) {
- if (propertyCreators == null) propertyCreators = new ArrayList();
- propertyCreators.add(new VpeAttributeCreator(attrName, attr.getValue(), dependencyMap, caseSensitive));
+ if (propertyCreators == null)
+ propertyCreators = new ArrayList();
+ propertyCreators.add(new VpeAttributeCreator(attrName, attr
+ .getValue(), dependencyMap, caseSensitive));
}
}
}
}
- public VpeCreatorInfo _create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument, nsIDOMElement visualElement, Map visualNodeMap) {
+ public VpeCreatorInfo create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, nsIDOMElement visualElement,
+ Map visualNodeMap) {
int tableSize = 1;
if (tableSizeExpr != null) {
VpeValue vpeValue = tableSizeExpr.exec(pageContext, sourceNode);
@@ -127,176 +198,59 @@
tableSize = val;
}
} catch (Exception e) {
- VpePlugin.getPluginLog().logError(e);
}
}
}
-
- nsIDOMElement visualTable = visualDocument.createElement(HTML.TAG_TABLE);
+
+ nsIDOMElement visualTable = visualDocument
+ .createElement(HTML.TAG_TABLE);
VpeCreatorInfo creatorInfo = new VpeCreatorInfo(visualTable);
if (propertyCreators != null) {
for (int i = 0; i < propertyCreators.size(); i++) {
- VpeCreator creator = (VpeCreator)propertyCreators.get(i);
+ VpeCreator creator = (VpeCreator) propertyCreators.get(i);
if (creator != null) {
- VpeCreatorInfo info = creator.create(pageContext, (Element) sourceNode, visualDocument, visualTable, visualNodeMap);
+ VpeCreatorInfo info = creator.create(pageContext,
+ (Element) sourceNode, visualDocument, visualTable,
+ visualNodeMap);
if (info != null && info.getVisualNode() != null) {
- nsIDOMAttr attr = (nsIDOMAttr)info.getVisualNode();
+ nsIDOMAttr attr = (nsIDOMAttr) info.getVisualNode();
visualTable.setAttributeNode(attr);
}
}
}
}
-
- NodeList children = sourceNode.getChildNodes();
- int count = children != null ? children.getLength() : 0;
- if (count > 0) {
- Node header = null;
- Node footer = null;
- Node[] sourceChildren = new Node[count];
- int childrenCount = 0;
- for (int i = 0; i < count; i++) {
- Node node = children.item(i);
- int type = node.getNodeType();
- if (type == Node.ELEMENT_NODE || type == Node.TEXT_NODE && node.getNodeValue().trim().length() > 0) {
- if (type == Node.ELEMENT_NODE && (node.getPrefix() + ":facet").equals(node.getNodeName())) {
- Node nameAttr = node.getAttributes().getNamedItem("name");
- if (nameAttr != null) {
- String value = nameAttr.getNodeValue();
- if ("header".equals(value)) {
- header = node;
- } else if ("footer".equals(value)) {
- footer = node;
- }
- }
- } else {
- sourceChildren[childrenCount] = node;
- childrenCount++;
- }
- }
- }
- if (childrenCount > 0) {
- if (tableSize == 0) {
- tableSize = childrenCount;
- }
- int rowCount = (childrenCount + tableSize - 1) / tableSize;
- nsIDOMElement visualHead = null;
- nsIDOMElement visualFoot = null;
- nsIDOMElement visualBody = visualDocument.createElement(HTML.TAG_TBODY);
- visualTable.appendChild(visualBody);
- if (header != null || footer != null) {
- if (header != null) {
- visualHead = visualDocument.createElement(HTML.TAG_THEAD);
- visualTable.appendChild(visualHead);
- }
- if (footer != null) {
- visualFoot = visualDocument.createElement(HTML.TAG_TFOOT);
- visualTable.appendChild(visualFoot);
- }
- }
- List rowClasses = getClasses(rowClassesExpr, sourceNode, pageContext);
- List columnClasses = getClasses(columnClassesExpr, sourceNode, pageContext);
- int rci = 0, cci = 0;
- for (int i = 0; i < rowCount; i++) {
- nsIDOMElement visualRow = visualDocument.createElement(HTML.TAG_TD);
- if (rowClasses.size() > 0) {
- visualRow.setAttribute("class", rowClasses.get(rci).toString());
- rci++;
- if (rci >= rowClasses.size()) rci = 0;
- }
- for (int j = 0; j < tableSize; j++) {
- nsIDOMElement visualCell = visualDocument.createElement("td");
- if (columnClasses.size() > 0) {
- visualCell.setAttribute("class", columnClasses.get(rci).toString());
- cci++;
- if (cci >= rowClasses.size()) cci = 0;
- }
- visualRow.appendChild(visualCell);
- int sourceIndex = tableSize * i + j;
- if (sourceIndex < childrenCount) {
- Node child = sourceChildren[sourceIndex];
- if (child != header && child != footer) {
- VpeChildrenInfo childrenInfo = new VpeChildrenInfo(visualCell);
- childrenInfo.addSourceChild(child);
- creatorInfo.addChildrenInfo(childrenInfo);
- }
- }
- }
- if (visualBody != null) {
- visualBody.appendChild(visualRow);
- } else {
- visualTable.appendChild(visualRow);
- }
- }
- makeSpecial(header, visualHead, visualDocument, tableSize, creatorInfo, HTML.TAG_TH, headerClassExpr, pageContext);
- makeSpecial(footer, visualFoot, visualDocument, tableSize, creatorInfo, HTML.TAG_TD, footerClassExpr, pageContext);
-
- for (int i = 0; i < propertyCreators.size(); i++) {
- VpeCreator creator = (VpeCreator)propertyCreators.get(i);
- if (creator != null) {
- VpeCreatorInfo info = creator.create(pageContext, (Element) sourceNode, visualDocument, visualTable, visualNodeMap);
- if (info != null && info.getVisualNode() != null) {
- nsIDOMAttr attr = (nsIDOMAttr)info.getVisualNode();
- visualTable.setAttributeNode(attr);
- }
- }
- }
- }
+ if (rulesExpr != null) {
+ String rules = rulesExpr.exec(pageContext, sourceNode)
+ .stringValue();
+ if (rules.length() > 0)
+ visualTable.setAttribute(
+ VpeTemplateManager.ATTR_PANELGRID_RULES, rules);
}
-
- return creatorInfo;
- }
-
- public VpeCreatorInfo create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument, nsIDOMElement visualElement, Map visualNodeMap) {
- int tableSize = 1;
- if (tableSizeExpr != null) {
- VpeValue vpeValue = tableSizeExpr.exec(pageContext, sourceNode);
- if (vpeValue != null) {
- String strValue = vpeValue.stringValue();
- try {
- int val = Integer.valueOf(strValue).intValue();
- if (val > 0) {
- tableSize = val;
- }
- } catch (Exception e) {}
- }
- }
-
- nsIDOMElement visualTable = visualDocument.createElement(HTML.TAG_TABLE);
- VpeCreatorInfo creatorInfo = new VpeCreatorInfo(visualTable);
-
- if (propertyCreators != null) {
- for (int i = 0; i < propertyCreators.size(); i++) {
- VpeCreator creator = (VpeCreator)propertyCreators.get(i);
- if (creator != null) {
- VpeCreatorInfo info = creator.create(pageContext, (Element) sourceNode, visualDocument, visualTable, visualNodeMap);
- if (info != null && info.getVisualNode() != null) {
- nsIDOMAttr attr = (nsIDOMAttr)info.getVisualNode();
- visualTable.setAttributeNode(attr);
- }
- }
- }
- }
-
NodeList children = sourceNode.getChildNodes();
int count = children != null ? children.getLength() : 0;
if (count > 0) {
Node header = null;
Node footer = null;
+ Node caption = null;
Node[] sourceChildren = new Node[count];
int childrenCount = 0;
for (int i = 0; i < count; i++) {
Node node = children.item(i);
int type = node.getNodeType();
- if (type == Node.ELEMENT_NODE || type == Node.TEXT_NODE && node.getNodeValue().trim().length() > 0) {
+ if (type == Node.ELEMENT_NODE || type == Node.TEXT_NODE
+ && node.getNodeValue().trim().length() > 0) {
switch (VpeCreatorUtil.getFacetType(node, pageContext)) {
- case VpeCreatorUtil.FASET_TYPE_HEADER:
+ case VpeCreatorUtil.FACET_TYPE_HEADER:
header = node;
break;
- case VpeCreatorUtil.FASET_TYPE_FOOTER:
+ case VpeCreatorUtil.FACET_TYPE_FOOTER:
footer = node;
break;
+ case VpeCreatorUtil.FACET_TYPE_CAPTION:
+ caption = node;
+ break;
default:
sourceChildren[childrenCount] = node;
childrenCount++;
@@ -312,41 +266,75 @@
nsIDOMElement visualHead = null;
nsIDOMElement visualFoot = null;
- nsIDOMElement visualBody = visualDocument.createElement(HTML.TAG_TBODY);
+ nsIDOMElement visualCaption = null;
+ nsIDOMElement visualBody = visualDocument
+ .createElement(HTML.TAG_TBODY);
visualTable.appendChild(visualBody);
- if (header != null || footer != null) {
- if (header != null) {
- visualHead = visualDocument.createElement(HTML.TAG_THEAD);
- visualTable.appendChild(visualHead);
+ if (caption != null) {
+ visualCaption = visualDocument
+ .createElement(HTML.TAG_CAPTION);
+ visualTable.appendChild(visualCaption);
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(
+ visualCaption);
+ childrenInfo.addSourceChild(caption);
+ creatorInfo.addChildrenInfo(childrenInfo);
+ if (captionClassExpr != null
+ && caption.getParentNode() != null) {
+ String captionClass = captionClassExpr.exec(
+ pageContext, caption.getParentNode())
+ .stringValue();
+ visualCaption.setAttribute("class", captionClass);
}
- if (footer != null) {
- visualFoot = visualDocument.createElement(HTML.TAG_TFOOT);
- visualTable.appendChild(visualFoot);
+
+ if (captionStyleExpr != null
+ && caption.getParentNode() != null) {
+ String captionStyle = captionStyleExpr.exec(
+ pageContext, caption.getParentNode())
+ .stringValue();
+ visualCaption.setAttribute("style", captionStyle);
}
}
- List rowClasses = getClasses(rowClassesExpr, sourceNode, pageContext);
- List columnClasses = getClasses(columnClassesExpr, sourceNode, pageContext);
+ if (header != null) {
+ visualHead = visualDocument.createElement(HTML.TAG_THEAD);
+ visualTable.appendChild(visualHead);
+ }
+ if (footer != null) {
+ visualFoot = visualDocument.createElement(HTML.TAG_TFOOT);
+ visualTable.appendChild(visualFoot);
+ }
+
+ List rowClasses = getClasses(rowClassesExpr, sourceNode,
+ pageContext);
+ List columnClasses = getClasses(columnClassesExpr, sourceNode,
+ pageContext);
int rci = 0, cci = 0;
for (int i = 0; i < rowCount; i++) {
- nsIDOMElement visualRow = visualDocument.createElement(HTML.TAG_TR);
+ nsIDOMElement visualRow = visualDocument
+ .createElement(HTML.TAG_TR);
if (rowClasses.size() > 0) {
- visualRow.setAttribute("class", rowClasses.get(rci).toString());
+ visualRow.setAttribute("class", rowClasses.get(rci)
+ .toString());
rci++;
- if (rci >= rowClasses.size()) rci = 0;
+ if (rci >= rowClasses.size())
+ rci = 0;
}
for (int j = 0; j < tableSize; j++) {
- nsIDOMElement visualCell = visualDocument.createElement(HTML.TAG_TD);
+ nsIDOMElement visualCell = visualDocument
+ .createElement(HTML.TAG_TD);
if (columnClasses.size() > 0) {
- visualCell.setAttribute("class", columnClasses.get(cci).toString());
+ visualCell.setAttribute("class", columnClasses.get(
+ cci).toString());
cci++;
- if (cci >= columnClasses.size()) cci = 0;
+ if (cci >= columnClasses.size())
+ cci = 0;
}
visualRow.appendChild(visualCell);
int sourceIndex = tableSize * i + j;
if (sourceIndex < childrenCount) {
Node child = sourceChildren[sourceIndex];
if (child != header && child != footer) {
- VpeChildrenInfo childrenInfo = new VpeChildrenInfo(visualCell);
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(
+ visualCell);
childrenInfo.addSourceChild(child);
creatorInfo.addChildrenInfo(childrenInfo);
}
@@ -358,16 +346,22 @@
visualTable.appendChild(visualRow);
}
}
- makeSpecial(header, visualHead, visualDocument, tableSize, creatorInfo, "th", headerClassExpr, pageContext);
- makeSpecial(footer, visualFoot, visualDocument, tableSize, creatorInfo, "td", footerClassExpr, pageContext);
+ makeSpecial(header, visualHead, visualDocument, tableSize,
+ creatorInfo, "th", headerClassExpr, pageContext);
+ makeSpecial(footer, visualFoot, visualDocument, tableSize,
+ creatorInfo, "td", footerClassExpr, pageContext);
for (int i = 0; i < propertyCreators.size(); i++) {
- VpeCreator creator = (VpeCreator)propertyCreators.get(i);
+ VpeCreator creator = (VpeCreator) propertyCreators.get(i);
if (creator != null) {
- VpeCreatorInfo info = creator.create(pageContext, (Element) sourceNode, visualDocument, visualTable, visualNodeMap);
+ VpeCreatorInfo info = creator.create(pageContext,
+ (Element) sourceNode, visualDocument,
+ visualTable, visualNodeMap);
if (info != null && info.getVisualNode() != null) {
- nsIDOMAttr attr = (nsIDOMAttr)info.getVisualNode();
- visualTable.setAttributeNode(attr);
+ nsIDOMAttr attr = (nsIDOMAttr) info.getVisualNode();
+ if (attr.getValue().length() > 0) {
+ visualTable.setAttributeNode(attr);
+ }
}
}
}
@@ -377,10 +371,12 @@
return creatorInfo;
}
- private List getClasses(VpeExpression expression, Node sourceNode, VpePageContext pageContext) {
+ private List getClasses(VpeExpression expression, Node sourceNode,
+ VpePageContext pageContext) {
List b = new ArrayList();
if (expression != null && sourceNode != null) {
- String classes = expression.exec(pageContext, sourceNode).stringValue();
+ String classes = expression.exec(pageContext, sourceNode)
+ .stringValue();
String[] a = classes.split(",");
for (int i = 0; i < a.length; i++) {
if (a[i].trim().length() > 0) {
@@ -391,14 +387,18 @@
return b;
}
- private void makeSpecial(Node header, nsIDOMElement visualHead, nsIDOMDocument visualDocument, int tableSize, VpeCreatorInfo creatorInfo, String cellTag, VpeExpression headerClassExpr, VpePageContext pageContext) {
+ private void makeSpecial(Node header, nsIDOMElement visualHead,
+ nsIDOMDocument visualDocument, int tableSize,
+ VpeCreatorInfo creatorInfo, String cellTag,
+ VpeExpression headerClassExpr, VpePageContext pageContext) {
if (header != null && visualHead != null) {
nsIDOMElement visualRow = visualDocument.createElement(HTML.TAG_TR);
visualHead.appendChild(visualRow);
nsIDOMElement visualCell = visualDocument.createElement(cellTag);
visualCell.setAttribute("colspan", "" + tableSize);
if (headerClassExpr != null && header.getParentNode() != null) {
- String headerClass = headerClassExpr.exec(pageContext, header.getParentNode()).stringValue();
+ String headerClass = headerClassExpr.exec(pageContext,
+ header.getParentNode()).stringValue();
visualCell.setAttribute("class", headerClass);
}
visualRow.appendChild(visualCell);
@@ -422,7 +422,9 @@
return null;
}
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNde, Object data, String name, String value) {
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext,
+ Element sourceElement, Document visualDocument, Node visualNde,
+ Object data, String name, String value) {
return true;
}
}
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-03-14 15:20:35 UTC (rev 6935)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2008-03-14 15:44:54 UTC (rev 6936)
@@ -129,11 +129,14 @@
static final String ATTR_PANELGRID_FOOTER_CLASS = "footerClass";
static final String ATTR_PANELGRID_ROW_CLASSES = "rowClasses";
static final String ATTR_PANELGRID_COLUMN_CLASSES = "columnClasses";
- static final String[] ATTR_PANELGRID_PROPERTIES = {"style","class","width","border","frame","rules","cellspacing","cellpadding","bgcolor","title"};
+ static final String ATTR_PANELGRID_CAPTION_CLASS = "captionClass";
+ static final String ATTR_PANELGRID_CAPTION_STYLE = "captionStyle";
+ static final String ATTR_PANELGRID_RULES = "rules";
+ static final String[] ATTR_PANELGRID_PROPERTIES = {"style","class","width","border","frame","cellspacing","cellpadding","bgcolor","title"};
static final String ATTR_GRID_LAYOUT = "layout";
static final String ATTR_GRID_TABLE_SIZE = "table-size";
- static final String[] ATTR_GRID_PROPERTIES = {"style","class","width","border","frame","rules","cellspacing","cellpadding","bgcolor","title"};
+ static final String[] ATTR_GRID_PROPERTIES = {"style","class","width","border","frame","cellspacing","cellpadding","bgcolor","title","dir"};
static final String ATTR_ANY_DISPLAY = "display";
static final String ATTR_ANY_ICON = "icon";
16 years, 3 months
JBoss Tools SVN: r6935 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-03-14 11:20:35 -0400 (Fri, 14 Mar 2008)
New Revision: 6935
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteTaglibInserter.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1806
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteTaglibInserter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteTaglibInserter.java 2008-03-14 14:15:48 UTC (rev 6934)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteTaglibInserter.java 2008-03-14 15:20:35 UTC (rev 6935)
@@ -21,6 +21,7 @@
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
+import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
import org.eclipse.wst.xml.core.internal.document.DocumentImpl;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
@@ -114,21 +115,76 @@
}
return false;
}
+
+ private static Node getSelectedNode(ISourceViewer v, Properties p){
+ ISelectionProvider selProvider = (ISelectionProvider)p.get(PaletteInsertHelper.PROPOPERTY_SELECTION_PROVIDER);
+ if(selProvider == null) return null;
+
+ ITextSelection selection = null;
+
+ if(selProvider.getSelection() instanceof ITextSelection)
+ selection = (ITextSelection)selProvider.getSelection();
+ else return null;
+
+ IndexedRegion region = ContentAssistUtils.getNodeAt(v, selection.getOffset());
+ if(region == null) return null;
+
+ if(!(region instanceof Node)) return null;
+
+ Node text = (Node)region;
+
+
+ if("#text".equals(text.getNodeName()))
+ return text.getParentNode();
+ else
+ return text;
+ }
+
+ private static boolean checkSelectedElement(HashMap<String,String> map, ISourceViewer v, Properties p){
+ String taglibUri = p.getProperty(PaletteInsertHelper.PROPOPERTY_TAGLIBRARY_URI);
+ if(taglibUri == null) return false;
+
+ Node selectedNode = getSelectedNode(v, p);
+ if(selectedNode == null) return false;
+
+ return checkElement(map, selectedNode, taglibUri);
+ }
+
+ private static boolean checkElement(HashMap<String,String> map, Node node, String taglibUri){
+
+ NamedNodeMap attrs = node.getAttributes();
+ for (int j = 0; attrs != null && j < attrs.getLength(); j++) {
+ Node a = attrs.item(j);
+ String name = a.getNodeName();
+ if (name.startsWith("xmlns:")) {
+ map.put(a.getNodeValue(), name.substring("xmlns:".length()));
+ }
+ }
+
+ if (map.containsKey(taglibUri)) return true;
+ else{
+ if(node.getParentNode() == null) return false;
+ else return checkElement(map, node.getParentNode(), taglibUri);
+ }
+ }
+
public boolean inserTaglibInXml(ISourceViewer v, Properties p) {
if(!checkProperties(p)) {
return false;
}
-
+
IDocument d = v.getDocument();
IStructuredModel model = null;
-
+
try {
model = StructuredModelManager.getModelManager().getExistingModelForRead(d);
IDOMDocument xmlDocument = (model instanceof IDOMModel) ? ((IDOMModel) model).getDocument() : null;
+
if (xmlDocument == null) {
return false;
}
+
Properties tl = getPrefixes(v);
if(tl == null) tl = PaletteInsertHelper.getPrefixes(d.get());
Element root = xmlDocument.getDocumentElement();
@@ -136,12 +192,12 @@
if (root != null && xmlDocument.getDoctype() != null /* && tagLibListConainsFacelet(tl)*/ ) {
String publicId = xmlDocument.getDoctype().getPublicId();
if (publicId!=null && publicId.toUpperCase().startsWith("-//W3C//DTD XHTML")) { // && root.getNodeName().equalsIgnoreCase(HTML_SOURCE_ROOT_ELEMENT)) {
- checkTL(root, p, d);
+ checkTL(root, v, p, d);
return true;
}
// for jsp:root
} else if (root != null && root.getNodeName().equals(JSP_SOURCE_ROOT_ELEMENT)) {
- checkTL(root, p, d);
+ checkTL(root, v, p, d);
return true;
}
} catch (Exception e) {
@@ -188,7 +244,7 @@
* for jsp:root and html check the taglib if exist check the prefix else add the taglib
* with text formatting
*/
- private static Properties checkTL(Element root, Properties p, IDocument d) {
+ private static Properties checkTL(Element root, ISourceViewer v, Properties p, IDocument d) {
String uri_p = p.getProperty(PaletteInsertHelper.PROPOPERTY_TAGLIBRARY_URI);
String defaultPrefix_p = p.getProperty(PaletteInsertHelper.PROPOPERTY_DEFAULT_PREFIX);
@@ -202,8 +258,8 @@
map.put(a.getNodeValue(), name.substring("xmlns:".length()));
}
}
-
- if (map.containsKey(uri_p)) {
+
+ if (map.containsKey(uri_p) || checkSelectedElement(map, v, p)) {
if (!map.get(uri_p).equals(defaultPrefix_p)) {
p.setProperty(PaletteInsertHelper.PROPOPERTY_DEFAULT_PREFIX, (String) map.get(uri_p));
}
16 years, 3 months
JBoss Tools SVN: r6934 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-03-14 10:15:48 -0400 (Fri, 14 Mar 2008)
New Revision: 6934
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1868
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2008-03-14 13:57:08 UTC (rev 6933)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2008-03-14 14:15:48 UTC (rev 6934)
@@ -24,7 +24,6 @@
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
@@ -32,7 +31,6 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.SelectionListenerAction;
import org.eclipse.ui.part.MultiPageEditorPart;
-import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.ui.texteditor.ITextEditor;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
@@ -106,6 +104,7 @@
IEditorPart editorPart = null;
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
java.io.File configXMLFile = consoleConfiguration.getPreferences().getConfigXMLFile();
+ if (configXMLFile == null) return null;
IResource resource = null;
if (selection instanceof Property){
Property p = (Property)selection;
@@ -159,6 +158,7 @@
if (parentProperty.getPersistentClass() == null) return null;
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
java.io.File configXMLFile = consoleConfiguration.getPreferences().getConfigXMLFile();
+ if (configXMLFile == null) return null;
IResource resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, configXMLFile, parentProperty.getPersistentClass());
IEditorPart editorPart = null;
16 years, 3 months
JBoss Tools SVN: r6933 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-03-14 09:57:08 -0400 (Fri, 14 Mar 2008)
New Revision: 6933
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1744, code adjustment
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java 2008-03-14 13:56:03 UTC (rev 6932)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java 2008-03-14 13:57:08 UTC (rev 6933)
@@ -36,7 +36,6 @@
boolean isHeader = false;
boolean isFooter = false;
- boolean isCaption = false;
Node nameAttr = sourceNode.getAttributes().getNamedItem("name");
if (nameAttr != null) {
16 years, 3 months
JBoss Tools SVN: r6932 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-03-14 09:56:03 -0400 (Fri, 14 Mar 2008)
New Revision: 6932
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableElements.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1744, caption creation was gathered in VpeDataTableCreator, duplicate caption creation was removed from VpeFacetCreator.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableCreator.java 2008-03-14 13:06:30 UTC (rev 6931)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableCreator.java 2008-03-14 13:56:03 UTC (rev 6932)
@@ -45,6 +45,8 @@
private VpeExpression rowClassesExpr;
private VpeExpression columnClassesExpr;
+ private static final String ATTR_CAPTION_STYLE = "captionStyle";
+ private static final String ATTR_CAPTION_CLASS = "captionClass";
private static final String ATTR_STYLE = "style";
private static final String ATTR_CLASS = "class";
private static final String ATTR_WIDTH = "width";
@@ -135,12 +137,22 @@
if (true || sourceElements.hasTableCaption()) {
caption = visualDocument.createElement(HTML.TAG_CAPTION);
- visualElements.setTableCaptionTag(caption);
if (sourceElements.getTableCaption() != null) {
VpeChildrenInfo info = new VpeChildrenInfo(caption);
info.addSourceChild(sourceElements.getTableCaption());
creatorInfo.addChildrenInfo(info);
}
+
+ // Everything concerning table caption
+ // lies here (was removed from VpeFacetCreator)
+ Node attr = sourceNode.getAttributes().getNamedItem(ATTR_CAPTION_STYLE);
+ if (attr != null) {
+ caption.setAttribute(ATTR_STYLE, attr.getNodeValue());
+ }
+ attr = sourceNode.getAttributes().getNamedItem(ATTR_CAPTION_CLASS);
+ if (attr != null) {
+ caption.setAttribute(ATTR_CLASS, attr.getNodeValue());
+ }
outterTable.appendChild(caption);
visualElements.setCaption(caption);
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableElements.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableElements.java 2008-03-14 13:06:30 UTC (rev 6931)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeDataTableElements.java 2008-03-14 13:56:03 UTC (rev 6932)
@@ -315,14 +315,6 @@
public void setColumnsHeaderRow(nsIDOMElement columnsHeaderRow) {
this.columnsHeaderRow = columnsHeaderRow;
}
-
- public nsIDOMElement getTableCaptionTag() {
- return tableCaptionTag;
- }
-
- public void setTableCaptionTag(nsIDOMElement tableCaptionTag) {
- this.tableCaptionTag = tableCaptionTag;
- }
public nsIDOMElement getTableFooter() {
return tableFooter;
@@ -447,7 +439,7 @@
VpeDataTableElements.getNamedChild(visualParent, HTML.TAG_TFOOT)
);
- visualDataTableElements.setTableCaptionTag(VpeDataTableElements.getNamedChild(visualDataTableElements.getCaption(), "caption"));
+ visualDataTableElements.setCaption(VpeDataTableElements.getNamedChild(visualDataTableElements.getCaption(), "caption"));
visualDataTableElements.setTableHeaderRow(VpeDataTableElements.getNamedChild(visualDataTableElements.getTableHeader(), "tr"));
visualDataTableElements.setColumnsHeaderRow(VpeDataTableElements.getNamedChild(visualDataTableElements.getColumnsHeader(), "tr"));
visualDataTableElements.setBodyRow(VpeDataTableElements.getNamedChild(visualDataTableElements.getBody(), "tr"));
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java 2008-03-14 13:06:30 UTC (rev 6931)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeFacetCreator.java 2008-03-14 13:56:03 UTC (rev 6932)
@@ -43,10 +43,9 @@
String name = nameAttr.getNodeValue();
isHeader = name.equals("header");
isFooter = name.equals("footer");
- isCaption = name.equals("caption");
}
- if (isHeader || isFooter || isCaption) {
+ if (isHeader || isFooter) {
Node sourceParent = sourceNode.getParentNode();
if (sourceParent != null) {
nsIDOMNode visualParent = null;
@@ -57,7 +56,6 @@
nsIDOMNode header = null;
nsIDOMNode footer = null;
- nsIDOMNode caption = null;
if (visualParent != null && visualParent.getNodeName().equalsIgnoreCase("table")) {
nsIDOMNodeList children = visualParent.getChildNodes();
@@ -84,17 +82,12 @@
cell = makeCell(columnsCount, HTML.TAG_TH, visualDocument);
} else if (isFooter) {
cell = makeCell(columnsCount, HTML.TAG_TD, visualDocument);
- } else if (isCaption) {
- cell = visualDocument.createElement(HTML.TAG_CAPTION);
}
if (cell != null) {
if (isHeader) {
setCellClass(cell, getTableAttrValue(sourceParent, "headerClass"));
} else if (isFooter) {
setCellClass(cell, getTableAttrValue(sourceParent, "footerClass"));
- } else if (isCaption) {
- setCellClass(cell, getTableAttrValue(sourceParent, "captionClass"));
- setCaptionStyle(sourceParent, cell, getTableAttrValue(sourceParent, "captionStyle"));
}
creatorInfo = new VpeCreatorInfo(cell);
}
@@ -119,26 +112,6 @@
}
}
- /**
- * Sets the caption style and stretches caption to fit the full table width.
- *
- * @param sourceParent the source parent
- * @param cell the cell
- * @param captionStyle the caption style
- */
- private void setCaptionStyle(Node sourceParent, nsIDOMElement cell, String captionStyle) {
- if (cell != null) {
- String resultStyle = "";
- if (captionStyle != null) {
- if (!(captionStyle.lastIndexOf("width") > -1)) {
- resultStyle += "width: 100%; ";
- }
- resultStyle += captionStyle;
- }
- cell.setAttribute(HTML.ATTR_STYLE, resultStyle);
- }
- }
-
private String getTableAttrValue(Node dataTableNode, String attrName) {
if (dataTableNode != null) {
Node attr = dataTableNode.getAttributes().getNamedItem(attrName);
16 years, 3 months
JBoss Tools SVN: r6931 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-03-14 09:06:30 -0400 (Fri, 14 Mar 2008)
New Revision: 6931
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1322
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2008-03-14 11:21:35 UTC (rev 6930)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2008-03-14 13:06:30 UTC (rev 6931)
@@ -68,9 +68,7 @@
try {
SeamSettingsPreferencePage page = (SeamSettingsPreferencePage)dialog.getSelectedPage();
IFieldEditor seamSuport = page.getEditor(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_SEAM_SUPPORT);
- System.out.println("set true");
- seamSuport.setValue("true");
- System.out.println("end");
+ seamSuport.setValue(Boolean.TRUE);
Bundle seamCoreTest = Platform.getBundle("org.jboss.tools.seam.core.test");
URL seamUrl = null;
@@ -99,7 +97,7 @@
sessionPackageName.setValue(ACTION_PACKAGE_NAME);
IFieldEditor createTest = page.getEditor(ISeamFacetDataModelProperties.TEST_CREATING);
- createTest.setValue("true");
+ createTest.setValue(Boolean.TRUE);
IFieldEditor testPackageName = page.getEditor(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME);
testPackageName.setValue(TEST_PACKAGE_NAME);
16 years, 3 months