Difference between revisions of "Folding support"

(Links)
 
(21 intermediate revisions by 4 users not shown)
Line 5: Line 5:
 
The aim of this project is to enhance Vision with a RichText control that supports folding. The goal is to make this surface in the editor windows of EiffelStudio.
 
The aim of this project is to enhance Vision with a RichText control that supports folding. The goal is to make this surface in the editor windows of EiffelStudio.
  
=Milestones=
+
==Introduction==
 +
While using an editor like the one provided by EiffelStudio the actual area in a
 +
text, in thsi case source code, that is actually being edited is restricted to a
 +
small part of the entire document. Therefor being able to remove text sequences
 +
from the display without changing the actual text sequence could increase
 +
productivity. One such approach is to use folding, which is a line-based
 +
technique that "folds" a block of lines into a single line that is then
 +
displayed in addition to a special symbol that marks the line as actually being
 +
a "pile" of lines, and which also serves as the interface to unfold the passage
 +
back into it's original state (and subsequent fold/unfold operations).
  
==todo==
+
==The Goal==
===M1: May 4th===
+
The goal of this project was to implement folding support for the
* ADT specified
+
EiffelStudio editor in order to be able to fold semantic blocks of code such as
 +
entire features or loop blocks. The source text should however not be modified by this procedure in
 +
the sense that folding or unfolding a text should not change the AST. In addition folding should also not
 +
have any affects on any print output. A search for specific parts of code should also be able to enter
 +
folded text areas. It is also critical that folded areas are always displayed to the user correctly. Nested folding
 +
(e.g. a loop body in a feature, nested loops etc...) should also be possible.
  
===M2: May ??? ===
 
* be familiar with ES' way of implementing the AST
 
* with the above: think about a control wrapper from ES' AST to the project-widget
 
  
===Milestones TO DO ===
+
 
* implement support for word wrapping ("View" part of the widget)
+
=Classes=
* specify & implement "Controller"
+
 
 +
See our class diagram:
 +
 
 +
