Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
12.  Creating Actions Manually Creating an Action Manually: General Steps Specifying the Icon Image Used by an Action  Previous   Contents   Next 
   
 

To Modify an Existing Action Definition

You can modify any of the actions available on your system, including built-in actions.


Note - Use caution when modifying the built-in action database. The built-in actions are designed to work well with the desktop applications.


  1. Locate the definition of the action you want to modify.

    The default locations for action definitions are:

    • Built-in actions: /usr/dt/appconfig/types/language

    • System-wide actions: /etc/dt/appconfig/types/language

    • Personal actions: HomeDirectory/.dt/types

      Your system might include additional locations. To see a list of the locations your system uses for actions, type the command:

      	dtsearchpath -v

      Your system uses the directories listed under DTDATABASESEARCHPATH.

  2. If necessary, copy the text of the action definition to a new or existing file in one of these directories:

    • System-wide actions: /etc/dt/appconfig/types/language

    • Personal actions: HomeDirectory/.dt/types

      You must copy built-in actions, since you should not edit files in the /usr/dt/appconfig/types/language directory.

  3. Edit the action definition.

  4. When you are done editing, save the file.

  5. Double-click Reload Actions in the Desktop_Tools application group.

Precedence in Action Definitions

When the user invokes an action, the system searches the database for a matching action name. When more than one action exists with that name, the system uses precedence rules to decide which one to use.

  • If no other precedence rules apply, the precedence is based on the location of the definition. The following list is ordered from higher to lower precedence:

    • Personal actions (HomeDirectory/.dt/types)

    • System-wide local actions (/etc/dt/appconfig/types/language)

    • System-wide remote actions (hostname:/etc/dt/appconfig/types/language). The remote hosts searched are those listed in the application search path.

    • Built-in actions (/usr/dt/appconfig/types/language)

  • Within a given directory, the *.dt files are read in alphabetical order.

  • Actions restricted by ARG_CLASS, ARG_TYPE, ARG_MODE, or ARG_COUNT have precedence over unrestricted actions. (The default for these four fields is *.)

    Where more than one restriction applies, the precedence order from high to low is:

    • ARG_CLASS

    • ARG_TYPE

    • ARG_MODE

    • ARG_COUNT

      Where more than one restricted ARG_COUNT exists, the precedence order from high to low is:

    • Specific integer value n

    • <n

    • >n

    • *

    For example, consider the following portions of action definitions:

    ACTION EditGraphics
     # EditGraphics-1
     {
     	ARG_TYPE				XWD
     	...
     }
     
    ACTION EditGraphics
     # EditGraphics-2
     {
     	ARG_COUNT  				0
     	...
     }
     
    ACTION EditGraphics
     # EditGraphics-3
     {
     	ARG_TYPE  		*
         ...
     }

    Double-clicking the EditGraphics action icon starts EditGraphics-2 because no argument is provided and ARG_COUNT 0 has precedence. When an XWD-type file argument is provided, EditGraphics-1 is used because it specified the XWD ARG_TYPE. EditGraphics-3 is used for all other file arguments.

 
 
 
  Previous   Contents   Next