![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Object to Object DropsA number of the object to object drops have already been mentioned in examples like accept_changes and file copy/move. In this section, we will review some of the other less obvious cases where drag-and-drop can be used effectively.
Grep
There is a convenient interface to the Unix grep tool. Dropping a text string on a file or a group of files or on a directory or view or group of views or on a configuration, does the Apex grep command of that text string in the given contexts. If matches are found in multiple files, a summary window is produced.
If a text object is dropped on a single line representing a file in a directory window and there are matches, the file is visited in the editor with color highlights placed on the matches. For example, a file is displayed in an Apex editor and you're interested in finding all occurrences of some word, name, function name, etc., in the enclosing directory. Place a Motif selection on the item of interest, drag the text and drop it on the menu bar of the enclosing directory window. Grep will be automatically run for that item in all files in the directory.
If you are in the Apex file or language editor and two windows are displayed on the screen, dropping a text string dragged from one onto the menu bar of the other highlights all occurrences of that text in the second file. This uses the usual editor (case insensitive) highlighting mechanisms. The text can also be dropped on the menu bar of the same window to get the effect of the Edit > Highlight menu item.
Show Usage
By exact analogy with the way it's done with grep, the show usage command can be directly executed using drag-and-drop. To do this one needs to drag something of type ada_item or c++_item and drop it on files, views etc.
There are two ways to create an ada_item or a c++_item object from the declaration under the cursor in the language editor. One is to use the menu item Tools > Hold Set > Hold Ada or Tools > Hold_Set > Hold_C++ which places an ada_item or a c++_item in the hold set which can then be dragged.
A second way is to drag the declaration directly. To do this, place the text cursor on the declaration of interest and move the mouse cursor to the blank area at the end of the button bar. Start the drag from there. The object dragged is the ada_item or c++_item at the text cursor. Drop the dragged item onto a group of selected files or onto a view or group of selected views in any directory-type window or onto the menu bar of some other unit and show usage will be run of that item in the target context(s) you dropped on.
Switch Object
One of the object types in Apex is a switch object. Dropping a switch object on a Switches file sets that switch in the file. Dropping a switch object on a view sets the switch in the associated Switches file. Dropping a switch object on a group of views or a configuration sets it in all the views.
There are several ways to get a switch object as a drag source.
- The Compare Switches command produces a summary window most of whose lines are switch objects.
- A switch file can be expanded in-place in a directory window. To do this, select a line representing a view or any object in a view, or, if the window is a view no selection is needed. Then do Shift Control > Show > Switches (Apex/Summit). This places switch object lines directly in the directory window. These can be used as drag sources. To remove these lines from the display use View > Elide.
- In the text editor on a Switches file, there is a menu item called Tools > Hold Set > Hold Switch. It places the switch at the text cursor into the hold set.
- One can also directly drag the switch at the text cursor using the surrogate button bar drag method described above.
History
To change the default history of a view, drop a history object on the view.
To change the history of a controlled file, drop a history object on the file.
The histories of a subsystem can be shown in place in a directory window by doing Shift Control > Show > Histories (Apex/Summit). The lines shown there or in the separate Histories window or in dialog boxes can serve as drag sources.
To remodel a view, drop a model object on the view.
Compare
To compare two files, do Shift drag-and-drop of one file onto the other.
To compare two versions, drop one version object onto the other.
To set the version of a file to be the same as some given version, do Shift drag-and-drop of the version object onto the file.
Add
To add a view to another view's imports set, bring up the Imports window, drag the new view(s) to be imported, and drop them on one of the blank lines in the Imports window. If the view you want to add is already in the closure imports of the target view, just drag it from there.
To add a file to an export_set, bring up the Exports window and drop the file onto an export_set line in that window.
To run an executable which takes filename arguments, drop the filenames on the line for the executable file in a directory window.
Dropping an executable file on the menu bar of the debugger starts the debugger on that program.
Queue
Dragging a job from the Job Queue window or Job History window and dropping it on the Jobs window runs that job. Dropping a directory on queued job causes the job to run with that directory as its context. Dropping a machine on a queued job causes the job to run on that machine. Dropping a command_server on a queued job causes the job to run on the machine of the command_server.
Dragging a running or queued job and dropping it on a queued job adds the source job as a prerequisite of the queued job.
Rational Software Corporation http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |