Package org.eclipse.ui

Examples of org.eclipse.ui.IWorkbenchPage


            name = name.substring(0, i);
        }
        final FunctionRef ref = new FunctionRef(name, f.getFunctionName(), f.getArity());

        final IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        final IWorkbenchPage page = dw.getActivePage();

        final AsyncCaller<CallHierarchyView> ac = new AsyncCaller<CallHierarchyView>(100) {

            @Override
            protected CallHierarchyView prepare() {
                try {
                    final IViewPart p = page.showView("org.erlide.ui.callhierarchy");
                    final CallHierarchyView cvh = (CallHierarchyView) p
                            .getAdapter(CallHierarchyView.class);

                    cvh.setMessage("<searching... project "
                            + ErlangEngine.getInstance().getModelUtilService()
                                    .getProject(module).getName() + ">");
                    return cvh;
                } catch (final PartInitException e) {
                    ErlLogger.error("could not open Call hierarchy view: ",
                            e.getMessage());
                    return null;
                }
            }

            @Override
            protected RpcFuture call() throws BackendException {
                final RpcFuture result = xrefService.addProject(ErlangEngine
                        .getInstance().getModelUtilService().getProject(module));
                return result;
            }

            @Override
            protected void handleResult(final CallHierarchyView context,
                    final RpcFuture result) {
                page.activate(context);
                try {
                    context.setRoot(ErlangEngine.getInstance().getModel()
                            .findFunction(ref));
                } catch (final ErlModelException e) {
                    ErlLogger.error(e);
View Full Code Here


        if (erl) {
            final IWorkbench workbench = PlatformUI.getWorkbench();
            final IWorkbenchWindow activeWorkbenchWindow = workbench
                    .getActiveWorkbenchWindow();
            if (activeWorkbenchWindow != null) {
                final IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
                try {
                    activePage.showView(CONSOLE_VIEW_ID);
                } catch (final PartInitException e) {
                    // ignore
                }
            }
        }
View Full Code Here

                fFoldingRunner.cancel();
                return;
            }
            final IWorkbenchPartSite site = getSite();
            if (site != null) {
                final IWorkbenchPage page = site.getPage();
                if (!page.isPartVisible(ErlangEditor.this)) {
                    // if we're not visible - defer until visible
                    fPage = page;
                    fFoldingRunner = this;
                    page.addPartListener(this);
                    return;
                }
            }
            // we're visible - run now
            toggleFolding();
View Full Code Here

        monitor.setTaskName("Opening file for editing...");
        getShell().getDisplay().asyncExec(new Runnable() {

            @Override
            public void run() {
                final IWorkbenchPage page = PlatformUI.getWorkbench()
                        .getActiveWorkbenchWindow().getActivePage();
                try {
                    IDE.openEditor(page, file, true);
                } catch (final PartInitException e) {
                }
View Full Code Here

            file.refreshLocal(IResource.DEPTH_ZERO, null);
        } catch (final CoreException e) {
        }

        final IWorkbench wbench = PlatformUI.getWorkbench();
        final IWorkbenchPage page = wbench.getActiveWorkbenchWindow().getActivePage();
        final IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry()
                .getDefaultEditor(file.getName());
        try {
            page.openEditor(new FileEditorInput(file), desc.getId());
        } catch (final PartInitException e) {
            ErlLogger.error(e);
        }
    }
View Full Code Here

        final File fileToOpen = new File(module.getFilePath());

        final IFileStore fileStore = EFS.getLocalFileSystem()
                .getStore(fileToOpen.toURI());
        final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
                .getActivePage();

        try {
            final IEditorPart p = IDE.openEditorOnFileStore(page, fileStore);
View Full Code Here

        }
    }

    protected final boolean isActiveEditor() {
        final IWorkbenchWindow window = getSite().getWorkbenchWindow();
        final IWorkbenchPage page = window.getActivePage();
        if (page == null) {
            return false;
        }
        final IEditorPart activeEditor = page.getActiveEditor();
        return activeEditor != null && activeEditor.equals(this);
    }
View Full Code Here

                            } else {
                                final IWorkbenchWindow window = PlatformUI.getWorkbench()
                                        .getActiveWorkbenchWindow();

                                if (window != null) {
                                    final IWorkbenchPage page = window.getActivePage();
                                    workingSet = page.getAggregateWorkingSet();

                                    if (workingSet.isAggregateWorkingSet()
                                            && workingSet.isEmpty()) {
                                        workingSet = null;
                                    }
View Full Code Here

        bringConsoleViewToFront();
        launchConfiguration.launch(mode, null);
    }

    private void bringConsoleViewToFront() throws PartInitException {
        final IWorkbenchPage activePage = PlatformUI.getWorkbench()
                .getActiveWorkbenchWindow().getActivePage();
        activePage.showView(CONSOLE_VIEW_ID);
    }
View Full Code Here

    }

    private static IEditorPart openInEditor(final IFile file, final boolean activate)
            throws PartInitException {
        if (file != null) {
            final IWorkbenchPage p = ErlideUIPlugin.getActivePage();
            if (p != null) {
                final IEditorPart editorPart = IDE.openEditor(p, file, activate);
                return editorPart;
            }
        }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IWorkbenchPage

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.