Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Refactor-rename of XML based resources
Refactor-rename of XML based resources [message #289648] Tue, 09 August 2005 15:09 Go to next message
Stefan Junsved is currently offline Stefan JunsvedFriend
Messages: 56
Registered: July 2009
Member
Hi all.



I have several resources in my workbench described in xml but edited with
different GEF editors. I would like to hook into the Eclipse Refactor ->
Rename functionality when changing the name of an xml resource.



I have read quiet a lot about this, but it seems as if most issues take care
of how to rename Java packages, classes, methods, and fields etc, etc. I
have not found anything about a more generic functionality on how to rename
any resource not being a Java resource.



I'd very much appreciate some help with this.



/Stefan Junsved
Re: Refactor-rename of XML based resources [message #289719 is a reply to message #289648] Wed, 10 August 2005 09:28 Go to previous messageGo to next message
Stefan Junsved is currently offline Stefan JunsvedFriend
Messages: 56
Registered: July 2009
Member
Hi again.

Is there actually no one in this entire news group who hasn't come across
the same problem as I have?
Maybe the title wasn't enough carefully chosen. My ambition is to find out
how to do a rename on a resource, and using the built in IDE functionality
for that as much as possible. Isn't it possible to provide the
refactor->rename with extensive functionality for a certain type of
resource, and when exactly that type of resource is to be renamed, the
provided functionality is executed.

I mean, in the editor case, you just create a plugin with desired editor
type, and in the extension point for the editor you say what file extension
should trig this editor. It's extremely simple and genoius. Couldn't this be
the for all refactoring functionality in the IDE?

/Stefan

"Stefan Junsved" <stefan.junsved@comactivity.net> wrote in message
news:ddagvb$e5$1@news.eclipse.org...
> Hi all.
>
>
>
> I have several resources in my workbench described in xml but edited with
> different GEF editors. I would like to hook into the Eclipse Refactor ->
> Rename functionality when changing the name of an xml resource.
>
>
>
> I have read quiet a lot about this, but it seems as if most issues take
> care of how to rename Java packages, classes, methods, and fields etc,
> etc. I have not found anything about a more generic functionality on how
> to rename any resource not being a Java resource.
>
>
>
> I'd very much appreciate some help with this.
>
>
>
> /Stefan Junsved
>
Re: Refactor-rename of XML based resources [message #289817 is a reply to message #289719] Thu, 11 August 2005 08:06 Go to previous message
Stefan Junsved is currently offline Stefan JunsvedFriend
Messages: 56
Registered: July 2009
Member
This is a multi-part message in MIME format.

------=_NextPart_000_000C_01C59E5C.5EAD9060
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Before I wrote this issue, I tampered with the =
org.eclipse.ltk.core.refactoring.renameParticipants extension point, but =
I didn't get it to work.

The plugin.xml sub part looks like this:

<extension
point=3D"org.eclipse.ltk.core.refactoring.renameParticipants ">
<renameParticipant
id=3D"myid"
name=3D"myname"=20
class=3D"net.mycompany.eclipse.tools.core.refactoring.MyClass ">
<enablement>
<with variable=3D"affectedNatures">
<iterate operator=3D"or">
<equals value=3D"org.eclipse.jdt.core.javanature"/>
</iterate>
</with>
<with variable=3D"element">
<instanceof value=3D"org.eclipse.core.resources.IResource"/>
</with>
</enablement>
</renameParticipant>
</extension>

MyClass extends the =
org.eclipse.ltk.core.refactoring.participants.RenameParticip ant class. =
Nothing is trigged though in MyClass when a rename is executed. Is there =
anything more I have to do?

I'll start a new thread on this part of the issue.

/Stefan
=20
"Stefan Junsved" <stefan.junsved@comactivity.net> wrote in message =
news:ddchc0$3a9$1@news.eclipse.org...
> Hi again.
>=20
> Is there actually no one in this entire news group who hasn't come =
across=20
> the same problem as I have?
> Maybe the title wasn't enough carefully chosen. My ambition is to find =
out=20
> how to do a rename on a resource, and using the built in IDE =
functionality=20
> for that as much as possible. Isn't it possible to provide the=20
> refactor->rename with extensive functionality for a certain type of=20
> resource, and when exactly that type of resource is to be renamed, the =

> provided functionality is executed.
>=20
> I mean, in the editor case, you just create a plugin with desired =
editor=20
> type, and in the extension point for the editor you say what file =
extension=20
> should trig this editor. It's extremely simple and genoius. Couldn't =
this be=20
> the for all refactoring functionality in the IDE?
>=20
> /Stefan
>=20
> "Stefan Junsved" <stefan.junsved@comactivity.net> wrote in message=20
> news:ddagvb$e5$1@news.eclipse.org...
>> Hi all.
>>
>>
>>
>> I have several resources in my workbench described in xml but edited =
with=20
>> different GEF editors. I would like to hook into the Eclipse Refactor =
->=20
>> Rename functionality when changing the name of an xml resource.
>>
>>
>>
>> I have read quiet a lot about this, but it seems as if most issues =
take=20
>> care of how to rename Java packages, classes, methods, and fields =
etc,=20
>> etc. I have not found anything about a more generic functionality on =
how=20
>> to rename any resource not being a Java resource.
>>
>>
>>
>> I'd very much appreciate some help with this.
>>
>>
>>
>> /Stefan Junsved
>>=20
>=20
>
------=_NextPart_000_000C_01C59E5C.5EAD9060
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2668" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Before I wrote this issue, I tampered =
with the=20
</FONT><FONT face=3DArial=20
size=3D2>org.eclipse.ltk.core.refactoring.renameParticipants extension =
point, but=20
I didn't get it to work.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The plugin.xml sub part looks like=20
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
size=3D2>&lt;extension<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp=
;=20
point=3D"org.eclipse.ltk.core.refactoring.renameParticipants "&gt;<BR>&nbs=
p;&nbsp;&lt;renameParticipant<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
id=3D"myid"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name=3D"myname"=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
class=3D"net.mycompany.eclipse.tools.core.refactoring.MyClass "&gt;<BR>&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;enablement&gt;<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; =
&lt;with=20
variable=3D"affectedNatures"&gt;<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &=
nbsp;&nbsp;&nbsp;=20
&lt;iterate=20
operator=3D"or"&gt;<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;=20
&lt;equals=20
value=3D"org.eclipse.jdt.core.javanature"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/iterate&gt;<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
&lt;/with&gt;<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;with=20
variable=3D"element"&gt;<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nb=
sp;&nbsp;=20
&lt;instanceof=20
value=3D"org.eclipse.core.resources.IResource"/&gt;<BR >&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/with&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/enablement&gt;<BR>&nbsp;&nbsp;&lt;/renameParticipant&gt; <BR>&nbsp;&l=
t;/extension&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>MyClass extends the=20
org.eclipse.ltk.core.refactoring.participants.RenameParticip ant class. =
Nothing=20
is trigged though in MyClass when a rename is executed. Is there =
anything more I=20
have to do?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I'll start a new thread on this part of =
the=20
issue.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>/Stefan</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>"Stefan Junsved" &lt;</FONT><A=20
href=3D"mailto:stefan.junsved@comactivity.net"><FONT face=3DArial=20
size=3D2>stefan.junsved@comactivity.net</FONT></A><FONT face=3DArial =
size=3D2>&gt;=20
wrote in message </FONT><A =
href=3D"news:ddchc0$3a9$1@news.eclipse.org"><FONT=20
face=3DArial size=3D2>news:ddchc0$3a9$1@news.eclipse.org</FONT></A><FONT =
face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; Hi =
again.<BR>&gt; <BR>&gt;=20
Is there actually no one in this entire news group who hasn't come =
across=20
<BR>&gt; the same problem as I have?<BR>&gt; Maybe the title wasn't =
enough=20
carefully chosen. My ambition is to find out <BR>&gt; how to do a rename =
on a=20
resource, and using the built in IDE functionality <BR>&gt; for that as =
much as=20
possible. Isn't it possible to provide the <BR>&gt; refactor-&gt;rename =
with=20
extensive functionality for a certain type of <BR>&gt; resource, and =
when=20
exactly that type of resource is to be renamed, the <BR>&gt; provided=20
functionality is executed.<BR>&gt; <BR>&gt; I mean, in the editor case, =
you just=20
create a plugin with desired editor <BR>&gt; type, and in the extension =
point=20
for the editor you say what file extension <BR>&gt; should trig this =
editor.=20
It's extremely simple and genoius. Couldn't this be <BR>&gt; the for all =

refactoring functionality in the IDE?<BR>&gt; <BR>&gt; /Stefan<BR>&gt; =
<BR>&gt;=20
"Stefan Junsved" &lt;</FONT><A=20
href=3D"mailto:stefan.junsved@comactivity.net"><FONT face=3DArial=20
size=3D2>stefan.junsved@comactivity.net</FONT></A><FONT face=3DArial =
size=3D2>&gt;=20
wrote in message <BR>&gt; </FONT><A=20
href=3D"news:ddagvb$e5$1@news.eclipse.org"><FONT face=3DArial=20
size=3D2>news:ddagvb$e5$1@news.eclipse.org</FONT></A><FONT face=3DArial=20
size=3D2>...<BR>&gt;&gt; Hi =
all.<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; <BR>&gt;&gt; I=20
have several resources in my workbench described in xml but edited with=20
<BR>&gt;&gt; different GEF editors. I would like to hook into the =
Eclipse=20
Refactor -&gt; <BR>&gt;&gt; Rename functionality when changing the name =
of an=20
xml resource.<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; <BR>&gt;&gt; I have =
read quiet=20
a lot about this, but it seems as if most issues take <BR>&gt;&gt; care =
of how=20
to rename Java packages, classes, methods, and fields etc, <BR>&gt;&gt; =
etc. I=20
have not found anything about a more generic functionality on how =
<BR>&gt;&gt;=20
to rename any resource not being a Java=20
resource.<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; <BR>&gt;&gt; I'd very much=20
appreciate some help with =
this.<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; <BR>&gt;&gt;=20
/Stefan Junsved<BR>&gt;&gt; <BR>&gt; <BR>&gt;</FONT></BODY></HTML>

------=_NextPart_000_000C_01C59E5C.5EAD9060--
Previous Topic:Problem with org.eclipse.compare.structuremergeviewer.differencer
Next Topic:Error into my plugin configuration...
Goto Forum:
  


Current Time: Wed Apr 24 15:58:04 GMT 2024

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

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

Back to the top