Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Custom Outline view(Please help)
Custom Outline view [message #643980] Wed, 08 December 2010 21:35 Go to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
Hello,
I have my plugin almost sorted out. There's one thing I have problems with and that's the outline-view.

When this is the text in the editor:
*-----------------------------------------
IDENTIFICATION DIVISION.
PROGRAM-ID. XXXXXXXX.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FILE1 ASSIGN xx
SELECT FILE2 ASSIGN xx
DATA DIVISION.
FILE SECTION.
FD FILE1
FD FILE2
WORKING-STORAGE SECTION.
COPY X OF "COPYLIB".
COPY Y OF "COPYLIB".
EXTENDED-STORAGE SECTION.
LINKAGE SECTION.
PROCEDURE DIVISION.
S1 SECTION.
....
EXIT.
S2 SECTION.
....
EXIT.
*-----------------------------------------

I want the outline to look like this :

+ ENVIRONMENT DIVISION.
- FILE1
- FILE2
+ FILE SECTION.
- FILE1
- FILE2
+ WORKING-STORAGE SECTION.
- X
- Y
+ EXTENDED-STORAGE SECTION.
+ LINKAGE SECTION.
+ PROCEDURE DIVISION.
- S1
- S2

I'm not a super-expert on plugin-programming, so could somebody please help me with this. A piece of working code for another unstructured programming language would also do (so I can convert it to above).
Re: Custom Outline view [message #644243 is a reply to message #643980] Fri, 10 December 2010 08:11 Go to previous messageGo to next message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
OutlineView is nothing but a view with TreeViewer.
To display the tree viewer you need to have a model.

Generally a document needs to be presented in a structured format as a model

Then You can register your outline view as a listener to the editor and show it.

If you have texts in editor, you need to parse the text and construct the model and feed to the Outline view.

Hope this helps.

cheers,
Saurav


Re: Custom Outline view [message #644360 is a reply to message #644243] Fri, 10 December 2010 16:58 Go to previous messageGo to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
It helps a little bit, but I would like to have a working example that I can customize (there must be people out there that already did this).

I already knew that I have to parse the file myself (because it's an unstructured language) to get out the items that are needed in the TreeView. This parsing is no problem, the rest is Wink

I appreciate all feedback ! thanks Saurav !
Re: Custom Outline view [message #644421 is a reply to message #643980] Sat, 11 December 2010 04:03 Go to previous messageGo to next message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
I am not sure if i have seen any text editor has a outline view.But i have seen outline view for structured documents like xml, wsdl etc.May be you can have a look at the WTP code.

cheers,
Saurav


Re: Custom Outline view [message #644851 is a reply to message #644360] Tue, 14 December 2010 13:24 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Kitesurfer wrote:
> It helps a little bit, but I would like to have a working example that
> I can customize (there must be people out there that already did this).
http://www.eclipse.org/eclipse/platform-text/eclipseCon/2006 /texteditorrecipes.zip

Dani
>
> I already knew that I have to parse the file myself (because it's an
> unstructured language) to get out the items that are needed in the
> TreeView. This parsing is no problem, the rest is ;)
>
> I appreciate all feedback ! thanks Saurav !
>
Re: Custom Outline view [message #644907 is a reply to message #644851] Tue, 14 December 2010 17:16 Go to previous messageGo to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
Hello Dani,
Thanks for your reply ! ... a lot of info ... I'll work my way through the examples Razz

Greetz.
Re: Custom Outline view [message #644929 is a reply to message #644851] Tue, 14 December 2010 19:51 Go to previous messageGo to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
Hi Dani,

I stranded at project (steps) 3 "03_partitioning", 1 and 2 work fine.
When running 03, and higher, the editor just displays "ERROR" when opening a ".rec"-file.
Tried several things, also stepped though the sourcecode in debug but nothing strange seems to happen.

Do you have any idea what could be the problem ? (that is if the same thing happens when you run the project). I have Eclipse Galileo.

Appreciate your help.

Greetz.
Re: Custom Outline view [message #646078 is a reply to message #644929] Tue, 21 December 2010 21:52 Go to previous messageGo to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
Anyone ?
Re: Custom Outline view [message #646125 is a reply to message #644929] Wed, 22 December 2010 08:37 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 14.12.2010 20:51, Kitesurfer wrote:
> Hi Dani,
>
> I stranded at project (steps) 3 "03_partitioning", 1 and 2 work fine.
> When running 03, and higher, the editor just displays "ERROR" when
> opening a ".rec"-file.
You mean with the example editor or your own? The sample/tutorial has
been used many times so I doubt it gives you an error.

Dani
> Tried several things, also stepped though the sourcecode in debug but
> nothing strange seems to happen.
>
> Do you have any idea what could be the problem ? (that is if the same
> thing happens when you run the project). I have Eclipse Galileo.
>
> Appreciate your help.
>
> Greetz.
Re: Custom Outline view [message #646146 is a reply to message #646125] Wed, 22 December 2010 11:13 Go to previous messageGo to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
Yes, I mean with the example editor (I don't have an editor "attached" to .rec files).
I also didn't change anything to the sourcecode. I just load the plugin/project into eclipse ... then "run as application" ... and then open the .rec-file that is also included in the zip.

First two example projects go oke; at number 3 (and up) it doesn't show the contents of the .rec-file when opening it, but the text "error" instead.

What happens when you do above with projekt "03_partitioning" ?

Regards, Hans
Re: Custom Outline view [message #646149 is a reply to message #646146] Wed, 22 December 2010 11:28 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
On 22.12.2010 12:13, Kitesurfer wrote:
> Yes, I mean with the example editor (I don't have an editor "attached"
> to .rec files).
> I also didn't change anything to the sourcecode. I just load the
> plugin/project into eclipse ... then "run as application" ... and then
> open the .rec-file that is also included in the zip.
>
> First two example projects go oke; at number 3 (and up) it doesn't
> show the contents of the .rec-file when opening it, but the text
> "error" instead.
>
> What happens when you do above with projekt "03_partitioning" ?
I didn't try it recently but as said before, the example has never given
us any problems so far. Please try again and if it continues to fail
report a bug against Platform Text.

Dani
>
> Regards, Hans
Re: Custom Outline view [message #646573 is a reply to message #646149] Tue, 28 December 2010 20:58 Go to previous messageGo to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
I tried it again. This is what I did :
- a clean install of "eclipse-jee-galileo-SR1-win32"
- loaded projekt "03_partitioning"
- executed it with "run as eclipse application"
- when started, opened the .rec file
- error still occured.

Do you really think it's problem in Eclipse ? ... isn't it more likely that the plugin used to work in previous versions of Eclipse, but not in the newer versions ?

Report a bug against Platform Text ? ... I'm not familiar with that.

Re: Custom Outline view [message #646763 is a reply to message #643980] Thu, 30 December 2010 19:22 Go to previous messageGo to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
I also tried it with the latest Eclipse version (Helios) ... same results Evil or Very Mad
Re: Custom Outline view [message #647183 is a reply to message #646763] Tue, 04 January 2011 21:24 Go to previous messageGo to next message
Kitesurfer () is currently offline Kitesurfer ()Friend
Messages: 87
Registered: December 2009
Member
Dani found the problem. Thx,

You need to edit the .rec file inside a workspace (project), then all the project work. Editting a .rec file outside a project doesn't work.

My next question is ... my plugin downloads a source-file from a host-system ... and then this source-file needs to be opened in Eclipse for editting.
How do I programmatically open this downloaded file in a workspace (project) ?

After editting the plugin programmatically uploads the file back to the host and then the source-file must be removed from the workspace (project).
How do I programmatically remove a source-file from a workspace ?
Re: Custom Outline view [message #647255 is a reply to message #643980] Wed, 05 January 2011 12:36 Go to previous message
Bighair49 is currently offline Bighair49Friend
Messages: 1
Registered: January 2011
Junior Member
I was having trouble with the .rec file too. Thanks for the info! Cool
Previous Topic:content type clash
Next Topic:InputStream in the WebPageEditor
Goto Forum:
  


Current Time: Fri Apr 26 15:11:40 GMT 2024

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

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

Back to the top