Solaris Common Desktop Environment: Programmer's Guide

Drag-and-Drop Destinations

The following components on the desktop provide drop destinations:

Each component accepts drops of text selections, files, and buffers. Most of the text drop destinations are provided automatically by the Motif library. File or buffer data drop destinations require additional code.

When a user drops data from a file, and that file is modified in some way, the modifications can be written back to the original holder of the file. This behavior is described as saveback. However, when data is dropped from a buffer, the data does not have information about an originating file. As a result, changes to data from buffers cannot be written back, because there is no original holder of the data. This behavior is described as no saveback.

For example, the Mailer can export mail attachments to editors using drag and drop. If the attachment is exported as a buffer (that has no saveback), the editor has no way to change the original attachment in the mailer. So, the editor can only save its modified version of the attachment to a new file.

Because mail attachments are not already separate files (they are embedded into a mail folder file), they are only exported as buffers and cannot be saved back by other editors.

If the attachment is exported as a file (that has saveback) the editor saves its modified version to that same file. Table 5-3 describes the drops of text selections, files, and buffers on editor-type components such as Text Editor, Icon Editor, Calendar and Mailer.

Table 5-3 Editor Drop Destinations

Drop Destination 

Text Selections 

Files 

Buffers 

Text Editor: Main Window 

Insert 

Insert 

Insert 

Terminal: Main Window 

Insert 

N/A 

N/A 

Icon Editor: Main Window 

N/A 

Load (if file in icon format) saveback 

Load into read-only (if data in icon format) no saveback 

Mailer: Message List 

N/A 

Append (if file in mail format) 

Append (if data in mail format) 

Mailer: Compose 

Insert 

Insert 

Insert 

Mailer: Attachment List 

Attach 

Attach 

Attach 

Calendar: Main Window 

N/A 

Schedule Appointment (if file in appointment format) 

Schedule appointment (if data in appointment format) 

Calendar: Appointment Editor 

Insert into text field 

Fill in appointment fields (if file in appointment format) 

Fill in appointment fields (if data in appointment format) 

AppBuilder 

N/A 

Load (if file in BIX or BIL format) saveback 

Load into read-only (if data in BIP format) no saveback 

Table 5-4 describes the drops of text selections, files, and buffers on file and folder icons in the File Manager.

Table 5-4 File Manager Drop Destinations

Drop Destination 

Text Selections 

Files 

Buffers 

File Icon 

Invoke drop action on target file and dropped text (if file accepts text drops and dropped text in appropriate format) no saveback/copy 

Invoke drop action on target file and dropped file (if file accepts file drop and dropped file in appropriate format) saveback 

Invoke drop action on target file and dropped data (if file accepts data drop and dropped data in appropriate format) no saveback/copy 

Folder Icon 

Insert text into new file using "Untitled" name in folder 

Copy/move file to folder 

Insert data into new file using supplied name (if available) in folder else using "Untitled" 

Action Icon 

Invoke action on text (if appropriate format and accepts text drop) no saveback 

Invoke action on files (if appropriate format and accepts file drop) saveback 

Invoke action on data (if appropriate format and accepts data drop) no saveback 

Mail Container Icon 

Append to mailbox (if text in mail format) 

Append to mailbox (if file in mail format) 

Append to mailbox (if data in mail format) 

Table 5-5 describes the drops of text selections, files, and buffers on action icons in the Front Panel.

Table 5-5 Front Panel Drop Destinations

Drop Destination 

Text Selections 

Files 

Buffers 

Text Editor 

Load into read-only no saveback 

Load saveback 

Load into read-only no saveback 

Calendar 

Schedule appointment (if text in appointment format) 

Schedule appointment (if file in appointment format) 

Schedule appointment (if data in appointment format) 

Mail 

Compose message attach text 

Compose message attach file 

Compose message attach data 

Printer 

Print text (if print method available for text) 

Print file contents (if print method available for file format) 

Print data (if print method available for data format) 

Trash Can 

N/A 

Move file to Trash Can 

N/A 

Subpanel: Install Icon 

N/A 

Install icon 

N/A 

Subpanel: Action 

Same as File Manager 

Same as File Manager 

Same as File Manager 

Subpanel: Executable 

Same as File Manager 

Same as File Manager 

Same as File Manager 

See the Common Desktop Environment: Style Guide and Certification Checklist for more information and guidelines on how the drag and drop should appear to the user.