public void createPresentation(TextPresentation presentation, ITypedRegion region) { int start= region.getOffset(); int length= 0; boolean firstToken= true; TextAttribute attribute = getTokenTextAttribute(Token.UNDEFINED); scanner.setRange(document,start,region.getLength()); while (true) { IToken resultToken = scanner.nextToken(); if (resultToken.isEOF()) { break; } if(resultToken.equals(Token.UNDEFINED)) { continue; } if (!firstToken) { addRange(presentation,start,length,attribute,true); } firstToken = false; attribute = getTokenTextAttribute(resultToken); start = scanner.getTokenOffset(); length = scanner.getTokenLength(); } addRange(presentation,start,length,attribute,true); }
/** * Performs the initial partitioning of the partitioner's document. */ protected void initialize() { fIsInitialized= true; fScanner.setRange(fDocument, 0, fDocument.getLength()); try { IToken token= fScanner.nextToken(); while (!token.isEOF()) { String contentType= getTokenContentType(token); if (isSupportedContentType(contentType)) { TypedPosition p= new TypedPosition(fScanner.getTokenOffset(), fScanner.getTokenLength(), contentType); fDocument.addPosition(fPositionCategory, p); } token= fScanner.nextToken(); } } catch (BadLocationException x) { // cannot happen as offsets come from scanner } catch (BadPositionCategoryException x) { // cannot happen if document has been connected before } }
/** * Performs the initial partitioning of the partitioner's document. */ protected void initialize() { fScanner.setRange(fDocument, 0, fDocument.getLength()); try { IToken token= fScanner.nextToken(); while (!token.isEOF()) { String contentType= getTokenContentType(token); if (isSupportedContentType(contentType)) { TypedPosition p= new TypedPosition(fScanner.getTokenOffset(), fScanner.getTokenLength(), contentType); fDocument.addPosition(fPositionCategory, p); } token= fScanner.nextToken(); } } catch (BadLocationException x) { // cannot happen as offsets come from scanner } catch (BadPositionCategoryException x) { // cannot happen if document has been connected before } }
/** * Performs the initial partitioning of the partitioner's document. */ protected void initialize() { fScanner.setRange(fDocument, 0, fDocument.getLength()); try { IToken token= fScanner.nextToken(); while (!token.isEOF()) { String contentType= getTokenContentType(token); if (isSupportedContentType(contentType)) { TypedPosition p= new TypedPosition(fScanner.getTokenOffset(), fScanner.getTokenLength(), contentType); fDocument.addPosition(fPositionCategory, p); } token= fScanner.nextToken(); } } catch (BadLocationException x) { // cannot happen as offsets come from scanner } catch (BadPositionCategoryException x) { // cannot happen if document has been connected before } }
/** * Performs the initial partitioning of the partitioner's document. */ protected void initialize() { fIsInitialized= true; fScanner.setRange(fDocument, 0, fDocument.getLength()); try { IToken token= fScanner.nextToken(); while (!token.isEOF()) { String contentType= getTokenContentType(token); if (isSupportedContentType(contentType)) { TypedPosition p= new TypedPosition(fScanner.getTokenOffset(), fScanner.getTokenLength(), contentType); fDocument.addPosition(fPositionCategory, p); } token= fScanner.nextToken(); } } catch (BadLocationException x) { // cannot happen as offsets come from scanner } catch (BadPositionCategoryException x) { // cannot happen if document has been connected before } }
/** * Performs the initial partitioning of the partitioner's document. * <p> * May be extended by subclasses. * </p> */ protected void initialize() { fIsInitialized= true; clearPositionCache(); fScanner.setRange(fDocument, 0, fDocument.getLength()); try { IToken token= fScanner.nextToken(); while (!token.isEOF()) { String contentType= getTokenContentType(token); if (isSupportedContentType(contentType)) { TypedPosition p= new TypedPosition(fScanner.getTokenOffset(), fScanner.getTokenLength(), contentType); fDocument.addPosition(fPositionCategory, p); } token= fScanner.nextToken(); } } catch (BadLocationException x) { // cannot happen as offsets come from scanner } catch (BadPositionCategoryException x) { // cannot happen if document has been connected before } }
/** * Performs the initial partitioning of the partitioner's document. * <p> * May be extended by subclasses. * </p> */ protected void initialize() { fIsInitialized= true; clearPositionCache(); fScanner.setRange(fDocument, 0, fDocument.getLength()); try { IToken token= fScanner.nextToken(); while (!token.isEOF()) { String contentType= getTokenContentType(token); if (isSupportedContentType(contentType)) { TypedPosition p= new TypedPosition(fScanner.getTokenOffset(), fScanner.getTokenLength(), contentType); fDocument.addPosition(fPositionCategory, p); } token= fScanner.nextToken(); } } catch (BadLocationException x) { // cannot happen as offsets come from scanner } catch (BadPositionCategoryException x) { // cannot happen if document has been connected before } }
/** * Performs the initial partitioning of the partitioner's document. * <p> * May be extended by subclasses. * </p> */ protected void initialize() { fIsInitialized= true; clearPositionCache(); fScanner.setRange(fDocument, 0, fDocument.getLength()); try { IToken token= fScanner.nextToken(); while (!token.isEOF()) { String contentType= getTokenContentType(token); if (isSupportedContentType(contentType)) { TypedPosition p= new TypedPosition(fScanner.getTokenOffset(), fScanner.getTokenLength(), contentType); fDocument.addPosition(fPositionCategory, p); } token= fScanner.nextToken(); } } catch (BadLocationException x) { // cannot happen as offsets come from scanner } catch (BadPositionCategoryException x) { // cannot happen if document has been connected before } }
/** * Performs the initial partitioning of the partitioner's document. * <p> * May be extended by subclasses. * </p> */ protected void initialize() { fIsInitialized= true; clearPositionCache(); fScanner.setRange(fDocument, 0, fDocument.getLength()); try { IToken token= fScanner.nextToken(); while (!token.isEOF()) { String contentType= getTokenContentType(token); if (isSupportedContentType(contentType)) { TypedPosition p= new TypedPosition(fScanner.getTokenOffset(), fScanner.getTokenLength(), contentType); fDocument.addPosition(fPositionCategory, p); } token= fScanner.nextToken(); } } catch (BadLocationException x) { // cannot happen as offsets come from scanner } catch (BadPositionCategoryException x) { // cannot happen if document has been connected before } }
/** * Performs the initial partitioning of the partitioner's document. * <p> * May be extended by subclasses. * </p> * * @since 2.2 */ protected void initialize() { fIsInitialized = true; clearPositionCache(); fScanner.setRange(fDocument, 0, fDocument.getLength()); try { IToken token = fScanner.nextToken(); while (!token.isEOF()) { String contentType = getTokenContentType(token); if (isSupportedContentType(contentType)) { TypedPosition p = new TypedPosition(fScanner.getTokenOffset(), fScanner.getTokenLength(), contentType); fDocument.addPosition(fPositionCategory, p); } token = fScanner.nextToken(); } } catch (BadLocationException x) { // cannot happen as offsets come from scanner } catch (BadPositionCategoryException x) { // cannot happen if document has been connected before } }
if (token.isEOF()) break;
if (token.isEOF()) break;
if (token.isEOF()) break;
IToken token= fScanner.nextToken(); while (!token.isEOF()) {
IToken token= fScanner.nextToken(); while (!token.isEOF()) {
IToken token= fScanner.nextToken(); while (!token.isEOF()) {
IToken token= fScanner.nextToken(); while (!token.isEOF()) {
IToken token= fScanner.nextToken(); while (!token.isEOF()) {
IToken token= fScanner.nextToken(); while (!token.isEOF()) {
IToken token= fScanner.nextToken(); while (!token.isEOF()) {