Examples of IWorkingCopyManager


Examples of org.eclipse.dltk.ui.IWorkingCopyManager

            return externalSourceModule;
          }
        }
      }

      IWorkingCopyManager manager = DLTKUIPlugin.getDefault()
          .getWorkingCopyManager();
      return manager.getWorkingCopy(input, false);
    }

    return null;
  }
View Full Code Here

Examples of org.eclipse.dltk.ui.IWorkingCopyManager

    IEditorPart editor = page.getActiveEditor();
    if (editor == null)
      return null;

    IWorkingCopyManager manager = PHPUiPlugin.getWorkingCopyManager();
    ISourceModule unit = manager.getWorkingCopy(editor.getEditorInput());
    if (unit == null)
      return null;

    return unit;
  }
View Full Code Here

Examples of org.eclipse.jdt.ui.IWorkingCopyManager

  /**
   * @see IActionDelegate#run(IAction)
   */
  public void run(IAction action) {
    IWorkingCopyManager manager = JavaUI.getWorkingCopyManager();
    IEditorInput editorInput = editor.getEditorInput();
    try {
      manager.connect(editorInput);
      ICompilationUnit workingCopy = manager.getWorkingCopy(editorInput);

      CreateDialog dialog = new CreateDialog(new Shell(), new BuilderGenerator());
      dialog.show(workingCopy);

      synchronized (workingCopy) {
        workingCopy.reconcile(ICompilationUnit.NO_AST, false, null, null);
      }

    } catch (JavaModelException e) {
      e.printStackTrace();
    } catch (CoreException e) {
      e.printStackTrace();
    } finally {
      manager.disconnect(editorInput);
    }

  }
View Full Code Here

Examples of org.eclipse.jdt.ui.IWorkingCopyManager

    return menu;
  }
 
  private ICompilationUnit getCompilationUnit(CompilationUnitEditor javaEditor)
  {
    IWorkingCopyManager manager = JavaPlugin.getDefault().getWorkingCopyManager();
   
    return manager.getWorkingCopy(javaEditor.getEditorInput());
  }
View Full Code Here

Examples of org.eclipse.jdt.ui.IWorkingCopyManager

     */
    public void run(IAction action) {
        IEditorPart editorPart = _window.getActivePage().getActiveEditor();
        MultiPageCompilationUnitEditor editor = (MultiPageCompilationUnitEditor) editorPart;

        IWorkingCopyManager manager = JavaPlugin.getDefault()
                .getWorkingCopyManager();
        ICompilationUnit compilationUnit = manager.getWorkingCopy(editor
                .getEditorInput());

        SortMembersUtility.sortICompilationUnit(compilationUnit, editor);
    }
View Full Code Here

Examples of org.eclipse.jdt.ui.IWorkingCopyManager

     @exception JavaModelException If the compilation unit cannot be
     *   retrieved from the Eclipse Java editor.
     */
    private CompilationUnit _getCompilationUnit() throws JavaModelException {

        IWorkingCopyManager manager = JavaPlugin.getDefault()
                .getWorkingCopyManager();
        ICompilationUnit unit = manager.getWorkingCopy(getEditorInput());

        CompilerOptions options = new CompilerOptions(unit.getJavaProject()
                .getOptions(true));
        ASTParser parser = ASTParser.newParser(AST.JLS3); // FIXME
        parser.setCompilerOptions(options.getMap());
View Full Code Here

Examples of org.eclipse.jdt.ui.IWorkingCopyManager

      IDocument doc = provider.getDocument(editor.getEditorInput());

      cacheDoc(doc);

      if (editor instanceof CompilationUnitEditor) {
        IWorkingCopyManager manager = JavaPlugin.getDefault().getWorkingCopyManager();
        input = manager.getWorkingCopy(editor.getEditorInput());

      }
      else if (editor instanceof ClassFileEditor) {
        IClassFileEditorInput editorInput = (IClassFileEditorInput) editor.getEditorInput();
        input = editorInput.getClassFile();
View Full Code Here

Examples of org.eclipse.jdt.ui.IWorkingCopyManager

      IDocument doc = provider.getDocument(editor.getEditorInput());

      cacheDoc(doc);

      if (editor instanceof CompilationUnitEditor) {
        IWorkingCopyManager manager = JavaPlugin.getDefault().getWorkingCopyManager();
        input = manager.getWorkingCopy(editor.getEditorInput());

      }
      else if (editor instanceof ClassFileEditor) {
        IClassFileEditorInput editorInput = (IClassFileEditorInput) editor.getEditorInput();
        input = editorInput.getClassFile();
View Full Code Here

Examples of org.eclipse.jdt.ui.IWorkingCopyManager

   * taken from the getElementAt(int offset, boolean reconcile) method in the
   * CompilationUnitEditor class.
   */
  private static IJavaElement getElementAt(JavaEditor editor, int offset,
      boolean reconcile) {
    IWorkingCopyManager manager;
    if (workingCopyManagersForEditors.get(editor) instanceof IWorkingCopyManager) {
      manager = (IWorkingCopyManager) workingCopyManagersForEditors
          .get(editor);
    }
    else {
      manager = JavaPlugin.getDefault().getWorkingCopyManager();
    }
    ICompilationUnit unit = manager.getWorkingCopy(editor.getEditorInput());

    if (unit != null) {
      try {
        if (reconcile) {
          synchronized (unit) {
View Full Code Here

Examples of org.eclipse.jdt.ui.IWorkingCopyManager

  /**
   * Returns the most narrow java element including the given offset. This is taken from the
   * getElementAt(int offset, boolean reconcile) method in the CompilationUnitEditor class.
   */
  private IJavaElement getElementAt(JavaEditor editor, int offset, boolean reconcile) {
    IWorkingCopyManager manager;
    if (workingCopyManagersForEditors.get(editor) instanceof IWorkingCopyManager) {
      manager = (IWorkingCopyManager) workingCopyManagersForEditors.get(editor);
    }
    else {
      manager = JavaPlugin.getDefault().getWorkingCopyManager();
    }
    ICompilationUnit unit = manager.getWorkingCopy(editor.getEditorInput());

    if (unit != null) {
      try {
        if (reconcile) {
          synchronized (unit) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.