示例#1
0
  public RefactoringInfo(PyEdit edit, ITextSelection selection) throws MisconfigurationException {
    IEditorInput input = edit.getEditorInput();
    this.indentPrefs = edit.getIndentPrefs();
    IPythonNature localNature = edit.getPythonNature();

    if (input instanceof IFileEditorInput) {
      IFileEditorInput editorInput = (IFileEditorInput) input;
      this.sourceFile = editorInput.getFile();
      this.realFile = sourceFile != null ? sourceFile.getLocation().toFile() : null;
    } else {
      this.realFile = edit.getEditorFile();
    }

    if (localNature == null) {
      Tuple<IPythonNature, String> infoForFile = PydevPlugin.getInfoForFile(this.realFile);
      if (infoForFile != null && infoForFile.o1 != null) {
        localNature = infoForFile.o1;
      }
    }
    this.nature = localNature;

    this.doc = edit.getDocument();

    this.project = edit.getProject();
    versionProvider = this.nature;
    initInfo(selection);
  }
 public void onDispose(PyEdit edit, IProgressMonitor monitor) {
   IEditorInput input = edit.getEditorInput();
   // remove the markers if we want problems only in the active editor.
   removeMarkersFromInput(input);
 }