The Selected menu in File Manager is active only when a file or directory is selected. The commands at the bottom of the Selected menu depend on the data type. For example, if an XWD file is selected, the Selected menu includes the items Open and Print.
The ACTIONS field in the data type definition specifies the commands added to the bottom of the data type's Selected menu.
DATA_ATTRIBUTES XWD { ACTIONS Open,Print ... }
The contents of the Selected menu depends on the data type. However, many different data types provide an Open action--that is, when you select a file of that particular data type in File Manager and display the Selected menu, you see an Open command.
The Open action usually runs the application with which the data file is associated. For example, opening an XWD file runs the Xwud action, which in turn runs the xwud X client to display the screen image. In other words, for the XWD data type, the Open action is synonymous with the Xwud action. Likewise, opening a file of data type TEXTFILE runs the Text Editor, and opening a BM (bitmap) or PM (pixmap) file runs Icon Editor.
The ability to create a variety of Open actions that do different things uses two features of action definitions:
Action mapping lets you create an action that runs another action, rather than directly running a command. For example, you can create an Open action that maps to (runs) the Xwud action.
Data-type restrictions on an action
Action definitions can include an ARG_TYPE field that limits the action to certain data types. For example, you can specify that the Open action that maps to the Xwud action applies only to files of data type XWD.
Here is the definition of the action that maps the Open action to the Xwud action for the XWD data type. It is located in the database configuration file /usr/dt/appconfig/types/C/xclients.dt.
ACTION Open { LABEL Open ARG_TYPE XWD TYPE MAP MAP_ACTION Xwud }
The TYPE field specifies that this is a map action; the MAP_ACTION field specifies this action runs the Xwud action. The ARG_TYPE field specifies that this action applies only to files whose data type is XWD.
Compare the previous definition of the Open action to the next definition, which appears in the database file /usr/dt/appconfig/types/C/dt.dt.
ACTION Open { LABEL Open ARG_TYPE BM TYPE MAP MAP_ACTION Dticon }
This definition applies to files of data type (ARG_TYPE) BM (bitmap files). The definition maps the Open action to the Dticon action, which runs Icon Editor.