Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 333441

Summary: texteditorrecipes example gives error when opening editor
Product: [Eclipse Project] Platform Reporter: Kitesurfer () <hans.netten>
Component: TextAssignee: Dani Megert <daniel_megert>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, remy.suen
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Screenprint of error
none
Picture showing working editor none

Description Kitesurfer () CLA 2011-01-03 16:00:25 EST
Created attachment 185973 [details]
Screenprint of error

Hello,

I was directed to a set of example plugin-projects at the eclipse.org site for customizing Eclipse for use in the company I'm currently working :

http://www.eclipse.org/eclipse/platform-text/eclipseCon/2006 /texteditorrecipes.zip

This zip contains 8 projects that build up a complete editor (for .rec files) with all the things I would like to have for my languages.
There is one problem ... project 1 & 2 work ... project 3 (and 4 tm. 8) don't work (see attached screenprint.jpg).

I already had a thread on the forum with Dani Megert (who directed me to the zip), and he suggested I should report a bug to the "platform text". Honestly I really don't know if it is a bug in Eclipse or that the plugin is not correct. The plugin however shows no errors and doesn't crash.

Is it possible for you guys to take a look at it ? ... and find out what is wrong in Eclipse, or what is wrong in the plugin ?

To reproduce it:
- do a clean install of Eclipse Helios (or Ganyede).
- import project "03_partitioning"
- run the plugin by "run as eclipse application"
- open the "fondue.rec"-file, which is in the recipes-directory of the zip.
- not the fondue.rec file is shown, but the text "ERROR"

Projects 04 tm. 08 also don't work, but that could be just because of an error in the 03-project (as each project is an increment of the previous one).

I hope to get a reaction. I would for sure appreciate this very much, as I'm stuck at this moment

Regards,
Hans
Netherlands
Comment 1 Dani Megert CLA 2011-01-04 06:13:25 EST
This works fine for me with these steps:
1. download Eclipse 3.6.1 SDK from:
http://download.eclipse.org/eclipse/downloads/drops/R-3.6.1-201009090800/index.php
2. start with new workspace using Oracle JRE 1.6.0
3. File > Import... > Existing Projects into Workspace
   select http://www.eclipse.org/eclipse/platform-text/eclipseCon/2006
/texteditorrecipes.zip\steps\03_partitioning\org.recipeeditor.ui_1.0.0.jar
4. in the Package Explorer select the project 'org.recipeeditor.ui'
5. context menu > Run As > Eclipse Application
   ==> target workspace opens
6. in the target workspace:
   1. create a project (File > New > Project, select General > Project)
   2. copy recipes\fondue.rec from the ZIP into the project
   3. open the file
   ==> editor opens as expected, see attached picture.
Comment 2 Dani Megert CLA 2011-01-04 06:14:26 EST
Created attachment 185994 [details]
Picture showing working editor
Comment 3 Dani Megert CLA 2011-01-04 06:24:30 EST
After a second look at the picture you provided, it looks like you try to open a recipe file which is not in the (target) workspace. This is not supported by the example.
Comment 4 Kitesurfer () CLA 2011-01-04 16:13:38 EST
(In reply to comment #3)
> After a second look at the picture you provided, it looks like you try to open
> a recipe file which is not in the (target) workspace. This is not supported by
> the example.

This indeed is the "problem". I got all the examples up and running under Eclipse Helios when editting the .rec file in a workspace.
Strange that there is a difference between editting a file in a workspace and outside a workspace. Creating a workspace looks like just creating a directory.

Thanks for you help. I have another question, but I'll ask that one on the forum.
Comment 5 Dani Megert CLA 2011-01-05 02:58:10 EST
> Strange that there is a difference between editting a file in a workspace and
> outside a workspace. Creating a workspace looks like just creating a 
> directory.
There's much more. Workspace "files" can also point to a different type of file system (e.g. a database). Primary support is for handling files known to the workspace root. Having said that, I have a new version of the example that uses TextFileDocumentProvider instead of FileDocumentProvider and this version can also open files outside the workspace (e.g. from the file system). Please drop me an e-mail if you're interested in it.