Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Sync names of two resources--use WorkspaceSynchronizer?
Sync names of two resources--use WorkspaceSynchronizer? [message #414146] Thu, 25 October 2007 23:52 Go to next message
Jeff Ramsdale is currently offline Jeff RamsdaleFriend
Messages: 122
Registered: July 2009
Senior Member
I have two files whose names (identical, but for their file extensions)
I need to keep in sync (that is, if one is renamed the other is also
automatically renamed). The first is my custom EMF model instance, the
other is a corresponding UML instance.

My initial poke at this suggested WorkspaceSychronizer might be a
candidate for helping me out--I'd have to implement a custom delegate.
Toying with this approach, though, suggests it would only trap changes
to a resource referenced by an open editor (technically, an active
EditingDomain). Is an IResourceChangeListener a better option? Other ideas?

Thanks,

-jeff
Re: Sync names of two resources--use WorkspaceSynchronizer? [message #414147 is a reply to message #414146] Fri, 26 October 2007 00:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Jeff,

That's right -- the WorkspaceSynchronizer's purpose is to notify an editor
that a resource it currently has loaded is changed in the workspace.

Sounds like you're going to need IResourceChangeListener, though I suspect
the WorkspaceSynchronizer might still be useful for helping out editors
that do happen to be open :-)

HTH,

Christian


Jeff Ramsdale wrote:

> I have two files whose names (identical, but for their file extensions)
> I need to keep in sync (that is, if one is renamed the other is also
> automatically renamed). The first is my custom EMF model instance, the
> other is a corresponding UML instance.
>
> My initial poke at this suggested WorkspaceSychronizer might be a
> candidate for helping me out--I'd have to implement a custom delegate.
> Toying with this approach, though, suggests it would only trap changes
> to a resource referenced by an open editor (technically, an active
> EditingDomain). Is an IResourceChangeListener a better option? Other
> ideas?
>
> Thanks,
>
> -jeff
Re: Sync names of two resources--use WorkspaceSynchronizer? [message #414244 is a reply to message #414147] Fri, 26 October 2007 18:45 Go to previous messageGo to next message
Jeff Ramsdale is currently offline Jeff RamsdaleFriend
Messages: 122
Registered: July 2009
Senior Member
Aren't there other scenarios where I might not have any editors open but
that I might have several resources impacted by a change? In other
words, I feel like I'm reinventing something by combining
WorkspaceSynchronizer and an additional ResourceChangeListener.

Here's a concrete example. If I rename a .ecore file, shouldn't the
reference to it in the corresponding .genmodel change as well? Is there
a particular reason this isn't the case? What would be the best way to
implement this capability?

Jeff

Christian W. Damus wrote:
> Hi, Jeff,
>
> That's right -- the WorkspaceSynchronizer's purpose is to notify an editor
> that a resource it currently has loaded is changed in the workspace.
>
> Sounds like you're going to need IResourceChangeListener, though I suspect
> the WorkspaceSynchronizer might still be useful for helping out editors
> that do happen to be open :-)
>
> HTH,
>
> Christian
>
>
> Jeff Ramsdale wrote:
>
>> I have two files whose names (identical, but for their file extensions)
>> I need to keep in sync (that is, if one is renamed the other is also
>> automatically renamed). The first is my custom EMF model instance, the
>> other is a corresponding UML instance.
>>
>> My initial poke at this suggested WorkspaceSychronizer might be a
>> candidate for helping me out--I'd have to implement a custom delegate.
>> Toying with this approach, though, suggests it would only trap changes
>> to a resource referenced by an open editor (technically, an active
>> EditingDomain). Is an IResourceChangeListener a better option? Other
>> ideas?
>>
>> Thanks,
>>
>> -jeff
>
Re: Sync names of two resources--use WorkspaceSynchronizer? [message #414245 is a reply to message #414244] Fri, 26 October 2007 18:54 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090702040608020306030002
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Jeff,

Well, yes, there is much we could do in terms of providing refactoring
support. But that's a pretty challenging problem in the general case
and we likely can't tackle that without help from the community.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=149508



Jeff Ramsdale wrote:
> Aren't there other scenarios where I might not have any editors open
> but that I might have several resources impacted by a change? In other
> words, I feel like I'm reinventing something by combining
> WorkspaceSynchronizer and an additional ResourceChangeListener.
>
> Here's a concrete example. If I rename a .ecore file, shouldn't the
> reference to it in the corresponding .genmodel change as well? Is
> there a particular reason this isn't the case? What would be the best
> way to implement this capability?
>
> Jeff
>
> Christian W. Damus wrote:
>> Hi, Jeff,
>>
>> That's right -- the WorkspaceSynchronizer's purpose is to notify an
>> editor
>> that a resource it currently has loaded is changed in the workspace.
>>
>> Sounds like you're going to need IResourceChangeListener, though I
>> suspect
>> the WorkspaceSynchronizer might still be useful for helping out editors
>> that do happen to be open :-)
>>
>> HTH,
>>
>> Christian
>>
>>
>> Jeff Ramsdale wrote:
>>
>>> I have two files whose names (identical, but for their file extensions)
>>> I need to keep in sync (that is, if one is renamed the other is also
>>> automatically renamed). The first is my custom EMF model instance, the
>>> other is a corresponding UML instance.
>>>
>>> My initial poke at this suggested WorkspaceSychronizer might be a
>>> candidate for helping me out--I'd have to implement a custom delegate.
>>> Toying with this approach, though, suggests it would only trap changes
>>> to a resource referenced by an open editor (technically, an active
>>> EditingDomain). Is an IResourceChangeListener a better option? Other
>>> ideas?
>>>
>>> Thanks,
>>>
>>> -jeff
>>


--------------090702040608020306030002
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">
Jeff,<br>
<br>
Well, yes, there is much we could do in terms of providing refactoring
support.&nbsp; But that's a pretty challenging problem in the general case
and we likely can't tackle that without help from the community.<br>
<blockquote><a
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=149508">https://bugs.eclipse.org/bugs/show_bug.cgi?id=149508</a><br>
</blockquote>
<br>
<br>
Jeff Ramsdale wrote:
<blockquote cite="mid:fftcl1$p5k$1@build.eclipse.org" type="cite">Aren't
there other scenarios where I might not have any editors open but that
I might have several resources impacted by a change? In other words, I
feel like I'm reinventing something by combining WorkspaceSynchronizer
and an additional ResourceChangeListener.
<br>
<br>
Here's a concrete example. If I rename a .ecore file, shouldn't the
reference to it in the corresponding .genmodel change as well? Is there
a particular reason this isn't the case? What would be the best way to
implement this capability?
<br>
<br>
Jeff
<br>
<br>
Christian W. Damus wrote:
<br>
<blockquote type="cite">Hi, Jeff,
<br>
<br>
That's right -- the WorkspaceSynchronizer's purpose is to notify an
editor
<br>
that a resource it currently has loaded is changed in the workspace.
<br>
<br>
Sounds like you're going to need IResourceChangeListener, though I
suspect
<br>
the WorkspaceSynchronizer might still be useful for helping out editors
<br>
that do happen to be open&nbsp; :-)
<br>
<br>
HTH,
<br>
<br>
Christian
<br>
<br>
<br>
Jeff Ramsdale wrote:
<br>
<br>
<blockquote type="cite">I have two files whose names (identical,
but for their file extensions)
<br>
I need to keep in sync (that is, if one is renamed the other is also
<br>
automatically renamed). The first is my custom EMF model instance, the
<br>
other is a corresponding UML instance.
<br>
<br>
My initial poke at this suggested WorkspaceSychronizer might be a
<br>
candidate for helping me out--I'd have to implement a custom delegate.
<br>
Toying with this approach, though, suggests it would only trap changes
<br>
to a resource referenced by an open editor (technically, an active
<br>
EditingDomain). Is an IResourceChangeListener a better option? Other
<br>
ideas?
<br>
<br>
Thanks,
<br>
<br>
-jeff
<br>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
</body>
</html>

--------------090702040608020306030002--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Instantiating Ecore model from Strings
Next Topic:Reading (parsing) EMF models without EMF runtime classes
Goto Forum:
  


Current Time: Fri Apr 26 04:01:54 GMT 2024

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

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

Back to the top