|
Re: Handling saving/ dirty state over multiple files [message #651800 is a reply to message #651797] |
Tue, 01 February 2011 16:14 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------040700000303020801080909
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Philipp,
Does this option help?
/**
* A save option that can be used only with {@link #save(Map)}
* to specify that the resource is to be saved only if the new
contents
* are different from actual contents;
* this compares the bytes in the backing store against the new
bytes that would be saved.
* The value on this option can be either <code>null</code>,
* {@link #OPTION_SAVE_ONLY_IF_CHANGED_FILE_BUFFER},
* or {@link #OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER}.
* @since 2.3
*/
String OPTION_SAVE_ONLY_IF_CHANGED = "SAVE_ONLY_IF_CHANGED";
Resource.setTrackingModification might help too...
philipp huebner wrote:
> Hi folks,
> we are working on a emf editor based on a relatively simply model.
> Now we have the requirement to expand the dirty state on another file.
> This is because of we import data into our model and want to handle
> it transient, but when sth of the data is changed the data should be
> saved back into the formerly loaded file.
> Is there sth build in in EMF to handle this use-case or do we have to
> realize this by our own ?
>
> Thank you...
--------------040700000303020801080909
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Philipp,<br>
<br>
Does this option help?<br>
<blockquote><small> /**</small><br>
<small> * A save option that can be used only with {@link
#save(Map)}</small><br>
<small> * to specify that the resource is to be saved only if the
new contents</small><br>
<small> * are different from actual contents; </small><br>
<small> * this compares the bytes in the backing store against the
new bytes that would be saved.</small><br>
<small> * The value on this option can be either
<code>null</code>, </small><br>
<small> * {@link #OPTION_SAVE_ONLY_IF_CHANGED_FILE_BUFFER},</small><br>
<small> * or {@link #OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER}.</small><br>
<small> * @since 2.3</small><br>
<small> */ </small><br>
<small> String OPTION_SAVE_ONLY_IF_CHANGED = "SAVE_ONLY_IF_CHANGED";</small><br>
</blockquote>
Resource.setTrackingModification might help too...<br>
<br>
<br>
philipp huebner wrote:
<blockquote cite="mid:ii9aqt$d2i$1@news.eclipse.org" type="cite">Hi
folks,
<br>
we are working on a emf editor based on a relatively simply model.
Now we have the requirement to expand the dirty state on another file.
This is because of we import data into our model and want to handle it
transient, but when sth of the data is changed the data should be saved
back into the formerly loaded file.
<br>
Is there sth build in in EMF to handle this use-case or do we have to
realize this by our own ?
<br>
<br>
Thank you...
<br>
</blockquote>
</body>
</html>
--------------040700000303020801080909--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
|
|
|
|
|
Re: Handling saving/ dirty state over multiple files [message #652423 is a reply to message #652330] |
Thu, 03 February 2011 19:59 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Philipp,
Comments below.
philipp huebner wrote:
> ok after many hours knopcking my head against the wall i got sth ....
> i implemented my resource and factory; but how can i create a model,
How does the generated wizard do that?
> add this model as a child to a node in my main model
Is his a containment reference or a non-containment reference?
> and seralize it by resource doLoad() ....
I guess you mean deserialize.
> Excuse my dump questiomns but this is really a hard struggle without
> examples or anything ...
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03199 seconds