Custom Developed Editor only contains "ERROR" if used to open external file [message #333047] |
Fri, 21 November 2008 18:31 |
Mike Jackson![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=imikejackson%40gmail.com) Messages: 128 Registered: July 2009 |
Senior Member |
|
|
From: Mike Jackson <imikejackson@gmail.com>
Newsgroups: eclipse.tools.jdt
Subject: Custom Developed Editor only contains "ERROR" if used to open
external file
Date: Fri, 21 Nov 2008 12:27:30 -0500
I am working on the CMakeEd project (cmakeed.sourceforge.net) and I
have a bug report that basically says if I try to open an external
cmake file (one NOT already in a project) then I get a blank editor
window opened up with just the word "ERROR" in it.
As a test I opened a .java file and it opened just fine. I would like
the same functionality for my editor but can not quite seem to figure
out what I am either supposed to extend in the xml (extension point) or
implement in my editor. I currently have the following in a
CMakeDocumentProvider class:
protected IDocument createDocument(final Object element) throws CoreException
{
final IDocument document = super.createDocument(element);
if (document != null) {
final IDocumentPartitioner partitioner =
new FastPartitioner(new CMakePartitionScanner(),
CMakePartitionScanner.CONTENT_TYPES);
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
}
return document;
}
When a cmake file is opened from with a project the 'document' variable
is NOT null. If an external CMake file is opened then 'document' is
null.
I tried looking for the javaeditor example but can not seem to find the
source code for the examples. Alternately where would the full source
for the built in java editor be located?
Having looked around some more I think I am seeing that my
"CMakeDocumentProvider.java" should extend from
TextFileDocumentProvider and NOT FileDocumentProvider like it has been
doing. Is this correct? Is there any documentation or "walk throughs"
that show how to use TextFileDocumentProvider class or properly inherit
from it?
Any help or just pointing me in the right direction would be great.
Thanks
Mike Jackson
BlueQuartz Software
www.bluequ
|
|
|
Powered by
FUDForum. Page generated in 0.02685 seconds