super(init(),new Action() {
public void handleAction(Object context) throws ApplicationException
{
if (context == null || (context instanceof Object[]))
return;
Action a = new PassportDetail();
if (context instanceof PassportObject)
a.handleAction(((PassportObject) context).passport);
else if (context instanceof ConfigObject)
a.handleAction(((ConfigObject) context).config);
}
});
this.addColumn(i18n.tr("Bezeichnung"),"name");
this.setFormatter(new TreeFormatter() {
public void format(TreeItem item)
{
Object data = item.getData();
if (data instanceof ConfigObject)
item.setImage(SWTUtil.getImage("seahorse-preferences.png"));
}
});
this.setMulti(false);
ContextMenu menu = new ContextMenu();
menu.addItem(new CheckedSingleContextMenuItem(i18n.tr("�ffnen"),new Action() {
public void handleAction(Object context) throws ApplicationException
{
if (context == null || !(context instanceof ConfigObject))
return;
new PassportDetail().handleAction(((ConfigObject) context).config);
}
},"document-open.png")
{
public boolean isEnabledFor(Object o)
{
return (o instanceof ConfigObject) && super.isEnabledFor(o);
}
});
menu.addItem(new ContextMenuItem(i18n.tr("Neuer Bank-Zugang..."),new Action() {
public void handleAction(Object context) throws ApplicationException
{
new PassportDetail().handleAction(getPassport());
}
},"seahorse-preferences.png"));
menu.addItem(ContextMenuItem.SEPARATOR);
menu.addItem(new CheckedSingleContextMenuItem(i18n.tr("L�schen"),new Action() {