org.eclipse.ui.console.IConsoleDocumentPartitioner Java Examples

The following examples show how to use org.eclipse.ui.console.IConsoleDocumentPartitioner. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XdsConsoleViewer.java    From xds-ide with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void lineGetStyle(LineStyleEvent event) {
    // Overrided to don't show hyperlinks as original console do it 
    IDocument document = getDocument();
    if (document != null && document.getLength() > 0) {
        ArrayList<StyleRange> ranges = new ArrayList<StyleRange>();
        int offset = event.lineOffset;
        int length = event.lineText.length();

        StyleRange[] partitionerStyles = ((IConsoleDocumentPartitioner) document.getDocumentPartitioner()).getStyleRanges(event.lineOffset, event.lineText.length());
        if (partitionerStyles != null) {
            for (int i = 0; i < partitionerStyles.length; i++) {
                ranges.add(partitionerStyles[i]);
            }
        } else {
            ranges.add(new StyleRange(offset, length, null, null));
        }

        if (ranges.size() > 0) {
            event.styles = (StyleRange[]) ranges.toArray(new StyleRange[ranges.size()]);
        }
    }
}
 
Example #2
Source File: N4JSStackTraceConsole.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected IConsoleDocumentPartitioner getPartitioner() {
	return partitioner;
}
 
Example #3
Source File: ScriptConsole.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected IConsoleDocumentPartitioner getPartitioner() {
    return partitioner;
}