Setting perspective customization with Oomph

You can install DevOps Model RealTime with Eclipse Oomph (a.k.a. the Eclipse installer), which provides the ability to easily deploy the Model RealTime version to multiple users. Workspace preferences can be set using Oomph preference tasks. Starting with Eclipse Mars.2, you can introduce perspective customization using the same mechanism as for preferences.

Consider a scenario where some UI definitions in Model RealTime need to be hidden and you want to make this layout the default for multiple users.

The recommended way to hide or show menu contributions and toolbars in Eclipse is to introduce a perspective customization. Select Window - Perspective - Customize Perspective.

In the customization dialog, select items that you want to show or hide.

After making the selections, save your customization as a new (or redefined) perspective: Select Windows - Perspective - Save Perspective As. In Eclipse you can export your customization as a normal workspace preference: Select File - Export - Preferences to export preferences to an .epf file. The next time you want to use this layout, import the preference file (.epf) containing the perspective customization. If you want to share this customization with multiple users during installation, you need to define the Preference Task for the Oomph setup file.

To define the Preference Task, open the Oomph setup file editor for the Model RealTime product and create a new preference task with the following fields: Key: /instance/org.eclipse.ui.workbench/UMLDevelopment1e4persp

Perspective ID: Copied from the .epf file

Value:

<xml version="1.0" encoding="ASCII"?>
<advanced:Perspective xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:advanced="http://www.eclipse.org/ui/2010/UIModel/application/ui/advanced" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmi:id="_QqNxMAV8EeaJTOvmVSjMzg" elementId="com.ibm.xtools.umldt.ui.internal.perspectives.UMLDevelopmentPerspective.UMLDevelopment_customized" selectedElement="_QqNxMQV8EeaJTOvmVSjMzg" label="UMLDevelopment_customized" ...
</advanced:Perspective>

The XML definition for the perspective is copied from the .epf file and converted to clear XML format (the definition in the .epf might contain additional \n\r characters, which need to be removed).

Now the customized perspective becomes active when you first launch Model RealTime. Read more about Oomph preference tasks in this article.