Christian Hanshans | 2 Aug 20:40
Favicon

Xforms editor in Eclipse

 

Hi,

 

I was looking for a possibility of generating forms easily and slipped over your project but I wasn´t able to get the Editor running.

 

I checked out the repository, made a jar out of it and copied the files to the plugin directory and got an error:

 

Unable to create view: Plug-in org.nuxeo.xforms.ui.editors was unable to load class org.nuxeo.xforms.ui.editors.XFormsView.

 

What am I doing wrong? I am an Eclipse newbie as I was using only an light weight editor for my Java coding so far.

 

Thanks in advance

 

Christian Hanshans

 

_______________________________________________
Apogee mailing list
Apogee@...
http://lists.nuxeo.com/mailman/listinfo/apogee
Stéphane Bouchet | 8 Aug 09:08
Picon

Questions about xforms editor

Hi,

I am looking a bit around the XForms editor in eclipse.

I checked out from svn and installed it. it's working very good.

But after looking a bit more inside, i have a question :
Why the <Hint> element is mapped into an attribute of the parent element ?
it seems also that the mapping from <hint> element to swt tooltiptext is 
not working ?
this is due to the AttributeMap class that is not setting new values 
correctly....

finally, i am very interresed to the edit part of the editor also. ( add 
elements to the xform... )

Cheers,

Stéphane
Dan Connelly | 11 Aug 15:39
Picon

Liferay integration ?

Has anyone used Apogee to support Liferay/Jackrabbit?
Bogdan Stefanescu | 14 Aug 19:57

Re: Questions about xforms editor


Stéphane Bouchet wrote:

Hi Stephane,

If I remember well the "Hint" is mapped to an attribute to ease the
generation of the SWT form
because usually a xforms control element is mapped to an eclipse control
(like XFInput to a text widget)
And the hint element is mapped to a tooltip which is not a swt controlb
but a widget property.
The same is used to store the label of a xform component by setting the
mLabel member of the parent control (XFLabeledControl)
instead of mapping it into a SWT label - this way we can easily put the
label widget before widget corresponding to the parent element in the
SWT form.

There are many things to be implemented and fix. (like the AttributeMap
bug you mention)

Unfortunately, I had no time to continue development on the XForms
engine these months - I hope this will change in the near future - when
the core part of Apogee will be done so that we can integrate the engine
into Apogee.

Anyway, anyone is welcome to contribute with fixes or new features.

A first change in the engine implementation I see is to integrate the
XSD engine from https://xsom.dev.java.net/
This is fully supporting XSD specs so the xforms engine may benefit of them.

Regards,
Bogdan

> Hi,
>
> I am looking a bit around the XForms editor in eclipse.
>
> I checked out from svn and installed it. it's working very good.
>
> But after looking a bit more inside, i have a question :
> Why the <Hint> element is mapped into an attribute of the parent
> element ?
> it seems also that the mapping from <hint> element to swt tooltiptext
> is not working ?
> this is due to the AttributeMap class that is not setting new values
> correctly....
>
>
> finally, i am very interresed to the edit part of the editor also. (
> add elements to the xform... )

>
> Cheers,
>
> Stéphane
>
> _______________________________________________
> Apogee mailing list
> Apogee@...
> http://lists.nuxeo.com/mailman/listinfo/apogee

--

-- 

Bogdan Stefanescu - Apogee project Team Leader

Nuxeo - Open Source ECM - www.nuxeo.com
Apogée - the rich client platform for ECM
http://apogee.nuxeo.org/ - http://www.nuxeo.com/en
Bogdan Stefanescu | 14 Aug 20:35

Re: Liferay integration ?


Currently only local jackrabbit repositories are supported.
Also, the Jackrabbit RMI is not supported because it is not compliant
with JCR API

We are working on a high level repository model (the default
implementation is build on top of Jackrabbit)
When this will be done Apogee will be updated to access both local and
remote repositories using this high level repository API

What are you interested in exactly about Liferay integration ?

Regards,
Bogdan

Dan Connelly wrote:
> Has anyone used Apogee to support Liferay/Jackrabbit?
> _______________________________________________
> Apogee mailing list
> Apogee@...
> http://lists.nuxeo.com/mailman/listinfo/apogee

--

-- 

Bogdan Stefanescu - Apogee project Team Leader

