|
Re: hexbinary and Edit custom itemprovider for storing binaries(images) [message #427533 is a reply to message #427530] |
Fri, 20 February 2009 11:42 |
Ed Merks Messages: 33162 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.
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...<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/
|
|
|
|
Powered by
FUDForum. Page generated in 0.02911 seconds