Quick Instructions Using CIDE

This document references videos. To view the videos (sadly only on Windows platforms), you need to install the following codex.  A general link to CIDE is:

Here is an index to this document:

CIDE installation in Eclipse Helios (3.6), Java 1.6

Create a fresh install of Eclipse -- CIDE does not work well with other plug-ins.  Then follow these steps:

  1. Start Eclipse and go to "Help > Install New Software..."
  2. Add the following remote site: http://wwwiti.cs.uni-magdeburg.de/iti_db/research/cide/update/
  3. Select all but the pure:variants plug-in (as it doesn't install).
  4. Continue with "Install..."

Watch this video to accomplish the above.

You also need to initialize CIDE Preferences. Window->preferences->CIDE. Deselect Java 1.5 and select Java 1.6

Watch this video to accomplish the above.

Also, initialize editor preferences. Window->Preferences->General->Editors->File Associations. Select “*.java”. Under “Associated Editors”, click on “Colored Java Editor” and press “Default”.

Watch this video to accomplish the above.

Creating a CIDE Project and Enabling the CIDE Perspective

  1. Create a standard Eclipse (Java) project
  2. Now, enable the CIDE perspective by: Window->Open Perspective->Other and select CIDE.
  3. Then enable this perspective by left-clicking the project in ProjectExplorer, go down to CIDE, and enable perspective.

Watch this video to accomplish the above.

Create Feature Model for CIDE

Before you can do anything interesting with CIDE, it has to have a set of features.  So go and create a feature model using tools that have been imported from FeatureIDE.  Left-click the project in the ProjectExplorer, go down to CIDE, and then Edit Features (guidsl).  Create your model and most importantly save it.

Watch this video to accomplish the above.

Coloring

Under the project, open the feature model “model.m”. Select “Window > Show View > Other… > Feature List”. Right-click on a feature, “Select color…” and give it the color you want.

Highlight a piece of code that corresponds to an AST node (e.g., you cannot highlight part of an identifier or a code fragment with a missing bracket). Right-click and select a feature. Note that the color of code nested within code of another color will not have its original color as colors will mix.

Note: You cannot uncolor a statement when color is provided by a parent element -- always keep the underlying tree in mind.

Watch this video to accomplish the above.

Coloring Wrappers

Suppose we want to color the following method such that when the if-conditional wraps the two statements only when “Lock” feature is present. Features are labeled beside each line:

void empty() { // Stack
 
if(unlocked) { // Lock
    reset(); // Counter
    s = “”; // Stack
 
  
} // Lock
} // Stack

Because we can only highlight a contiguous piece of code that forms an AST node and “Lock” feature is not contiguous, this coloring is a little tricky to achieve:

  1. Color empty() as “Stack”.

  2. Color the entire if-conditional as “Lock”.

  3. Color reset() as “Counter”

  4. Highlight only the braces and statements of the if-conditional. Right-click and select “Lock”, which will remove this color.

Note: You cannot uncolor a statement when color is provided by a parent element -- always keep the underlying tree in mind.

Watch this video to accomplish the above.

Generating Variant

Right-click on the project, “CIDE > Generate Variant…”.  Double-click on features to include or exclude them as part of the variant (aka “configuration”, “product”, “program”).  A feature left blank will be excluded.  Press “Next”.  Give the variant a unique name (different from the original project!) and “Finish”.

Watch this video to accomplish the above.

Verifying Colors

There are two ways in which you can verify that the color of a code fragment is "correct".  First, have your cursor hover over the fragment in question.  You will see the set of features that color it.  In the figure below, the cursor has been placed over the "if ( unlocked )" code fragment.  The features listed say that this code is colored by "Lock" and "Stack".  (Note: the color of "void pop()" is "Stack", so the way to read this information is "Lock inside Stack".

Another way is to create a view (by hiding code fragments that are not among the selected colors).  Here is how this is accomplished.

  1. You must use the Colored Text Editor to view a file.  Select a file to open-->open with-->other-->Colored Text Editor

  2. You must have Feature List visible

  3. Click the CIDE icon on both the file window and the Feature List window

  4. Then select View on a Variant (the second, bottom-most possibility).

  5. Then turn off the features that you don't want to see.

The above is a bit too complicated as a set of instructions without a video.

Watch this video to accomplish the above.