}
else
{
Object obj = ((IStructuredSelection) selection).getFirstElement();
Attribut a = (Attribut) obj;
addidx = a.getDisplayOrder() + 1;
}
Attribut at0 = new Attribut(getFD().getID(), T_String);
getFD().addAttribut(at0, addidx);
_tabvLdAttr.refresh();
}
}, new SelectionAdapter()
{
/**
* Add Before Callback
*/
@Override
public void widgetSelected(SelectionEvent e)
{
ISelection selection = _tabvLdAttr.getSelection();
int addidx = 0;
if (selection.isEmpty())
{
Object obj = ((IStructuredSelection) selection).getFirstElement();
Attribut a = (Attribut) obj;
addidx = Math.max(0, a.getDisplayOrder() - 1);
}
Attribut at0 = new Attribut(getFD().getID(), T_String);
getFD().addAttribut(at0, addidx);
_tabvLdAttr.refresh();
}
}, new SelectionAdapter()
{
@Override
public void widgetSelected(SelectionEvent e)
{
ISelection selection = _tabvLdAttr.getSelection();
Object obj = ((IStructuredSelection) selection).getFirstElement();
Attribut attr = (Attribut) obj;
// Get confirmation
boolean rb = MessageDialog.openConfirm(_tabvLdAttr.getControl().getShell(), "Delete Attribute",
"Do you confirm the deletion of Attribut:" + attr.getName() + "\nType:" + attr.getType().name);
if (rb)
{
// Execute the deletion
getFD().removeAttribut(attr);
_tabvLdAttr.refresh();
}
}
}, new SelectionAdapter()
{
@Override
public void widgetSelected(SelectionEvent e)
{
ISelection selection = _tabvLdAttr.getSelection();
if (!selection.isEmpty())
{
Object obj = ((IStructuredSelection) selection).getFirstElement();
Attribut a = (Attribut) obj;
int r = getFD().changeAttributPosition(a, false);
if (r == C_OK)
{
setDirty(true);
}
_tabvLdAttr.refresh();
}
}
}, new SelectionAdapter()
{
@Override
public void widgetSelected(SelectionEvent e)
{
ISelection selection = _tabvLdAttr.getSelection();
if (!selection.isEmpty())
{
Object obj = ((IStructuredSelection) selection).getFirstElement();
Attribut a = (Attribut) obj;
int r = getFD().changeAttributPosition(a, true);
if (r == C_OK)
{
setDirty(true);