How to open new editor, Editing commands, Default key layout, Searching, Go to line, Nonallowed operations, Saving of files

II. User's Guide to the Editor


II.1 How to open new editor?

    The editor can be opened either for already existing source or for new class.

    The list of existing classes can be shown in the browser window and that is why the browser is the right place for opening editor on exisiting source. For more info refer to the browser documentation.

    To open new class you have to open the New class dialog and create new source. The editor window with the source will be displayed.


II.2 Editing Commands (new in 0.91)

    From version 0.91 the editor offers any user to customize keyboard reactions. To any key (even sequence of keys) a action can be assigned and users are allowed to modify this via configuration file.

    The possibility to redefine keyboard layouts is restricted only to registrated version. Unregistered users have to deal with our keys.

    Redefinition of keys is done through configuration files. These files should be stored in package xelfi.editor.keys.mappings. Without any changes the standard configuration loads default key layout to the editor. But this can be changed in Editor Options (menu item System/Options tab Editor) where one can specify which configuration file to use.

II 2.1 Default keys

    Key Action Description
    ENTER NewLine Inserts new line and indents the cursor (aligns it with the first word on previous line).
    Shift + ENTER InsertText "\n" Inserts new line without any indentation.
    TAB MoveNextTab Aligns cursor with begin of next word on previous line.
    DEL KillChar Deletes character under the cursor.
    BACKSP KillPrevChar Deletes character before the cursor.
    LEFT MoveLeft Moves the cursor.
    RIGHT MoveRight Moves the cursor.
    UP MoveUp Moves the cursor.
    DOWN MoveDown Moves the cursor.
    HOME MoveLineStart Moves the cursor.
    END MoveLineEnd Moves the cursor.
    PGUP MovePageUp Moves the cursor.
    PGDN MovePageDown Moves the cursor.
    Ctrl + LEFT MoveWordPrev Moves the cursor to the previous word.
    Ctrl + RIGHT MoveWordNext Moves the cursor to the next word.
    Shift + LEFT MoveLeft Moves the cursor. And extends selected block.
    Shift + RIGHT MoveRight Moves the cursor. And extends selected block.
    Shift + UP MoveUp Moves the cursor. And extends selected block.
    Shift + DOWN MoveDown Moves the cursor. And extends selected block.
    Shift + HOME MoveLineStart Moves the cursor. And extends selected block.
    Shift + END MoveLineEnd Moves the cursor. And extends selected block.
    Shift + PGUP MovePageUp Moves the cursor. And extends selected block.
    Shift + PGDN MovePageDown Moves the cursor. And extends selected block.
    Shift + Ctrl + LEFT MoveWordPrev Moves the cursor to the previous word. And extends selected block.
    Shift + Ctrl + RIGHT MoveWordNext Moves the cursor to the next word. And extends selected block.
    Ctrl + Y KillLine Deletes line with cursor.
    ESC BlockUnmark Unmarks selected block.
    Ctrl + C BlockCopy Copies selected block to clipboard.
    Ctrl + V BlockPaste Pastes text from clipboard and select it.
    Ctrl + C BlockCut Copies selected block to clipboard and deletes it in the editor.

    To manipulate with text also commands in editor menu can be used.

    Warning: Please also notice that it is not posible to share the clipboard with other programs in your system. The clipboard is private for Xelfi. It is caused by the absence of clipboard handling methods in the JDK 1.0.2.


II.3 Searching in the Editor

    For searching the Find and replace dialog is used. It can be opened by command in the editor menu. As can be seen from previous picture there are several fields there. The Text to find must be filled with the searched text. Then the searching can start by pressing the Find button. The finded text is shown and marked as selected in the editor. The dialog window remains still on the screen and that is why searching for next occurence can be activated by simple clicking the Find button again.

    Replacing of text is also very easy. When first occurence of Text to find has been found it is possible to press the Replace and find button. Then the text in Replace with field is substituted instead of the found one and new occurence of Text to find is found.

    The dialog can be closed by click to Cancel but it need not be. Because in spite of its appearance the editing of text in the editor is unaffected.


II.4 Finding Line

    It is possible to find a line in the editor window even only if its line number is known. For these purposes the Go To Line dialog can be used.

    It is required to specify line number in the input line and then to press OK button to use this dialog. It can remain shown without restricting the behaviour of the editor but also can be closed by Close.

II.5 Nonallowed operations

    Because we use the editor to browse text that is automaticly generated by the visual designer and we do not want to solve problems that could arrive when the user would modify this code we decided not to allow changes in the generated text. This may be seen as a strong restriction but it saves users a lot of troubles that could result in unexpected code lost.

    When an insert or delete is initiated in the text that is "Xelfi generated" the operation is canceled and a warning message in the status line is shown.


II.6 Saving of files

    The sources of edited classes are kept in the memory and to disk are flushed (this process is called synchronization) only at one of user requests:

    • Command save can be choosen from System menu and affects only the current editor file. Its content is saved to the file on disk.
    • Related command save all saves all files in the system.
    • Any request for compilation behaves like save all. All files are flushed to the disk.
    • At the exit the user is asked about files he wishes to save.
    Warning: Closing an editor window does not caused the source to be saved. It is because it can be used by another part of the system (visual one, browseser, debbuger, etc.). That is why the file will be saved only when an explicit request listed above occures.