private static Integer getIDInteger(BaseDocument doc) { if (doc == null) { return null; } return (Integer)doc.getProperty(BaseDocument.ID_PROP); }
private static Integer getIDInteger(BaseDocument doc) { if (doc == null) { return null; } return (Integer) doc.getProperty(BaseDocument.ID_PROP); }
public EncodingInputStream(BaseDocument doc, String encoding) { this( (CharSequence) doc.getProperty(CharSequence.class), encoding); }
void setDocument(BaseDocument doc) { this.doc = doc; MARK_DISTANCE = ((Integer) doc.getProperty(SettingsNames.MARK_DISTANCE)).intValue(); MAX_MARK_DISTANCE = ((Integer) doc.getProperty(SettingsNames.MAX_MARK_DISTANCE)).intValue(); MIN_MARK_DISTANCE = ((Integer) doc.getProperty(SettingsNames.MIN_MARK_DISTANCE)).intValue(); SYNTAX_UPDATE_BATCH_SIZE = ((Integer) doc.getProperty(SettingsNames.SYNTAX_UPDATE_BATCH_SIZE)).intValue(); }
FileObject getCurrentFileObject () { FileObject result = referencedFileObject; if (result == null) { Object sdp = doc.getProperty(Document.StreamDescriptionProperty); if (sdp instanceof FileObject) { result = (FileObject)sdp; } else if (sdp instanceof DataObject) { result = ((DataObject)sdp).getPrimaryFile(); } } return result; }
public TokenList findTokenList(Document doc) { if (!(doc instanceof BaseDocument)) { return null; } BaseDocument bdoc = (BaseDocument) doc; if ("text/x-properties".equals (bdoc.getProperty ("mimeType"))) return new PropertiesTokenList (bdoc); return null; } }
public static int getPreviousWord(BaseDocument doc, int offset) throws BadLocationException { Finder prevWordFinder = (Finder) doc.getProperty(SettingsNames.PREVIOUS_WORD_FINDER); offset = doc.find(prevWordFinder, offset, 0); if (offset < 0) { offset = 0; } return offset; }
public static int getPreviousWord(BaseDocument doc, int offset) throws BadLocationException { Finder prevWordFinder = (Finder)doc.getProperty(SettingsNames.PREVIOUS_WORD_FINDER); offset = doc.find(prevWordFinder, offset, 0); if (offset < 0) { offset = 0; } return offset; }
public int eot(int offset) { return ((Integer) getDocument().getProperty(SettingsNames.MARK_DISTANCE)).intValue(); }
/** Get position of wrap mark for some document */ public int getWrapSearchMarkPos(BaseDocument doc) { Mark mark = (Mark)doc.getProperty(BaseDocument.WRAP_SEARCH_MARK_PROP); try { return (mark != null) ? mark.getOffset() : doc.getLength(); } catch (InvalidMarkException e) { throw new RuntimeException(); // shouldn't happen } }
/** Get position of wrap mark for some document */ public int getWrapSearchMarkPos(BaseDocument doc) { Mark mark = (Mark) doc.getProperty(BaseDocument.WRAP_SEARCH_MARK_PROP); try { return (mark != null) ? mark.getOffset() : doc.getLength(); } catch (InvalidMarkException e) { throw new RuntimeException(); // shouldn't happen } }
public static int getNextWord(BaseDocument doc, int offset) throws BadLocationException { Finder nextWordFinder = (Finder) doc.getProperty(SettingsNames.NEXT_WORD_FINDER); offset = doc.find(nextWordFinder, offset, -1); if (offset < 0) { offset = doc.getLength(); } return offset; }
public static synchronized CppUpToDateStatusProvider get(BaseDocument doc) { if (doc == null) { return null; } CppUpToDateStatusProvider provider = (CppUpToDateStatusProvider) doc.getProperty(CppUpToDateStatusProvider.class); if (provider == null) { doc.putProperty(CppUpToDateStatusProvider.class, provider = new CppUpToDateStatusProvider()); } return provider; }
public static int getNextWord(BaseDocument doc, int offset) throws BadLocationException { Finder nextWordFinder = (Finder)doc.getProperty(SettingsNames.NEXT_WORD_FINDER); offset = doc.find(nextWordFinder, offset, -1); if (offset < 0) { offset = doc.getLength(); } return offset; }
/** Get position pairs finder depending on find properties */ public FinderFactory.BlocksFinder getBlocksFinder(BaseDocument doc, Map props) { FinderFactory.BlocksFinder blocksFinder = (FinderFactory.BlocksFinder) doc.getProperty(BaseDocument.BLOCKS_FINDER_PROP); if (blocksFinder == null) { blocksFinder = getFinderCreator().createBlocksFinder(doc, getValidFindProperties(props)); } return blocksFinder; }
/** Get position pairs finder depending on find properties */ public FinderFactory.BlocksFinder getBlocksFinder(BaseDocument doc, Map props) { FinderFactory.BlocksFinder blocksFinder = (FinderFactory.BlocksFinder)doc.getProperty(BaseDocument.BLOCKS_FINDER_PROP); if (blocksFinder == null) { blocksFinder = getFinderCreator().createBlocksFinder(doc, getValidFindProperties(props)); } return blocksFinder; }
/** Get opposite direction finder depending on find properties */ public FinderFactory.StringFinder getStringBwdFinder(BaseDocument doc, Map props) { FinderFactory.StringFinder stringBwdFinder = (FinderFactory.StringFinder) doc.getProperty(BaseDocument.STRING_BWD_FINDER_PROP); if (stringBwdFinder == null) { stringBwdFinder = getFinderCreator().createBwdFinder(doc, getValidFindProperties(props)); doc.putProperty(BaseDocument.STRING_BWD_FINDER_PROP, stringBwdFinder); } return stringBwdFinder; }
/** Get opposite direction finder depending on find properties */ public FinderFactory.StringFinder getStringBwdFinder(BaseDocument doc, Map props) { FinderFactory.StringFinder stringBwdFinder = (FinderFactory.StringFinder)doc.getProperty(BaseDocument.STRING_BWD_FINDER_PROP); if (stringBwdFinder == null) { stringBwdFinder = getFinderCreator().createBwdFinder(doc, getValidFindProperties(props)); doc.putProperty(BaseDocument.STRING_BWD_FINDER_PROP, stringBwdFinder); } return stringBwdFinder; }
/** Get finder depending on find properties */ public FinderFactory.StringFinder getStringFinder(BaseDocument doc, Map props) { FinderFactory.StringFinder stringFinder = (FinderFactory.StringFinder)doc.getProperty(BaseDocument.STRING_FINDER_PROP); if (stringFinder == null) { stringFinder = getFinderCreator().createFinder(doc, getValidFindProperties(props)); doc.putProperty(BaseDocument.STRING_FINDER_PROP, stringFinder); } return stringFinder; }
/** Get finder depending on find properties */ public FinderFactory.StringFinder getStringFinder(BaseDocument doc, Map props) { FinderFactory.StringFinder stringFinder = (FinderFactory.StringFinder) doc.getProperty(BaseDocument.STRING_FINDER_PROP); if (stringFinder == null) { stringFinder = getFinderCreator().createFinder(doc, getValidFindProperties(props)); doc.putProperty(BaseDocument.STRING_FINDER_PROP, stringFinder); } return stringFinder; }