Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and...

30
Extending Rational Apex Extending Rational Apex Greg Bek [email protected] Greg Bek [email protected]

Transcript of Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and...

Page 1: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Extending Rational ApexExtending Rational Apex

Greg [email protected]

Greg [email protected]

Page 2: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Rational Apex - A quick overviewRational Apex - A quick overview

w Rational Apex is an integrated development environment for Ada and mixed language applications

w Apex includes:� High performance optimizing compiler

• Supports incremental compilation

� Integrated Configuration Management and Version Control• ClearCase

• Summit/CM

� Integrated Editor/Browser/Debugger� Extensive customization facilities

w Rational Apex is an integrated development environment for Ada and mixed language applications

w Apex includes:� High performance optimizing compiler

• Supports incremental compilation

� Integrated Configuration Management and Version Control• ClearCase

• Summit/CM

� Integrated Editor/Browser/Debugger� Extensive customization facilities

Page 3: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Customizing ApexCustomizing Apex

w Apex can be extended or customized by a single user or an entire project

w This presentation will briefly outline some of them� X-defaults� User preferences for the GUI� Menus and Dialogs� Configuration Management process� Configuration Management attributes� Code Rule Checker

w Apex can be extended or customized by a single user or an entire project

w This presentation will briefly outline some of them� X-defaults� User preferences for the GUI� Menus and Dialogs� Configuration Management process� Configuration Management attributes� Code Rule Checker

Page 4: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Reference MaterialReference Material

w Most of the customizations described in this presentation are described in the online Apex manuals

Using and Customizing the GUI

or

Using and Customizing Summit/CM

w Most of the customizations described in this presentation are described in the online Apex manuals

Using and Customizing the GUI

or

Using and Customizing Summit/CM

Page 5: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Apex ServersApex Servers

w Apex is a co-operating set of server processes, each with a specific job� Ada Server� Text Server� Dialog Server� Directory Server etc.

w To update a running Apex session with new customizations requires that the appropriate server gets shutdown

w The server will restart automatically next time it is needed

w Apex is a co-operating set of server processes, each with a specific job� Ada Server� Text Server� Dialog Server� Directory Server etc.

w To update a running Apex session with new customizations requires that the appropriate server gets shutdown

w The server will restart automatically next time it is needed

Page 6: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Apex Servers Apex Servers

w Shutdown a server from the Servers Windoww Navigate:Jobsw Navigate:Serversw Select Server and then

File:Shutdown orShutdown from pop-upMenu

w Shutdown a server from the Servers Windoww Navigate:Jobsw Navigate:Serversw Select Server and then

File:Shutdown orShutdown from pop-upMenu

w Shutdown a server from the Servers Windoww Navigate:Jobsw Navigate:Servers

w Shutdown a server from the Servers Windoww Navigate:Jobsw Navigate:Servers

w Shutdown a server from the Servers Windoww Navigate:Jobs

w Shutdown a server from the Servers Windoww Navigate:Jobsw Shutdown a server from the Servers Windoww Shutdown a server from the Servers Window

Page 7: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Apex X-defaultsApex X-defaults

w Apex on UNIX is a well behaved X-windows applicationw The application name for Apex is “Rational”w In your personal .Xdefaults file all settings for

Apex should be prefixed by “Rational*”� Rational*main_apex_panel*geometry: -0+100

w Extensive person customizations are best stored in an application specific file� $HOME/Rational

� No need to prefix entries by “Rational*”

w Product defaults are stored in� $APEX_HOME/app-defaults/Rational

w Apex on UNIX is a well behaved X-windows applicationw The application name for Apex is “Rational”w In your personal .Xdefaults file all settings for

Apex should be prefixed by “Rational*”� Rational*main_apex_panel*geometry: -0+100

w Extensive person customizations are best stored in an application specific file� $HOME/Rational

� No need to prefix entries by “Rational*”

w Product defaults are stored in� $APEX_HOME/app-defaults/Rational

Page 8: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Apex X-defaults - Some favoritesApex X-defaults - Some favorites

