@Override
  public void init(IEditorSite site, IEditorInput input) throws PartInitException {
    super.setSite(site);
    super.setInput(input);
    this.setPartName(input.getName());
    editorImage = input.getImageDescriptor().createImage();
    this.setTitleImage(editorImage);

    listener = new DatabaseEditorListener(this);
  }
Пример #2
0
 @Override
 protected ISonarResource findSelectedElement(IWorkbenchPart part, ISelection selection) {
   if (part instanceof EditorPart) {
     EditorPart editor = (EditorPart) part;
     IEditorInput editorInput = editor.getEditorInput();
     IResource resource = ResourceUtil.getResource(editorInput);
     return ResourceUtils.adapt(resource);
   } else if (selection instanceof IStructuredSelection) {
     return ResourceUtils.adapt(SelectionUtils.getSingleElement(selection));
   }
   return null;
 }
Пример #3
0
  /**
   * The <code>AbstractTextEditor</code> implementation of this <code>IWorkbenchPart</code> method
   * may be extended by subclasses. Subclasses must call <code>super.dispose()</code>.
   *
   * <p>Note that many methods may return <code>null</code> after the editor is disposed.
   */
  @Override
  public void dispose() {

    if (fTitleImage != null) {
      fTitleImage.dispose();
      fTitleImage = null;
    }

    disposeDocumentProvider();

    if (fSourceViewer != null) {
      fSourceViewer = null;
    }

    if (fConfiguration != null) fConfiguration = null;

    IOperationHistory history = OperationHistoryFactory.getOperationHistory();
    if (history != null) {
      if (fNonLocalOperationApprover != null)
        history.removeOperationApprover(fNonLocalOperationApprover);
      if (fLinearUndoViolationApprover != null)
        history.removeOperationApprover(fLinearUndoViolationApprover);
    }
    fNonLocalOperationApprover = null;
    fLinearUndoViolationApprover = null;

    super.dispose();
  }
Пример #4
0
  @Override
  public void dispose() {
    super.dispose();

    if (fWaveMgr != null) {
      fWaveMgr.dispose();
    }
  }
 @Override
 public void dispose() {
   if (editorImage != null) {
     editorImage.dispose();
     editorImage = null;
   }
   listener.dispose();
   super.dispose();
 }
Пример #6
0
  @Override
  public void dispose() {
    getEditorSite().getWorkbenchWindow().getPartService().removePartListener(fActivationListener);
    fEditorHandlers.dispose();

    disposeTableInput();

    super.dispose();
  }
Пример #7
0
 @Override
 public void dispose() {
   IEditorInput editorInput = getEditorInput();
   if (editorInput instanceof NoteEditorInput) {
     EditorRegistry.getInstance()
         .closeEditor(String.valueOf(((NoteEditorInput) editorInput).getId()));
   }
   if (editorInput instanceof AttachmentEditorInput) {
     EditorRegistry.getInstance()
         .closeEditor(String.valueOf(((AttachmentEditorInput) editorInput).getId()));
   }
   super.dispose();
 }
Пример #8
0
  @Override
  public void dispose() {
    Logging.log(this, "Destroyed relay client");

    if (mRelayClient != null) {
      // delete as observer for corresponding stream client application
      mRelayClient.deleteObserver(this);

      // terminate application
      mRelayClient.exit();
    }

    super.dispose();
  }
Пример #9
0
  @Override
  public void run() {
    SaveAsRoutesWizard processWizard =
        new SaveAsRoutesWizard((JobEditorInput) editorPart.getEditorInput());

    WizardDialog dlg = new WizardDialog(editorPart.getSite().getShell(), processWizard);
    if (dlg.open() == Window.OK) {

      try {

        // Set readonly to false since created routes will always be editable.
        JobEditorInput newRoutesEditorInput =
            new CamelProcessEditorInput(processWizard.getProcess(), true, true, false);

        IWorkbenchPage page = editorPart.getSite().getPage();

        IRepositoryNode repositoryNode =
            RepositorySeekerManager.getInstance()
                .searchRepoViewNode(newRoutesEditorInput.getItem().getProperty().getId(), false);
        newRoutesEditorInput.setRepositoryNode(repositoryNode);

        // close the old editor
        page.closeEditor(editorPart, false);

        // open the new editor, because at the same time, there will update the routes view
        page.openEditor(newRoutesEditorInput, CamelMultiPageTalendEditor.ID, true);

      } catch (Exception e) {
        MessageDialog.openError(
            editorPart.getSite().getShell(),
            "Error",
            "Routes could not be saved" + " : " + e.getMessage());
        ExceptionHandler.process(e);
      }
    }
  }
Пример #10
0
  protected void doSetInput(final IEditorInput input) throws CoreException {
    if (input == null) {
      throw new NullPointerException("input");
    }
    if (!(input instanceof RLiveDataEditorInput)) {
      throw new CoreException(
          new Status(
              IStatus.ERROR,
              RUI.PLUGIN_ID,
              -1,
              NLS.bind(
                  "The element ''{0}'' is not supported by the R data editor.", input.getName()),
              null));
    }

    super.setInput(input);

    setPartName(input.getName());
    setTitleToolTip(input.getToolTipText());
  }
  /** We have to dispose the windows shown on our Editor */
  @Override
  public void dispose() {
    super.dispose();
    EventQueue.invokeLater(
        new Runnable() {
          @Override
          public void run() {
            if (window != null) {
              window.dispose();
            }
          }
        });

    Display.getDefault()
        .asyncExec(
            new Runnable() {
              @Override
              public void run() {
                if (wndFind != null) {
                  wndFind.close();
                }
              }
            });

    IWorkbenchWindow wind = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (wind == null) {
      return;
    }
    IEditorReference[] editors =
        wind.getActivePage().findEditors(null, GraphEditor.ID, IWorkbenchPage.MATCH_ID);
    if (editors != null && editors.length == 0 && satView != null) {
      satView.setEditor(null);
      satView.clear();
    }

    for (AbstractHandler hnd : handlers) {
      hnd.dispose();
    }
  }
Пример #12
0
  protected void doSetInput(IEditorInput input) throws CoreException {
    if (input == null) {
      close(isSaveOnCloseNeeded());

    } else {
      IEditorInput oldInput = getEditorInput();
      if (oldInput != null) getDocumentProvider().disconnect(oldInput);

      super.setInput(input);

      updateDocumentProvider(input);

      IDocumentProvider provider = getDocumentProvider();

      provider.connect(input);

      initializeTitle(input);

      if (fSourceViewer != null) {
        initializeSourceViewer(input);
      }
    }
  }
Пример #13
0
 @Override
 public void dispose() {
   intervalReport.removePropertyChangeListener(changeListener);
   intervalReport.dispose();
   super.dispose();
 }
Пример #14
0
 @Override
 public void dispose() {
   ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
   super.dispose();
 }
 public static IStatusLineManager getStatusLineManager(EditorPart e) {
   return e.getEditorSite().getActionBars().getStatusLineManager();
 }
 @Override
 protected void setInput(IEditorInput input) {
   super.setInput(input);
 }
 @Override
 public void dispose() {
   super.dispose();
 }
Пример #18
0
 /** {@inheritDoc} */
 @Override
 protected void firePropertyChange(int property) {
   super.firePropertyChange(property);
 }