Extending Rational Apex Extending Rational Apex Greg Bek Greg Bek - - PowerPoint PPT Presentation

extending rational apex extending rational apex
SMART_READER_LITE
LIVE PREVIEW

Extending Rational Apex Extending Rational Apex Greg Bek Greg Bek - - PowerPoint PPT Presentation

Extending Rational Apex Extending Rational Apex Greg Bek Greg Bek gab@rational.com gab@rational.com Rational Apex - A quick overview Rational Apex - A quick overview Rational Apex is an integrated development Rational Apex is an


slide-1
SLIDE 1

Extending Rational Apex Extending Rational Apex

Greg Bek gab@rational.com Greg Bek gab@rational.com

slide-2
SLIDE 2

Rational Apex - A quick overview Rational Apex - A quick overview

Rational Apex is an integrated development environment for Ada and mixed language applications 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

Rational Apex is an integrated development environment for Ada and mixed language applications 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

slide-3
SLIDE 3

Customizing Apex Customizing Apex

Apex can be extended or customized by a single user or an entire project 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

Apex can be extended or customized by a single user or an entire project 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

slide-4
SLIDE 4

Reference Material Reference Material

Most of the customizations described in this presentation are described in the online Apex manuals Using and Customizing the GUI

  • r

Using and Customizing Summit/CM Most of the customizations described in this presentation are described in the online Apex manuals Using and Customizing the GUI

  • r

Using and Customizing Summit/CM

slide-5
SLIDE 5

Apex Servers Apex Servers

Apex is a co-operating set of server processes, each with a specific job

Ada Server Text Server Dialog Server Directory Server etc.

To update a running Apex session with new customizations requires that the appropriate server gets shutdown The server will restart automatically next time it is needed Apex is a co-operating set of server processes, each with a specific job

Ada Server Text Server Dialog Server Directory Server etc.

To update a running Apex session with new customizations requires that the appropriate server gets shutdown The server will restart automatically next time it is needed

slide-6
SLIDE 6

Apex Servers Apex Servers

Shutdown a server from the Servers Window Navigate:Jobs Navigate:Servers Select Server and then File:Shutdown or Shutdown from pop-up Menu Shutdown a server from the Servers Window Navigate:Jobs Navigate:Servers Select Server and then File:Shutdown or Shutdown from pop-up Menu Shutdown a server from the Servers Window Navigate:Jobs Navigate:Servers Shutdown a server from the Servers Window Navigate:Jobs Navigate:Servers Shutdown a server from the Servers Window Navigate:Jobs Shutdown a server from the Servers Window Navigate:Jobs Shutdown a server from the Servers Window Shutdown a server from the Servers Window

slide-7
SLIDE 7

Apex X-defaults Apex X-defaults

Apex on UNIX is a well behaved X-windows application The application name for Apex is “Rational” In your personal .Xdefaults file all settings for Apex should be prefixed by “Rational*”

Rational*main_apex_panel*geometry: -0+100

Extensive person customizations are best stored in an application specific file

$HOME/Rational No need to prefix entries by “Rational*”

Product defaults are stored in

$APEX_HOME/app-defaults/Rational

Apex on UNIX is a well behaved X-windows application The application name for Apex is “Rational” In your personal .Xdefaults file all settings for Apex should be prefixed by “Rational*”

Rational*main_apex_panel*geometry: -0+100

Extensive person customizations are best stored in an application specific file

$HOME/Rational No need to prefix entries by “Rational*”

Product defaults are stored in

$APEX_HOME/app-defaults/Rational

slide-8
SLIDE 8

Apex X-defaults - Some favorites Apex 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

slide-9
SLIDE 9

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

*languageCommentsForeground:

  • livedrab

*languageKeywordsForeground: sienna *languageStringsForeground: Blue Disable by setting the environment variable APEX_NO_ADA_LANGUAGE_MARKS true *languageCommentsForeground:

  • livedrab

*languageKeywordsForeground: sienna *languageStringsForeground: Blue Disable by setting the environment variable APEX_NO_ADA_LANGUAGE_MARKS true

