2.6 XecliP Java Editor

For the XecliP-plug-in the XecliP Java editor is the default editor to edit Java documents. If you are not in a XP-session you will not notice any difference to the ordinary Java editor of Eclipse. The editor provides all specialized features the Eclipse user knows from the Java editor, amongst others:

  • syntax highlighting
  • content/code assist
  • code formatting
  • import assistance
  • quick fix
  • integrated debugging features

After initializing a pair programming session (SessionDefinitionDialog), it is important to use the XecliP Java editor. If the driver opens a new Java file, which is part of the shared project of the session, the same file is opened in the XecliP Java editor at the other XP-partners; on navigator or visitor side. The most common way to invoke the XecliP Java editor is to open a Java file from the Navigator or Package Explorer using pop-up menus or by selecting a Java file. While the opening of the editor is in process at the XP-partners side, the driver sees a progress monitor, which will disappear when the editor is open at all XP-partners.

While the pair programming session is running, all changes made on the driver side will appear on the XP-partner side. If the role of the XP-partner (driver - naviagtor) changes (SwitchRole) the new driver get the control to edit the files.

At the moment the following events are supported by the XecliP Java editor:

  • The driver opens a new Java file, so the editor will be opened at XP-partner side as well.
  • The driver saves editor content; the file will be saved at XP-partner side, to keep the source code consistent.
    (A navigator or visitor can not save a editor file while the session is running.)
  • The editor window is closed by any XP-partner, the file will be closed at all other XP-partners too.
  • The driver changes to another editor window, the new window will get to top at all XP-partners.
  • The driver changes the cursor position or changes the text of the file; the changes will appear at XP-partner side.
    (During the pair programming session the navigator or visitor is not able to edit the document or to change the cursor position.)
  • The driver or navigator fold or unfold an editor region, the folding or unfolding event is shown at all XP-partners. The event only effects those XP-partners, which have enabled folding event in the Eclipse preferences.
  • The driver selects a text; the text selection is shown to all other XP-partners in blue colour.
  • The navigator selects a text; the text selection is shown in green colour to the other XP-partners.
  • A visitor has the speech right, and then a text selection is shown in brown colour at all other XP-partners.
  • If a driver or a navigator scrolls up or down in the editor window, the scrolling event is performed on the other XP-partner side as well.

Screen example:

On this screenshot you can see on the top the view of the navigator and at the bottem the view of the driver

Keep in mind:

If the driver choose a different editor for opening a Java file, while a session is running, the file will not be opened on the XP-partner side. At the moment the plug-in Java editor only supports Java files. So if you open a file of a different format, you can not share it within a pair programming session.

Source consistence:

To keep the Java sources consistent, it is not recommended to make a checkout or check in to CVS or other version management system during a session. After the session is closed either the driver or the navigator should check in the changed java documents. The other XP-partners should only update the project data if needed.