if (category == null)
return;
if (StructuredTextEditorActionConstants.STATUS_CATEGORY_OFFSET.equals(category)) {
IStatusField field = getStatusField(category);
ISourceViewer sourceViewer = getSourceViewer();
if (field != null && sourceViewer != null) {
Point selection = sourceViewer.getTextWidget().getSelection();
int offset1 = widgetOffset2ModelOffset(sourceViewer, selection.x);
int offset2 = widgetOffset2ModelOffset(sourceViewer, selection.y);
String text = null;
if (offset1 != offset2)
text = "[" + offset1 + "-" + offset2 + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
else
text = "[ " + offset1 + " ]"; //$NON-NLS-1$ //$NON-NLS-2$
field.setText(text == null ? fErrorLabel : text);
}
}
}