Class and Interface Context Menus

All of the UML diagram elements share common context menu commands. To use the context menu for an element, simply right click on the element in the Diagram view. To view the common context menu commands, see Common Element Context Commands.

The context menu for the class and interface elements share the common element context commands as well as the following commands specific to both:

New

The New command for the class or interface element offers a submenu with the following options:

Attribute

Selecting Attribute from the submenu adds an attribute to the class or interface.

Operation

Selecting Operation from the submenu adds an operation to the class or interface.

Constructor

Selecting Constructor from the submenu adds a constructor to the class or interface.

Property

Selecting Property from the submenu adds a property to the class or interface.

Inner Class

Selecting Inner Class from the submenu adds an inner class to the class or interface.

Inner Interface

Selecting Inner Interface from the submenu adds an inner interface to the class or interface.

Open

Selecting Open from the context menu, opens the selected class or interface in the text editor.

Open Type Hierarchy

The Open Type Hierarchy command highlights the node selected in the Hierarchy view. The Hierarchy view will expand and highlight that element in the tree-view. If closed, the Hierarchy view will open.

Show in Packages View

The Show in Packages View command highlights the node selected in the Packages tree-view. The Packages view will expand and highlight that element in the tree-view. If closed, the Packages view will open.

Show in UML Explorer

The Show in UML Explorer View command highlights the node selected in the UML Explorer tree-view. The UML Explorer view will expand and highlight that element in the tree-view. If closed, this view will open.

Add linked

The Add Linked dialog is opened from the class and interface context menus. It is available for class and package diagrams, and provides search options for references, implementations, and inheritance according to the specified types and scopes. The search is applicable to a single object or to a group of selected objects. For more information, see Using Add Linked.

Modifiers

The Modifiers command for the class element offers a submenu with the following options:

Public

Selecting Public from the submenu sets the visibility property for the class or interface to public.

Package Local

Selecting Package Local from the submenu sets the visibility property for the class or interface to package local.

Abstract

Selecting Abstract from the context menu sets the abstract property for the class or interface. For more information, see Editing Classes and Interfaces.

Final

Selecting Final from the context menu sets the final property for the class or interface.

For more information, see Editing Classes and Interfaces.

Override Methods

The Override Methods command displays the Override Methods dialog box:

Within this dialog, you can choose which methods you wish to implement for a class. Select the methods that you wish to add to the class, and press OK. This is especially helpful when inheriting methods from an interface that the class implements.

Quality Assurance

The Quality Assurance command for the class element offers a submenu with the following options:

Audit

Selecting Audit from the submenu processes audits for only the selected class or interface. For more information, see Running Audits.

Metrics

Selecting Metrics from the submenu processes metrics for only the selected class or interface. For more information, see Running Metrics.

Load Metric Results

Once you've run metrics on a project or part of a project, you can save those metric results and view them whenever you like. Use this command to load a set of metrics results. For more information, see Saving/Loading Metrics Results.

Add Constructors from Superclass

Selecting this command from the context menu will add constructors from the superclass of the selected class.

Apply Pattern

Selecting Apply Pattern launches the Apply Pattern dialog displaying the available patterns. From the resulting dialog, select the pattern you want for the new class. Invoking Choose Pattern enables refactoring of the class according to the specific pattern. For more information, see Using Class By Pattern.

Save As Pattern

Selecting the Save As Pattern command displays the Create Template dialog allowing you to save the class or interface as a template.

Add Bookmark

Bookmarks allow you to navigate to resources that are frequently used. You can set, remove, and view bookmarks using the Bookmarks view.

References

The References command for the class diagram offers a submenu with the following options:

Workspace

By selecting Workspace from the submenu, you can search the entire workbench for references to the element.

Hierarchy

By selecting Hierarchy from the submenu, you can search the Hierarchy view for references to the element.

Working Set

By selecting Working Set from the submenu, the Select Working Sets dialog displays. From this dialog, you can select which working sets to search.

Declarations

The Declarations command for the class or interface offers a submenu with the following options:

Workspace

By selecting Workspace from the submenu, you can search the entire workbench for declarations of the element.

Hierarchy

By selecting Hierarchy from the submenu, you can search the Hierarchy view for references to the element.

Working Set

By selecting Working Set from the submenu, the Select Working Sets dialog displays. From this dialog, you can select which working sets to search.

Hide / Show

The Hide / Show command for a class (or interface) element offers a submenu with the following options:

Attributes

Selecting Attributes from the submenu hides only the attributes of the class. The Hide / Show command for Attributes works as a toggle. To redisplay hidden attributes, right click the class where the attributes are hidden, and select Hide / Show > Attributes from the context menu.

Operations

Selecting Operations from the submenu hides only the operations of the class. The Hide / Show command for Operations works as a toggle. To redisplay hidden operations, right click the class where the operations are hidden, and select Hide / Show > Operations from the context menu.

Properties

Selecting Properties from the submenu hides only the properties of the class. The Hide / Show command for Properties works as a toggle. To redisplay hidden properties, right click the class where the properties are hidden, and select Hide / Show > Properties from the context menu.

Inner Classes

Selecting Inner Classes from the submenu hides only the inner classes of the class. The Hide / Show command for Inner Classes works as a toggle. To redisplay a hidden inner class, right click on the class where it was hidden, and select Hide / Show > Inner Classes from the context menu.

Inner Interfaces

Selecting Inner Interfaces from the submenu hides only inner interfaces of the class. The Hide / Show command for Inner Interfaces works as a toggle. To redisplay a hidden inner interface, right click on the class where it was hidden, and select Hide / Show > Inner Interfaces from the context menu.

All

Selecting All from the submenu hides attributes, operations, properties, inner classes, and inner interfaces of the class. The Hide / Show command for All works as a toggle. To redisplay hidden class elements, right click the class where the elements are hidden, and select Hide / Show > All from the context menu.

Hide

The Hide command hides the class, so that it does not show in the Diagram view. To show classes hidden from using the Hide command, right click on the diagram background, and select Hide/Show.

Compare With

Use Compare With to compare the resources in the Workbench with the resources held within the repository. The Compare With command offers a submenu with the following options:

Each Other

Using the Each Other command simply compares two files. Select two diagrams in the UML Navigator view by using CTRL+Click, then invoke Compare With > Each Other.

Local History

Use this command to compare resources with local edit history. A local history for a file is kept when you create or modify a file.

Patch

Using a patch allows you to share work with other team members without storing it in a repository. Use the Patch command to access this type of resource.

Replace With

Use Replace With to replace Workbench resources with versions in the repository. The Replace With command offers a submenu with the following options:

Local History

Use the Local History command to revert to the local history of a file.

Previous From Local History

Each time that you edit a file, a copy of the file is saved in local history. You can use the Previous From Local History command to restore a file to its previous state.