Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchWindow


  private void openApplicationPage(ModuleServer moduleServer) {
    final IModule[] modules = moduleServer.getModule();
    IServer server = moduleServer.getServer();
    CloudFoundryServer cloudServer = (CloudFoundryServer) server.loadAdapter(CloudFoundryServer.class, null);
    if (cloudServer != null && modules != null && modules.length == 1) {
      IWorkbenchWindow workbenchWindow = ServerUIPlugin.getInstance().getWorkbench().getActiveWorkbenchWindow();
      IWorkbenchPage page = workbenchWindow.getActivePage();

      try {
        // open server editor
        ServerEditor editor = (ServerEditor) page.openEditor(new ServerEditorInput(server.getId()),
            IServerEditorInput.EDITOR_ID);
View Full Code Here


    if (serversViewDescriptor != null) {

      // Granular null checks required as any of the workbench components
      // may not be available at some given point in time (e.g., during
      // start/shutdown)
      IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();

      if (activeWorkbenchWindow != null) {

        IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();

        if (activePage != null) {
          IViewReference[] references = activePage.getViewReferences();

          if (references != null) {
View Full Code Here

      // attempt to close any modal dialogs
      if (test instanceof ShutdownWatchdog) {
        Display.getDefault().asyncExec(new Runnable() {
          public void run() {
            IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            if (window != null) {
              Shell shell = window.getShell();
              Shell[] shells = window.getShell().getDisplay().getShells();
              for (Shell child : shells) {
                if (child != shell) {
                  child.close();
                }
              }
View Full Code Here

    protected abstract INewWizard createWizard() throws CoreException;

    private IStructuredSelection getSelection()
    {
        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        if (window != null)
        {
            ISelection selection = window.getSelectionService().getSelection();
            if (selection instanceof IStructuredSelection)
            {
                return (IStructuredSelection) selection;
            }
        }
View Full Code Here

    public void run(String[] params, ICheatSheetManager manager)
    {
        if (params != null && params.length > 0)
        {
            IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
            IWorkbenchPage page = window.getActivePage();
            try
            {
                page.showView(params[0]);
            }
            catch (PartInitException e)
View Full Code Here

                        InputStream in = FileLocator.openStream(b, new Path(sourcePath),
                            false);
                        file.create(in, true, monitor);
                    }

                    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
                    FileEditorInput input = new FileEditorInput(file);
                    window.getActivePage().openEditor(input, editorID);
                }
                catch (IOException e)
                {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
View Full Code Here

  private boolean fInViewPart = true;
private OpenFileAction action;
private TreeViewer treeViewer;
  private IWorkbenchPage getActivePage() {
    IWorkbenchWindow activeWorkbenchWindow= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (activeWorkbenchWindow == null) {
      return null;
    }
    return activeWorkbenchWindow.getActivePage();
  }
View Full Code Here

    protected void selectRevealAndShow(IFile file)
    {
        selectAndReveal(file);

        // Open editor on new file.
        IWorkbenchWindow dw = getWorkbench().getActiveWorkbenchWindow();
        try
        {
            if (dw != null)
            {
                IWorkbenchPage page = dw.getActivePage();
                if (page != null)
                {
                    IDE.openEditor(page, file, true);
                }
            }
View Full Code Here

    IProject project = null;
    project = FilesAccess.getProjectFromMenuSelection(event);
    if (project != null)
      removeNature(project);
    else {
      IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
      MessageDialog.openError(window.getShell(), "PlayClipse", "Cannot find the project object.");
    }
    return null;
  }
View Full Code Here

    IProject project = null;
    project = FilesAccess.getProjectFromMenuSelection(event);
    if (project != null)
      addNature(project);
    else {
      IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
      MessageDialog.openError(window.getShell(), "PlayClipse", "Cannot find the project object.");
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWorkbenchWindow

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.