Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » LTK copy refactoring
LTK copy refactoring [message #334922] Tue, 10 March 2009 13:51 Go to next message
David is currently offline DavidFriend
Messages: 2
Registered: July 2009
Junior Member
Hi,

I need to do some refactoring on certain actions in the Project Explorer
for the copy and paste action but can't seem to get it to work. I have
successfully used the rename, move and delete refactoring extension points
in the LTK (i.e. org.eclipse.ltk.core.refactoring.renameParticipants) but
when I try to use the org.eclipse.ltk.core.refactoring.copyParticipants
extension point nothing happens. I can't find any documentation regarding
the use of copyParticipants and/or the createParticipants extension
points.

Does anyone know what triggers the copy & create participants?

Also, does anyone know how I can contribute a participant for refactoring
when a Copy & Paste Action is executed from both the menu/keyboard
shortcuts and RMB context menu?

Thanks
Re: LTK copy refactoring [message #334932 is a reply to message #334922] Tue, 10 March 2009 16:55 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The IDE actions (i.e. not in the Package Explorer) only implements Move,
Rename, and Delete.

You've done the right thing, open a bug
https://bugs.eclipse.org/bugs/show_bug.cgi?id=267851

AFAIK there aren't plans to work on this, although I'll always consider
patches (it's not trivial, though :-)

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: LTK copy refactoring [message #334937 is a reply to message #334932] Tue, 10 March 2009 18:16 Go to previous messageGo to next message
David is currently offline DavidFriend
Messages: 2
Registered: July 2009
Junior Member
Hi Paul,

Can you provide any hints on where I might start to add copy refactoring,
both for Project Explorer and what parts of the refactoring framework
would I need to invoke to notify the participants?

Also, I noticed in addition to copy refactoring participants there are
create refactoring participants.

org.eclipse.ltk.core.refactoring.copyParticipants
org.eclipse.ltk.core.refactoring.createParticipants

How are these two intended to be used? For example, will copy refactoring
happen on a copy (CTRL+C) or would it happen on the paste (CTRL+V)?

If I can figure out how to patch support for this in I might, assuming I
can figure it out.

Thanks,

Dave
Re: LTK copy refactoring [message #335311 is a reply to message #334937] Tue, 31 March 2009 18:14 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

I guess there's probably 2 parts to it.

1) you would have to modify the global actions, similar to how
org.eclipse.ui.actions.MoveResourceAction uses
org.eclipse.ui.internal.ide.actions.LTKLauncher.openMoveWiza rd(IStructuredSelection)

That makes the LTK available to the Project Explorer and Resource
Navigator (deprecated in 3.5)

Then you need to add the wizard and associated supprt (Processing,
Refactoring, Change support, etc).

See org.eclipse.ltk.ui.refactoring.resource.MoveResourcesWizard and
org.eclipse.ltk.internal.core.refactoring.resource.MoveResou rcesProcessor
as starting points.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:dynamically updating plugin classpath
Next Topic:How to remove an Internal Discouraged Access Warnings for NewKeysPreferencePage?
Goto Forum:
  


Current Time: Thu Aug 29 22:17:40 GMT 2024

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

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

Back to the top