}
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);
_tabvFdAttr.refresh();
}
}, new SelectionAdapter()
{
/**
* Add Before Callback
*/
@Override
public void widgetSelected(SelectionEvent e)
{
ISelection selection = _tabvFdAttr.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);
_tabvFdAttr.refresh();
}
}, new SelectionAdapter()
{
@Override
public void widgetSelected(SelectionEvent e)
{
ISelection selection = _tabvFdAttr.getSelection();
Object obj = ((IStructuredSelection) selection).getFirstElement();
Attribut attr = (Attribut) obj;
// Get confirmation
boolean rb = MessageDialog.openConfirm(_tabvFdAttr.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);
_tabvFdAttr.refresh();
}
}
}, new SelectionAdapter()
{
@Override
public void widgetSelected(SelectionEvent e)
{
ISelection selection = _tabvFdAttr.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);
}
_tabvFdAttr.refresh();
}
}
}, new SelectionAdapter()
{
@Override
public void widgetSelected(SelectionEvent e)
{
ISelection selection = _tabvFdAttr.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);