Rational*main_apex_panel*geometry: -0+100

Rational*jobs*geometry: -0-0

Rational.jobs*workArea*visibleItemCount: 3

Rational*jobsWindowIconify: true

Rational*output*geometry: +0-0

Rational*debugger.log*debugSource: True

Rational*XmRowColumn.TearOffModel: XmTEAR_OFF_DISABLED

Rational*main_apex_panel*geometry: -0+100

Rational*jobs*geometry: -0-0

Rational.jobs*workArea*visibleItemCount: 3

Rational*jobsWindowIconify: true

Rational*output*geometry: +0-0

Rational*debugger.log*debugSource: True

Rational*XmRowColumn.TearOffModel: XmTEAR_OFF_DISABLED

Page 9: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Apex Editor Coloring - New in Apex UNIX 4.0Apex Editor Coloring - New in Apex UNIX 4.0

*languageCommentsForeground: olivedrab

*languageKeywordsForeground: sienna

*languageStringsForeground: Blue

Disable by setting the environment variable APEX_NO_ADA_LANGUAGE_MARKS true

*languageCommentsForeground: olivedrab

*languageKeywordsForeground: sienna

*languageStringsForeground: Blue

Disable by setting the environment variable APEX_NO_ADA_LANGUAGE_MARKS true

Page 10: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Editor Key BindingsEditor Key Bindings

w Apex editors are built using Motif Text-Widgetsw Key bindings are changed through the X-defaults

� Please remember, Xdefaults are absolute, not additive� Eh? You can’t just put a single line in your X-defaults to

change a key, you must replicate the entire binding out of the product default area

*XmText.translations: #override\

Ctrl <Key><: perform(beginingOfSelection)\n\

Ctrl <Key>>: perform(endOfSelection)\n\

Ctrl Meta <Key>f: forward-word()\n\

Ctrl Alt <Key>f: forward-word()\n\

Ctrl <Key>f: forward-character()\n\

Ctrl Meta <Key>b: backward-word()\n\

w Apex editors are built using Motif Text-Widgetsw Key bindings are changed through the X-defaults

� Please remember, Xdefaults are absolute, not additive� Eh? You can’t just put a single line in your X-defaults to

change a key, you must replicate the entire binding out of the product default area

*XmText.translations: #override\

Ctrl <Key><: perform(beginingOfSelection)\n\

Ctrl <Key>>: perform(endOfSelection)\n\

Ctrl Meta <Key>f: forward-word()\n\

Ctrl Alt <Key>f: forward-word()\n\

Ctrl <Key>f: forward-character()\n\

Ctrl Meta <Key>b: backward-word()\n\

Page 11: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Editor Key Bindings - My favoritesEditor Key Bindings - My favorites

w Fix the “Delete” key to act like windows - Delete Character Right

*XmText.translations: #override\

...

<Key>Delete: delete-next-character()\n\

...

<Key>osfDelete: delete-next-character()\n\

...

w Fix the “Delete” key to act like windows - Delete Character Right

*XmText.translations: #override\

...

<Key>Delete: delete-next-character()\n\

...

<Key>osfDelete: delete-next-character()\n\

...

Page 12: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Editor Key Bindings for Menu OperationsEditor Key Bindings for Menu Operations

w Work through X-defaults as well! Bind semanticize and complete where they were on the

! R1000 rational access keymap

!

Rational*menuBar*semanticize.accelerator: Shift<Key>F9

Rational*menuBar*semanticize.acceleratorText:Shift+F9

Rational*menuBar*complete.accelerator: Shift<Key>F6

Rational*menuBar*complete.acceleratorText:Shift+F6

w Work through X-defaults as well! Bind semanticize and complete where they were on the

! R1000 rational access keymap

!

Rational*menuBar*semanticize.accelerator: Shift<Key>F9

Rational*menuBar*semanticize.acceleratorText:Shift+F9

Rational*menuBar*complete.accelerator: Shift<Key>F6

Rational*menuBar*complete.acceleratorText:Shift+F6

