@SuppressWarnings("unchecked") @Override public Object getAdapter(Class adapter) { if (adapter == ITextEditorExtension3.class) { IEditorInput activeInput = (IEditorInput) super.getAdapter(IEditorInput.class); if (activeInput != null) { for (Iterator<TypeScriptEditorAdapter> iterator = fEditor.values().iterator(); iterator.hasNext();) { TypeScriptEditorAdapter editor = iterator.next(); if (activeInput.equals(editor.getEditorInput())) return editor; } } return null; } return super.getAdapter(adapter); }
/** * Returns the smart preference state. * * @return <code>true</code> if smart mode is on, <code>false</code> * otherwise */ private boolean isSmartMode() { ITextEditor editor = getTextEditor(); if (editor instanceof ITextEditorExtension3) return ((ITextEditorExtension3) editor).getInsertMode() == ITextEditorExtension3.SMART_INSERT; return false; }
private boolean isSmartMode() { IWorkbenchPage page = JavaScriptPlugin.getActivePage(); if (page != null) { IEditorPart part = page.getActiveEditor(); if (part instanceof ITextEditorExtension3) { ITextEditorExtension3 extension = (ITextEditorExtension3) part; return extension.getInsertMode() == ITextEditorExtension3.SMART_INSERT; } } return false; }
private boolean computeSmartMode() { IWorkbenchPage page= JavaScriptPlugin.getActivePage(); if (page != null) { IEditorPart part= page.getActiveEditor(); if (part instanceof ITextEditorExtension3) { ITextEditorExtension3 extension= (ITextEditorExtension3) part; return extension.getInsertMode() == ITextEditorExtension3.SMART_INSERT; } } return false; }
/** * Returns the smart preference state. * * @return <code>true</code> if smart mode is on, <code>false</code> otherwise */ private boolean isSmartMode() { ITextEditor editor= getTextEditor(); if (editor instanceof ITextEditorExtension3) return ((ITextEditorExtension3) editor).getInsertMode() == ITextEditorExtension3.SMART_INSERT; return false; }
private boolean isSmartMode() { IWorkbenchPage page= JavaPlugin.getActivePage(); if (page != null) { IEditorPart part= page.getActiveEditor(); if (part instanceof ITextEditorExtension3) { ITextEditorExtension3 extension= (ITextEditorExtension3) part; return extension.getInsertMode() == ITextEditorExtension3.SMART_INSERT; } } return false; }
@Override public Object getAdapter(Class adapter) { if (adapter == ITextEditorExtension3.class) { IEditorInput activeInput= (IEditorInput)super.getAdapter(IEditorInput.class); if (activeInput != null) { for (Iterator<CompilationUnitEditorAdapter> iterator= fEditor.values().iterator(); iterator.hasNext();) { CompilationUnitEditorAdapter editor= iterator.next(); if (activeInput.equals(editor.getEditorInput())) return editor; } } return null; } return super.getAdapter(adapter); }