Hi everyone,
At the moment I'm using the following code to allow a user to change a highlighted piece of text (in the standard Java editor) to uppercase:
IDocument document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
ISelectionProvider selectionProvider = editor.getSelectionProvider();
ITextSelection selection = (ITextSelection) selectionProvider.getSelection();
String text = selection.getText();
String newText = text.toUpperCase();
document.replace(selection.getOffset(), selection.getLength(), newText);
What i really want to do however, is change the color of the selected text, instead of the case.