Page 13: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Editor Key Bindings for Menu OperationsEditor Key Bindings for Menu Operations!! Bind the normal editing operations to the block of 10

keys

!! on the left of a sun keyboard

!!

Rational*menuBar*cut.accelerator: <Key>F20

Rational*menuBar*cut.acceleratorText: Cut

Rational*menuBar*paste.accelerator: <Key>F18

Rational*menuBar*paste.acceleratorText: Paste

Rational*menuBar*copy.accelerator: <Key>F16

Rational*menuBar*copy.acceleratorText: Copy

Rational*menuBar*undo.accelerator: <Key>F14

Rational*menuBar*undo.acceleratorText: Undo

Rational*menuBar*redo.accelerator: Shift<Key>F14

Rational*menuBar*redo.acceleratorText: Shift+Undo

!! Bind the normal editing operations to the block of 10 keys

!! on the left of a sun keyboard

!!

Rational*menuBar*cut.accelerator: <Key>F20

Rational*menuBar*cut.acceleratorText: Cut

Rational*menuBar*paste.accelerator: <Key>F18

Rational*menuBar*paste.acceleratorText: Paste

Rational*menuBar*copy.accelerator: <Key>F16

Rational*menuBar*copy.acceleratorText: Copy

Rational*menuBar*undo.accelerator: <Key>F14

Rational*menuBar*undo.acceleratorText: Undo

Rational*menuBar*redo.accelerator: Shift<Key>F14

Rational*menuBar*redo.acceleratorText: Shift+Undo

Page 14: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

User Preferences and the GUIUser Preferences and the GUI

w Many of the changes made to Apex GUI windows can be saved so that they are used again next time� Information Format, Sorting Order

w Use the Tools:Session menu to do this

w Many of the changes made to Apex GUI windows can be saved so that they are used again next time� Information Format, Sorting Order

w Use the Tools:Session menu to do this

Save window properties sets the preferences for all windows of the same type

Save window properties Save window properties sets the preferences for sets the preferences for all windows of the same all windows of the same typetype

Save object properties sets the preferences for only that particular object (file/directory)

Save object properties Save object properties sets the preferences for sets the preferences for only that particular only that particular object (file/directory)object (file/directory)

Page 15: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Menus and DialogsMenus and Dialogs

w Apex menus can be customized� New Items added� Items removed� Items moved/renamed

w Each menu item has an associated rulew Personal customizations are store in $HOME/.Rational

� <server_>menus� <server_>rules� Where <server_> can be “ada_”, “directory_”, “text_” or “”

(null - which apply to all window kinds)

w Apex menus can be customized� New Items added� Items removed� Items moved/renamed

w Each menu item has an associated rulew Personal customizations are store in $HOME/.Rational

� <server_>menus� <server_>rules� Where <server_> can be “ada_”, “directory_”, “text_” or “”

(null - which apply to all window kinds)

Page 16: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Menu File Examples - directory_menusMenu File Examples - directory_menus

w Add an entry to eject the floppy disk on Sun Solarisappend separator directory.toolsappend pushbutton directory.tools.ejectFD “Eject Floppy”

w The corresponding rule from directory_rulesaction ejectFD

options output_window title "Ejecting floppy disk"eject floppy

end_action

w Add an entry to eject the floppy disk on Sun Solarisappend separator directory.toolsappend pushbutton directory.tools.ejectFD “Eject Floppy”

w The corresponding rule from directory_rulesaction ejectFD

options output_window title "Ejecting floppy disk"eject floppy

end_action

Page 17: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Menu File ExamplesMenu File Examples

w Replace File/Edit/View/Navigate menus with single letters (this from my “menus” file, so it affect every window)replace cascade *.file F Freplace cascade *.edit E Ereplace cascade *.view V Vreplace cascade *.navigate N N

w Replace File/Edit/View/Navigate menus with single letters (this from my “menus” file, so it affect every window)replace cascade *.file F Freplace cascade *.edit E Ereplace cascade *.view V Vreplace cascade *.navigate N N

Page 18: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Rules FilesRules Files

w Contain “action” clauses that are executed when the corresponding menu item is selected

