wiki:JCopCJEdit
close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Version 16 (modified by malte.appeltauer, 9 years ago) (diff)

--

CJEdit

Environment
JVM 1.5
'Qt Jambi GUI Framework'
CJEdit includes win32/64 versions.
Downloads
CJEdit sources
Requires
JCop

In a case study, we have developed a little IDE using JCop, whose GUI provides context-specific behavior.

Modern rich text editing environments, such as Microsoft Word, provide extensive functionality to edit, format, and manage text and other elements, for example, pictures and data tables. Such large feature sets cause an additional complexity that also end-users have to cope with. To ease the use of complex work-flows, Word-like applications support context-specific menus and toolbars that emphasize important and hide irrelevant functionality. For instance, Microsoft Word provides an environment that partly integrates Microsoft Word features to deal with tables; Excel-specific functionality (such as toolbars and menu entries) and behavior (such as cell calculation and formatting) is provided whenever a table is selected by the user. CJEdit provides similar behavior for the tasks programming and documenting.

The documentation of applications is an important task in the software development process. In addition to architectural and infrastructural descriptions, the documentation of source-code artifacts is vital for understanding and evolving software systems. Therefore, most programming languages support source-code comments. However, most languages and programming environments restrict comments to plain text; text formating is not possible. To overcome this issue, tools like JavaDoc allow for the generation of HTML documents from source-code. This leads to a separation of source code from its formatted documentation, which is unintended in most cases since it requires additional effort to synchronize source code and comments.

Overview

cjedit

The editor is equipped with syntax highlighting, an outline view, and a compilation/execution toolbar. Additionally, CJEdit allows to format JCop compilation units with rich text comments. For this task, the editor provides rich text formatting features, such as font family, size, style, and color modifications. Through the combination of rich text and source code, CJEdit documents are single-source, executable representations of code and documentation.

Both activities require different functionality, therefore our application supports focusing on the actual task at hand by offering only relevant tools, menus, and widgets. A context switch between text editing and programming features is either directly triggered by the user, or on text cursor change: While writing new text, the user can enter the programming mode by pushing a toolbar button. Whenever the text cursor is moved through the document from text to code and vice versa, the GUI elements are changed accordingly. The left screenshot this page presents the application's rich text formatting mode. The toolbar offers various text formatting actions. The right image depicts the programming mode, where the editor comes with an outline and a different toolbar. To support focusing on the source code, any rich text within the document is faded gray.

Implementation

CJEdit is implemented using JCop and the 'Qt Jambi GUI Framework'. The editor consists of approximately 1400 lines of code, where most parts are written with plain Java constructs and the help of the Qt GUI Designer. The overlay of task-specific user interfaces and behavior is implemented in JCop. The system contains layers that encapsulate rich text and programming widgets such as toolbars and their corresponding behavior.

Attachments (1)

Download all attachments as: .zip