}
catch(Exception e) {
logger.error("Exception caught while trying to open editor for: " + obj + "; "
+ e.getLocalizedMessage(), e);
alertService.addAlert(new Alert(Alert.Type.ERROR, Messages
.getString("participant.editor.error.source.campaign_list.text"), e
.getLocalizedMessage()));
}
}
}
}
});
campaignListViewer.setInput(participant);
}
// owned objects
Group ownedObjectsGroup = new Group(comp, SWT.BORDER);
ownedObjectsGroup.setLayout(new FillLayout());
ownedObjectsGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
ownedObjectsGroup.setText(Messages.getString("participant.editor.group.owned_objects_list.label"));
{
ownedObjectsTable = new Table(ownedObjectsGroup, SWT.FULL_SELECTION | SWT.SINGLE);
// ownedObjectsTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
ownedObjectsTable.setLinesVisible(false);
ownedObjectsTable.setHeaderVisible(false);
ownedObjectsViewer = new TableViewer(ownedObjectsTable);
TableViewerColumn vCol;
TableColumn col;
vCol = new TableViewerColumn(ownedObjectsViewer, SWT.LEFT);
col = vCol.getColumn();
col.setText(Messages.getString("participant.editor.owned_objects_list.table.column.item.label"));
col.setToolTipText(Messages.getString("participant.editor.owned_objects_list.table.column.item.tooltip"));
col.setResizable(true);
col.setMoveable(false);
col.setWidth(1024);
ownedObjectsViewer.setContentProvider(new ParticipantOwnedObjectsListContentProvider());
ownedObjectsViewer.setLabelProvider(new ParticipantOwnedObjectsListLabelProvider());
ownedObjectsViewer.setComparator(new ParticipantOwnedObjectsListComparator());
ownedObjectsViewer.addSelectionChangedListener(this);
ownedObjectsViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
logger.debug("double-click: " + event);
ISelection selection = event.getSelection();
logger.trace("selection: " + selection);
if(selection instanceof IStructuredSelection) {
Iterator iter = ((IStructuredSelection)selection).iterator();
while(iter.hasNext()) {
Object obj = iter.next();
logger.trace("obj: " + obj);
try {
// open object instance editor
EditorUtils.editObject(obj);
}
catch(Exception e) {
logger.error("Exception caught while trying to open editor for: " + obj + "; "
+ e.getLocalizedMessage(), e);
alertService.addAlert(new Alert(Alert.Type.ERROR, Messages
.getString("participant.editor.error.source.owned_objects_list.text"), e
.getLocalizedMessage()));
}
}
}