@Override public void onSurfaceCreated(GL10 gl, EGLConfig config){ ... mLine = new Lines(); ... }
public CpAlternativeLocation(CPCslElementHandle handle, DeclarationLocation location, Snapshot snapshot, Lines lines, boolean currentFile) { this.handle = handle; this.location = location; this.currentFile = currentFile; try { lineIndex = lines.getLineIndex(location.getOffset()); //line bounds int from = lines.getLineOffset(lineIndex); int to = lines.getLinesCount() > (lineIndex + 1) ? lines.getLineOffset(lineIndex + 1) : snapshot.getText().length(); lineText = snapshot.getText().subSequence(from, to).toString(); } catch (BadLocationException ex) { Logger.getLogger(CpAlternativeLocation.class.getName()).log(Level.INFO, null, ex); } }
@Override public boolean visit(Node node) { switch (node.type()) { case sass_control_block: case cp_mixin_block: case sass_map: //find the ruleSet curly brackets and create the fold between them inclusive int from = node.from(); int to = node.to(); try { //do not creare one line folds if (lines.getLineIndex(from) < lines.getLineIndex(to)) { List<OffsetRange> codeblocks = getResult().get("codeblocks"); //NOI18N if (codeblocks == null) { codeblocks = new ArrayList<>(); getResult().put("codeblocks", codeblocks); //NOI18N } codeblocks.add(new OffsetRange(from, to)); } } catch (BadLocationException ex) { Exceptions.printStackTrace(ex); } } return false; } };
@Override public <T extends Map<String, List<OffsetRange>>> NodeVisitor<T> getFoldsNodeVisitor(FeatureContext context, T result) { final Snapshot snapshot = context.getSnapshot(); final Lines lines = new Lines(snapshot.getText());
CPCslElementHandle handle = item.first(); Snapshot snapshot = item.second(); Lines lines = new Lines(snapshot.getText()); DeclarationLocation location = new DeclarationLocation( handle.getFileObject(), handle.getOffsetRange(null).getStart());
CPCslElementHandle handle = item.first(); Snapshot snapshot = item.second(); Lines lines = new Lines(snapshot.getText()); DeclarationLocation location = new DeclarationLocation( handle.getFileObject(), handle.getOffsetRange(null).getStart());
CPCslElementHandle handle = item.first(); Snapshot snapshot = item.second(); Lines lines = new Lines(snapshot.getText()); DeclarationLocation location = new DeclarationLocation( handle.getFileObject(), handle.getOffsetRange(null).getStart()); CPCslElementHandle handle = item.first(); Snapshot snapshot = item.second(); Lines lines = new Lines(snapshot.getText()); DeclarationLocation location = new DeclarationLocation( handle.getFileObject(), handle.getOffsetRange(null).getStart());