Introduce Indirection does nothing on a .class file [message #522786] |
Tue, 23 March 2010 18:21  |
Eclipse User |
|
|
|
I want to replace all calls to org.eclipse.jface.dialogs.DialogPage.setButtonLayoutData() with calls to a new method that I've written in my own class. I open DialogPage.class (It's listed in my plug-in's plug-in dependencies) and right click on the method name, hit Refactor-> Introduce Indirection... and nothing happens.
Any way to get this to work? Or another way to do what I want to do? Thanks.
|
|
|
Re: Introduce Indirection does nothing on a .class file [message #522802 is a reply to message #522786] |
Tue, 23 March 2010 14:08   |
Eclipse User |
|
|
|
Gary Miguel wrote:
> I want to replace all calls to
> org.eclipse.jface.dialogs.DialogPage.setButtonLayoutData() with calls to
> a new method that I've written in my own class. I open DialogPage.class
> (It's listed in my plug-in's plug-in dependencies) and right click on
> the method name, hit Refactor-> Introduce Indirection... and nothing
> happens.
>
> Any way to get this to work? Or another way to do what I want to do?
> Thanks.
A refactor is a change to source code. A .class file is a compiled binary file,
although when you open it, Eclipse will try to locate the source that it was
compiled from and show you the source.
Are you saying that you want to edit the JFace implementation, that is,
DialogPage.java? That doesn't sound like a good idea to me unless you're
planning on contributing the change back to Eclipse, but if you really want to
you can; to do that, import the plugin's source code into your project as a
source project.
If you're saying that you want to actually modify the .class file itself, rather
than modifying the source and then recompiling, I don't believe that Eclipse
will do that for you. You may be able to do it with a bytecode modification
program, such as BCEL, ASM, AspectWorkz, etc.
|
|
|
Re: Introduce Indirection does nothing on a .class file [message #522809 is a reply to message #522802] |
Tue, 23 March 2010 19:50   |
Eclipse User |
|
|
|
Walter Harley wrote on Tue, 23 March 2010 14:08 |
Are you saying that you want to edit the JFace implementation, that is,
DialogPage.java?
|
No, I am saying I want to edit MY code that calls the JFace code.
Walter Harley wrote on Tue, 23 March 2010 14:08 |
If you're saying that you want to actually modify the .class file itself,.
|
No, that's not what I'm saying. I'm saying I want to change MY code that references this class file.
For example, if this code appears in my class, which is a subclass of DialogPage:
this.setButtonLayoutData(button)
I want to replace it with:
NewUtilityClass.setButtonLayoutData(button)
|
|
|
Re: Introduce Indirection does nothing on a .class file [message #522824 is a reply to message #522809] |
Wed, 24 March 2010 00:07   |
Eclipse User |
|
|
|
Gary Miguel wrote:
> Walter Harley wrote on Tue, 23 March 2010 14:08
>> Are you saying that you want to edit the JFace implementation, that
>> is, DialogPage.java?
>
>
> No, I am saying I want to edit MY code that calls the JFace code.
> Walter Harley wrote on Tue, 23 March 2010 14:08
>> If you're saying that you want to actually modify the .class file
>> itself,.
>
> No, that's not what I'm saying. I'm saying I want to change MY code that
> references this class file.
>
> For example, if this code appears in my class, which is a subclass of
> DialogPage:
> this.setButtonLayoutData(button)
> I want to replace it with:
> NewUtilityClass.setButtonLayoutData(button)
Oh, I understand - my apologies for misreading your request.
Is it only happening for calls to binary methods (methods in .class files)?
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.31458 seconds