Contents

Preface

Audience
Other Resources
Related Documentation
File Names
Contacting Rational Technical Publications
Contacting Rational Technical Support

Basic Extensibility Concepts

Contents
Rational Rose Extensibility
The REI Model and Rose Extensibility
Rose Scripting
Rose Automation
Rose Add-In Manager
Default Properties and Property Sets
Rose Extensibility Type Libraries

Customizing Rational Rose Menus

Contents
Extending Rational Rose Menus
Customizing Rose Main Menus
Procedure
Adding Entries to a Rose Menu File

Menu File Keywords 9

Menu Actions 10

Menu File Variables and Modifiers 11

Syntax Rules for Rose Menu File Entries
Adding Scripts to a Rose Menu
Adding or Editing the Virtual Path for Scripts
Sample Rose Menu File
Customizing Rose Shortcut Menus
Benefits
Limitations
Key Terms and Concepts

Language-Dependent 20

Language-Neutral 21

Language Add-In 21

Non-Language Add-In 22

Behind the Scenes of Shortcut Menus
How Rose Formats and Displays Shortcut Menu Items
Shortcut Menu Scenarios
Shortcut Menu Design Considerations
Procedure
Adding Menu Items to the Shortcut Menu
Working with Shortcut Menu Items
Working with the Shortcut Menu Item Collection
Editing Shortcut Menu Items
Changing the State of a Shortcut Menu Item
Sample Shortcut Menu Implementation Code
Sample Rose Script Shortcut Menu Code

Using the REI to Work with Rational Rose

Contents
Introduction
Getting the Rose Application Object
Using Rose Script
Using Rose Automation
Associating Files and URLs with Classes
Managing Default Properties
Adding a Property to a Set
How To
Example
Notes on the Example
Creating a New Property
How To
Example
Notes on the Example
Deleting Model Properties
Getting Model Properties
Setting Model Properties
Setting Model Properties Using OverrideProperty

How To 42

Example 42

Notes on the Example 42

Setting Model Properties Using InheritProperty

How To 43

Example 43

Notes on the Example 43

Creating a New Property Set
Cloning a Property Set
How To
Example
Notes on the Example
Deleting a Property Set
How To
Example
Notes on the Example
Getting and Setting the Current Property Set
How To
Example
Notes on the Example
Creating a User-Defined Property Type
How To
Example
Notes on the Example
Creating a New Tool
Placing Classes in Categories
Using Type Libraries for Rose Automation
How To
Example
Working with Controllable Units
Working with Rose Diagrams
Getting an Element from a Collection
Accessing Collection Elements by Count

How To 51

Example 51

Accessing Collection Elements by Unique ID

How To 51

Example 52

Accessing Collection Elements by Name

How To 52

Example 52

Using the Rational Rose Script Editor

Contents
The Rose Script Editor
The Script Editor Window
Opening a Script
Creating New Rose Scripts
Creating a New Script from Scratch
Creating a New Script from an Existing Script
Selecting a Font for the Script Editor
Moving the Insertion Point in a Script
Moving the Insertion Point with the Mouse
Moving the Insertion Point to a Specified Line in Your Script
Selecting Text
Selecting Text with the Mouse
Selecting Text with the Keyboard
Selecting an Entire Line
Deleting, Cutting, Copying, and Pasting Text
Deleting Text
Cutting a Selection
Copying a Selection
Pasting the Contents of the Clipboard into Your Script
Adding Comments to a Script
Adding a Full-Line Comment
Adding a Comment at the End of a Line of Code
Finding and Replacing Text
Finding Specified Text
Replacing Specified Text
Running, Pausing, and Stopping Your Script
Running Your Script
Pausing an Executing Script
Stopping an Executing Script
Tracing Script Execution
Stepping Through Your Script
Displaying the Calls Dialog Box
Setting and Removing Breakpoints
Starting Debugging Partway Through a Script
Continuing Debugging at a Line Outside the Current Subroutine
Debugging Selected Portions of Your Script
Removing a Single Breakpoint Manually
Removing All Breakpoints Manually
Working with Watch Variables
Adding Watch Variables
Selecting Variables on the Watch List
Deleting Watch Variables
Modifying the Value of Variables on the Watch Variable List
Compiling Your Script
Using Interscript Calls
Guidelines for Using a Script to Call Another Script
Debugging Interscript Calls
Working with the Dialog Editor
Inserting a Dialog Box into Your Script
Editing an Existing Dialog Box
Displaying and Adjusting the Grid
Changing Titles and Labels
Assigning Accelerator Keys
Capturing Standard Windows Dialog Boxes
Testing Your Dialog Boxes
Incorporating Dialog Boxes or Controls into Your Script
Selecting Controls
Selecting Dialog Boxes
Repositioning Items

Repositioning Items with the Mouse 77

Repositioning Items with the Arrow Keys 77

Repositioning Dialog Boxes with the Dialog Information Dialog Box 77

Repositioning Controls with the Dialog Information Dialog Box 78

Resizing Items

Resizing Items with the Mouse 78

Resizing Items with the Information Dialog Box 78

Resizing Selected Items Automatically 79

Adding Controls
Duplicating Controls
Adding Pictures to a Dialog Box

Adding Pictures from Files 80

Adding Pictures from Picture Libraries 81

Pasting Items into Dialog Editor

Pasting Existing Dialog Boxes into the Dialog Editor 81

Pasting Controls from Existing Dialog Boxes into the Dialog Editor 82

Displaying the Information Dialog Boxes

Displaying the Information Dialog Boxes for Dialog Boxes 82

Attributes You Can Adjust with the Dialog Box Information Dialog Box 83

Displaying the Information Dialog Boxes for Controls 83

Attributes You Can Adjust with the Information Dialog Boxes for Controls 84

Rational Rose Script Editor Shortcuts

Contents
General Shortcuts
Navigating Shortcuts
Editing Shortcuts
Debugging Shortcuts
File Menu Shortcuts
Edit Menu Shortcuts
Debugger Menu Shortcuts

Developing Add-Ins for Rational Rose

Contents
Introduction
Why Create Add-Ins?
Types of Add-Ins
What Is in an Add-In?
Main Menus
Shortcut Menu
Custom Specifications
Properties
Data Types
Stereotypes
Online Help
Context-sensitive Help
Registering for Events
Functionality
UNIX vs. Windows
Creating Portable Add-Ins
How to Develop Add-Ins
Customizing Main Menus
Customizing the Shortcut Menu
Creating Custom Specifications
Customizing Properties

Design Considerations 103

Information in Property Files 104

Format for Property Files 105

Sample Property File 109

Creating Property Files 110

Testing Property Files 110

Customizing Data Types
Customizing Stereotypes

Steps for Creating Add-In Stereotypes 112

Additional Online Help

Adding Online Help for Your Add-In 116

Additional Context-sensitive Help

Main Menu Items 117

Model Properties 118

User Manuals
Registering for Events

Interface vs. Script Events 119

What Events Are Available? 119

How to Add Events to Your Add-In 120

Updating the Registry

Registry Entries 123

Registering Custom Stereotypes 125

Updating the Registry During Installation 125

Registry File Anatomy 126

Installing, Setting Up, and Uninstalling Your Add-In

Installation Reminders 127

Installing Add-Ins 128

Uninstalling Add-Ins 128

Activating and Deactivating Add-Ins

Index