| SWT.H_SCROLL | SWT.FULL_SELECTION);
hotlinkViewer.setContentProvider(ArrayContentProvider.getInstance());
TableViewerColumn column = new TableViewerColumn(hotlinkViewer, SWT.NONE);
column.getColumn().setText(""); //$NON-NLS-1$
column.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
return ""; //$NON-NLS-1$
}
@Override
public Image getImage(Object element) {
final HotlinkDescriptor descriptor = (HotlinkDescriptor) element;
switch (descriptor.getType()) {
case FILE:
return PlatformUI.getWorkbench().getSharedImages()
.getImage(ISharedImages.IMG_OBJ_FILE);
case WEB:
return InfoPlugin.getDefault().getImageRegistry()
.get(InfoPlugin.IMG_OBJ_LINK);
case ACTION:
return InfoPlugin.getDefault().getImageRegistry()
.get(InfoPlugin.IMG_OBJ_ACTION);
default:
break;
}
return PlatformUI.getWorkbench().getSharedImages()
.getImage(ISharedImages.IMG_OBJ_ELEMENT);
}
});
columnLayout.setColumnData(column.getColumn(), new ColumnWeightData(8, 0, false));
column = new TableViewerColumn(hotlinkViewer, SWT.NONE);
column.getColumn().setText(Messages.Document_Label_Column);
column.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
final HotlinkDescriptor descriptor = (HotlinkDescriptor) element;
return descriptor.getLabel();
}
});
columnLayout.setColumnData(column.getColumn(), new ColumnWeightData(25, 0, true));
column = new TableViewerColumn(hotlinkViewer, SWT.NONE);
column.getColumn().setText(Messages.Document_Attribute_Column);
column.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
HotlinkDescriptor descriptor = (HotlinkDescriptor) element;
return descriptor.getAttributeName();
}
});
columnLayout.setColumnData( column.getColumn(), new ColumnWeightData( 25, 0, true ));
column = new TableViewerColumn(hotlinkViewer, SWT.NONE);
column.getColumn().setText(Messages.Document_Hotlink_Column);
column.getColumn().setAlignment(SWT.CENTER);
column.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
HotlinkDescriptor descriptor = (HotlinkDescriptor) element;
return DocUtils.toCamelCase(descriptor.getType().toString());
}
});
columnLayout.setColumnData( column.getColumn(), new ColumnWeightData( 15, 0, true ));
column = new TableViewerColumn(hotlinkViewer, SWT.NONE);
column.getColumn().setText(Messages.Document_Action_Column);
column.setLabelProvider(new ColumnLabelProvider() {
@Override
public String getText(Object element) {
HotlinkDescriptor descriptor = (HotlinkDescriptor) element;
if( descriptor.getConfig() == null ){
return Messages.DocumentPropertyPage_Open;