Java Desktop System Release 3 User Guide

Configuring File Associations

To access the File Associations preference tool, click Launch, then choose Preferences -> Desktop Preferences -> File Associations.

Use the File Associations preference tool to configure the following:

File types

You can specify how files of various types are displayed and edited. For example, you can specify an icon to represent a particular type of file. Also, you can specify that if a file is a plain text file, the file is launched in a text editor.

The file manager and other desktop applications check the contents of a file to determine the type of a file. If the first lines do not determine the type of the file, then the application checks the filename.

Services

A Uniform Resource Identifier (URI) is a string that identifies a particular location in a file system or on the Web. For example, the web address of a web page is a URI. A service is a protocol or task that a URI requests. For example, the http://www.gnome.org URI requests the http service.

You can associate an application with a service, so that the application performs the task required by the service. For example, you can associate your preferred web browser with the http service.

Table 7–5 describes the preferences in the File Associations preference tool.

Table 7–5 File Associations Preference Tool

Dialog Element 

Description 

Table 

To view the contents of a category of file types, click on the right arrow next to the category name. The category expands, and displays a description of each file type, and the file extension that is associated with the file type.  

To select a file type, click on the file type. 

Add File Type

Click on this button to add a file type. For more information, see To Add a File Type.

Add Service

Click on this button to add a service. For more information, see To Add a Service.

Edit

To edit a file type, a service, or a file type category, select the item that you want to edit, then click Edit.

Remove

To remove a file type or a service, select the item that you want to remove, then click Remove.

To Add a File Type

Perform the following steps:

  1. Start the File Associations preference tool.

  2. Click on the Add File Type button.

  3. Enter the properties of the file type in the Add File Type dialog.

    The following table describes the dialog elements of the Add File Type dialog:

    Dialog Element 

    Description 

    No Icon

    Choose an icon to represent the file type. To choose an icon, click on the No Icon button. An icon selector dialog is displayed. Choose an icon from the dialog. Alternatively, to choose an icon from another directory, click Browse. When you choose an icon, click OK.

    Description

    Enter a description of the file type. 

    MIME type

    Enter the MIME type for this type of file.  

    Category

    Enter the category to which you want the file type to belong in this preference tool. Click on Choose to choose a category from the Choose a file category dialog, then click OK.

    Filename extensions

    Enter the file extensions to associate with the file type. Enter a file extension in the field on the left side, then press Return. To remove a file extension, select the file extension in the field on the right side, then click on the Remove button.

    Viewer component

    Use the drop-down list to select the viewer component to display files of this type in the file manager. 

    Default action

    Use the drop-down to select the default application to open files of this type. 

    Program to run

    Specify a program to associate with the file type. Enter the command to start the program. Alternatively, to choose a command that you entered previously, click the down arrow button, then choose the command. 

    You can also use the Browse button to choose a command.

    Run in Terminal

    Select this option to run the program in a terminal window. Choose this option for a program that does not create a window in which to run. 

  4. Click OK.

To Add a Service

Perform the following steps:

  1. Start the File Associations preference tool.

  2. Click on the Add Service button.

  3. Enter the properties of the service in the Add Service dialog.

    The following table describes the dialog elements on the Add Service dialog:

    Dialog Element 

    Description 

    Description

    Enter a description of the service. 

    Protocol

    Enter the protocol for the service. 

    Program to Run

    Use the drop-down list to select a program to run for this service. 

    Program

    Specify the program to associate with the service. Enter the command to start the program. Alternatively, to choose a command that you entered previously, click the down arrow button, then choose the command. 

    You can also use the Browse button to choose a command.

    Run in Terminal

    Select this option to run the program in a terminal window. Choose this option for a program that does not create a window in which to run. 

  4. Click OK.