Nuxeo - Open Source ECM - www.nuxeo.com
Apogée - the rich client platform for ECM
http://apogee.nuxeo.org/ - http://www.nuxeo.com/en
Bogdan Stefanescu | 16 Aug 12:47

Re: Questions about xforms editor

Stéphane Bouchet wrote:
> Bogdan Stefanescu a écrit :
>> Stéphane Bouchet wrote:
>>
>> Hi Stephane,
>>
>> If I remember well the "Hint" is mapped to an attribute to ease the
>> generation of the SWT form
>> because usually a xforms control element is mapped to an eclipse control
>> (like XFInput to a text widget)
>> And the hint element is mapped to a tooltip which is not a swt controlb
>> but a widget property.
>>   
> ok, i understand that.
>
>> The same is used to store the label of a xform component by setting the
>> mLabel member of the parent control (XFLabeledControl)
>> instead of mapping it into a SWT label - this way we can easily put the
>> label widget before widget corresponding to the parent element in the
>> SWT form.
>>   
> ok, iunderstand too, but the mLabel member is atype of  XFLabel, not
> an attribute.
>
> My question is : why not having a mHint member for each Control, that
> will be mapped into a tooltiptext ?
Indeed, we can do that since all controls may have tooltips.
Initially the AttributeMap was added to store custom properties on
controls, but since the hint is valid for any control we may
put it directly in the control as a member.

>
> i understand that the swt tooltip is a property, but in the XForm
> Model, it is specified that the hint element is not an attribute.
> Then, it is the job of the SWTBuilder to set the property if the hint
> element is set or not.
>
> This could be cdone via XFControlElement, that holds the actions and
> style of every control.
>
>
>> There are many things to be implemented and fix. (like the AttributeMap
>> bug you mention)
>>
>> Unfortunately, I had no time to continue development on the XForms
>> engine these months - I hope this will change in the near future - when
>> the core part of Apogee will be done so that we can integrate the engine
>> into Apogee.
>>
>> Anyway, anyone is welcome to contribute with fixes or new features.
>>   
> Ok, i'll try to do some changes and send the patches.
Thank you

Bogdan

>
>> A first change in the engine implementation I see is to integrate the
>> XSD engine from https://xsom.dev.java.net/
>> This is fully supporting XSD specs so the xforms engine may benefit
>> of them.
>>
>> Regards,
>> Bogdan
>>
>>   
>
> Cheers,
>
> Stéphane
>
>>> Hi,
>>>
>>> I am looking a bit around the XForms editor in eclipse.
>>>
>>> I checked out from svn and installed it. it's working very good.
>>>
>>> But after looking a bit more inside, i have a question :
>>> Why the <Hint> element is mapped into an attribute of the parent
>>> element ?
>>> it seems also that the mapping from <hint> element to swt tooltiptext
>>> is not working ?
>>> this is due to the AttributeMap class that is not setting new values
>>> correctly....
>>>
>>>
>>> finally, i am very interresed to the edit part of the editor also. (
>>> add elements to the xform... )
>>>     
>>
>>  
>>> Cheers,
>>>
>>> Stéphane
>>>
>>> _______________________________________________
>>> Apogee mailing list
>>> Apogee@...
>>> http://lists.nuxeo.com/mailman/listinfo/apogee
>>>     
>>
>>
>>   
>

--

-- 

Bogdan Stefanescu - Apogee project Team Leader

Nuxeo - Open Source ECM - www.nuxeo.com
Apogée - the rich client platform for ECM
http://apogee.nuxeo.org/ - http://www.nuxeo.com/en
Stéphane Bouchet | 17 Aug 12:09
Picon

Re: Questions about xforms editor

Hi,

I made some change to the core/ui to add the Hint Control has an object 
rather than an attribute.

I corrected some bugs in ArrayMap and AttributesMap too.

Cheers,

Stéphane.