w Action clauses are shell scripts (default is sh) with the first line treated specially (it may specify certain options like which shell to use)

action machinesPsAll

options No_Register Output_Window

if ($APEX_ARCH == "rs6k" || $APEX_ARCH == "rs6k_aix") thenps -ef

else

ps -axwwww

endif

end_action

w Contain “action” clauses that are executed when the corresponding menu item is selected

w Action clauses are shell scripts (default is sh) with the first line treated specially (it may specify certain options like which shell to use)

action machinesPsAll

options No_Register Output_Window

if ($APEX_ARCH == "rs6k" || $APEX_ARCH == "rs6k_aix") thenps -ef

else

ps -axwwww

endif

end_action

Page 19: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Apex ShellApex Shell

w Apex has an integrated shellw Has a debuggerw Based on C-shell

� extended variety of types available that match Apex objects� Object Oriented style of function call for objects

w Initializes several variable based on Apex context� SELECTION, CONTEXT etc.

w Used through out standard Apex rules files to implement menu actions

w Use to implement dialog boxes

w Apex has an integrated shellw Has a debuggerw Based on C-shell

� extended variety of types available that match Apex objects� Object Oriented style of function call for objects

w Initializes several variable based on Apex context� SELECTION, CONTEXT etc.

w Used through out standard Apex rules files to implement menu actions

w Use to implement dialog boxes

Page 20: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Apex Dialog BoxesApex Dialog Boxes

w Are a combination of Apex shell script and a description language for Dialog layout

w Using Apex shell gives access to the values of any GUI widget, selection etc.

w Writing dialog boxes from scratch is difficult, instead you should plagiarize (just like makefiles)

w Are a combination of Apex shell script and a description language for Dialog layout

w Using Apex shell gives access to the values of any GUI widget, selection etc.

w Writing dialog boxes from scratch is difficult, instead you should plagiarize (just like makefiles)

Page 21: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Dialog Box LayoutDialog Box Layout

w This example shows the ClearCase Wink-In dialog from Apex 4.0

w This example shows the ClearCase Wink-In dialog from Apex 4.0

Page 22: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Layout - from ccaseWinkIn.dlgLayout - from ccaseWinkIn.dlgobjectsLabel: label -label "Subsystems:"subsystems: file_list

printpreview: toggle_button-label "Effort Only"

nooverwrite: toggle_button-label "Don’t overwrite derived objects created in this view"

recurse: toggle_button-label "Wink-in import closure"

optionForm: pack -place_box true -side top -grow falseprintpreview nooverwrite recurse

ccaseWinkIn: dialog -title "ClearCase Wink-In" -grow subsystems-allowShellResize false

objectsLabel: label -label "Subsystems:"subsystems: file_list

printpreview: toggle_button-label "Effort Only"

nooverwrite: toggle_button-label "Don’t overwrite derived objects created in this view"

recurse: toggle_button-label "Wink-in import closure"

optionForm: pack -place_box true -side top -grow falseprintpreview nooverwrite recurse

ccaseWinkIn: dialog -title "ClearCase Wink-In" -grow subsystems-allowShellResize false

Page 23: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Dialog ControlDialog Control

w Appears after layout codew Consists of a series of clauses containing Apex shell

scriptw Clauses start with %w First clause must be %dialogw The %prog exec clause is executed when the OK button

is clicked

w Appears after layout codew Consists of a series of clauses containing Apex shell

scriptw Clauses start with %w First clause must be %dialogw The %prog exec clause is executed when the OK button

is clicked

Page 24: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Dialog Control Dialog Control string_array cmd

cmd.add apex_displaycmd.add executecmd.add cleartoolcmd.add winkin

if (‘ valw printpreview‘ ) thencmd.add "-print"

endif

if (‘ valw nooverwrite‘ ) thencmd.add "-noverwrite"

endif

cmd.add "-adirs"

cmd.add ‘proglibs.show -flat‘

cmd.execute -background

string_array cmd

cmd.add apex_displaycmd.add executecmd.add cleartoolcmd.add winkin

