Skip to main content



      Home
Home » Newcomers » Newcomers » Modifying Eclipse Components
Modifying Eclipse Components [message #488250] Sat, 26 September 2009 15:31 Go to next message
Eclipse UserFriend
Hi,

I'm writing an eclipse plug-in and I want to rewrite some code from an existing Eclipse components, specifically (org.eclipse.jface.text).
I can view the source but it's a .class file so i can't modify it.
How do I get the source code to modify it? Also, once i have modified the source how do I get my plugin to use the new component instead of the old one?

Thanks a lot
Re: Modifying Eclipse Components [message #488257 is a reply to message #488250] Sat, 26 September 2009 19:32 Go to previous messageGo to next message
Eclipse UserFriend
Hello

> How do I get the source code to modify it?

- File > Import...
- select "Plugins and Fragments"
- [Next >]
- At "Import As" select "Projects with source folders"
- [Next >]
- Put all plugins you like to get the source into the right hand side
list
- [Finish]

When you run an Eclipse application, the checked out (and opened) bundle
is used instead of the binary one provided by the platform.


> Also, once i have modified the source how do I get my plugin to use
> the new component instead of the old one?
Either ship the Runtime with the updated bundle or fork the code out into
a new plug-in of your own and put dependencies to that new plugin. If you
do the latter, use a separate package name for the forked code to avoid
a lot of troubles.

BTW: I think it is not the best idea to change/fork platform classes. If
functionally possible, I would wrap the component I'd like to change
instead of replacing it. In a project I work for, we have successfully
implemented many wrappers of SWT widgets to fulfill the requirement to
have more widget states than enabled and disabled (validation error and
mandatory were added).

HTH

Michael
Re: Modifying Eclipse Components [message #488316 is a reply to message #488250] Sun, 27 September 2009 22:23 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

see http://www.vogella.de/articles/EclipseCodeAccess/article.htm l

Also these blogs posts give examples how to modify Eclipse code:

http://www.vogella.de/blog/2009/07/27/modify-eclipse-pde-cod e/
http://www.vogella.de/blog/2009/07/08/modify-eclipse-code/

Best regards, Lars


--
http://www.vogella.de/ - Eclipse plugin and Eclipse RCP Tutorials
http://www.twitter.com/vogella - vogella on Twitter


Best regards, Lars
Maciej Kozlowski wrote:
> Hi,
>
> I'm writing an eclipse plug-in and I want to rewrite some code from an
> existing Eclipse components, specifically (org.eclipse.jface.text).
> I can view the source but it's a .class file so i can't modify it. How
> do I get the source code to modify it? Also, once i have modified the
> source how do I get my plugin to use the new component instead of the
> old one?
>
> Thanks a lot
Re: Modifying Eclipse Components [message #488937 is a reply to message #488250] Wed, 30 September 2009 14:52 Go to previous messageGo to next message
Eclipse UserFriend
This is what i did.

i go in the plugin developpement perspective then from the <plug-ins> view i right-click on
org.eclipse.jface.text and do import as source project

Then i get 2 error:

Description Resource Path Location Type
Package 'org.eclipse.jface.text.source.projection.images' does not exist in this plug-in MANIFEST.MF /org.eclipse.jface.text/META-INF line 11 Plug-in Problem

and

Description Resource Path Location Type
Package 'org.eclipse.jface.contentassist.images' does not exist in this plug-in MANIFEST.MF /org.eclipse.jface.text/META-INF line 11 Plug-in Problem

I understand that it is because the binary didn't got imported but if a do import as binary i can't modify the source file inside the imported project.

I was looking for the proper way to import both the binary and the source so i can modify them.



[Updated on: Thu, 01 October 2009 19:58] by Moderator

Re: Modifying Eclipse Components [message #489246 is a reply to message #488250] Thu, 01 October 2009 22:41 Go to previous messageGo to next message
Eclipse UserFriend
My problem is:
I can import the plug-ins as a project into my workspace (whether it is through the Plug-In View or File>Import)
but some plug-ins don't have a src folder. For example, org.eclipse.text has a src folder but
org.eclipse.jface.text does not.
I can manually attach the jar file with the source to the .class file but still no src folder.
Re: Modifying Eclipse Components [message #490168 is a reply to message #489246] Wed, 07 October 2009 12:04 Go to previous message
Eclipse UserFriend
Jface Text should get a source folder when imported with source folders. A couple reasons why this wouldn't work: 1) If you are using Eclipse 3.5 there were some problems with plug-in import that are fixed in 3.5.1. 2) The source for whatever reason is missing (you can look for org.eclipse.jface.text.source jar file in your plugins directory).
Previous Topic:Is Eclipse suited for Web page development
Next Topic:JSP validation with nested jsp files
Goto Forum:
  


Current Time: Thu May 15 07:48:13 EDT 2025

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

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

Back to the top