/** * Returns the model currently active on <code>document</code> at * <code>offset</code>, or <code>null</code> if there is none. * * @param document the document for which the caller asks for a * model * @param offset the offset into <code>document</code>, as there may be * several models on a document * @return the model currently active on <code>document</code>, or * <code>null</code> */ public static LinkedModeModel getModel(IDocument document, int offset) { if (!hasInstalledModel(document)) return null; LinkedModeManager mgr= LinkedModeManager.getLinkedManager(new IDocument[] {document}, false); if (mgr != null) return mgr.getTopEnvironment(); return null; }
/** * Returns the model currently active on <code>document</code> at * <code>offset</code>, or <code>null</code> if there is none. * * @param document the document for which the caller asks for a * model * @param offset the offset into <code>document</code>, as there may be * several models on a document * @return the model currently active on <code>document</code>, or * <code>null</code> */ public static LinkedModeModel getModel(IDocument document, int offset) { if (!hasInstalledModel(document)) return null; LinkedModeManager mgr= LinkedModeManager.getLinkedManager(new IDocument[] {document}, false); if (mgr != null) return mgr.getTopEnvironment(); return null; }