how to change resource when its moved/renamed in 3.0 [message #258068] |
Fri, 02 July 2004 22:01  |
Eclipse User |
|
|
|
Originally posted by: vadim.strizhevsky.remove.com
Hi,
In 3.0 I have a resource type .foo in Java project (and also my nature as
well). I'd like to change the
resource when its moved or renamed. Similar to how JDT updates package
name of the .java file when
its moved. What's the best way to do this?
I thought using MoveParticipant would work, but after I dug deeper into
this, acording to
documentation participants can't modify the resource being moved. What are
my choices? Ideally I'd
like to own the whole Move/Rename refactoring of the .foo resources and
both move the resource and
modify it while doing that, but I couldn't find a way todo that.
Any help would be apreciated.
Thanks,
Vadim
|
|
|
|
Re: how to change resource when its moved/renamed in 3.0 [message #258926 is a reply to message #258359] |
Tue, 06 July 2004 18:11   |
Eclipse User |
|
|
|
Originally posted by: vadim.strizhevsky.remove.com
Thanks, while it might be doable, its not exactly trivial, and feels in
the wrong place. You get notification about deletion and additon, not that
its moved. You have no way to abort it and say refactoring is bad (i.e no
way to checkPrecondition) etc...
I see in one of the older refactoring docs and plans notes about
pluggable Processors in addition to Participants, which is what I think I
need, but looks like that wasn't generalized into extensions in 3.0
timeframe :(
-Vadim
Jerome Lanneluc wrote:
> You can add an IResourceChangeListener (see
> IWorkspace.addResourceChangeListener(IResourceChangeListener listener, int
> eventMask)) that listen for PRE_BUILD events. During a PRE_BUILD
> notification you can change resources.
> Jerome
> "Vadim Strizhevsky" <vadim@strizhevsky.remove.com> wrote in message
> news:cc542j$lbm$1@eclipse.org...
> >
> > Hi,
> >
> > In 3.0 I have a resource type .foo in Java project (and also my nature as
> > well). I'd like to change the
> > resource when its moved or renamed. Similar to how JDT updates package
> > name of the .java file when
> > its moved. What's the best way to do this?
> >
> > I thought using MoveParticipant would work, but after I dug deeper into
> > this, acording to
> > documentation participants can't modify the resource being moved. What are
> > my choices? Ideally I'd
> > like to own the whole Move/Rename refactoring of the .foo resources and
> > both move the resource and
> > modify it while doing that, but I couldn't find a way todo that.
> >
> > Any help would be apreciated.
> > Thanks,
> > Vadim
> >
|
|
|
Re: how to change resource when its moved/renamed in 3.0 [message #259046 is a reply to message #258926] |
Wed, 07 July 2004 05:13  |
Eclipse User |
|
|
|
Actually you get notification that it is moved. See the
IResourceDelta.MOVED_TO and MOVED_FROM flags.
For other issues you might want to enter feature requests.
Jerome
"Vadim Strizhevsky" <vadim@strizhevsky.remove.com> wrote in message
news:ccf83b$p7a$1@eclipse.org...
>
> Thanks, while it might be doable, its not exactly trivial, and feels in
> the wrong place. You get notification about deletion and additon, not that
> its moved. You have no way to abort it and say refactoring is bad (i.e no
> way to checkPrecondition) etc...
>
> I see in one of the older refactoring docs and plans notes about
> pluggable Processors in addition to Participants, which is what I think I
> need, but looks like that wasn't generalized into extensions in 3.0
> timeframe :(
>
> -Vadim
>
> Jerome Lanneluc wrote:
>
> > You can add an IResourceChangeListener (see
> > IWorkspace.addResourceChangeListener(IResourceChangeListener listener,
int
> > eventMask)) that listen for PRE_BUILD events. During a PRE_BUILD
> > notification you can change resources.
>
> > Jerome
>
> > "Vadim Strizhevsky" <vadim@strizhevsky.remove.com> wrote in message
> > news:cc542j$lbm$1@eclipse.org...
> > >
> > > Hi,
> > >
> > > In 3.0 I have a resource type .foo in Java project (and also my nature
as
> > > well). I'd like to change the
> > > resource when its moved or renamed. Similar to how JDT updates package
> > > name of the .java file when
> > > its moved. What's the best way to do this?
> > >
> > > I thought using MoveParticipant would work, but after I dug deeper
into
> > > this, acording to
> > > documentation participants can't modify the resource being moved. What
are
> > > my choices? Ideally I'd
> > > like to own the whole Move/Rename refactoring of the .foo resources
and
> > > both move the resource and
> > > modify it while doing that, but I couldn't find a way todo that.
> > >
> > > Any help would be apreciated.
> > > Thanks,
> > > Vadim
> > >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.27987 seconds