handleSetData(event);
}
protected void handleSetData(Event event) {
TableItem item = (TableItem) event.item;
IEObjectDescription description = (IEObjectDescription) item.getData();
if(description != null) {
StyledString styledString = styledLabelProvider.getStyledText(description);
String displayString = styledString == null
? description.toString()
: styledString.toString();
StyleRange[] styleRanges = styledString.getStyleRanges();
item.setText(displayString);
TableOwnerDrawSupport.storeStyleRanges(item, 0, styleRanges);
}
}
};
table.addListener(SWT.SetData, listener);
}
messageLabel = new Label(parent, SWT.NONE);
setDefaultGridData(messageLabel);
EObjectDescriptionContentProvider contentProvider = new EObjectDescriptionContentProvider();
getTableViewer().setContentProvider(contentProvider);
getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
if(selection instanceof IStructuredSelection) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
if(!structuredSelection.isEmpty()) {
Object firstElement = structuredSelection.getFirstElement();
if(firstElement instanceof IEObjectDescription) {
IEObjectDescription eObjectDescription = (IEObjectDescription) firstElement;
URI resourceURI = eObjectDescription.getEObjectURI().trimFragment();
if(resourceURI.isPlatform()) {
messageLabel.setText(resourceURI.toPlatformString(true));
}
else if(resourceURI.isFile()) {
messageLabel.setText(resourceURI.toFileString());