public void popup(SelectionEditor editor, int cause)
{
if (cause != PopupEvent.POPUP_OPENING)
return;
JSelectionField selectionField = (JSelectionField) editor.getPropertyComponent();
// Save the text (will be cleared when removing the items)
String text = selectionField.getText();
// Clear the item list
selectionField.clearItems();
Object o = editor.getObject();
if (!(o instanceof HandlerDefinition))
return;
selectionField.addItem(null);
ModelObject mo = ((HandlerDefinition) o).getOwner();
String pkg = mo.getOwningModel().getDefaultPackage();
if (pkg != null)
{
String prefix = editor.getParameterParser().getString("prefix");
String suffix = editor.getParameterParser().getString("suffix");
StringBuffer className = new StringBuffer(pkg);
className.append (".");
if (prefix != null)
{
className.append (prefix);
}
className.append (mo.getName());
if (suffix != null)
{
className.append (suffix);
}
selectionField.addItem(className.toString());
}
else
{
selectionField.addItem("<no default model package name specified>");
}
// Restore the text
selectionField.setText(text);
}