* [http://n.ethz.ch/student/sennol/download/folding_class_diagram.pdf Class diagram, pdf version]
 +
* [http://n.ethz.ch/student/sennol/download/folding_class_diagram.odt Class diagram, odt (OpenOffice) version]
 +
 
 +
=Testing=
 +
 
 +
 
 +
The following testcases have been propsed:
 +
- write a small application (source code to be provided by author) that includes multiple features, loops and nested loops
 +
to check the correct creation and display of folded areas (ncl. nested folds).
 +
 
 +
- print the source code of the application mentioned above with and without folding support. The output
 +
should be identical.
 +
 
 +
- compile and run both the source code with and without folding support. The applications behaviour should be identical.
 +
 
 +
- search for specific words and text segments within folded areas of the source. The search should find such segments.
 +
 
 +
 
 +
 
 +
=TO DO=
 +
 
 +
=== Part one :: generating the folding areas ===
 +
This is the part where the data is gathered and put in to a datastructure to work on.
 +
Assigned to
 +
* sanakan
 +
 
 +
====Done====
 +
<b>EB_FOLDING_AREA</b>:<br>
 +
Folding points of interests are gathered from the class ast via click_tool.current_class.ast. the of features of the class include
 +
* next: EB_FOLDING_AREA
 +
* previous: EB_FOLDING_AREA<br>-- links to adjacent folding_areas
 +
* hidden: BOOLEAN<br>-- flag to indicate if the feature is hidden or not
 +
* show
 +
* hide
 +
* toggle_hidden_status<br>-- manipulate the hidden-flag
 +
 
 +
<b>EB_FOLDING_AREA_TREE</b>:<br>
 +
EB_FOLDING_AREAs are inserted stored in an avl-tree EB_FOLDING_AREA_TREE with doubly-linked leaves. features of the class include
 +
* first: EB_FOLDING_AREA
 +
* last: EB_FOLDING_AREA<br>-- links to the very first and very last folding_areas
 +
 
 +
<b>EB_SMART_EDITOR</b>:<br>
 +
The editor was enchanced to support the generation an maintaining of folding areas. properties and functions include
 +
* folding_areas: EB_FOLDING_AREA_TREE<br>-- rooting point of the datastructure
 +
* initialize_folding_areas<br>-- deletes any existing tree & builds it anew from the currently loaded classtext
 +
* update_folding_areas<br>-- synchronizes with the shown/saved classtext. only executes if the syntax is correct.
 +
 
 +
=== Part two :: graphical sidebar===
 +
A breakpoint-sidebar like widget to display our folding-handles in.
 +
Assigned to
 +
* ledergec
 +
* bru
 +
* lord bubu
 +
* salmanasar
 +
* grippus
 +
* thomas
 +
* sanakan
 +
 
 +
====Done====
 +
* added grey bar containing EDITOR_TOKEN_FOLDING_POINTs (the thingies to click on)
 +
* added menu entry to toggle folding-support (edit menu -> toggle folding points)
 +
* added keyboard shortcut for toggling folding-support (ctrl + p)
 +
* prepared interface for code-folding (see "part three")
 +
 
 +
====images speak a thousand words====
 +
 
 +
{|
 +
|-
 +
!Basic bar
 +
!Code-Folding bar with line numbers bar
 +
!Code-Folding: menu entry
 +
|-
 +
|[[Image:Folding margin 1.png|code-folding: basic code-folding bar]]
 +
|[[Image:Folding margin 2.png|code-folding: code-folding bar with line numbers]]
 +
|[[Image:Folding_menu_1.png|code-folding: menu entry]]
 +
|}
 +
 
 +
=== Part three :: text-manipulation===
 +
* Perro
 +
* Panarium
 +
* Exception
 +
 
 +
=== AST ===
 +
To be familiar with ES' way of implementing the AST
 +
 
  
 
==done==
 
==done==
* vast empty space 'ere.......  yet!
+
* (half) ADT specified
 +
* some specifications
 +
* generation of points/areas-of-interest (aka folding-areas)
 +
* graphical representation (aka folding bar)
 +
* togglabillity (sp?) of graphical bar (aka ctrl-p)
  
 
=Links=
 
=Links=
 
[http://www.moria.de/~michael/fe/folding.html What is a folding editor?]
 
[http://www.moria.de/~michael/fe/folding.html What is a folding editor?]
  
A link on how to implement an AST:
+
[http://jerry.cs.uiuc.edu/~plop/plop2003/Papers/Jones-ImplementingASTs.pdf How to implement an AST?]
[http://jerry.cs.uiuc.edu/~plop/plop2003/Papers/Jones-ImplementingASTs.pdf]
+
 
 +
[http://en.wikipedia.org/wiki/Visitor_pattern What's the Visitor Design-Pattern?]
 +
 
 +
[http://www.cs.unm.edu/~crowley/papers/sds/sds.html A paper about ADT's and text editors] ([http://citeseer.ist.psu.edu/rd/0%2C162545%2C1%2C0.25%2CDownload/http://citeseer.ist.psu.edu/compress/0/papers/cs/1797/http:zSzzSzwww.bolthole.comzSzjwordzSzwppaper.ps.gz/crowley98data.ps download of the file with graphics])
  
 
=Team=
 
=Team=
  
Everyone intrested in this project is welcome to join our mailinglist [http://origo.ethz.ch/cgi-bin/mailman/listinfo/es-ui es-ui@origo.ethz.ch]
+
Everyone intrested in this project is welcome to join our mailinglist [http://origo.ethz.ch/cgi-bin/mailman/listinfo/es-ui-fold es-ui-fold@origo.ethz.ch]
  
* [[User:Sanakan| Sanakan]] (Project leader)
+
* [[User:Sanakan| sanakan]] (Project leader)
 
* [[User:lord Bubu| Lord Bubu]] (Project leader)
 
* [[User:lord Bubu| Lord Bubu]] (Project leader)
* TODO add project members
+
* [[User:Bayt| Bayt]] (Project Supervisor)
 +
* [[User:Bru| Bru]]
 
* [[User:Exception| Exception]]
 
* [[User:Exception| Exception]]
 +
* [[User:Grippus| Grippus]]
 +
* [[User:Ledergec| Ledergec]]
 
* [[User:Panarium| Panarium]]
 
* [[User:Panarium| Panarium]]
* [[User:Bayt| Bayt]]
 
* [[User:salmanasar| salmanasar]]
 
 
* [[User:Perro| Perro]]
 
* [[User:Perro| Perro]]
* [[User:Bru| Bru]]
+
* [[User:salmanasar| salmanasar]] (aka. David, Quality Checking)
* [[User:Grippus| Grippus]]
+

Latest revision as of 05:33, 25 June 2006


Overview

The aim of this project is to enhance Vision with a RichText control that supports folding. The goal is to make this surface in the editor windows of EiffelStudio.

Introduction

While using an editor like the one provided by EiffelStudio the actual area in a text, in thsi case source code, that is actually being edited is restricted to a small part of the entire document. Therefor being able to remove text sequences from the display without changing the actual text sequence could increase productivity. One such approach is to use folding, which is a line-based technique that "folds" a block of lines into a single line that is then displayed in addition to a special symbol that marks the line as actually being a "pile" of lines, and which also serves as the interface to unfold the passage back into it's original state (and subsequent fold/unfold operations).

The Goal

The goal of this project was to implement folding support for the EiffelStudio editor in order to be able to fold semantic blocks of code such as entire features or loop blocks. The source text should however not be modified by this procedure in the sense that folding or unfolding a text should not change the AST. In addition folding should also not have any affects on any print output. A search for specific parts of code should also be able to enter folded text areas. It is also critical that folded areas are always displayed to the user correctly. Nested folding (e.g. a loop body in a feature, nested loops etc...) should also be possible.


Classes

See our class diagram:

Testing

The following testcases have been propsed: - write a small application (source code to be provided by author) that includes multiple features, loops and nested loops to check the correct creation and display of folded areas (ncl. nested folds).

- print the source code of the application mentioned above with and without folding support. The output should be identical.

- compile and run both the source code with and without folding support. The applications behaviour should be identical.

- search for specific words and text segments within folded areas of the source. The search should find such segments.


TO DO

Part one :: generating the folding areas

This is the part where the data is gathered and put in to a datastructure to work on. Assigned to

  • sanakan

Done

EB_FOLDING_AREA:
Folding points of interests are gathered from the class ast via click_tool.current_class.ast. the of features of the class include

  • next: EB_FOLDING_AREA
  • previous: EB_FOLDING_AREA
    -- links to adjacent folding_areas
  • hidden: BOOLEAN
    -- flag to indicate if the feature is hidden or not
  • show
  • hide
  • toggle_hidden_status
    -- manipulate the hidden-flag

EB_FOLDING_AREA_TREE:
EB_FOLDING_AREAs are inserted stored in an avl-tree EB_FOLDING_AREA_TREE with doubly-linked leaves. features of the class include

  • first: EB_FOLDING_AREA
  • last: EB_FOLDING_AREA
    -- links to the very first and very last folding_areas

EB_SMART_EDITOR:
The editor was enchanced to support the generation an maintaining of folding areas. properties and functions include

  • folding_areas: EB_FOLDING_AREA_TREE
    -- rooting point of the datastructure
  • initialize_folding_areas
    -- deletes any existing tree & builds it anew from the currently loaded classtext
  • update_folding_areas
    -- synchronizes with the shown/saved classtext. only executes if the syntax is correct.

Part two :: graphical sidebar

A breakpoint-sidebar like widget to display our folding-handles in. Assigned to

  • ledergec
  • bru
  • lord bubu
  • salmanasar
  • grippus
  • thomas
  • sanakan

Done

  • added grey bar containing EDITOR_TOKEN_FOLDING_POINTs (the thingies to click on)
  • added menu entry to toggle folding-support (edit menu -> toggle folding points)
  • added keyboard shortcut for toggling folding-support (ctrl + p)
  • prepared interface for code-folding (see "part three")

images speak a thousand words

Basic bar Code-Folding bar with line numbers bar Code-Folding: menu entry
code-folding: basic code-folding bar code-folding: code-folding bar with line numbers code-folding: menu entry

Part three :: text-manipulation

  • Perro
  • Panarium
  • Exception

AST

To be familiar with ES' way of implementing the AST


done

  • (half) ADT specified
  • some specifications
  • generation of points/areas-of-interest (aka folding-areas)
  • graphical representation (aka folding bar)
  • togglabillity (sp?) of graphical bar (aka ctrl-p)

Links

What is a folding editor?

How to implement an AST?

What's the Visitor Design-Pattern?

A paper about ADT's and text editors (download of the file with graphics)

Team

Everyone intrested in this project is welcome to join our mailinglist es-ui-fold@origo.ethz.ch