Examples of IFileEditorInput


Examples of org.eclipse.ui.IFileEditorInput

  @Override
  public void init(IEditorSite site, IEditorInput input)
      throws PartInitException {
    super.init(site, input);
    IFileEditorInput fileInput = (IFileEditorInput) input;
    IFile file = fileInput.getFile();
    new ASTParserJob(file).schedule();
  }
View Full Code Here

Examples of org.eclipse.ui.IFileEditorInput

    this.code = code;
  }

 
  public void editCode(IEditorPart editor) {
    IFileEditorInput file = (IFileEditorInput) editor.getEditorInput();
    ICompilationUnit unit = JavaCore.createCompilationUnitFrom(file
        .getFile());
    try {
      String name = file.getName();
      int dot = name.lastIndexOf('.');
      if (dot != -1)
        name = name.substring(0, dot);
      IType type = unit.getType(name);
      String mName = adapter.isRoot() ? INIT_METHOD_NAME
View Full Code Here

Examples of org.eclipse.ui.IFileEditorInput

      if (dot != -1)
        pname = pname.substring(dot + 1);
     
      String eventTypeSig = Signature.createTypeSignature(pname, false);
     
      IFileEditorInput file = (IFileEditorInput) editor.getEditorInput();
      ICompilationUnit unit = JavaCore.createCompilationUnitFrom(file.getFile());
      String name = file.getName();
      dot = name.lastIndexOf('.');
      if (dot != -1)
        name = name.substring(0, dot);
      IType type = unit.getType(name);
      IType meType = type.getType(className);     
View Full Code Here

Examples of org.eclipse.ui.IFileEditorInput

      if (dot != -1)
        pname = pname.substring(dot + 1);

      String eventTypeSig = Signature.createTypeSignature(pname, false);

      IFileEditorInput file = (IFileEditorInput) editor.getEditorInput();
      ICompilationUnit unit = JavaCore.createCompilationUnitFrom(file
          .getFile());
      String name = file.getName();
      dot = name.lastIndexOf('.');
      if (dot != -1)
        name = name.substring(0, dot);
      IType type = unit.getType(name);
      IMember member = type.getMethod(methodDesc.getName(),
View Full Code Here

Examples of org.eclipse.ui.IFileEditorInput

    }
  }

  private void updateTestCasesFromFile(IEditorPart editor, List<String> testCases)
      throws IOException {
    IFileEditorInput editorInput = (IFileEditorInput) editor.getEditorInput();
    File jsFile = editorInput.getFile().getLocation().toFile();
    testCases.addAll(finder.getTestCases(jsFile));
  }
View Full Code Here

Examples of org.eclipse.ui.IFileEditorInput

        Preferences.setJavaPackageFragmentRoot("src/main/javaxx");
        Preferences.setTemplateFileExtension(LoomConstants.HTML_FILE_EXTENSION);
        EditorFileOpener.getInstance().switchToTemplateOrJavaFile(javaFile);
        IDE.setDefaultEditor(templateFile, "org.eclipse.ui.DefaultTextEditor");
        TextEditor currentEditor = (TextEditor) getActiveEditor();
        IFileEditorInput input = (IFileEditorInput) currentEditor.getEditorInput();
        Assert.assertEquals("Wizard.html", input.getFile().getName());
    }
View Full Code Here

Examples of org.eclipse.ui.IFileEditorInput

        Preferences.setCreateTemplateInJavaFolder(true);
        Preferences.setTemplateFileExtension(LoomConstants.TML_FILE_EXTENSION);
        EditorFileOpener.getInstance().switchToTemplateOrJavaFile(javaFile);
        IDE.setDefaultEditor(localTemplateFile, "org.eclipse.ui.DefaultTextEditor");
        TextEditor currentEditor = (TextEditor) getActiveEditor();
        IFileEditorInput input = (IFileEditorInput) currentEditor.getEditorInput();
        Assert.assertEquals("Wizard.tml", input.getFile().getName());
    }
View Full Code Here

Examples of org.eclipse.ui.IFileEditorInput

    @Test
    public void testSwitchToJavaFile() {
        Preferences.setTemplateFileExtension(LoomConstants.HTML_FILE_EXTENSION);
        EditorFileOpener.getInstance().switchToTemplateOrJavaFile(templateFile);
        JavaEditor currentEditor = (JavaEditor) getActiveEditor();
        IFileEditorInput input = (IFileEditorInput) currentEditor.getEditorInput();
        Assert.assertEquals("Wizard.java", input.getFile().getName());
    }
View Full Code Here

Examples of org.eclipse.ui.IFileEditorInput

        return getProjectFromResource(selectedObject);
      } else if (selection instanceof ITextSelection) {
        IEditorPart activeEditor = DesignerPlugin.getActiveEditor();
        IEditorInput editorInput = activeEditor.getEditorInput();
        if (editorInput instanceof IFileEditorInput) {
          IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput;
          return getProjectFromResource(fileEditorInput.getFile());
        }
      }
    } catch (Throwable e) {
    }
    return null;
View Full Code Here

Examples of org.eclipse.ui.IFileEditorInput

    public boolean equals(Object obj) {
        if (!(obj instanceof IFileEditorInput)) {
            return false;
        }
        IFileEditorInput o = (IFileEditorInput) obj;
        return getFile().equals(o.getFile());
    }
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.