Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbench


     */
    public static void setSelection(final ISelection selection) throws WranglerException {
        // TODO:: if the module is selected it is not handled
        try {
            if (editor == null) {
                final IWorkbench instance = PlatformUI.getWorkbench();
                final IWorkbenchWindow activeWorkbenchWindow = instance
                        .getActiveWorkbenchWindow();
                editor = activeWorkbenchWindow.getActivePage().getActiveEditor();
            }
            if (selection instanceof ITextSelection) {
                final IWorkbench instance = PlatformUI.getWorkbench();
                final IWorkbenchWindow activeWorkbenchWindow = instance
                        .getActiveWorkbenchWindow();
                editor = activeWorkbenchWindow.getActivePage().getActiveEditor();

                wranglerSelection = new ErlTextMemberSelection(
                        (ITextSelection) selection, (ITextEditor) editor);
View Full Code Here


     * Shows the warning view.
     *
     * @return view which is shown
     */
    public static IViewPart showWarningView() {
        final IWorkbench workbench = PlatformUI.getWorkbench();

        final IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
        try {
            final IViewPart theView = window.getActivePage().showView(warningViewID);
            return theView;
        } catch (final PartInitException e) {
            ErlLogger.error(e);
View Full Code Here

    /**
     * Hides the warning view.
     */
    public static void closeWarningView() {
        final IWorkbench workbench = PlatformUI.getWorkbench();

        final IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
        final IViewPart theView = window.getActivePage().findView(warningViewID);
        window.getActivePage().hideView(theView);

    }
View Full Code Here

  public void open()
  {
    if (this.wicketId != null)
    {
      final IWorkbench workbench = PlatformUI.getWorkbench();
      final IWorkbenchPage activePage = workbench.getActiveWorkbenchWindow().getActivePage();
     
      if(!(activePage.getActiveEditor() instanceof WicketFunEditor))
        return;
     
      final WicketFunEditor wEditor = (WicketFunEditor)activePage.getActiveEditor();
View Full Code Here

  @Override
  protected void doDisable() {
    recorder.stop();
    TrackingPlugin.getDefault().getIdleDetector().deleteObserver(observer);

    IWorkbench workbench = PlatformUI.getWorkbench();
    workbench.removeWindowListener(winListener);
    for (IWorkbenchWindow window : workbench.getWorkbenchWindows()) {
      deregister(window);
    }
  }
View Full Code Here

    }
  }

  @Override
  protected void doEnable() {
    IWorkbench workbench = PlatformUI.getWorkbench();
    workbench.addWindowListener(winListener);
    for (IWorkbenchWindow window : workbench.getWorkbenchWindows()) {
      register(window);
    }
    TrackingPlugin.getDefault().getIdleDetector().addObserver(observer);

    // If there is an Java editor already active, start tracking:
View Full Code Here

  @Before
  public void setUp() {
    tracker = createTracker();

    IWorkbench wb = PlatformUI.getWorkbench();
    wb.getActiveWorkbenchWindow().getActivePage()
        .setPerspective(wb.getPerspectiveRegistry().getPerspectives()[1]);
  }
View Full Code Here

     */
    public static IWorkbenchWindow getActiveWorkbenchWindow() {
        if (getDefault() == null) {
            return null;
        }
        IWorkbench workBench = getDefault().getWorkbench();
        if (workBench == null) {
            return null;
        }
        return workBench.getActiveWorkbenchWindow();
    }
View Full Code Here

      }
    }
  }

  private IWorkbenchPartSite getEditorSite() {
    IWorkbench workbench = PlatformUI.getWorkbench();
    if (workbench != null) {
      IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
      if (window != null) {
        IWorkbenchPage page = window.getActivePage();
        if (page != null) {
          IEditorPart editor = page.getActiveEditor();
          if (editor != null)
View Full Code Here

    }

    @Test @Ignore
    public void testMultipleEditors() throws PartInitException {

        IWorkbench workbench = PlatformUI.getWorkbench();
        IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();

        DRLRuleEditor2 part1 = (DRLRuleEditor2) IDE.openEditor( page,
                                                                fFile1 );
        DRLRuleEditor2 part2 = (DRLRuleEditor2) IDE.openEditor( page,
                                                                fFile2 );
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWorkbench

Copyright © 2018 www.massapicom. 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.