public boolean handleEvent(VisualElementEvent event)
{
if (event.type == VisualElementEvent.DOUBLE_CLICK)
{
PlaceholderNode placeholderNode = (PlaceholderNode) node;
if (placeholderNode.getReferencePath() == null)
{
// Double-clicking a placeholder w/o reference path means creating a reference to a process or process element.
// We may either create a new one or choose an existing one.
// Ask the user what he wants:
ResourceCollection res = getDrawing().getEditor().getPluginResourceCollection();
String title = res.getRequiredString("placeholder.referencedialog.title");
String text = res.getRequiredString("placeholder.referencedialog.text");
JMsgBox msgBox = new JMsgBox(null, title, text, JMsgBox.TYPE_YESNOCANCEL);
msgBox.setResource(res);
msgBox.setResourcePrefix("placeholder.referencedialog.");
msgBox.initDialog();
SwingUtil.show(msgBox);
int choice = msgBox.getUserChoice();
Model model = node.getOwningModel();
if (choice == JMsgBox.TYPE_YES)
{
// Yes means create a new process
final Item item = ItemCreationUtil.createItem(model, placeholderNode.getName(), placeholderNode.getDisplayName(), ItemTypes.PROCESS, null);
if (item != null)
{
assignPlaceholderReference(item);
// Open the new process