slide-10
SLIDE 10

Editor Key Bindings Editor Key Bindings

Apex editors are built using Motif Text-Widgets 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\

Apex editors are built using Motif Text-Widgets 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\

slide-11
SLIDE 11

Editor Key Bindings - My favorites Editor Key Bindings - My favorites

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\ ...

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\ ...

slide-12
SLIDE 12

Editor Key Bindings for Menu Operations Editor Key Bindings for Menu Operations

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

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

slide-13
SLIDE 13

Editor Key Bindings for Menu Operations Editor 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

slide-14
SLIDE 14

User Preferences and the GUI User Preferences and the GUI

Many of the changes made to Apex GUI windows can be saved so that they are used again next time

Information Format, Sorting Order

Use the Tools:Session menu to do this Many of the changes made to Apex GUI windows can be saved so that they are used again next time

Information Format, Sorting Order

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 type type Save object properties sets the preferences for

  • nly that particular
  • bject (file/directory)

Save object properties Save object properties sets the preferences for sets the preferences for

  • nly that particular
  • nly that particular
  • bject (file/directory)
  • bject (file/directory)
slide-15
SLIDE 15

Menus and Dialogs Menus and Dialogs

Apex menus can be customized

New Items added Items removed Items moved/renamed

Each menu item has an associated rule 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)

Apex menus can be customized

New Items added Items removed Items moved/renamed

Each menu item has an associated rule 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)

slide-16
SLIDE 16

Menu File Examples - directory_menus Menu File Examples - directory_menus

Add an entry to eject the floppy disk on Sun Solaris

append separator directory.tools append pushbutton directory.tools.ejectFD “Eject Floppy”

The corresponding rule from directory_rules

action ejectFD

  • ptions output_window title "Ejecting floppy disk"

eject floppy end_action

Add an entry to eject the floppy disk on Sun Solaris

append separator directory.tools append pushbutton directory.tools.ejectFD “Eject Floppy”

The corresponding rule from directory_rules

action ejectFD

  • ptions output_window title "Ejecting floppy disk"

eject floppy end_action

slide-17
SLIDE 17

Menu File Examples Menu File Examples

Replace File/Edit/View/Navigate menus with single letters (this from my “menus” file, so it affect every window)

replace cascade *.file F F replace cascade *.edit E E replace cascade *.view V V replace cascade *.navigate N N

Replace File/Edit/View/Navigate menus with single letters (this from my “menus” file, so it affect every window)

replace cascade *.file F F replace cascade *.edit E E replace cascade *.view V V replace cascade *.navigate N N

slide-18
SLIDE 18

Rules Files Rules Files

Contain “action” clauses that are executed when the corresponding menu item is selected 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

  • ptions No_Register Output_Window

if ($APEX_ARCH == "rs6k" || $APEX_ARCH == "rs6k_aix") then ps -ef else ps -axwwww endif end_action

Contain “action” clauses that are executed when the corresponding menu item is selected 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

  • ptions No_Register Output_Window

if ($APEX_ARCH == "rs6k" || $APEX_ARCH == "rs6k_aix") then ps -ef else ps -axwwww endif end_action

slide-19
SLIDE 19

Apex Shell Apex Shell

Apex has an integrated shell Has a debugger Based on C-shell

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

Initializes several variable based on Apex context

SELECTION, CONTEXT etc.

Used through out standard Apex rules files to implement menu actions Use to implement dialog boxes Apex has an integrated shell Has a debugger Based on C-shell

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

Initializes several variable based on Apex context

SELECTION, CONTEXT etc.

Used through out standard Apex rules files to implement menu actions Use to implement dialog boxes

slide-20
SLIDE 20

Apex Dialog Boxes Apex Dialog Boxes

Are a combination of Apex shell script and a description language for Dialog layout Using Apex shell gives access to the values of any GUI widget, selection etc. Writing dialog boxes from scratch is difficult, instead you should plagiarize (just like makefiles) Are a combination of Apex shell script and a description language for Dialog layout Using Apex shell gives access to the values of any GUI widget, selection etc. Writing dialog boxes from scratch is difficult, instead you should plagiarize (just like makefiles)

