Custom Dialog Snapshots
All the values that you enter in various input fields of a Custom Dialog are automatically saved as a “snapshot”. In other words, the snapshot stores the Custom Dialog state. The next time you open the Custom Dialog, you’ll see the values that you previously entered, as they are restored from the snapshot.
At any time you can explicitly save the dialog state as a snapshot with a meaningful name.
Both automatically saved and explicitly saved snapshots are stored in the <project_root>/.dvt/<dialog_name>.snapshots.xml file. Besides being a snapshots repository, this file is a mean to share snapshots with colleagues working on the same project.
In addition, as another mean to share, you can “copy to clipboard” the current dialog inputs and send them, for example by email or instant messaging, to a colleague who will “paste from clipboard” to fill-in the dialog inputs with your values.
If you chose a snapshot and change a few values, to avoid overwriting the original snapshot, a new timestamped version is automatically created. For example, assuming you select snapshot “bug_235” and change the seed input field, you will get a new timestamped snapshot called “bug_235 [2015-02-20 14:02:53]”. This is to avoid breaking the original snapshot. You can explicitly save “bug_235 [2015-02-20 14:02:53]” as “bug_235” to update the original snapshot. You can at any time explicitly save “bug_235” after you change some values. When there are no changes compared with the saved snapshot, a timestamped snapshot will not be created. When there are changes, if a previous timestamped snapshot already exists, it will be deleted and a new timestamped snapshot is created. This is to avoid accumulating many timestamped snapshots.
A “default” snapshot is always available and it contains the dialog state as specified in the Custom Dialog XML definition. It cannot be overwritten.
Actions
To load an existing snapshot select the desired one from the combo (see #1).
The dropdown menu (see #2) provides the following actions:
Save - Save the dialog state into the current snapshot
Save as… - Save the dialog state as a new snapshot (or overwrite an existing one)
Copy To Clipboard - Copies to clipboard the xml dialog state
Paste From Clipboard - Loads from clipboard the xml dialog state
Custom Dialog Snapshots File Syntax (XML)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<dialog-snapshots last-snapshot="#LAST_RUNNED_SNAPSHOT#" version="1">
<-- #COMMENT# -->
<snapshot
name="#SNAPSHOT_NAME_1#" >
<element
path="#ELEMENT_PATH_1#"
value="#ELEMENT_VALUE_1"
/>
...
<element
path="#ELEMENT_PATH_N#"
value="#ELEMENT_VALUE_N"
/>
</snapshot>
...
<snapshot
name="#SNAPSHOT_NAME_N#"
timestamp="true">
<!-- A timestamped snapshot. Timestamped snapshots are maintained by DVT.-->
<!-- Avoid defining timestamped snapshots! -->
...
</snapshot>
</dialog-snapshots>
#LAST_RUNNED_SNAPSHOT#
Mandatory
Name of the last ran snapshot
#COMMENT#
Any valid XML comment (must not contain
-->
)
#SNAPSHOT_NAME#
Mandatory
Uniquely identifies the snapshot
#ELEMENT_PATH#
Mandatory
Uniquely identifies a widget from the custom dialog
- It is standard XML XPath that has the following structure:
“/Composite/Composite[1]/Group[1]/Button[1]”
#ELEMENT_VALUE#
Mandatory
Value of the widget selected by #ELEMENT_PATH#