Bogdan Stefanescu a écrit :
> Stéphane Bouchet wrote:
>   
>> Bogdan Stefanescu a écrit :
>>     
>>> Stéphane Bouchet wrote:
>>>
>>> Hi Stephane,
>>>
>>> If I remember well the "Hint" is mapped to an attribute to ease the
>>> generation of the SWT form
>>> because usually a xforms control element is mapped to an eclipse control
>>> (like XFInput to a text widget)
>>> And the hint element is mapped to a tooltip which is not a swt controlb
>>> but a widget property.
>>>   
>>>       
>> ok, i understand that.
>>
>>     
>>> The same is used to store the label of a xform component by setting the
>>> mLabel member of the parent control (XFLabeledControl)
>>> instead of mapping it into a SWT label - this way we can easily put the
>>> label widget before widget corresponding to the parent element in the
>>> SWT form.
>>>   
>>>       
>> ok, iunderstand too, but the mLabel member is atype of  XFLabel, not
>> an attribute.
>>
>> My question is : why not having a mHint member for each Control, that
>> will be mapped into a tooltiptext ?
>>     
> Indeed, we can do that since all controls may have tooltips.
> Initially the AttributeMap was added to store custom properties on
> controls, but since the hint is valid for any control we may
> put it directly in the control as a member.
>
>   
>> i understand that the swt tooltip is a property, but in the XForm
>> Model, it is specified that the hint element is not an attribute.
>> Then, it is the job of the SWTBuilder to set the property if the hint
>> element is set or not.
>>
>> This could be cdone via XFControlElement, that holds the actions and
>> style of every control.
>>
>>
>>     
>>> There are many things to be implemented and fix. (like the AttributeMap
>>> bug you mention)
>>>
>>> Unfortunately, I had no time to continue development on the XForms
>>> engine these months - I hope this will change in the near future - when
>>> the core part of Apogee will be done so that we can integrate the engine
>>> into Apogee.
>>>
>>> Anyway, anyone is welcome to contribute with fixes or new features.
>>>   
>>>       
>> Ok, i'll try to do some changes and send the patches.
>>     
> Thank you
>
> Bogdan
>
>   
>>> A first change in the engine implementation I see is to integrate the
>>> XSD engine from https://xsom.dev.java.net/
>>> This is fully supporting XSD specs so the xforms engine may benefit
>>> of them.
>>>
>>> Regards,
>>> Bogdan
>>>
>>>   
>>>       
>> Cheers,
>>
>> Stéphane
>>
>>     
>>>> Hi,
>>>>
>>>> I am looking a bit around the XForms editor in eclipse.
>>>>
>>>> I checked out from svn and installed it. it's working very good.
>>>>
>>>> But after looking a bit more inside, i have a question :
>>>> Why the <Hint> element is mapped into an attribute of the parent
>>>> element ?
>>>> it seems also that the mapping from <hint> element to swt tooltiptext
>>>> is not working ?
>>>> this is due to the AttributeMap class that is not setting new values
>>>> correctly....
>>>>
>>>>
>>>> finally, i am very interresed to the edit part of the editor also. (
>>>> add elements to the xform... )
>>>>     
>>>>         
>>>  
>>>       
>>>> Cheers,
>>>>
>>>> Stéphane
>>>>
>>>> _______________________________________________
>>>> Apogee mailing list
>>>> Apogee@...
>>>> http://lists.nuxeo.com/mailman/listinfo/apogee
>>>>     
>>>>         
>>>   
>>>       
>
>
>   


Property changes on: D:\workspace\org.nuxeo.xforms.core
___________________________________________________________________
Name: svn:ignore
   + bin