slide-21
SLIDE 21

Dialog Box Layout Dialog Box Layout

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

slide-22
SLIDE 22

Layout - from ccaseWinkIn.dlg Layout - from ccaseWinkIn.dlg

  • bjectsLabel: 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"
  • ptionForm: pack -place_box true -side top -grow false

printpreview nooverwrite recurse ccaseWinkIn: dialog -title "ClearCase Wink-In" -grow subsystems

  • allowShellResize false
  • bjectsLabel: 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"
  • ptionForm: pack -place_box true -side top -grow false

printpreview nooverwrite recurse ccaseWinkIn: dialog -title "ClearCase Wink-In" -grow subsystems

  • allowShellResize false
slide-23
SLIDE 23

Dialog Control Dialog Control

Appears after layout code Consists of a series of clauses containing Apex shell script Clauses start with % First clause must be %dialog The %prog exec clause is executed when the OK button is clicked Appears after layout code Consists of a series of clauses containing Apex shell script Clauses start with % First clause must be %dialog The %prog exec clause is executed when the OK button is clicked

slide-24
SLIDE 24

Dialog Control Dialog Control

string_array cmd cmd.add apex_display cmd.add execute cmd.add cleartool cmd.add winkin if (‘valw printpreview‘) then cmd.add "-print" endif if (‘valw nooverwrite‘) then cmd.add "-noverwrite" endif cmd.add "-adirs" cmd.add ‘proglibs.show -flat‘ cmd.execute -background string_array cmd cmd.add apex_display cmd.add execute cmd.add cleartool cmd.add winkin if (‘valw printpreview‘) then cmd.add "-print" endif if (‘valw nooverwrite‘) then cmd.add "-noverwrite" endif cmd.add "-adirs" cmd.add ‘proglibs.show -flat‘ cmd.execute -background Variable of type string_array will hold the command string we are building to run the winkin command Variable of type string_array Variable of type string_array will hold the command string we are will hold the command string we are building to run the building to run the winkin winkin command command Segments of the command being built up Segments of the command being built up Segments of the command being built up Tests for dialog checkboxes. If they have been pressed then add the appropriate

  • ption 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

  • ption to the command
  • ption to the command

Add the final command option and the actual file names to be winked-in Add the final command option and the Add the final command option and the actual file names to be winked actual file names to be winked-

  • in

in Run the command Run the command Run the command

slide-25
SLIDE 25

Configuration Management Process Configuration Management Process

When using Summit/CM with Apex you can customize the behavior of many CM actions 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

When using Summit/CM with Apex you can customize the behavior of many CM actions 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

slide-26
SLIDE 26

Configuration Management Process Configuration Management Process

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

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
slide-27
SLIDE 27

Extending CM Attributes Extending CM Attributes

You can define an extended set of attributes to be stored with versions of files Standard Attributes are:

check in timestamp check out timestamp user notes

Extended attributes can be:

strings, integers, fixed, float, date, text, string, enumerated types, path names

You can define an extended set of attributes to be stored with versions of files Standard Attributes are:

check in timestamp check out timestamp user notes

Extended attributes can be:

strings, integers, fixed, float, date, text, string, enumerated types, path names

slide-28
SLIDE 28

Extended CM Attributes Extended CM Attributes

Can be displayed in directory viewers, command line scripts etc. Use in process customizations to verify process conformance Can be displayed in directory viewers, command line scripts etc. Use in process customizations to verify process conformance

slide-29
SLIDE 29

Where To Store Customizations Where To Store Customizations

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

Individual user customizations should be kept in $HOME/.Rational 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

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

slide-30
SLIDE 30

Code Rule Checker Code Rule Checker

ASIS Based checking of coding standard 41 predefined rules Application of rules controlled by switches on a library basis Can be extended

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

ASIS Based checking of coding standard 41 predefined rules Application of rules controlled by switches on a library basis Can be extended

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