]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/editor2/SingleTokenScanner.java
LabelDecorator.decorateLabel can return null
[simantics/platform.git] / bundles / org.simantics.scl.ui / src / org / simantics / scl / ui / editor2 / SingleTokenScanner.java
1 package org.simantics.scl.ui.editor2;
2
3 import org.eclipse.jface.text.IDocument;
4 import org.eclipse.jface.text.rules.IToken;
5 import org.eclipse.jface.text.rules.RuleBasedScanner;
6 import org.eclipse.jface.text.rules.Token;
7
8 public class SingleTokenScanner extends RuleBasedScanner {
9     public SingleTokenScanner(Object attribute) {
10         setDefaultReturnToken(new Token(attribute));
11     }
12     
13     @Override
14     public IToken nextToken() {
15         return super.nextToken();
16     }
17     
18     @Override
19     public void setRange(IDocument document, int offset, int length) {
20         super.setRange(document, offset, length);
21     }
22 }