Index: D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xml/ArrayMap.java
===================================================================
--- D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xml/ArrayMap.java	(revision 47548)
+++ D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xml/ArrayMap.java	(working copy)
@@ -43,7 +43,7 @@
 	}

 	public int size() {
-		return count<<1;
+		return count;
 	}

 	public void add(String key, Object value){
Index: D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xml/AttributesMap.java
===================================================================
---
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xml/AttributesMap.java	(revision 48407)
+++ D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xml/AttributesMap.java	(working copy)
@@ -130,11 +130,13 @@
 	public void set(String uri, String name, String value) {
 		int i = indexOf(uri, name);
 		if (i > -1) setValue(i, value);
+        else put(uri, name, value);
 	}

 	public void set(String name, String value) {
 		int i = indexOf(name);
 		if (i > -1) setValue(i, value);
+        else put(name, value);
 	}

 	public int size() {
Index: D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/factories/HintXFactory.java
===================================================================
---
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/factories/HintXFactory.java	(revision 47548)
+++
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/factories/HintXFactory.java	(working copy)
@@ -15,11 +15,15 @@

 package org.nuxeo.xforms.xforms.factories;

+import org.nuxeo.xforms.xforms.model.XForm;
 import org.nuxeo.xforms.xforms.model.controls.XFControlElement;
+import org.nuxeo.xforms.xforms.model.controls.XFHint;
+import org.nuxeo.xforms.xml.AttributesMap;
 import org.nuxeo.xforms.xml.DefaultXFactory;
 import org.nuxeo.xforms.xml.XParserGlobalContext;
 import org.xml.sax.Attributes;

+
 /**
  * @author <a href="mailto:bstefanescu@...">Bogdan Stefanescu</a>
  *
@@ -32,7 +36,9 @@
 	 * @see org.nuxeo.xf4e.xml.DefaultXFactory#create(org.nuxeo.xf4e.xml.XParserGlobalContext,
java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
 	 */
 	public Object create(XParserGlobalContext context, String uri, String localName, String qname,
Attributes attrs) {
-		return null;
+        XForm form = (XForm) context.document;
+        XFHint element = new XFHint(form, new AttributesMap(attrs));
+        return element;
 	}

 	/* (non-Javadoc)
@@ -40,8 +46,10 @@
 	 */
 	public void setContent(XParserGlobalContext context, Object object, String text) {
 		Object parent = context.peekObject();
-		if (parent instanceof XFControlElement) {
-			((XFControlElement)parent).setHint(text);
+        XFHint hint = (XFHint)object;
+        hint.setText(text);
+        if (parent instanceof XFControlElement) {
+            ((XFControlElement)parent).setHint(hint);
 		} else {
 			System.out.println("Parse error: hint element out of it's scope"); // TODO
 		}
Index: D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/model/controls/XFHint.java
===================================================================
---
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/model/controls/XFHint.java	(revision 0)
+++
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/model/controls/XFHint.java	(revision 0)
@@ -0,0 +1,40 @@
+package org.nuxeo.xforms.xforms.model.controls;
+
+import org.nuxeo.xforms.xforms.XFormsControlVisitor;
+import org.nuxeo.xforms.xforms.model.XForm;
+import org.nuxeo.xforms.xml.AttributesMap;
+
+public class XFHint extends XFControlElement {
+
+    public final static String TYPE = TAG_HINT;
+
+    protected String mText;
+
+    public String getText() {
+        return this.mText;
+    }
+
+    public void setText(String text) {
+        this.mText = text;
+    }
+
+    public XFHint(XForm form) {
+        super(form);
+    }
+
+    public XFHint(XForm form, AttributesMap map) {
+        super(form, map);
+    }
+
+    @Override
+    public Object accept(XFormsControlVisitor visitor, Object arg) {
+        return arg;
+    }
+
+    @Override
+    public String type() {
+        return TYPE;
+    }
+
+
+}
Index: D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/model/controls/XFControlElement.java
===================================================================
---
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/model/controls/XFControlElement.java	(revision 47548)
+++
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/model/controls/XFControlElement.java	(working copy)
@@ -46,6 +46,8 @@
 	 * corresponding action
 	 */ 
 	protected ArrayMap mEventMap;
+    
+    protected XFHint mHint;
 	
 	
 	public XFControlElement() {
@@ -94,12 +96,12 @@
 	}
 	
 		
-	public String getHint() {
-		return getAttribute("hint");
+	public XFHint getHint() {
+		return this.mHint;
 	}

-	public void setHint(String hint) {
-		setAttribute("hint", hint);
+	public void setHint(XFHint hint) {
+		this.mHint = hint;
 	}
 	
 	/**

Property changes on: D:\workspace\org.nuxeo.xforms.ui
___________________________________________________________________
Name: svn:ignore
   + bin

Index: D:/workspace/org.nuxeo.xforms.ui/src/org/nuxeo/xforms/ui/swt/SWTBuilder.java
===================================================================
--- D:/workspace/org.nuxeo.xforms.ui/src/org/nuxeo/xforms/ui/swt/SWTBuilder.java	(revision 47548)
+++ D:/workspace/org.nuxeo.xforms.ui/src/org/nuxeo/xforms/ui/swt/SWTBuilder.java	(working copy)
@@ -45,6 +45,7 @@
 import org.nuxeo.xforms.xforms.model.controls.XFBody;
 import org.nuxeo.xforms.xforms.model.controls.XFControlElement;
 import org.nuxeo.xforms.xforms.model.controls.XFGroup;
+import org.nuxeo.xforms.xforms.model.controls.XFHint;
 import org.nuxeo.xforms.xforms.model.controls.XFInput;
 import org.nuxeo.xforms.xforms.model.controls.XFItem;
 import org.nuxeo.xforms.xforms.model.controls.XFLabel;
@@ -59,6 +60,7 @@

 

+
 /**
  * 
  * @author <a href="mailto:bstefanescu@...">Bogdan Stefanescu</a>
@@ -487,10 +489,10 @@
 		//String value = element.getValue(); 
 		//if (value != null) mContext.proxy.setXMLValue(mContext.control, value);
 		// setting tooltip if any
-		String value = element.getHint();
-		if (value != null) {
-			mContext.proxy.setToolTipText(value);		
-		}
+        XFHint hint = element.getHint();
+        if (hint != null) {
+            mContext.proxy.setToolTipText(hint.getText());
+        }
 				
 		
 		// third processing step
_______________________________________________
Apogee mailing list
Apogee@...
http://lists.nuxeo.com/mailman/listinfo/apogee
Bogdan Stefanescu | 18 Aug 22:13

Re: Questions about xforms editor

Stéphane Bouchet wrote:
> Hi,
>
> I made some change to the core/ui to add the Hint Control has an
> object rather than an attribute.
>
> I corrected some bugs in ArrayMap and AttributesMap too.
>
> Cheers,
>
> Stéphane.

Thank you Stephane, I will try to integrate your patches this weekend

Regards,
Bogdan

>
>
> Bogdan Stefanescu a écrit :
>> Stéphane Bouchet wrote:
>>  
>>> Bogdan Stefanescu a écrit :
>>>    
>>>> Stéphane Bouchet wrote:
>>>>
>>>> Hi Stephane,
>>>>
>>>> If I remember well the "Hint" is mapped to an attribute to ease the
>>>> generation of the SWT form
>>>> because usually a xforms control element is mapped to an eclipse
>>>> control
>>>> (like XFInput to a text widget)
>>>> And the hint element is mapped to a tooltip which is not a swt
>>>> controlb
>>>> but a widget property.
>>>>         
>>> ok, i understand that.
>>>
>>>    
>>>> The same is used to store the label of a xform component by setting
>>>> the
>>>> mLabel member of the parent control (XFLabeledControl)
>>>> instead of mapping it into a SWT label - this way we can easily put
>>>> the
>>>> label widget before widget corresponding to the parent element in the
>>>> SWT form.
>>>>         
>>> ok, iunderstand too, but the mLabel member is atype of  XFLabel, not
>>> an attribute.
>>>
>>> My question is : why not having a mHint member for each Control, that
>>> will be mapped into a tooltiptext ?
>>>     
>> Indeed, we can do that since all controls may have tooltips.
>> Initially the AttributeMap was added to store custom properties on
>> controls, but since the hint is valid for any control we may
>> put it directly in the control as a member.
>>
>>  
>>> i understand that the swt tooltip is a property, but in the XForm
>>> Model, it is specified that the hint element is not an attribute.
>>> Then, it is the job of the SWTBuilder to set the property if the hint
>>> element is set or not.
>>>
>>> This could be cdone via XFControlElement, that holds the actions and
>>> style of every control.
>>>
>>>
>>>    
>>>> There are many things to be implemented and fix. (like the
>>>> AttributeMap
>>>> bug you mention)
>>>>
>>>> Unfortunately, I had no time to continue development on the XForms
>>>> engine these months - I hope this will change in the near future -
>>>> when
>>>> the core part of Apogee will be done so that we can integrate the
>>>> engine
>>>> into Apogee.
>>>>
>>>> Anyway, anyone is welcome to contribute with fixes or new features.
>>>>         
>>> Ok, i'll try to do some changes and send the patches.
>>>     
>> Thank you
>>
>> Bogdan
>>
>>  
>>>> A first change in the engine implementation I see is to integrate the
>>>> XSD engine from https://xsom.dev.java.net/
>>>> This is fully supporting XSD specs so the xforms engine may benefit
>>>> of them.
>>>>
>>>> Regards,
>>>> Bogdan
>>>>
>>>>         
>>> Cheers,
>>>
>>> Stéphane
>>>
>>>    
>>>>> Hi,
>>>>>
>>>>> I am looking a bit around the XForms editor in eclipse.
>>>>>
>>>>> I checked out from svn and installed it. it's working very good.
>>>>>
>>>>> But after looking a bit more inside, i have a question :
>>>>> Why the <Hint> element is mapped into an attribute of the parent
>>>>> element ?
>>>>> it seems also that the mapping from <hint> element to swt tooltiptext
>>>>> is not working ?
>>>>> this is due to the AttributeMap class that is not setting new values
>>>>> correctly....
>>>>>
>>>>>
>>>>> finally, i am very interresed to the edit part of the editor also. (
>>>>> add elements to the xform... )
>>>>>             
>>>>  
>>>>      
>>>>> Cheers,
>>>>>
>>>>> Stéphane
>>>>>
>>>>> _______________________________________________
>>>>> Apogee mailing list
>>>>> Apogee@...
>>>>> http://lists.nuxeo.com/mailman/listinfo/apogee
>>>>>             
>>>>         
>>
>>
>>   
>
> ------------------------------------------------------------------------
>
>
> Property changes on: D:\workspace\org.nuxeo.xforms.core
> ___________________________________________________________________
> Name: svn:ignore
>    + bin
>
>
> Index: D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xml/ArrayMap.java
> ===================================================================
> --- D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xml/ArrayMap.java	(revision 47548)
> +++ D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xml/ArrayMap.java	(working copy)
> @@ -43,7 +43,7 @@
>  	}
>  
>  	public int size() {
> -		return count<<1;
> +		return count;
>  	}
>  
>  	public void add(String key, Object value){
> Index: D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xml/AttributesMap.java
> ===================================================================
> ---
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xml/AttributesMap.java	(revision 48407)
> +++
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xml/AttributesMap.java	(working copy)
> @@ -130,11 +130,13 @@
>  	public void set(String uri, String name, String value) {
>  		int i = indexOf(uri, name);
>  		if (i > -1) setValue(i, value);
> +        else put(uri, name, value);
>  	}
>  
>  	public void set(String name, String value) {
>  		int i = indexOf(name);
>  		if (i > -1) setValue(i, value);
> +        else put(name, value);
>  	}
>  
>  	public int size() {
> Index: D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/factories/HintXFactory.java
> ===================================================================
> ---
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/factories/HintXFactory.java	(revision 47548)
> +++
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/factories/HintXFactory.java	(working copy)
> @@ -15,11 +15,15 @@
>  
>  package org.nuxeo.xforms.xforms.factories;
>  
> +import org.nuxeo.xforms.xforms.model.XForm;
>  import org.nuxeo.xforms.xforms.model.controls.XFControlElement;
> +import org.nuxeo.xforms.xforms.model.controls.XFHint;
> +import org.nuxeo.xforms.xml.AttributesMap;
>  import org.nuxeo.xforms.xml.DefaultXFactory;
>  import org.nuxeo.xforms.xml.XParserGlobalContext;
>  import org.xml.sax.Attributes;
>  
> +
>  /**
>   * @author <a href="mailto:bstefanescu@...">Bogdan Stefanescu</a>
>   *
> @@ -32,7 +36,9 @@
>  	 * @see org.nuxeo.xf4e.xml.DefaultXFactory#create(org.nuxeo.xf4e.xml.XParserGlobalContext,
java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
>  	 */
>  	public Object create(XParserGlobalContext context, String uri, String localName, String qname,
Attributes attrs) {
> -		return null;
> +        XForm form = (XForm) context.document;
> +        XFHint element = new XFHint(form, new AttributesMap(attrs));
> +        return element;
>  	}
>  
>  	/* (non-Javadoc)
> @@ -40,8 +46,10 @@
>  	 */
>  	public void setContent(XParserGlobalContext context, Object object, String text) {
>  		Object parent = context.peekObject();
> -		if (parent instanceof XFControlElement) {
> -			((XFControlElement)parent).setHint(text);
> +        XFHint hint = (XFHint)object;
> +        hint.setText(text);
> +        if (parent instanceof XFControlElement) {
> +            ((XFControlElement)parent).setHint(hint);
>  		} else {
>  			System.out.println("Parse error: hint element out of it's scope"); // TODO
>  		}
> Index: D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/model/controls/XFHint.java
> ===================================================================
> ---
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/model/controls/XFHint.java	(revision 0)
> +++
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/model/controls/XFHint.java	(revision 0)
> @@ -0,0 +1,40 @@
> +package org.nuxeo.xforms.xforms.model.controls;
> +
> +import org.nuxeo.xforms.xforms.XFormsControlVisitor;
> +import org.nuxeo.xforms.xforms.model.XForm;
> +import org.nuxeo.xforms.xml.AttributesMap;
> +
> +public class XFHint extends XFControlElement {
> +
> +    public final static String TYPE = TAG_HINT;
> +
> +    protected String mText;
> +
> +    public String getText() {
> +        return this.mText;
> +    }
> +
> +    public void setText(String text) {
> +        this.mText = text;
> +    }
> +
> +    public XFHint(XForm form) {
> +        super(form);
> +    }
> +
> +    public XFHint(XForm form, AttributesMap map) {
> +        super(form, map);
> +    }
> +
> +    @Override
> +    public Object accept(XFormsControlVisitor visitor, Object arg) {
> +        return arg;
> +    }
> +
> +    @Override
> +    public String type() {
> +        return TYPE;
> +    }
> +
> +
> +}
> Index: D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/model/controls/XFControlElement.java
> ===================================================================
> ---
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/model/controls/XFControlElement.java	(revision 47548)
> +++
D:/workspace/org.nuxeo.xforms.core/src/org/nuxeo/xforms/xforms/model/controls/XFControlElement.java	(working copy)
> @@ -46,6 +46,8 @@
>  	 * corresponding action
>  	 */ 
>  	protected ArrayMap mEventMap;
> +    
> +    protected XFHint mHint;
>  	
>  	
>  	public XFControlElement() {
> @@ -94,12 +96,12 @@
>  	}
>  	
>  		
> -	public String getHint() {
> -		return getAttribute("hint");
> +	public XFHint getHint() {
> +		return this.mHint;
>  	}
>  
> -	public void setHint(String hint) {
> -		setAttribute("hint", hint);
> +	public void setHint(XFHint hint) {
> +		this.mHint = hint;
>  	}
>  	
>  	/**
>   
> ------------------------------------------------------------------------
>
>
> Property changes on: D:\workspace\org.nuxeo.xforms.ui
> ___________________________________________________________________
> Name: svn:ignore
>    + bin
>
>
> Index: D:/workspace/org.nuxeo.xforms.ui/src/org/nuxeo/xforms/ui/swt/SWTBuilder.java
> ===================================================================
> --- D:/workspace/org.nuxeo.xforms.ui/src/org/nuxeo/xforms/ui/swt/SWTBuilder.java	(revision 47548)
> +++ D:/workspace/org.nuxeo.xforms.ui/src/org/nuxeo/xforms/ui/swt/SWTBuilder.java	(working copy)
> @@ -45,6 +45,7 @@
>  import org.nuxeo.xforms.xforms.model.controls.XFBody;
>  import org.nuxeo.xforms.xforms.model.controls.XFControlElement;
>  import org.nuxeo.xforms.xforms.model.controls.XFGroup;
> +import org.nuxeo.xforms.xforms.model.controls.XFHint;
>  import org.nuxeo.xforms.xforms.model.controls.XFInput;
>  import org.nuxeo.xforms.xforms.model.controls.XFItem;
>  import org.nuxeo.xforms.xforms.model.controls.XFLabel;
> @@ -59,6 +60,7 @@
>  
>  
>  
> +
>  /**
>   * 
>   * @author <a href="mailto:bstefanescu@...">Bogdan Stefanescu</a>
> @@ -487,10 +489,10 @@
>  		//String value = element.getValue(); 
>  		//if (value != null) mContext.proxy.setXMLValue(mContext.control, value);
>  		// setting tooltip if any
> -		String value = element.getHint();
> -		if (value != null) {
> -			mContext.proxy.setToolTipText(value);		
> -		}
> +        XFHint hint = element.getHint();
> +        if (hint != null) {
> +            mContext.proxy.setToolTipText(hint.getText());
> +        }
>  				
>  		
>  		// third processing step
>   

--

-- 

Bogdan Stefanescu - Apogee project Team Leader

Nuxeo - Open Source ECM - www.nuxeo.com
Apogée - the rich client platform for ECM
http://apogee.nuxeo.org/ - http://www.nuxeo.com/en

Gmane