Package org.eclipse.ui

Examples of org.eclipse.ui.IEditorPart


   *
   * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
   */
  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IEditorPart editor = HandlerUtil.getActiveEditor(event);
    if (editor != null && editor.getEditorInput() instanceof FileEditorInput) {
      if (editor.isDirty()) {
        editor.doSave(null);
      }
      IFile editedFile = ((FileEditorInput) editor.getEditorInput()).getFile();
      scheduleJob(editedFile, true);
    }
    return null;
  }
View Full Code Here


   *
   * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
   */
  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IEditorPart editor = HandlerUtil.getActiveEditor(event);
    if (editor != null && editor.getEditorInput() instanceof FileEditorInput) {
      if (editor.isDirty()) {
        editor.doSave(null);
      }
      IFile editedFile = ((FileEditorInput) editor.getEditorInput()).getFile();
      scheduleJob(editedFile, true);
    }
    return null;
  }
View Full Code Here

        final ISelection sel = getContainer().getSelection();
        SearchPatternData initData = null;
        if (sel instanceof IStructuredSelection) {
            initData = tryStructuredSelection((IStructuredSelection) sel);
        } else if (sel instanceof ITextSelection) {
            final IEditorPart activePart = getActiveEditor();
            if (activePart instanceof ErlangEditor) {
                initData = tryErlangTextSelection(initData, activePart);
            }
            if (initData == null) {
                initData = trySimpleTextSelection((ITextSelection) sel);
View Full Code Here

            final boolean activate) throws PartInitException {
        final Object element = match.getElement();
        if (element instanceof ErlangSearchElement) {
            final ErlangSearchElement ese = (ErlangSearchElement) element;
            final IErlModule module = ese.getModule();
            final IEditorPart editor = EditorUtility.openInEditor(module);
            if (offset != 0) {
                if (editor instanceof ErlangEditor) {
                    final AbstractErlangEditor ee = (AbstractErlangEditor) editor;
                    ee.selectAndReveal(offset, length);
                } else if (editor != null) {
View Full Code Here

            final IErlElementLocator.Scope scope) throws CoreException {
        final IErlElementLocator model = ErlangEngine.getInstance().getModel();
        final IErlModule module2 = ErlangEngine.getInstance().getModelFindService()
                .findModule(model, project, moduleName, modulePath, scope);
        if (module2 != null) {
            final IEditorPart editor = EditorUtility.openInEditor(module2);
            return openFunctionInEditor(function, editor);
        }
        return false;
    }
View Full Code Here

        }
        return false;
    }

    public static void openElement(final IErlElement element) throws PartInitException {
        final IEditorPart editor = EditorUtility.openInEditor(element);
        EditorUtility.revealInEditor(editor, element);
    }
View Full Code Here

        EditorUtility.revealInEditor(editor, element);
    }

    public static void openElement(final org.erlide.engine.new_model.IErlElement element)
            throws PartInitException {
        final IEditorPart editor = EditorUtility.openInEditor(element);
        EditorUtility.revealInEditor(editor, element);
    }
View Full Code Here

        EditorUtility.revealInEditor(editor, element);
    }

    public static void openSourceRange(final IErlModule module,
            final ISourceRange sourceRange) throws PartInitException {
        final IEditorPart editor = EditorUtility.openInEditor(module);
        EditorUtility.revealInEditor(editor, sourceRange);
    }
View Full Code Here

    @Override
    public boolean appliesAt(final IQuickAssistInvocationContext invocationContext) {
        final ISourceViewer viewer = invocationContext.getSourceViewer();

        final IEditorPart editorPart = PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getActivePage().getActiveEditor();
        if (!(editorPart instanceof ErlangEditor)) {
            return false;
        }
        final ErlangEditor editor = (ErlangEditor) editorPart;
View Full Code Here

                ErlLogger.info("*** Automatically cleaning caches ***");
                try {
                    try {
                        final List<IEditorReference> editorRefs = getWorkbenchEditorReferences();
                        for (final IEditorReference editorRef : editorRefs) {
                            final IEditorPart editor = editorRef.getEditor(false);
                            if (editor instanceof ErlangEditor) {
                                final ErlangEditor erlangEditor = (ErlangEditor) editor;
                                ClearCacheAction.resetCacheForEditor(erlangEditor);
                            }
                        }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IEditorPart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.