Chapter 4. Operations With File

Create File
Save/Save As... File
Save All Files
Delete File
Rename File
Open Files with the Non-default Editor
Go to Folder
Download File from Server
Open Local File
Upload File
Use File Template
Save File as Template
Create File from Template
Remove Non-default File Template
Open/Select/Close/Browse tabs
Undo/Redo Editing
Edit Files in the Code Editor
Format File
Show/hide line numbers
Go to lines
Watch the cursor position in the Status Bar
Delete lines
Find/Replace
Code Autocomplete
Code Outline
Edit File in the WYSIWYG Editor
Preview File Properties

To create a file, for example, do as follows:

Illustration 6. Create new REST Service

Once you have changed content of opened file, its tab title will be marked by * and the Save button will be enabled. So, you can save changed content by clicking Save or press Ctrl + S, or going to File > Save from the top menu. To save the file into another folder or with another name, select the target folder in the Workspace Panel. Next, click the Save As... button on the Toolbar; or select File > Save As... from the top menu.

If there is one or more files created, opened and changed in the Content Panel before, you can save all of them simply by selecting File > Save All from the top menu. Take into consideration that the Save All command willnot have any effect on new files.

To delete a file, do as follows:

Files opened in the Content Panel will be closed after removing. You can view the full path to the opened file in the tip of file tab in the Content Panel.

To rename a file, do as follows:

After renaming opened and unsaved file in the Content Panel, you can save this file later.

HTML and Goolge gadget files can be opened in the Code Editor or in the WYSIWYG Editor. The Code Editor is used by default. To open such files in the WYSIWYG Editor with the help of Open File With dialog, do as follows:

If the target file has been opened in the Content Panel before, the Reopen confirmation dialog will be shown:

Illustration 7. Open the HTML file in the WYSIWYG editor

Illustration 8. Opened the HTML file in the WYSIWYG editor

To change the default editor, do as follows:

The new settings will be stored in the User Settings File at the server that will be the default editor in next sessions. The default editor is marked by "Default" in the Open File With dialog.

You can quickly find the opened file in the Workspace Panel using the Go to Folder command as follows:

The eXo IDE will show the folder with this file selected. Similarly, you can localize the found file from the Search Tab.

If you want to get some files from the JCR Repository, do as follows:

The file will be sent to the client. So, the browser will suggest you save the file on the local computer.

With the eXo IDE, you can edit some local files with the registered type within the Code Editor or WYSIWYG Editor. During opening, you can directly define the correct file type. To edit the local file content with the eXo IDE, do as follows:

Now, you can continue working with the content with the new file:

Illustration 9. Example of opening the local groovy script

The following table is the list of MIME types registered in the eXo IDE.


Table 1. Registered MIME Types

Note

To load the Google Gadget file, you should set the MIME Type as "application/x-google-gadget" in the "Open file" dialog as it is figured out at the next illustration:

Illustration 10. Open the Google Gadget file

To upload the file directly into the JCR on the server, go to File > Upload... on the top menu. For example, to upload the gadget.xml file into the Gadget folder, do as follows:

The gadget.xml gadget will be uploaded on the sever and appear in the Gadget folder on theWorkspace Panel.

File Template is stored in the IDE registry file, and then can be used to create another file with the same MIME type.

To switch to the necessary file, click the tab title with the appropriate name. To close the file, just click the X button on the tab title. Also, you can use the tab browsing buttons "<", ">" and down arrow at the top right corner of the Content Panel as below:

There are several useful commands represented with special buttons at the center of Toolbar and in the Edit on the top menu: Undo/Redo Typing, Format, Show/Hide Line Numbers:

Illustration 13. Undo/Redo, Format and Show/Hide Line Numbers on Toolbar and in top menu

Actions to edit text are added into the history as distinct batch according to the editing pauses. After each pause of editing, the new operations batch is created. So, you can redo or undo current file content changes using Undo Typing or Redo Typing on the Toolbar (see the illustration above). Also, you can press Ctrl + Z or Ctrl+Y hotkeys respectively. In the Code Editor, the Undo/Redo functions are disabled if no changes in the Undo/Redo history. Each file opened in the editor has its own history.

When a file is created or opened, its content will be displayed in the separate tab on the Content Panel (see the illustration.1 for details) in the default Code Editor. This is eXo GWT implementation of Codemirror application from http://marijn.haverbeke.nl/codemirror/ . The JavaScript library is used to create an editor interface for Groovy, JavaScript, XML, Google Gadget, CSS, text and HTML MIME types of content. Such codes will be colored, and the editor will help you with indentation.

This feature enables you to autocomplete word including keywords, statements, declared variables and functions in context of JavaScript, CSS, HTML, XML, Google Gadget and Groovy Template files simply by clicking Ctrl + Space hotkeys. This gadget displays the Autocomplete form at the start of word:

Illustration 16. Autocomplete form

In the Google Gadget, the HTML and Groovy Template files autocomplete the list of content, depending on the cursor position within the file. If the cursor is put between <script> tags, or between <style> tags, there will be the autocomplete list for JavaScript content, or for CSS content respectively. In the other places, there will be the autocomplete list for HTML content.

To use the Autocomplete function, do as follows:

Also, you may double-click the needed token in the list to paste this token into the document. To close the Autocomplete form, you may also click the outside of form.

Illustration 17. Autocomplete form with description

Besides the Code Editor, you can open and edit HTML files and Google Gadgets with the WYSIWYG Editor based on the CKEditor. You can set the WYSIWYG Editor for those files as default. WYSIWYG Editor is the eXo GWT implementation of CKEditor application from http://ckeditor.com/ the widely used WYSIWYG-editor of HTML-content. Also, it is used to edit Google Gadget or Groove Template files.

WYSIWYG Editor does not support the line numbering, auto-indentation and format, code coloring, autocomplete, or code outline. However, the text edited with the WYSIWYG Editor looks as similar as possible to the results published. This editor has many common editing features found on desktop editing applications like Microsoft Word and OpenOffice. To open a file with the WYSIWYG Editor, see Open file with the non-default editor above.

This User Guide is a good start point to get advanced information about this editor.

Connected with the JCR repository node, file properties are displayed in the Properties Tab in the bottom of Content Panel. To view file properties, do as follows:

Illustration 21. View file's properties