Examples of IEditorSite


Examples of org.eclipse.ui.IEditorSite

    /*
     * Workaround: send out a text selection
     * XXX: Needs to be improved, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=32214
     */
    if (editor != null) {
      IEditorSite site= editor.getEditorSite();
      if (site == null)
        return;

      ISelectionProvider provider= editor.getEditorSite().getSelectionProvider();
      if (provider == null)
View Full Code Here

Examples of org.eclipse.ui.IEditorSite

    if (part instanceof CompilationUnitEditor) {// JAVA
      if (!QWickieActivator.getDefault().openAnyWicketFiles()) {
        return;
      }
      final String className = ((CompilationUnitEditor) part).getPartName().split("\\.")[0];
      final IEditorSite editorSite = ((CompilationUnitEditor) part).getEditorSite();
      if (editorSite != null) {
        final IWorkbenchWindow workbenchWindow = editorSite.getWorkbenchWindow();
        if (workbenchWindow != null) {
          final IWorkbenchPage activePage = workbenchWindow.getActivePage();
          if (activePage != null) {
            final IEditorReference[] editorReferences = activePage.getEditorReferences();
            for (IEditorReference editorReference : editorReferences) {
View Full Code Here

Examples of org.eclipse.ui.IEditorSite

    }

    public void menuAboutToShow(IMenuManager menu) {
      // slows down the menu and interferes with it for other editors;
      // optimize on visibility
      IEditorSite site = null;
      boolean activeEditorIsVisible = false;

      if (activeExtendedEditor != null && activeExtendedEditor.getEditorPart() != null)
        site = activeExtendedEditor.getEditorPart().getEditorSite();
      if (site == null)
        return;

      // Eclipse bug 48784 - [MPE] ClassCast exception Workbench page
      // isPartVisiable for MultiPageSite
      if (site instanceof MultiPageEditorSite) {
        Object multiPageEditor = ((MultiPageEditorSite) site).getMultiPageEditor();
        activeEditorIsVisible = multiPageEditor.equals(site.getPage().getActiveEditor()) || multiPageEditor.equals(site.getPage().getActivePart());
      }
      else {
        activeEditorIsVisible = site.getWorkbenchWindow().getPartService().getActivePart().equals(activeExtendedEditor.getEditorPart());
      }
      // due to a delay class loading, don't return now
//      if (!activeEditorIsVisible)
//        return;
View Full Code Here

Examples of org.eclipse.ui.IEditorSite

        overlappingIndexedRegionsTab.setControl(overlappingIndexedRegionsTabComposite);
        fillSelectionTabContents(overlappingIndexedRegionsTabComposite, getIndexedRegions(textSelection), "All IndexedRegions overlapping text selection"); //$NON-NLS-1$
        model.releaseFromRead();
      }

      IEditorSite site = fTextEditor.getEditorSite();
      if (site != null) {
        IWorkbenchWindow window = site.getWorkbenchWindow();
        if (window != null) {
          ISelectionService service = window.getSelectionService();
          ISelection selectionFromService = service.getSelection();
          if (service != null && !selectionFromService.equals(structuredSelection) && selectionFromService instanceof IStructuredSelection) {
            TabItem selectionServiceTab = new TabItem(tabfolder, SWT.BORDER);
View Full Code Here

Examples of org.eclipse.ui.IEditorSite

   * @see org.eclipse.ui.part.MultiPageEditorPart#handlePropertyChange(int) the handler for
   *      property change events from the nested editor
   */
  public void addPage(final IEditorPart editor, IEditorInput input)
      throws PartInitException {
    IEditorSite site = createSite(editor);
    // call init first so that if an exception is thrown, we have created no
    // new widgets
    editor.init(site, input);
    final Composite parent1 = new Composite(getContainer(), SWT.NONE);
    FillLayout fillLayout = new FillLayout();
View Full Code Here

Examples of org.eclipse.ui.IEditorSite

   */
  protected void activeEditorChanged(IEditorPart activeEditor) {
    setActiveEditor(activeEditor);
    setFocus();

    IEditorSite site = getEditorSite();
    while (site != null) {
      IEditorActionBarContributor contributor = site
          .getActionBarContributor();
      if (contributor instanceof MultiPageEditorActionBarContributor) {
        ((MultiPageEditorActionBarContributor) contributor)
            .setActivePage(activeEditor);
      }
View Full Code Here

Examples of org.eclipse.ui.IEditorSite

  /**
   * @see org.eclipse.ui.part.MultiPageEditorPart#createSite(org.eclipse.ui.IEditorPart)
   */
  protected IEditorSite createSite(IEditorPart editor) {
    IEditorSite site = null;
    if (editor == fTextEditor) {
      site = new MultiPageEditorSite(this, editor) {
        /**
         * @see org.eclipse.ui.part.MultiPageEditorSite#getActionBarContributor()
         */
 
View Full Code Here

Examples of org.eclipse.ui.IEditorSite

        // Check the active editor part.
        final IEditorPart newActiveEditor = activeWorkbenchPage
            .getActiveEditor();
        currentState.put(ISources.ACTIVE_EDITOR_NAME, newActiveEditor);
        if (newActiveEditor != null) {
          final IEditorSite activeEditorSite = newActiveEditor
              .getEditorSite();
          if (activeEditorSite != null) {
            final String newActiveEditorId = activeEditorSite
                .getId();
            currentState.put(ISources.ACTIVE_EDITOR_ID_NAME,
                newActiveEditorId);
          }
        }
View Full Code Here

Examples of org.eclipse.ui.IEditorSite

  /**
   * Activate contributions.
   */
  public void activate(IEditorPart editor) {
    editor.setFocus();
    IEditorSite site = editor.getEditorSite();
    CompositeEditorActionBars actionBars = (CompositeEditorActionBars) site.getActionBars();
    actionBars.partChanged(editor);
    actionBars.activate(true);
    ((EditorInViewSite) site).activate();
  }
View Full Code Here

Examples of org.eclipse.ui.IEditorSite

   */
  public void deactivate(IEditorPart editor) {
    if (editor != null) {
      CompositeEditorActionBars actionBars = (CompositeEditorActionBars) editor.getEditorSite().getActionBars();
      actionBars.deactivate(true);
      IEditorSite site = editor.getEditorSite();
      ((EditorInViewSite) site).deactivate();
    }
  }
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.