if (‘ valw printpreview‘ ) thencmd.add "-print"

endif

if (‘ valw nooverwrite‘ ) thencmd.add "-noverwrite"

endif

cmd.add "-adirs"

cmd.add ‘proglibs.show -flat‘

cmd.execute -background

Variable of type string_arraywill hold the command string we are building to run the winkin command

Variable of type string_arrayVariable of type string_arraywill hold the command string we are will hold the command string we are building to run the building to run the winkin winkin commandcommand

Segments of the command being built upSegments of the command being built upSegments of the command being built up

Tests for dialog checkboxes. If they have been pressed then add the appropriate option to the command

Tests for dialog checkboxes. If they have Tests for dialog checkboxes. If they have been pressed then add the appropriate been pressed then add the appropriate option to the commandoption to the command

Add the final command option and the actual file names to be winked-inAdd the final command option and the Add the final command option and the actual file names to be winkedactual file names to be winked--inin

Run the commandRun the commandRun the command

Page 25: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Configuration Management ProcessConfiguration Management Process

w When using Summit/CM with Apex you can customize the behavior of many CM actions

w Pre_* rules to verify permission or to check argument validity� pre_[private_]checkout

• local authentication, process enforcement

� pre_checkin• verify that test records exist for files being checked in

• run code rule checker

� pre_create_version

w When using Summit/CM with Apex you can customize the behavior of many CM actions

w Pre_* rules to verify permission or to check argument validity� pre_[private_]checkout

• local authentication, process enforcement

� pre_checkin• verify that test records exist for files being checked in

• run code rule checker

� pre_create_version

Page 26: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Configuration Management Process Configuration Management Process

w Post_* rules to perform tidy up or security� post_checkout

• Alter file system permissions -- carefully!!

� post_check_in• Register with change management tool

� post_create_view• Establish testing environment for unit

w Post_* rules to perform tidy up or security� post_checkout

• Alter file system permissions -- carefully!!

� post_check_in• Register with change management tool

� post_create_view• Establish testing environment for unit

Page 27: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Extending CM AttributesExtending CM Attributes

w You can define an extended set of attributes to be stored with versions of files

w Standard Attributes are:� check in timestamp� check out timestamp� user� notes

w Extended attributes can be:� strings, integers, fixed, float, date, text, string, enumerated

types, path names

w You can define an extended set of attributes to be stored with versions of files

w Standard Attributes are:� check in timestamp� check out timestamp� user� notes

w Extended attributes can be:� strings, integers, fixed, float, date, text, string, enumerated

types, path names

Page 28: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Extended CM AttributesExtended CM Attributes

w Can be displayed in directory viewers, command line scripts etc.

w Use in process customizations to verify process conformance

w Can be displayed in directory viewers, command line scripts etc.

w Use in process customizations to verify process conformance

Page 29: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Where To Store CustomizationsWhere To Store Customizations

w For a project wide customization put them in the APEX_LOCAL_DIR� $APEX_LOCAL_DIR/dialogs -- for dialog files� $APEX_LOCAL_DIR/editor_files -- for menus and rules

w Individual user customizations should be kept in $HOME/.Rational

w For a project wide customization put them in the APEX_LOCAL_DIR� $APEX_LOCAL_DIR/dialogs -- for dialog files� $APEX_LOCAL_DIR/editor_files -- for menus and rules

w Individual user customizations should be kept in $HOME/.Rational

Page 30: Extending Rational Apex - Ada · presentation are described in the online Apex manuals Using and Customizing the GUI or Using and Customizing Summit/CM Apex ServersApex Servers w

Code Rule CheckerCode Rule Checker

w ASIS Based checking of coding standardw 41 predefined rulesw Application of rules controlled by switches on a library

basisw Can be extended

� Write a subprogram that takes an ASIS.Element and return an indication whether a rule applies or not

w ASIS Based checking of coding standardw 41 predefined rulesw Application of rules controlled by switches on a library

basisw Can be extended

� Write a subprogram that takes an ASIS.Element and return an indication whether a rule applies or not