Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-ui-dev] Extending ClassFileEditor..

Kai-Uwe Maetzel wrote:
The ClassFileDocumentProvider uses IClassFile.getSource() to access the source of a  class file.  In order to associate source with a jar file  you  create a class path entry using JCore.newLibraryEntry and update the class path of the containing project. To change how the source path works this would be an appropriate starting point for your investigation. The UI elements such as the SourceAttachmentDialog must then be adapted to the new story.
Thanks Kai for your pointers. I am able to add  sourcePaths by extending the class SourceMapper and using  PackageFragmentRoot.setSourceMapper(mySourceMapper) .

Now my probem is how to store the extra sourcePaths in .classpath file. I tried hand-editing .classpath file  to have something like the following :
    <classpathentry kind="lib" path="D:/temp/myEclipseTest/foo.jar" sourcepath="D:/temp/myEclipseTest/src;D:/temp/myEclipseTest/mysrc"/>
where "sourcepath" has multiple src entries separated by ";".

This approach doesnt work as  IPackageFragmentRoot.getSourceAttachmentPath() returns null. It seems that someone is verifying  the sourcePath to have a valid directory or filename. Is there any way to disable this verification ? Or any other way to achieve this by adding new attributes to <classpathentry/> ?

Any help is greatly appreciated.

thanks,
prasen



In order to edit read-only files you should look into the following issues:
- the result of ITextEditor.isEditable is used to the set the editable state of the editor's SourceViewer (see AbstractTextEditor.validateState)
- source manipulating actions such as Paste enable/disable themselves based on  ITextEditorExtension2#validateEditorInputState() (based on this method files that are under version control can be checked out prior to the first modification)
- Save should redirect to Save As for modified read-only files

Kai


At 12:40 PM 5/28/2003 +0530, you wrote:
Hi,
 I am trying to extend ClassFileEditor  so that I can associate more than one source-paths to one .jar file in "Java Build Path -> Libraries", where the source-paths will be separated by ";". Also I would like to edit the java source files if they have write-permission(can it be done by just overwriting  in which isEditable() will return true).

Something similar to JBuilder-Libraries... ;)

Any pointer is greatly appreciated. Thanks in advance...

prasen

_______________________________________________
jdt-ui-dev mailing list
jdt-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/jdt-ui-dev



Back to the top