JBoss Tools SVN: r3101 - trunk/hibernatetools/features/org.hibernate.eclipse.feature.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-08-13 12:31:50 -0400 (Mon, 13 Aug 2007)
New Revision: 3101
Modified:
trunk/hibernatetools/features/org.hibernate.eclipse.feature/feature.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-443 Removed org.jboss.tools.hibernate.ui.veditor org.jboss.tools.hibernate.ui.view as Max asked.
Modified: trunk/hibernatetools/features/org.hibernate.eclipse.feature/feature.xml
===================================================================
--- trunk/hibernatetools/features/org.hibernate.eclipse.feature/feature.xml 2007-08-13 15:22:46 UTC (rev 3100)
+++ trunk/hibernatetools/features/org.hibernate.eclipse.feature/feature.xml 2007-08-13 16:31:50 UTC (rev 3101)
@@ -496,16 +496,4 @@
version="0.0.0"
unpack="false"/>
- <plugin
- id="org.jboss.tools.hibernate.ui.veditor"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.jboss.tools.hibernate.ui.view"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
</feature>
18 years, 4 months
JBoss Tools SVN: r3100 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-08-13 11:22:46 -0400 (Mon, 13 Aug 2007)
New Revision: 3100
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
Log:
http://jira.jboss.com/jira/browse/EXIN-427
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2007-08-13 15:16:12 UTC (rev 3099)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2007-08-13 15:22:46 UTC (rev 3100)
@@ -54,13 +54,13 @@
if (element instanceof RootClass) {
descriptor = (ImageDescriptor) ((RootClass) element).accept(ormModelImageVisitor);
} else if (element instanceof Property) {
- descriptor = (ImageDescriptor)ormModelImageVisitor.visitPersistentField((Property) element, null);
+ descriptor = (ImageDescriptor)ormModelImageVisitor.visitPersistentField((Property) element);
} else if (element instanceof Table) {
descriptor = (ImageDescriptor)ormModelImageVisitor.visitDatabaseTable((Table) element);
} else if (element instanceof Column) {
descriptor = (ImageDescriptor)ormModelImageVisitor.visitDatabaseColumn((Column) element);
} else if (element instanceof DependantValue) {
- descriptor = (ImageDescriptor)ormModelImageVisitor.visitComponentKeyMapping((DependantValue) element, null);
+ descriptor = (ImageDescriptor)ormModelImageVisitor.visitComponentKeyMapping((DependantValue) element);
} else if (element instanceof Component) {
descriptor = (ImageDescriptor)ormModelImageVisitor.visitComponentMapping((Component) element);
} else if (element instanceof ManyToOne) {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2007-08-13 15:16:12 UTC (rev 3099)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2007-08-13 15:22:46 UTC (rev 3100)
@@ -45,10 +45,6 @@
private ResourceBundle BUNDLE = ViewPlugin.BUNDLE_IMAGE;
- private static Integer ID = new Integer(1);
- private static Integer VER = new Integer(2);
-
-
public Object visitDatabaseTable(Table table) {
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.DatabaseTable")); //$NON-NLS-1$
}
@@ -66,7 +62,7 @@
}
- public Object visitPersistentField(Property field, Object argument) {
+ public Object visitPersistentField(Property field) {
if (field !=null){
if(field.getValue() != null){
if(field.getValue() instanceof ManyToOne)
@@ -119,16 +115,13 @@
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldNot_mapped")); //$NON-NLS-1$
}
- public Object visitComponentKeyMapping(DependantValue mapping, Object argument) {
- if (argument == ID){
+ public Object visitComponentKeyMapping(DependantValue mapping) {
+ if (mapping.getTable().getIdentifierValue() == mapping){
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldComponent_id")); //$NON-NLS-1$
}
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldSimple")); //$NON-NLS-1$
}
- public Object visitDatabaseColumn(Column column, Object argument) {
- return null;
- }
public Object accept(RootClass arg0) {
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentClass")); //$NON-NLS-1$
18 years, 4 months
JBoss Tools SVN: r3099 - trunk/documentation/GettingStartedGuide/docs/userguide/en/images.
by jbosstools-commits@lists.jboss.org
Author: afedosik
Date: 2007-08-13 11:16:12 -0400 (Mon, 13 Aug 2007)
New Revision: 3099
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/images/consoleoutput.png
Log:
consoleoutput.png resizing
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/images/consoleoutput.png
===================================================================
(Binary files differ)
18 years, 4 months
JBoss Tools SVN: r3098 - trunk/hibernatetools/features/org.hibernate.eclipse.feature.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-08-13 11:13:58 -0400 (Mon, 13 Aug 2007)
New Revision: 3098
Modified:
trunk/hibernatetools/features/org.hibernate.eclipse.feature/feature.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-443 Michael has fixed JBIDE-700
Modified: trunk/hibernatetools/features/org.hibernate.eclipse.feature/feature.xml
===================================================================
--- trunk/hibernatetools/features/org.hibernate.eclipse.feature/feature.xml 2007-08-13 15:05:02 UTC (rev 3097)
+++ trunk/hibernatetools/features/org.hibernate.eclipse.feature/feature.xml 2007-08-13 15:13:58 UTC (rev 3098)
@@ -496,6 +496,16 @@
version="0.0.0"
unpack="false"/>
-
+ <plugin
+ id="org.jboss.tools.hibernate.ui.veditor"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+ <plugin
+ id="org.jboss.tools.hibernate.ui.view"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"/>
+
</feature>
18 years, 4 months
JBoss Tools SVN: r3097 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-08-13 11:05:02 -0400 (Mon, 13 Aug 2007)
New Revision: 3097
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
Log:
http://jira.jboss.com/jira/browse/EXIN-427
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2007-08-13 15:03:48 UTC (rev 3096)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2007-08-13 15:05:02 UTC (rev 3097)
@@ -67,6 +67,8 @@
descriptor = (ImageDescriptor)ormModelImageVisitor.visitManyToOneMapping((ManyToOne) element);
} else if (element instanceof OneToMany) {
descriptor = (ImageDescriptor)ormModelImageVisitor.visitOneToManyMapping((OneToMany) element);
+ } else if (element instanceof SimpleValue) {
+ descriptor = (ImageDescriptor)ormModelImageVisitor.visitSimpleValueMapping((SimpleValue) element);
} else {
//throw unknownElement(element);
return null;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2007-08-13 15:03:48 UTC (rev 3096)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2007-08-13 15:05:02 UTC (rev 3097)
@@ -28,6 +28,7 @@
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.Set;
+import org.hibernate.mapping.SimpleValue;
import org.hibernate.mapping.SingleTableSubclass;
import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
@@ -107,6 +108,10 @@
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldOne-to-many")); //$NON-NLS-1$
}
+ public Object visitSimpleValueMapping(SimpleValue field) {
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldSimple")); //$NON-NLS-1$
+ }
+
public Object visitComponentMapping(Component mapping) {
if (mapping != null){
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldComponent")); //$NON-NLS-1$
@@ -118,7 +123,7 @@
if (argument == ID){
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldComponent_id")); //$NON-NLS-1$
}
- return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldNot_mapped")); //$NON-NLS-1$
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldSimple")); //$NON-NLS-1$
}
public Object visitDatabaseColumn(Column column, Object argument) {
18 years, 4 months
JBoss Tools SVN: r3096 - 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: ezheleznyakov
Date: 2007-08-13 11:03:48 -0400 (Mon, 13 Aug 2007)
New Revision: 3096
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelBarTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabPanelTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTogglePanelTemplate.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/RichFacesTreeTemplate.java
Log:
http://jira.jboss.com/jira/browse/EXIN-435
change using Node to nsIDOMNode and Element to nsIDOMElement for classes:
RichFacesTreeTemplate
RichFacesTreeNodeTemplate
RichFacesSimpleTogglePanelTemplate
RichFacesToggleTemplate
RichFacesTabTemplate
RichFacesTabPanelTemplate
RichFacesDropDownTemplate
RichFacesPanelTemplate
RichFacesPanelBarTemplate
RichFacesPanelItemTemplate
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2007-08-13 14:54:37 UTC (rev 3095)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2007-08-13 15:03:48 UTC (rev 3096)
@@ -22,6 +22,8 @@
import org.eclipse.ui.editors.text.ILocationProvider;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -185,6 +187,7 @@
return children;
}
+ //TODO: Evgeny Zheleznyakov remove if not references
/**
* Returns all child source elements of component but facets.
* @param sourceElement
@@ -193,7 +196,36 @@
public static List<Node> getChildren(Element sourceElement) {
return getChildren(sourceElement, false);
}
+
+
+ /**
+ * Returns all child visual elements of component but facets.
+ * @param visualElement
+ * @param
+ * @return returnTextNodes return child text nodes and elements or elements only;
+ */
+ public static List<nsIDOMNode> getChildren(nsIDOMElement visualElement, boolean returnTextNodes) {
+ ArrayList<nsIDOMNode> children = new ArrayList<nsIDOMNode>();
+ nsIDOMNodeList nodeList = visualElement.getChildNodes();
+ for(int i=0; i<nodeList.getLength(); i++) {
+ nsIDOMNode child = nodeList.item(i);
+ if((child instanceof nsIDOMElement || returnTextNodes) && (!child.getNodeName().equals("f:facet"))) {
+ children.add(child);
+ }
+ }
+ return children;
+ }
+
+ /**
+ * Returns all child visual elements of component but facets.
+ * @param visualElement
+ * @return
+ */
+ public static List<nsIDOMNode> getChildren(nsIDOMElement visualElement) {
+ return getChildren(visualElement, false);
+ }
+ //TODO: Evgeny zheleznyakov remove or not references
/**
* Copies all attributes from source node to visual node.
* @param sourceNode
@@ -246,6 +278,7 @@
return style;
}
+ //TODO: Evgeny zheleznyakov remove or not references
/**
* Returns value of attribute.
* @param sourceElement
@@ -303,13 +336,14 @@
return style + (s.length() == 0 || s.endsWith(";") ? "" : ";") + element;
}
+ //TODO: Evgeny zheleznyakov remove or not references
/** Adds image as attribute to IMG tag from users worcpace
* @param pageContext Page Context
* @param img img element to which set picture
* @param fileImageName image name
* @param undefinedImgName default image when image is undefined
*/
- public static void setImgFromResources(VpePageContext pageContext,Element img, String fileImageName, String undefinedImgName) {
+ public static void setImgFromResources(VpePageContext pageContext,Element img, String fileImageName, String undefinedImgName) {
IEditorInput input = pageContext.getEditPart().getEditorInput();
IPath inputPath = getInputParentPath(input);
File file=new File(inputPath.toOSString()+File.separator+fileImageName);
@@ -321,6 +355,25 @@
img.setAttribute(HtmlComponentUtil.HTML_ATR_SRC, undefinedImgName);
}
}
+
+ /** Adds image as attribute to IMG tag from users worcpace
+ * @param pageContext Page Context
+ * @param img img element to which set picture
+ * @param fileImageName image name
+ * @param undefinedImgName default image when image is undefined
+ */
+ public static void setImgFromResources(VpePageContext pageContext, nsIDOMElement img, String fileImageName, String undefinedImgName) {
+ IEditorInput input = pageContext.getEditPart().getEditorInput();
+ IPath inputPath = getInputParentPath(input);
+ File file=new File(inputPath.toOSString()+File.separator+fileImageName);
+ if(file.exists()){
+ img.setAttribute(HtmlComponentUtil.HTML_ATR_SRC,
+ HtmlComponentUtil.FILE_PROTOCOL+inputPath.toOSString()+
+ File.separator+fileImageName);
+ } else {
+ img.setAttribute(HtmlComponentUtil.HTML_ATR_SRC, undefinedImgName);
+ }
+ }
/**
* Returns locale of user input
@@ -343,6 +396,7 @@
return inputPath;
}
+ //TODO: Evgeny zheleznyakov remove or not references
/**
* Move attributes from sourceNode to html
*
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java 2007-08-13 14:54:37 UTC (rev 3095)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java 2007-08-13 15:03:48 UTC (rev 3096)
@@ -19,10 +19,10 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-//TODO A. Yukhovich please fix if
-//import org.jboss.tools.vpe.editor.util.MozillaSupports;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -33,18 +33,16 @@
private static final String STYLE_ATTR_NAME = "style";
private static final String ITEMCLASS_ATTR_NAME = "itemClass";
private static final String ITEMSTYLE_ATTR_NAME = "itemStyle";
+ private static final String LABEL_FACET_NAME = "label";
- // TODO A. Yukhovich please fix if
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
+
+
+ VpeCreationData creatorInfo = null;
+ try {
Element sourceElement = (Element)sourceNode;
- Element visualMenu = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ nsIDOMElement visualMenu = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
ComponentUtil.setCSSLink(pageContext, "dropDownMenu/dropDownMenu.css", "richFacesDropDownMenu");
@@ -59,7 +57,7 @@
Attr ddmLabelFromAttribute = sourceElement.getAttributeNode("value");
- Element visualMenuLabel = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
+ nsIDOMElement visualMenuLabel = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
visualMenuLabel.setAttribute("class", "dr-label-text-decor rich-label-text-decor");
correctAttribute(sourceElement, visualMenuLabel,
ITEMCLASS_ATTR_NAME,
@@ -75,27 +73,28 @@
String ddmLabelFromFacet = getLabelFacet(sourceElement);
Map visualNodeMap = pageContext.getDomMapping().getVisualMap();
- // TODO A. Yukhovich please fix if
- VpeCreationData creatorInfo = new VpeCreationData(null/*visualMenu*/);
- VpeChildrenInfo childrenInfo = new VpeChildrenInfo(null/*visualMenuLabel*/);
- Node textLabel = null;
+ creatorInfo = new VpeCreationData(visualMenu);
+ VpeChildrenInfo childrenInfo = new VpeChildrenInfo(visualMenuLabel);
+ nsIDOMNode textLabel = null;
if (ddmLabelFromFacet != null) {
textLabel = visualDocument.createTextNode(ddmLabelFromFacet);
} else {
- textLabel = visualDocument.createTextNode(ddmLabelFromAttribute.getValue());
+ String valueForLabel = ddmLabelFromAttribute == null
+ ? ""
+ : ddmLabelFromAttribute.getValue();
+ textLabel = visualDocument.createTextNode(valueForLabel);
}
if (textLabel != null) {
visualMenuLabel.appendChild(textLabel);
creatorInfo.addChildrenInfo(childrenInfo);
}
visualMenu.appendChild(visualMenuLabel);
- // TODO A. Yukhovich please fix if
- //MozillaSupports.release(visualMenuLabel);
+ }catch(Throwable t) {
+ t.printStackTrace();
+ }
return creatorInfo;
}
-
- private static final String LABEL_FACET_NAME = "label";
private String getLabelFacet(Element sourceElement) {
String labelFacet = null;
@@ -151,18 +150,15 @@
return content;
}
- // TODO A. Yukhovich please fix if
- /*
@Override
- public void removeAttribute(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name) {
+ public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
processAttributeChanges(pageContext, sourceElement, visualDocument, visualNode, data, name);
}
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
+ public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
processAttributeChanges(pageContext, sourceElement, visualDocument, visualNode, data, name);
}
- */
/**
* Correct list style accordinly parameters
@@ -176,9 +172,9 @@
*/
private void processAttributeChanges(VpePageContext pageContext,
- Element sourceElement, Document visualDocument, Node visualNode,
+ Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode,
Object data, String name) {
- Element el = (Element) visualNode;
+ nsIDOMElement el = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
if (STYLECLASS_ATTR_NAME.equals(name)) {
if (el.getNodeName()
@@ -197,14 +193,14 @@
HtmlComponentUtil.HTML_STYLE_ATTR, null, null);
}
} else if (ITEMCLASS_ATTR_NAME.equals(name)) {
- NodeList nodeList = el.getChildNodes();
- Node temp = null;
+ nsIDOMNodeList nodeList = el.getChildNodes();
+ nsIDOMNode temp = null;
for (int i = 0; i < nodeList.getLength(); i++) {
temp = nodeList.item(i);
if ((temp instanceof Element)
&& (temp.getNodeName()
.equalsIgnoreCase(HtmlComponentUtil.HTML_TAG_DIV))) {
- correctAttribute(sourceElement, (Element) temp,
+ correctAttribute(sourceElement, (nsIDOMElement) temp.queryInterface(nsIDOMNode.NS_IDOMNODE_IID),
ITEMCLASS_ATTR_NAME,
HtmlComponentUtil.HTML_CLASS_ATTR,
"dr-label-text-decor rich-label-text-decor",
@@ -212,14 +208,14 @@
}
}
} else if (ITEMSTYLE_ATTR_NAME.equals(name)) {
- NodeList nodeList = el.getChildNodes();
- Node temp = null;
+ nsIDOMNodeList nodeList = el.getChildNodes();
+ nsIDOMNode temp = null;
for (int i = 0; i < nodeList.getLength(); i++) {
temp = nodeList.item(i);
if ((temp instanceof Element)
&& (temp.getNodeName()
.equalsIgnoreCase(HtmlComponentUtil.HTML_TAG_DIV))) {
- correctAttribute(sourceElement, (Element) temp,
+ correctAttribute(sourceElement, (nsIDOMElement) temp.queryInterface(nsIDOMNode.NS_IDOMNODE_IID),
ITEMSTYLE_ATTR_NAME,
HtmlComponentUtil.HTML_STYLE_ATTR, null, null);
}
@@ -231,30 +227,23 @@
* Move attributes from sourceNode to html
*
* @param sourceNode
- * @param visualNode
+ * @param visualElement
* @param attrName
* @param htmlAttrName
* @param prefValue
* @param defValue
*/
- private void correctAttribute(Element sourceNode, Element visualNode,
+ private void correctAttribute(Element sourceNode, nsIDOMElement visualElement,
String attrName, String htmlAttrName, String prefValue, String defValue) {
String attrValue = ((Element) sourceNode).getAttribute(attrName);
if (prefValue != null && prefValue.trim().length() > 0 && attrValue != null) {
attrValue = prefValue.trim() + " " + attrValue;
}
if (attrValue != null) {
- visualNode.setAttribute(htmlAttrName, attrValue);
+ visualElement.setAttribute(htmlAttrName, attrValue);
} else if (defValue != null) {
- visualNode.setAttribute(htmlAttrName, defValue);
+ visualElement.setAttribute(htmlAttrName, defValue);
} else
- visualNode.removeAttribute(attrName);
+ visualElement.removeAttribute(attrName);
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
+}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java 2007-08-13 14:54:37 UTC (rev 3095)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPaint2DTemplate.java 2007-08-13 15:03:48 UTC (rev 3096)
@@ -41,7 +41,7 @@
* java.lang.Object, java.lang.String)
*/
@Override
- public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
+ public void removeAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
super.removeAttribute(pageContext, sourceElement, visualDocument, visualNode, data, name);
nsIDOMElement img = (nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
if (name.equals("styleClass")
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelBarTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelBarTemplate.java 2007-08-13 14:54:37 UTC (rev 3095)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelBarTemplate.java 2007-08-13 15:03:48 UTC (rev 3096)
@@ -21,7 +21,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -29,22 +29,14 @@
private static Map toggleMap = new HashMap();
- // TODO A. Yukhovich please fix it
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
Element sourceElement = (Element)sourceNode;
- Element div = visualDocument.createElement("div");
+ nsIDOMElement div = visualDocument.createElement("div");
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*div*/);
+ VpeCreationData creationData = new VpeCreationData(div);
ComponentUtil.setCSSLink(pageContext, "panelBar/panelBar.css", "richFacesPanelBar");
String styleClass = sourceElement.getAttribute("styleClass");
@@ -80,7 +72,6 @@
}
div.setAttribute("style", styleValue.toString());
-
return creationData;
}
@@ -136,10 +127,4 @@
}
return count;
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java 2007-08-13 14:54:37 UTC (rev 3095)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java 2007-08-13 15:03:48 UTC (rev 3096)
@@ -18,31 +18,24 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
public class RichFacesPanelItemTemplate extends VpeAbstractTemplate {
- // TODO A. Yukhovich please fix it
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
- public static VpeCreationData encode(VpeCreationData creationData, Element sourceElement, Document visualDocument, Element parentVisualElement, boolean active,
+ public static VpeCreationData encode(VpeCreationData creationData, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement parentVisualElement, boolean active,
String barStyleClass, String barStyle,
String barHeaderStyleClass, String barHeaderStyle,
String barHeaderActiveStyleClass, String barHeaderActiveStyle,
String barContentStyleClass,
String barContentStyle,
String toggleId) {
- Element div = visualDocument.createElement("div");
+
+ nsIDOMElement div = visualDocument.createElement("div");
if(creationData==null) {
- // TODO A. Yukhovich please fix it
- creationData = new VpeCreationData(null/*div*/);
+ creationData = new VpeCreationData(div);
} else {
parentVisualElement.appendChild(div);
}
@@ -64,23 +57,23 @@
// Encode Body
if(active) {
- Element bodyDiv = visualDocument.createElement("div");
+ nsIDOMElement bodyDiv = visualDocument.createElement("div");
div.appendChild(bodyDiv);
bodyDiv.setAttribute("style", "width: 100%;");
- Element table = visualDocument.createElement("table");
+ nsIDOMElement table = visualDocument.createElement("table");
bodyDiv.appendChild(table);
table.setAttribute("cellpadding", "0");
table.setAttribute("width", "100%");
table.setAttribute("style", "height: 100%;");
- Element tbody = visualDocument.createElement("tbody");
+ nsIDOMElement tbody = visualDocument.createElement("tbody");
table.appendChild(tbody);
- Element tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement("tr");
tbody.appendChild(tr);
- Element td = visualDocument.createElement("td");
+ nsIDOMElement td = visualDocument.createElement("td");
tr.appendChild(td);
String tdClass = "dr-pnlbar-c rich-panelbar-content " + barContentStyleClass + " " + ComponentUtil.getAttribute(sourceElement, "contentClass");
@@ -90,23 +83,22 @@
td.setAttribute("style", tdStyle);
List<Node> children = ComponentUtil.getChildren(sourceElement, true);
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo bodyInfo = new VpeChildrenInfo(null/*td*/);
+ VpeChildrenInfo bodyInfo = new VpeChildrenInfo(td);
for (Node child : children) {
bodyInfo.addSourceChild(child);
}
creationData.addChildrenInfo(bodyInfo);
}
-
return creationData;
}
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
return encode(null, (Element)sourceNode, visualDocument, null, false, "", "", "", "", "", "", "", "", "0");
}
- private static void encodeHeader(Element sourceElement, Document visualDocument, Element parentDiv, String styleClass, String style, String toggleId) {
- Element div = visualDocument.createElement("div");
+ private static void encodeHeader(Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement parentDiv, String styleClass, String style, String toggleId) {
+ try {
+ nsIDOMElement div = visualDocument.createElement("div");
parentDiv.appendChild(div);
div.setAttribute("class", styleClass);
div.setAttribute("style", style);
@@ -116,11 +108,8 @@
if(label!=null) {
div.appendChild(visualDocument.createTextNode(label));
}
+ }catch(Throwable t) {
+ t.printStackTrace();
+ }
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java 2007-08-13 14:54:37 UTC (rev 3095)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java 2007-08-13 15:03:48 UTC (rev 3096)
@@ -18,28 +18,23 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
public class RichFacesPanelTemplate extends VpeAbstractTemplate {
- // TODO A. Yukhovich please fix it
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
+
Element sourceElement = (Element)sourceNode;
- Element div = visualDocument.createElement("div");
+ nsIDOMElement div = visualDocument.createElement("div");
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*div*/);
+
+ VpeCreationData creationData = new VpeCreationData(div);
+
ComponentUtil.setCSSLink(pageContext, "panel/panel.css", "richFacesPanel");
String styleClass = sourceElement.getAttribute("styleClass");
@@ -52,27 +47,25 @@
// Encode Header
Node header = ComponentUtil.getFacet(sourceElement, "header", true);
if(header!=null) {
- Element headerDiv = visualDocument.createElement("div");
+ nsIDOMElement headerDiv = visualDocument.createElement("div");
div.appendChild(headerDiv);
String headerClass = sourceElement.getAttribute("headerClass");
headerDiv.setAttribute("class", "dr-pnl-h rich-panel-header " + (headerClass==null?"":headerClass));
headerDiv.setAttribute("style", ComponentUtil.getHeaderBackgoundImgStyle());
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo headerInfo = new VpeChildrenInfo(null/*headerDiv*/);
+ VpeChildrenInfo headerInfo = new VpeChildrenInfo(headerDiv);
headerInfo.addSourceChild(header);
creationData.addChildrenInfo(headerInfo);
}
// Encode Body
- Element bodyDiv = visualDocument.createElement("div");
+ nsIDOMElement bodyDiv = visualDocument.createElement("div");
div.appendChild(bodyDiv);
String bodyClass = sourceElement.getAttribute("bodyClass");
bodyDiv.setAttribute("class", "dr-pnl-b rich-panel-body " + (bodyClass==null?"":bodyClass));
List<Node> children = ComponentUtil.getChildren(sourceElement, true);
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo bodyInfo = new VpeChildrenInfo(null/*bodyDiv*/);
+ VpeChildrenInfo bodyInfo = new VpeChildrenInfo(bodyDiv);
for (Node child : children) {
bodyInfo.addSourceChild(child);
}
@@ -80,10 +73,4 @@
return creationData;
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java 2007-08-13 14:54:37 UTC (rev 3095)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java 2007-08-13 15:03:48 UTC (rev 3096)
@@ -22,38 +22,31 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
public class RichFacesSimpleTogglePanelTemplate extends VpeAbstractTemplate implements VpeToggableTemplate {
private static Map toggleMap = new HashMap();
- private Element storedSwitchDiv = null;
+ private nsIDOMElement storedSwitchDiv = null;
- // TODO A. Yukhovich please fix it
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
Element sourceElement = (Element)sourceNode;
- Element div = visualDocument.createElement("div");
+ nsIDOMElement div = visualDocument.createElement("div");
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*div*/);
+ VpeCreationData creationData = new VpeCreationData(div);
ComponentUtil.setCSSLink(pageContext, "simpleTogglePanel/simpleTogglePanel.css", "richFacesSimpleTogglePanel");
div.setAttribute("class", "dr-stglpnl rich-stglpanel " + ComponentUtil.getAttribute(sourceElement, "styleClass"));
div.setAttribute("style", "width: " + ComponentUtil.getAttribute(sourceElement, "width") + ";" + ComponentUtil.getAttribute(sourceElement, "style"));
// Encode Header
- Element headerDiv = visualDocument.createElement("div");
+ nsIDOMElement headerDiv = visualDocument.createElement("div");
div.appendChild(headerDiv);
headerDiv.setAttribute("class", "dr-stglpnl-h rich-stglpanel-header " + ComponentUtil.getAttribute(sourceElement, "headerClass"));
headerDiv.setAttribute("style", "position : relative; " + ComponentUtil.getHeaderBackgoundImgStyle());
@@ -61,7 +54,7 @@
String label = ComponentUtil.getAttribute(sourceElement, "label");
headerDiv.appendChild(visualDocument.createTextNode(label));
- Element switchDiv = visualDocument.createElement("div");
+ nsIDOMElement switchDiv = visualDocument.createElement("div");
headerDiv.appendChild(switchDiv);
switchDiv.setAttribute("style", "position : absolute; top: 0px; right: 5px;");
@@ -79,37 +72,34 @@
if(markerFacet==null) {
switchDiv.appendChild(visualDocument.createTextNode("" + defaultMarkerCode));
} else {
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo switchInfo = new VpeChildrenInfo(null/*switchDiv*/);
+ VpeChildrenInfo switchInfo = new VpeChildrenInfo(switchDiv);
switchInfo.addSourceChild(markerFacet);
creationData.addChildrenInfo(switchInfo);
}
// Encode Body
if(opened) {
- Element bodyDiv = visualDocument.createElement("div");
+ nsIDOMElement bodyDiv = visualDocument.createElement("div");
div.appendChild(bodyDiv);
bodyDiv.setAttribute("style", "overflow: auto; height: " + ComponentUtil.getAttribute(sourceElement, "height") + "; width: 100%;");
- Element table = visualDocument.createElement("table");
+ nsIDOMElement table = visualDocument.createElement("table");
bodyDiv.appendChild(table);
table.setAttribute("cellpadding", "0");
table.setAttribute("style", "width: 100%");
- Element tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement("tr");
table.appendChild(tr);
- Element td = visualDocument.createElement("td");
+ nsIDOMElement td = visualDocument.createElement("td");
tr.appendChild(td);
td.setAttribute("class", "dr-stglpnl-b rich-stglpanel-body " + ComponentUtil.getAttribute(sourceElement, "bodyClass"));
List<Node> children = ComponentUtil.getChildren(sourceElement, true);
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo bodyInfo = new VpeChildrenInfo(null/*td*/);
+ VpeChildrenInfo bodyInfo = new VpeChildrenInfo(td);
for (Node child : children) {
bodyInfo.addSourceChild(child);
}
creationData.addChildrenInfo(bodyInfo);
}
-
return creationData;
}
@@ -120,9 +110,8 @@
* @param visualDocument The document of the visual tree.
* @param data Object <code>VpeCreationData</code>, built by a method <code>create</code>
*/
- public void validate(VpePageContext pageContext, Node sourceNode, Document visualDocument, VpeCreationData data) {
- // TODO A. Yukhovich please fix it
- //super.validate(pageContext, sourceNode, visualDocument, data);
+ public void validate(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument, VpeCreationData data) {
+ super.validate(pageContext, sourceNode, visualDocument, data);
if (storedSwitchDiv == null) return;
String value = storedSwitchDiv.getAttribute("vpe-user-toggle-id");
if ("true".equals(value) || "false".equals(value)) {
@@ -131,12 +120,12 @@
}
}
- private void applyAttributeValueOnChildren(String attrName, String attrValue, List<Node> children) {
+ private void applyAttributeValueOnChildren(String attrName, String attrValue, List<nsIDOMNode> children) {
if (children == null || attrName == null || attrValue == null) return;
- for (Node child : children) {
- if (child instanceof Element) {
- Element childElement = (Element)child;
+ for (nsIDOMNode child : children) {
+ if (child instanceof nsIDOMElement) {
+ nsIDOMElement childElement = (nsIDOMElement)child.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
childElement.setAttribute(attrName, attrValue);
applyAttributeValueOnChildren(attrName, attrValue, ComponentUtil.getChildren(childElement));
}
@@ -166,10 +155,4 @@
public void stopToggling(Node sourceNode) {
toggleMap.remove(sourceNode);
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabPanelTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabPanelTemplate.java 2007-08-13 14:54:37 UTC (rev 3095)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabPanelTemplate.java 2007-08-13 15:03:48 UTC (rev 3096)
@@ -21,7 +21,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -29,23 +29,13 @@
private static Map toggleMap = new HashMap();
- // TODO A. Yukhovich please fix it
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
-
Element sourceElement = (Element)sourceNode;
- Element table = visualDocument.createElement("table");
-
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*table*/);
-
+ nsIDOMElement table = visualDocument.createElement("table");
+
+ VpeCreationData creationData = new VpeCreationData(table);
ComponentUtil.setCSSLink(pageContext, "tabPanel/tabPanel.css", "richFacesTabPanel");
table.setAttribute("class", "rich-tabpanel " + ComponentUtil.getAttribute(sourceElement, "styleClass"));
table.setAttribute("border", "0");
@@ -53,26 +43,26 @@
table.setAttribute("cellspacing", "0");
table.setAttribute("style", getStyle(sourceElement));
- Element tbody = visualDocument.createElement("tbody");
+ nsIDOMElement tbody = visualDocument.createElement("tbody");
table.appendChild(tbody);
- Element tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement("tr");
tbody.appendChild(tr);
- Element td = visualDocument.createElement("td");
+ nsIDOMElement td = visualDocument.createElement("td");
tr.appendChild(td);
td.setAttribute("align", getHeaderAlignment(sourceElement));
- Element inerTable = visualDocument.createElement("table");
+ nsIDOMElement inerTable = visualDocument.createElement("table");
td.appendChild(inerTable);
inerTable.setAttribute("border", "0");
inerTable.setAttribute("cellpadding", "0");
inerTable.setAttribute("cellspacing", "0");
// Encode header
- Element inerTr = visualDocument.createElement("tr");
+ nsIDOMElement inerTr = visualDocument.createElement("tr");
inerTable.appendChild(inerTr);
- Element inerTd = visualDocument.createElement("td");
+ nsIDOMElement inerTd = visualDocument.createElement("td");
inerTr.appendChild(inerTd);
- Element img = visualDocument.createElement("img");
+ nsIDOMElement img = visualDocument.createElement("img");
inerTd.appendChild(img);
ComponentUtil.setImg(img, "common/spacer.gif");
img.setAttribute("width", "2");
@@ -89,9 +79,9 @@
RichFacesTabTemplate.encodeHeader((Element)child, visualDocument, inerTr, active, ComponentUtil.getAttribute(sourceElement, "activeTabClass"), ComponentUtil.getAttribute(sourceElement, "inactiveTabClass"), ComponentUtil.getAttribute(sourceElement, "disabledTabClass"), String.valueOf(i));
i++;
// Add <td><img src="#{spacer}" height="1" alt="" border="0" style="#{this:encodeHeaderSpacing(context, component)}"/></td>
- Element spaceTd = visualDocument.createElement("td");
+ nsIDOMElement spaceTd = visualDocument.createElement("td");
inerTr.appendChild(spaceTd);
- Element spaceImg = visualDocument.createElement("img");
+ nsIDOMElement spaceImg = visualDocument.createElement("img");
spaceTd.appendChild(spaceImg);
ComponentUtil.setImg(spaceImg, "common/spacer.gif");
spaceImg.setAttribute("height", "1");
@@ -150,7 +140,7 @@
int count = getChildrenCount(children);
if (count - 1 < activeId) {
activeId = count - 1;
- }
+ }
return activeId;
}
@@ -184,6 +174,7 @@
}
private String getStyle(Element sourceElement) {
+
String widthAttrValue = sourceElement.getAttribute("width");
String heightAttrValue = sourceElement.getAttribute("height");
String styleAttrValue = sourceElement.getAttribute("style");
@@ -200,6 +191,7 @@
style =ComponentUtil.addParameter(style, "height:" + height);
}
}
+
return style;
}
@@ -218,10 +210,4 @@
public void stopToggling(Node sourceNode) {
toggleMap.remove(sourceNode);
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java 2007-08-13 14:54:37 UTC (rev 3095)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java 2007-08-13 15:03:48 UTC (rev 3096)
@@ -18,20 +18,12 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
public class RichFacesTabTemplate extends VpeAbstractTemplate {
- // TODO A. Yukhovich please fix it
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
-
/**
* Encode body of tab
* @param creationData
@@ -47,19 +39,19 @@
* @param contentStyle
* @return
*/
- public static VpeCreationData encodeBody(VpeCreationData creationData, Element sourceElement, Document visualDocument, Element parentVisualElement, boolean active,
+ public static VpeCreationData encodeBody(VpeCreationData creationData, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement parentVisualElement, boolean active,
String tabClass,
String activeTabClass,
String inactiveTabClass,
String disabledTabClass,
String contentClass,
String contentStyle) {
+
+ nsIDOMElement td = visualDocument.createElement("td");
- Element td = visualDocument.createElement("td");
-
if(creationData==null) {
- // TODO A. Yukhovich please fix it
- creationData = new VpeCreationData(null/*td*/);
+
+ creationData = new VpeCreationData(td);
} else {
parentVisualElement.appendChild(td);
}
@@ -68,8 +60,9 @@
}
// td.setAttribute("style", "position: relative;");
td.setAttribute("height", "100%");
+
- Element table = visualDocument.createElement("table");
+ nsIDOMElement table = visualDocument.createElement("table");
td.appendChild(table);
table.setAttribute("border", "0");
table.setAttribute("cellpadding", "10");
@@ -78,7 +71,7 @@
table.setAttribute("class", "dr-tbpnl-cntnt-pstn rich-tabpanel-content-position");
table.setAttribute("style", "position: relative; z-index: 1;");
- Element tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement("tr");
table.appendChild(tr);
td = visualDocument.createElement("td");
tr.appendChild(td);
@@ -86,8 +79,7 @@
td.setAttribute("style", ComponentUtil.getAttribute(sourceElement, "contentStyle") + "; " + ComponentUtil.getAttribute(sourceElement, "style"));
List<Node> children = ComponentUtil.getChildren(sourceElement, true);
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo bodyInfo = new VpeChildrenInfo(null/*td*/);
+ VpeChildrenInfo bodyInfo = new VpeChildrenInfo(td);
for (Node child : children) {
bodyInfo.addSourceChild(child);
}
@@ -96,7 +88,7 @@
return creationData;
}
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
return encodeBody(null, (Element)sourceNode, visualDocument, null, true, "", "", "", "", "", "");
}
@@ -110,11 +102,12 @@
* @param inactiveTabClass
* @param disabledTabClass
*/
- public static void encodeHeader(Element sourceElement, Document visualDocument, Element parentDiv, boolean active,
+ public static void encodeHeader(Element sourceElement, nsIDOMDocument visualDocument, nsIDOMElement parentDiv, boolean active,
String activeTabClass,
String inactiveTabClass,
String disabledTabClass, String toggleId) {
- Element td = visualDocument.createElement("td");
+
+ nsIDOMElement td = visualDocument.createElement("td");
parentDiv.appendChild(td);
td.setAttribute("style", "height: 100%; vertical-align: bottom;");
String styleClass = "dr-tbpnl-tbcell-dsbl rich-tabhdr-cell-dsbl";
@@ -128,7 +121,7 @@
td.setAttribute("class", styleClass);
td.setAttribute("vpe-user-toggle-id", toggleId);
- Element table = visualDocument.createElement("table");
+ nsIDOMElement table = visualDocument.createElement("table");
td.appendChild(table);
table.setAttribute("border", "0");
table.setAttribute("cellpadding", "0");
@@ -136,7 +129,7 @@
table.setAttribute("style", "height : 100%; position : relative; z-index : 2;");
table.setAttribute("vpe-user-toggle-id", toggleId);
- Element mainTr = visualDocument.createElement("tr");
+ nsIDOMElement mainTr = visualDocument.createElement("tr");
table.appendChild(mainTr);
encodeSpacer(mainTr, visualDocument);
@@ -154,7 +147,7 @@
table.setAttribute("cellspacing", "0");
table.setAttribute("vpe-user-toggle-id", toggleId);
- Element tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement("tr");
table.appendChild(tr);
td = visualDocument.createElement("td");
tr.appendChild(td);
@@ -187,24 +180,18 @@
/*
* Add <td class="dr-tbpnl-tbbrdr rich-tabhdr-side-border"><img src="#{spacer}" width="1" height="1" alt="" border="0" /></td>
*/
- private static void encodeSpacer(Element parentTr, Document visualDocument) {
- Element td = visualDocument.createElement("td");
+ private static void encodeSpacer(nsIDOMElement parentTr, nsIDOMDocument visualDocument) {
+ nsIDOMElement td = visualDocument.createElement("td");
parentTr.appendChild(td);
td.setAttribute("class", "dr-tbpnl-tbbrdr rich-tabhdr-side-border");
String borderImgPath = ComponentUtil.getAbsoluteResourcePath("tabPanel/border.gif");
String style = "background-image: url(file:///" + borderImgPath.replace('\\', '/') + ");";
td.setAttribute("style", style);
- Element img = visualDocument.createElement("img");
+ nsIDOMElement img = visualDocument.createElement("img");
td.appendChild(img);
ComponentUtil.setImg(img, "common/spacer.gif");
img.setAttribute("width", "1");
img.setAttribute("height", "1");
img.setAttribute("border", "0");
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
\ No newline at end of file
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTogglePanelTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTogglePanelTemplate.java 2007-08-13 14:54:37 UTC (rev 3095)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTogglePanelTemplate.java 2007-08-13 15:03:48 UTC (rev 3096)
@@ -23,6 +23,7 @@
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -36,22 +37,14 @@
private static Map toggleMap = new HashMap();
private Map states = null;
- // TODO A. Yukhovich please fix it
- /*
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, Document visualDocument, Node visualNode, Object data, String name, String value) {
- return true;
- }
- */
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, Document visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
Element sourceElement = (Element)sourceNode;
- Element div = visualDocument.createElement("div");
+ nsIDOMElement div = visualDocument.createElement("div");
- // TODO A. Yukhovich please fix it
- VpeCreationData creationData = new VpeCreationData(null/*div*/);
+ VpeCreationData creationData = new VpeCreationData(div);
states = getStates(sourceElement);
@@ -68,8 +61,7 @@
}
if(bodyFacet!=null) {
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo bodyInfo = new VpeChildrenInfo(null/*div*/);
+ VpeChildrenInfo bodyInfo = new VpeChildrenInfo(div);
bodyInfo.addSourceChild(bodyFacet);
creationData.addChildrenInfo(bodyInfo);
}
@@ -186,10 +178,4 @@
public void stopToggling(Node sourceNode) {
toggleMap.remove(sourceNode);
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
\ No newline at end of file
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-08-13 14:54:37 UTC (rev 3095)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodeTemplate.java 2007-08-13 15:03:48 UTC (rev 3096)
@@ -19,7 +19,9 @@
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.mozilla.interfaces.nsIDOMDocument;
-import org.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -78,12 +80,12 @@
* @return The information on the created node of the visual tree.
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- Document visualDocument) {
- Element tableRow = visualDocument
+ nsIDOMDocument visualDocument) {
+ nsIDOMElement tableRow = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TR);
addAttributeToTableNode((Element) sourceNode, tableRow);
- // TODO A. Yukhovich please fix it
- VpeCreationData vpeCreationData = new VpeCreationData(null/*tableRow*/);
+
+ VpeCreationData vpeCreationData = new VpeCreationData(tableRow);
createBasicTree(pageContext, visualDocument, tableRow, sourceNode,
vpeCreationData);
return vpeCreationData;
@@ -96,7 +98,7 @@
* @param sourceNode
* @param tableRow
*/
- private void addAttributeToTableNode(Element sourceNode, Element tableRow) {
+ private void addAttributeToTableNode(Element sourceNode, nsIDOMElement tableRow) {
String attrValue = sourceNode
.getAttribute(NODE_TITLE_STYLE_CLASS_ATTR_NAME);
@@ -123,9 +125,9 @@
* (image by default)
*/
private void setAttributeForPictureNode(VpePageContext pageContext,
- Document visualDocument, Element sourceNode, Element iconCell,
+ nsIDOMDocument visualDocument, Element sourceNode, nsIDOMElement iconCell,
String nodeAttrName, String defaultImage) {
- Element img = visualDocument
+ nsIDOMElement img = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_IMG);
addBasicAttributesToPicture(img);
iconCell.appendChild(img);
@@ -166,10 +168,10 @@
* @return tree
*/
private void createBasicTree(VpePageContext pageContext,
- Document visualDocument, Element treeRow, Node sourceNode,
+ nsIDOMDocument visualDocument, nsIDOMElement treeRow, Node sourceNode,
VpeCreationData vpeCreationData) {
// creates icon node
- Element iconNode = visualDocument
+ nsIDOMElement iconNode = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
String showLinesParam = ((Element) sourceNode.getParentNode())
.getAttribute(RichFacesTreeTemplate.SHOW_LINES_ATTR_NAME);
@@ -178,7 +180,7 @@
showLinesValue = false;
}
// creates icon with status of node(collapsed or not) node
- Element td1 = visualDocument
+ nsIDOMElement td1 = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
// sets attribute for icon expanded picture or not
@@ -202,12 +204,11 @@
treeRow.appendChild(td1);
treeRow.appendChild(iconNode);
// creates Tree Node Name Message
- Element nodeTitle = visualDocument
+ nsIDOMElement nodeTitle = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
addBasicNadeTitleAttributes(nodeTitle);
// Create mapping to Encode body
- // TODO A. Yukhovich please fix it
- VpeChildrenInfo tdInfo = new VpeChildrenInfo(null/*nodeTitle*/);
+ VpeChildrenInfo tdInfo = new VpeChildrenInfo(nodeTitle);
// Create mapping to Encode body
List<Node> children = ComponentUtil.getChildren((Element) sourceNode,
@@ -224,16 +225,16 @@
*
* @param nodeTitle
*/
- private void addBasicNadeTitleAttributes(Element nodeTitle) {
+ private void addBasicNadeTitleAttributes(nsIDOMElement nodeTitle) {
nodeTitle.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
STYLE_CLASS_FOR_NODE_TITLE);
}
- // TODO A. Yukhovich please fix it
- /*
+
+
@Override
public void setAttribute(VpePageContext pageContext, Element sourceElement,
- Document visualDocument, Node visualNode, Object data, String name,
+ nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name,
String value) {
//
// processed only next attributes iconExpanded and icon, becouse tree
@@ -241,23 +242,28 @@
// in model
//
if (NODE_ICON_EXPANDED_ATTR_NAME.equalsIgnoreCase(name)) {
- Element expandedIconCell = (Element) visualNode.getChildNodes()
- .item(0);
- Element img = (Element) expandedIconCell.getChildNodes().item(0);
+ nsIDOMElement expandedIconCell = (nsIDOMElement) visualNode.getChildNodes()
+ . item(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ nsIDOMElement img = (nsIDOMElement) expandedIconCell.getChildNodes()
+ .item(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
ComponentUtil.setImgFromResources(pageContext, img, value,
UNDEFINED_ICON);
img.setAttribute(ICON_PARAM_NAME, "");
} else if (NODE_ICON_ATTR_NAME.equals(name)
&& !isLastElement(visualNode.getParentNode(), visualNode)) {
- Element iconCell = (Element) visualNode.getChildNodes().item(1);
- Element img = (Element) iconCell.getChildNodes().item(0);
+ nsIDOMElement iconCell = (nsIDOMElement) visualNode.getChildNodes().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, "");
} else if (NODE_ICON_LEAF_ATTR_NAME.equals(name)
&& isLastElement(sourceElement.getParentNode(), sourceElement)) {
- Element iconCell = (Element) visualNode.getChildNodes().item(1);
- Element img = (Element) iconCell.getChildNodes().item(0);
+ nsIDOMElement iconCell = (nsIDOMElement) visualNode.getChildNodes().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, "");
@@ -266,7 +272,7 @@
@Override
public void removeAttribute(VpePageContext pageContext,
- Element sourceElement, Document visualDocument, Node visualNode,
+ Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode,
Object data, String name) {
//
// processed only next attributes iconExpanded and icon, becouse tree
@@ -280,9 +286,11 @@
showLinesValue = false;
}
if (NODE_ICON_EXPANDED_ATTR_NAME.equalsIgnoreCase(name)) {
- Element expandedIconCell = (Element) visualNode.getChildNodes()
- .item(0);
- Element img = (Element) expandedIconCell.getChildNodes().item(0);
+ nsIDOMElement expandedIconCell = (nsIDOMElement) visualNode.getChildNodes()
+ .item(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ 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) {
@@ -298,8 +306,11 @@
DEFAULT_ICON_EXPANDED_PARAM_VALUE);
} else if (NODE_ICON_ATTR_NAME.equalsIgnoreCase(name)
&& !isLastElement(sourceElement.getParentNode(), sourceElement)) {
- Element iconCell = (Element) visualNode.getChildNodes().item(1);
- Element img = (Element) iconCell.getChildNodes().item(0);
+ nsIDOMElement iconCell = (nsIDOMElement) visualNode.getChildNodes().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_ATTR_NAME);
if (parentAttrName == null || parentAttrName.length() == 0) {
@@ -314,8 +325,10 @@
} else if (NODE_ICON_LEAF_ATTR_NAME.equalsIgnoreCase(name)
&& isLastElement(sourceElement.getParentNode(), sourceElement)) {
- Element iconCell = (Element) visualNode.getChildNodes().item(1);
- Element img = (Element) iconCell.getChildNodes().item(0);
+ nsIDOMElement iconCell = (nsIDOMElement) visualNode.getChildNodes().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) {
@@ -329,7 +342,7 @@
img.setAttribute(ICON_PARAM_NAME, NODE_ICON_LEAF_ATTR_NAME);
}
}
- */
+
/**
*
@@ -351,6 +364,27 @@
}
return currentNode.equals(lastElement);
}
+
+ /**
+ *
+ * @param parentTree
+ * @param currentNode
+ * @return
+ */
+ private boolean isLastElement(nsIDOMNode parentTree, nsIDOMNode currentNode) {
+ nsIDOMNodeList childs = parentTree.getChildNodes();
+ String treeNodeName = parentTree.getPrefix() + ":"
+ + RichFacesTreeTemplate.TREE_NODE_NAME;
+ nsIDOMNode lastElement = null;
+ nsIDOMNode el = null;
+ for (int i = 0; i < childs.getLength(); i++) {
+ el = childs.item(i);
+ if (el.getNodeName().equals(treeNodeName)) {
+ lastElement = el;
+ }
+ }
+ return currentNode.equals(lastElement);
+ }
/**
* Adds basic attributes to tree
@@ -358,14 +392,8 @@
* @param img
*/
- private void addBasicAttributesToPicture(Element img) {
+ private void addBasicAttributesToPicture(nsIDOMElement img) {
img.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
TREE_TABLE_PICTURE_STYLE_CLASS_NAME);
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
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-08-13 14:54:37 UTC (rev 3095)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeTemplate.java 2007-08-13 15:03:48 UTC (rev 3096)
@@ -16,12 +16,13 @@
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.w3c.dom.Document;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import org.mozilla.interfaces.nsIDOMDocument;
-import org.mozilla.interfaces.nsIDOMNode;
/**
* Create template for rich:tree element.
*
@@ -64,22 +65,20 @@
* @return The information on the created node of the visual tree.
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- Document visualDocument) {
+ nsIDOMDocument visualDocument) {
// sets css for tree on page
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, "tree");
- Element visualElement = visualDocument
+ nsIDOMElement visualElement = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
- Element treeRow = visualDocument
+ nsIDOMElement treeRow = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TR);
- Element treeCell = visualDocument
+ nsIDOMElement treeCell = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
addBasicTreeAttributes(visualElement);
treeRow.appendChild(treeCell);
visualElement.appendChild(treeRow);
- // TODO A. Yukhovich please fix it
- nsIDOMNode domNode = null;
- VpeCreationData vpeCreationData = new VpeCreationData(domNode/*visualElement*/);
+ VpeCreationData vpeCreationData = new VpeCreationData(visualElement);
parseTree(pageContext, sourceNode, visualDocument, vpeCreationData,
treeCell);
@@ -93,7 +92,7 @@
* @param tree
* @param sourceNode
*/
- private void setStylesAttributesToTree(Element treeTable, Element sourceNode) {
+ private void setStylesAttributesToTree(nsIDOMElement treeTable, Element sourceNode) {
String styleAttr = sourceNode
.getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
if (styleAttr != null && styleAttr.length() != 0) {
@@ -135,15 +134,15 @@
* @param sourceNode
* @param attrValue
*/
- private void setAttributeToTree(Node node, String attrName, String attrValue) {
- if (!(node instanceof Element)) {
+ private void setAttributeToTree(nsIDOMNode node, String attrName, String attrValue) {
+ if (!(node instanceof nsIDOMElement)) {
return;
}
if (node.getNodeName().equalsIgnoreCase(
HtmlComponentUtil.HTML_TAG_TABLE)) {
- ((Element) node).setAttribute(attrName, attrValue);
+ ((nsIDOMElement)node.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID)).setAttribute(attrName, attrValue);
}
- NodeList list2 = node.getChildNodes();
+ nsIDOMNodeList list2 = node.getChildNodes();
for (int i = 0; i < list2.getLength(); i++) {
setAttributeToTree(list2.item(i), attrName, attrValue);
}
@@ -164,10 +163,11 @@
* <code>create</code>
*/
public void validate(VpePageContext pageContext, Node sourceNode,
- Document visualDocument, VpeCreationData data) {
- // TODO A. Yukhovich please fix it
- //super.validate(pageContext, sourceNode, visualDocument, data);
- //revertTableRows(data.getNode());
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ super.validate(pageContext, sourceNode, visualDocument, data);
+ //TODO: Evgeny Zheleznyakov
+ nsIDOMNode node = data.getNode();
+ revertTableRows(node);
}
/**
@@ -176,34 +176,35 @@
* @param node
*/
private void correctImage(VpePageContext pageContex, Element sourceNode,
- Node node) {
- if (!(node instanceof Element)) {
+ nsIDOMNode node) {
+ if (!(node instanceof nsIDOMElement)) {
return;
}
if (node.getNodeName().equalsIgnoreCase(HtmlComponentUtil.HTML_TAG_IMG)) {
- String srcAttr = ((Element) node)
+ String srcAttr = ((nsIDOMElement) node
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID))
.getAttribute(RichFacesTreeNodeTemplate.ICON_PARAM_NAME);
if (RichFacesTreeNodeTemplate.DEFAULT_ICON_EXPANDED_PARAM_VALUE
.equals(srcAttr)) {
- setImgForNode(pageContex, sourceNode, (Element) node,
+ setImgForNode(pageContex, sourceNode, (nsIDOMElement) node.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID),
ICON_COLLAPSED_ATTR_NAME,
RichFacesTreeNodeTemplate.ICON_EXPANDED_WITH_LINES,
RichFacesTreeNodeTemplate.ICON_EXPANDED_WITHOUT_LINES);
} else if (RichFacesTreeNodeTemplate.DEFAULT_ICON_PARAM_VALUE
.equals(srcAttr)) {
- setImgForNode(pageContex, sourceNode, (Element) node,
+ setImgForNode(pageContex, sourceNode, (nsIDOMElement) node.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID),
ICON_ATTR,
RichFacesTreeNodeTemplate.ICON_NODE_WITH_LINES,
RichFacesTreeNodeTemplate.ICON_NODE_WITHOUT_LINES);
} else if (RichFacesTreeNodeTemplate.NODE_ICON_LEAF_ATTR_NAME
.equals(srcAttr)) {
- setImgForNode(pageContex, sourceNode, (Element) node,
+ setImgForNode(pageContex, sourceNode, (nsIDOMElement) node.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID),
RichFacesTreeNodeTemplate.NODE_ICON_LEAF_ATTR_NAME,
RichFacesTreeNodeTemplate.ICON_LEAF_WITH_LINES,
RichFacesTreeNodeTemplate.ICON_LEAF_WITHOUT_LINES);
}
}
- NodeList list2 = node.getChildNodes();
+ nsIDOMNodeList list2 = node.getChildNodes();
for (int i = 0; i < list2.getLength(); i++) {
correctImage(pageContex, sourceNode, list2.item(i));
}
@@ -216,7 +217,7 @@
* @param sourceNode
*/
private void setImgForNode(VpePageContext pageContext, Element sourceNode,
- Element img, String attrName, String iconWithLines,
+ nsIDOMElement img, String attrName, String iconWithLines,
String iconWithoutLines) {
String treeIconAttr = sourceNode.getAttribute(attrName);
if (treeIconAttr != null && treeIconAttr.length() > 0) {
@@ -240,22 +241,22 @@
*
* @param node
*/
- private void revertTableRows(Node node) {
- if (!(node instanceof Element)) {
+ private void revertTableRows(nsIDOMNode node) {
+ if (!(node instanceof nsIDOMElement)) {
return;
}
- NodeList list = node.getChildNodes();
+ nsIDOMNodeList list = node.getChildNodes();
if (node.getNodeName().equalsIgnoreCase(
HtmlComponentUtil.HTML_TAG_TABLE)
&& list.getLength() == 2) {
- Node tr1 = list.item(0);
- Node tr2 = list.item(1);
+ nsIDOMNode tr1 = list.item(0);
+ nsIDOMNode tr2 = list.item(1);
node.removeChild(tr1);
node.removeChild(tr2);
node.appendChild(tr2);
node.appendChild(tr1);
}
- NodeList list2 = node.getChildNodes();
+ nsIDOMNodeList list2 = node.getChildNodes();
for (int i = 0; i < list2.getLength(); i++) {
revertTableRows(list2.item(i));
}
@@ -271,14 +272,14 @@
* @return
*/
public void parseTree(VpePageContext pageContext, Node sourceNode,
- Document visualDocument, VpeCreationData vpeCreationData,
- Element cell) {
+ nsIDOMDocument visualDocument, VpeCreationData vpeCreationData,
+ nsIDOMElement cell) {
// work arroud, becouse getChielsByName returns always null;
NodeList nodeList = sourceNode.getChildNodes();
Element element = null;
- Element tree = null;
- Element childTree = null;
- Element childLast = null;
+ nsIDOMElement tree = null;
+ nsIDOMElement childTree = null;
+ nsIDOMElement childLast = null;
int lenght = nodeList.getLength();
String treeNodeName = sourceNode.getPrefix() + ":" + TREE_NODE_NAME;
VpeChildrenInfo vpeChildrenInfo = null;
@@ -292,8 +293,7 @@
if (tree == null) {
tree = createBasicTree(visualDocument);
- // TODO A. Yukhovich please fix it
-// vpeChildrenInfo = new VpeChildrenInfo(tree);
+ vpeChildrenInfo = new VpeChildrenInfo(tree);
vpeCreationData.addChildrenInfo(vpeChildrenInfo);
vpeChildrenInfo.addSourceChild(element);
childLast = tree;
@@ -302,8 +302,7 @@
childTree = createBasicTree(visualDocument);
appendChildTree(childLast, childTree, visualDocument);
- // TODO A. Yukhovich please fix it
- //vpeChildrenInfo = new VpeChildrenInfo(childTree);
+ vpeChildrenInfo = new VpeChildrenInfo(childTree);
vpeCreationData.addChildrenInfo(vpeChildrenInfo);
vpeChildrenInfo.addSourceChild(element);
childLast = childTree;
@@ -323,13 +322,13 @@
* @param childNode
* @param visualDocument
*/
- private void appendChildTree(Element parentNode, Element childNode,
- Document visualDocument) {
- Element tr = visualDocument
+ private void appendChildTree(nsIDOMElement parentNode, nsIDOMElement childNode,
+ nsIDOMDocument visualDocument) {
+ nsIDOMElement tr = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TR);
- Element emptyCell = visualDocument
+ nsIDOMElement emptyCell = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
- Element treeCell = visualDocument
+ nsIDOMElement treeCell = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TD);
treeCell.setAttribute(HtmlComponentUtil.HTML_TABLE_COLSPAN, "2");
tr.appendChild(emptyCell);
@@ -338,11 +337,10 @@
parentNode.appendChild(tr);
}
- // TODO A. Yukhovich please fix it
- /*
+
@Override
public void setAttribute(VpePageContext pageContext, Element sourceElement,
- Document visualDocument, Node visualNode, Object data, String name,
+ nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name,
String value) {
if (TREE_STYLE_CLASS_ATR_NAME.equalsIgnoreCase(name)) {
setAttributeToTree(visualNode, HtmlComponentUtil.HTML_CLASS_ATTR,
@@ -350,7 +348,7 @@
} else if (HtmlComponentUtil.HTML_STYLE_ATTR.equalsIgnoreCase(name)) {
setAttributeToTree(visualNode, HtmlComponentUtil.HTML_STYLE_ATTR,
removeFromStyleWithAndHeight(value));
- ((Element) visualNode).setAttribute(
+ ((nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID)).setAttribute(
HtmlComponentUtil.HTML_STYLE_ATTR, value);
} else if (ICON_COLLAPSED_ATTR_NAME.equals(name)
|| SHOW_LINES_ATTR_NAME.equals(name)
@@ -360,13 +358,13 @@
correctImage(pageContext, sourceElement, visualNode);
}
}
- */
- // TODO A. Yukhovich please fix it
- /*
+
+
+
@Override
public void removeAttribute(VpePageContext pageContext,
- Element sourceElement, Document visualDocument, Node visualNode,
+ Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode,
Object data, String name) {
if (TREE_STYLE_CLASS_ATR_NAME.equalsIgnoreCase(name)) {
setAttributeToTree(visualNode, HtmlComponentUtil.HTML_CLASS_ATTR,
@@ -382,7 +380,6 @@
correctImage(pageContext, sourceElement, visualNode);
}
}
- */
/**
* Create simple tree node attribute.Used for creating more complex trees.
@@ -391,9 +388,9 @@
* @param visualDocument
* @return tree
*/
- private Element createBasicTree(Document visualDocument) {
+ private nsIDOMElement createBasicTree(nsIDOMDocument visualDocument) {
// create table
- Element tree = visualDocument
+ nsIDOMElement tree = visualDocument
.createElement(HtmlComponentUtil.HTML_TAG_TABLE);
addBasicTreeAttributes(tree);
return tree;
@@ -404,7 +401,7 @@
*
* @param tree
*/
- private void addBasicTreeAttributes(Element tree) {
+ private void addBasicTreeAttributes(nsIDOMElement tree) {
if (tree == null) {
return;
}
@@ -415,10 +412,4 @@
tree.setAttribute(HtmlComponentUtil.HTML_BORDER_ATTR,
TREE_TABLE_ATR_BORDER_VALUE);
}
-
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument) {
- // TODO Auto-generated method stub
- return null;
- }
}
18 years, 4 months
JBoss Tools SVN: r3095 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-08-13 10:54:37 -0400 (Mon, 13 Aug 2007)
New Revision: 3095
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
Log:
JBIDE-700: Hibernate diagram fails on simplest mapping
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-08-13 14:47:12 UTC (rev 3094)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-08-13 14:54:37 UTC (rev 3095)
@@ -548,14 +548,14 @@
Object element = shape.getOrmElement();
String key=null;
if (element instanceof RootClass) {
- key = ((RootClass)element).getEntityName();
+ key = HibernateUtils.getPersistentClassName(((RootClass)element).getEntityName());
} else if (element instanceof Table) {
key = HibernateUtils.getTableName((Table)element);
} else if (element instanceof Property) {
Property property = (Property)element;
key = property.getPersistentClass().getEntityName() + "." + property.getName();
} else if (element instanceof Subclass) {
- key = ((Subclass)element).getEntityName();
+ key = HibernateUtils.getPersistentClassName(((Subclass)element).getEntityName());
}
return key;
18 years, 4 months
JBoss Tools SVN: r3094 - trunk/documentation/GettingStartedGuide/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: sabrashevich
Date: 2007-08-13 10:47:12 -0400 (Mon, 13 Aug 2007)
New Revision: 3094
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/ManageJBossAS.xml
Log:
minor change
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/ManageJBossAS.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/ManageJBossAS.xml 2007-08-13 14:46:16 UTC (rev 3093)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/ManageJBossAS.xml 2007-08-13 14:47:12 UTC (rev 3094)
@@ -42,7 +42,7 @@
</figure>
<para>While launching Server output will be written to the Console view:</para>
-<!-- TODO: make a screenshot that doesn't show an exception!
+
<figure>
<title>Console output</title>
<mediaobject>
@@ -50,7 +50,7 @@
<imagedata fileref="images/consoleoutput.png"/>
</imageobject>
</mediaobject>
-</figure>-->
+</figure>
<para>When server has started you should see "Started" right to its name in JBoss Server view (column "Status").</para>
<figure>
<title>Server is started</title>
18 years, 4 months
JBoss Tools SVN: r3093 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-08-13 10:46:16 -0400 (Mon, 13 Aug 2007)
New Revision: 3093
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
Log:
http://jira.jboss.com/jira/browse/EXIN-427
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2007-08-13 14:41:11 UTC (rev 3092)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2007-08-13 14:46:16 UTC (rev 3093)
@@ -77,7 +77,7 @@
if(field.getPersistentClass().getIdentifierProperty() == field){
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldSimple_id")); //$NON-NLS-1$
}
- if (field.getType().isCollectionType()) {
+ if (field.getValue() != null && field.getType() != null && field.getType().isCollectionType()) {
if(field.getValue() instanceof PrimitiveArray)
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.Collection_primitive_array"));
else if(field.getValue() instanceof Array)
18 years, 4 months
JBoss Tools SVN: r3092 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-08-13 10:41:11 -0400 (Mon, 13 Aug 2007)
New Revision: 3092
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
Log:
http://jira.jboss.com/jira/browse/EXIN-427
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2007-08-13 14:29:07 UTC (rev 3091)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmLabelProvider.java 2007-08-13 14:41:11 UTC (rev 3092)
@@ -63,6 +63,10 @@
descriptor = (ImageDescriptor)ormModelImageVisitor.visitComponentKeyMapping((DependantValue) element, null);
} else if (element instanceof Component) {
descriptor = (ImageDescriptor)ormModelImageVisitor.visitComponentMapping((Component) element);
+ } else if (element instanceof ManyToOne) {
+ descriptor = (ImageDescriptor)ormModelImageVisitor.visitManyToOneMapping((ManyToOne) element);
+ } else if (element instanceof OneToMany) {
+ descriptor = (ImageDescriptor)ormModelImageVisitor.visitOneToManyMapping((OneToMany) element);
} else {
//throw unknownElement(element);
return null;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2007-08-13 14:29:07 UTC (rev 3091)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelImageVisitor.java 2007-08-13 14:41:11 UTC (rev 3092)
@@ -12,13 +12,22 @@
import java.util.ResourceBundle;
+import org.hibernate.mapping.Array;
+import org.hibernate.mapping.Bag;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.DependantValue;
+import org.hibernate.mapping.IdentifierBag;
import org.hibernate.mapping.JoinedSubclass;
+import org.hibernate.mapping.List;
+import org.hibernate.mapping.ManyToOne;
+import org.hibernate.mapping.Map;
+import org.hibernate.mapping.OneToMany;
import org.hibernate.mapping.PersistentClassVisitor;
+import org.hibernate.mapping.PrimitiveArray;
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.Set;
import org.hibernate.mapping.SingleTableSubclass;
import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
@@ -58,16 +67,46 @@
public Object visitPersistentField(Property field, Object argument) {
if (field !=null){
+ if(field.getValue() != null){
+ if(field.getValue() instanceof ManyToOne)
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldMany-to-one")); //$NON-NLS-1$
+ }
+ if(field.getPersistentClass().getVersion() == field){
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldSimple_version")); //$NON-NLS-1$
+ }
if(field.getPersistentClass().getIdentifierProperty() == field){
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldSimple_id")); //$NON-NLS-1$
}
if (field.getType().isCollectionType()) {
- return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.Collection_bag"));
+ if(field.getValue() instanceof PrimitiveArray)
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.Collection_primitive_array"));
+ else if(field.getValue() instanceof Array)
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.Collection_array"));
+ else if(field.getValue() instanceof List)
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.Collection_list"));
+ else if(field.getValue() instanceof Set)
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.Collection_set"));
+ else if(field.getValue() instanceof Map)
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.Collection_map"));
+ else if(field.getValue() instanceof Bag)
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.Collection_bag"));
+ else if(field.getValue() instanceof IdentifierBag)
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.Collection_idbag"));
+ else
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.Collection"));
}
}
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldSimple")); //$NON-NLS-1$
}
+ public Object visitManyToOneMapping(ManyToOne field) {
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldMany-to-many")); //$NON-NLS-1$
+ }
+
+ public Object visitOneToManyMapping(OneToMany field) {
+ return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldOne-to-many")); //$NON-NLS-1$
+ }
+
public Object visitComponentMapping(Component mapping) {
if (mapping != null){
return ViewPlugin.getImageDescriptor(BUNDLE.getString("OrmModelImageVisitor.PersistentFieldComponent")); //$NON-NLS-1$
18 years, 4 months