Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » hexbinary and Edit custom itemprovider for storing binaries(images)
hexbinary and Edit custom itemprovider for storing binaries(images) [message #427530] Fri, 20 February 2009 11:20 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hello,

Is there any work or use case for storing an image in binary format in a
model. I have tried setting a type to hexbinary in my .xsd, generate the
model and code, the result in the item provider is a regular property
descriptor for a hexbinary, Any chance propertysheet could support a
button with browse so an image can be serialized into the model?
(In similar fashion to non-containment references, showing a dialog?).


If this usecase is not supported, it would be nice to have a pointer
to the code which generates the Dialog for non-containment references.
(Is this the propertySheet?).


Thanks Christophe
Re: hexbinary and Edit custom itemprovider for storing binaries(images) [message #427533 is a reply to message #427530] Fri, 20 February 2009 11:42 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33146
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------020604030703000805000306
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Christophe,

You'll want to have a look at this for creating a specialized cell editor:

http://wiki.eclipse.org/EMF/Recipes#Recipe:_Create_your_own_ property_editor_in_a_generated_application

You might even want to define your own simple type that restricts
base64Binary (it's more compact) or hexBinary and use an
ecore:instanceClass annotation to specify that its type is
org.eclipse.swt.graphics.Image so that your model will use this type.
Then in your XyzFactoryImpl you can implement
convertAbcToString/createAbcFromString. You should even be able to
extend your label provider to display the image instead of the string
representation...


Christophe Bouhier wrote:
> Hello,
>
> Is there any work or use case for storing an image in binary format in
> a model. I have tried setting a type to hexbinary in my .xsd, generate
> the model and code, the result in the item provider is a regular
> property descriptor for a hexbinary, Any chance propertysheet could
> support a button with browse so an image can be serialized into the
> model?
> (In similar fashion to non-containment references, showing a dialog?).
>
>
> If this usecase is not supported, it would be nice to have a pointer
> to the code which generates the Dialog for non-containment references.
> (Is this the propertySheet?).
>
>
> Thanks Christophe

--------------020604030703000805000306
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Christophe,<br>
<br>
You'll want to have a look at this for creating a specialized cell
editor:<br>
<blockquote><a
href=" http://wiki.eclipse.org/EMF/Recipes#Recipe:_Create_your_own_ property_editor_in_a_generated_application"> http://wiki.eclipse.org/EMF/Recipes#Recipe:_Create_your_own_ property_editor_in_a_generated_application</a><br>
</blockquote>
You might even want to define your own simple type that restricts
base64Binary (it's more compact) or hexBinary and use an
ecore:instanceClass annotation to specify that its type is
org.eclipse.swt.graphics.Image so that your model will use this type.&nbsp;
Then in your XyzFactoryImpl you can implement
convertAbcToString/createAbcFromString.&nbsp;&nbsp; You should even be able to
extend your label provider to display the image instead of the string
representation...<br>
<br>
<br>
Christophe Bouhier wrote:
<blockquote cite="mid:gnm3l6$2hu$1@build.eclipse.org" type="cite">Hello,
<br>
<br>
Is there any work or use case for storing an image in binary format in
a model. I have tried setting a type to hexbinary in my .xsd, generate
the model and code, the result in the item provider is a regular
property descriptor for a hexbinary, Any chance propertysheet could
support a button with browse so an image can be serialized into the
model?
<br>
(In similar fashion to non-containment references, showing a dialog?).
<br>
<br>
<br>
If this usecase is not supported, it would be nice to have a pointer
<br>
to the code which generates the Dialog for non-containment references.
<br>
(Is this the propertySheet?).
<br>
<br>
<br>
Thanks Christophe
<br>
</blockquote>
</body>
</html>

--------------020604030703000805000306--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: hexbinary and Edit custom itemprovider for storing binaries(images) [message #427534 is a reply to message #427533] Fri, 20 February 2009 13:47 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Thank you!


Ed Merks wrote:
> Christophe,
>
> You'll want to have a look at this for creating a specialized cell editor:
>
> http://wiki.eclipse.org/EMF/Recipes#Recipe:_Create_your_own_ property_editor_in_a_generated_application
>
> You might even want to define your own simple type that restricts
> base64Binary (it's more compact) or hexBinary and use an
> ecore:instanceClass annotation to specify that its type is
> org.eclipse.swt.graphics.Image so that your model will use this type.
> Then in your XyzFactoryImpl you can implement
> convertAbcToString/createAbcFromString. You should even be able to
> extend your label provider to display the image instead of the string
> representation...
>
>
> Christophe Bouhier wrote:
>> Hello,
>>
>> Is there any work or use case for storing an image in binary format in
>> a model. I have tried setting a type to hexbinary in my .xsd, generate
>> the model and code, the result in the item provider is a regular
>> property descriptor for a hexbinary, Any chance propertysheet could
>> support a button with browse so an image can be serialized into the
>> model?
>> (In similar fashion to non-containment references, showing a dialog?).
>>
>>
>> If this usecase is not supported, it would be nice to have a pointer
>> to the code which generates the Dialog for non-containment references.
>> (Is this the propertySheet?).
>>
>>
>> Thanks Christophe
Previous Topic:Serialize an EObject without changing its resource
Next Topic:Resolve proxy URI always file URI?
Goto Forum:
  


Current Time: Thu May 09 16:08:29 GMT 2024

Powered by FUDForum. Page generated in 0.03644 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top