Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Custom Developed Editor only contains "ERROR" if used to open external file
Custom Developed Editor only contains "ERROR" if used to open external file [message #257574] Fri, 21 November 2008 12:27 Go to next message
Eclipse UserFriend
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?

Any help or just pointing me in the right direction would be great.

Thanks
Mike Jackson
BlueQuartz Software
www.bluequ
Re: Custom Developed Editor only contains "ERROR" if used to open external file [message #257579 is a reply to message #257574] Fri, 21 November 2008 15:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi Mike,

To find the source code you are after, please take a look at
http://wiki.eclipse.org/index.php/CVS_Howto

Connect to "dev.eclipse.org" as user "anonymous" with Repository path
"/cvsroot/eclipse".

There you can find the javaeditor example under project
"org.eclipse.ui.examples.javaeditor"

and the jdt java editor source code in project
"org.eclipse.jdt.ui" package "org.eclipse.jdt.internal.ui.javaeditor"

Best Regards, David Virdefors

Purple Scout / www.purplescout.com


"Mike Jackson" <imikejackson@gmail.com> wrote in message
news:gg6r23$g25$1@build.eclipse.org...
>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?
>
> Any help or just pointing me in the right direction would be great.
>
> Thanks
> Mike Jackson
> BlueQuartz Software
> www.bluequ
>
Re: Custom Developed Editor only contains "ERROR" if used to open external file [message #257591 is a reply to message #257574] Mon, 24 November 2008 05:44 Go to previous message
Eclipse UserFriend
Mike Jackson wrote:
> 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:
Let your document provider extend
org.eclipse.ui.editors.text.TextFileDocumentProvider. In addition you
might need to setup the parent document provider. See
org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitDocume ntProvider.CompilationUnitDocumentProvider()
for details.

Dani
>
> 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?
>
> Any help or just pointing me in the right direction would be great.
>
> Thanks
> Mike Jackson
> BlueQuartz Software
> www.bluequ
>
Previous Topic:Writing to console
Next Topic:Call hierarchy by Working Set for indirect calls
Goto Forum:
  


Current Time: Mon Apr 28 12:47:03 EDT 2025

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

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

Back to the top