Package org.eclipse.ui

Examples of org.eclipse.ui.ISelectionService


        if (!isActive()) {
            return;
        }
        setEnabled(false);
        if (editorListener != null) {
            ISelectionService service = getSite().getWorkbenchWindow()
                .getSelectionService();
            if (service != null) {
                service.removePostSelectionListener(editorListener);
            }
            FileBuffers.getTextFileBufferManager().removeFileBufferListener(
                editorListener);

        }
View Full Code Here


            .getBoolean(BCOConstants.LINK_REF_VIEW_TO_EDITOR);
        linkWithViewAction = new DefaultToggleAction(BCOConstants.LINK_REF_VIEW_TO_EDITOR){
            public void run(boolean newState) {
                linkWithView = newState;
                if(linkWithView){
                    ISelectionService selectionService = workbenchWindow
                        .getSelectionService();
                    try {
                        IViewPart part = workbenchWindow.getActivePage()
                            .showView(
                                "de.loskutov.bco.views.BytecodeOutlineView");
                        ISelection selection = selectionService
                            .getSelection("de.loskutov.bco.views.BytecodeOutlineView");
                        selectionChanged(part, selection);
                    } catch (PartInitException e) {
                        BytecodeOutlinePlugin.log(e, IStatus.ERROR);
                    }
View Full Code Here

    }

    public void partVisible(IWorkbenchPartReference partRef) {
        if (partRef.getId().equals(getSite().getId())) {
            IWorkbenchWindow workbenchWindow = getSite().getWorkbenchWindow();
            ISelectionService selectionService = workbenchWindow
                .getSelectionService();
            String partId = BytecodeOutlineView.class.getName();
            selectionService.addPostSelectionListener(this);


            // perform initialization with already existing selection (if any)
            ISelection selection = selectionService.getSelection(partId);
            if(selection != null) {
                IViewReference viewReference = workbenchWindow.getActivePage()
                    .findViewReference(partId);
                if(viewReference != null) {
                    selectionChanged(viewReference.getView(false), selection);
View Full Code Here

    public void initialize(IServiceLocator locator) {
        this.serviceLocator = locator;
    }

    protected IContributionItem[] getContributionItems() {
        ISelectionService selectionService = (ISelectionService) serviceLocator
                .getService(ISelectionService.class);
        if (selectionService == null) {
            return new IContributionItem[0];
        }
        ISelection selection = selectionService.getSelection();
        if (selection == null || !(selection instanceof IStructuredSelection)) {
            return new IContributionItem[0];
        }

        Map/* <IProject, Set<IvyClasspathContainer>> */containers = new HashMap();
View Full Code Here

    /**
     * Adds a post selection listener that listens to the workbench's selection for maps, layers or MapEditor.
     */
    private void addWorkbenchSelectionListener() {
        // page.addPostSelectionListener(workbenchSelectionListener);       
        ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService();
        selectionService.addPostSelectionListener(workbenchSelectionListener);
    }
View Full Code Here

       
        super.dispose();
        if( activePartListener!=null )
            page.removePartListener(activePartListener);
        if( workbenchSelectionListener!=null ){
            ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService();
            selectionService.removePostSelectionListener(workbenchSelectionListener);
        }
        if( layer!=null && layerListener!=null )
            layer.removeListener(layerListener);
        table = null;
        activePartListener = null;
View Full Code Here

        // Show the default page
        showPageRec(defaultPageRec);

        // Listen to part activation events.
        getSite().getPage().addPartListener(partListener);
        ISelectionService workbenchSelection = (ISelectionService) getSite().getService(
                ISelectionService.class);
        workbenchSelection.addPostSelectionListener(selectionListener);
        showBootstrapPart();

        getSite().getPage().getWorkbenchWindow().addPerspectiveListener(perspectiveListener);
    }
View Full Code Here

    public void dispose() {
        getSite().getPage().getWorkbenchWindow().removePerspectiveListener(perspectiveListener);

        // stop listening to part activation
        getSite().getPage().removePartListener(partListener);
        ISelectionService workbenchSelection = (ISelectionService) getSite().getService(
                ISelectionService.class);
        workbenchSelection.addPostSelectionListener(selectionListener);

        // Deref all of the pages.
        activeRec = null;
        if (defaultPageRec != null) {
            // check for null since the default page may not have
View Full Code Here

     * view's contents. Eg. workbench selection, view activation, etc.
     */
    private void addWorkbenchListeners() {

        final IWorkbenchPartSite partSite = getSite();
        final ISelectionService selectionService = partSite.getWorkbenchWindow()
                .getSelectionService();
       
        // Add workbench selection listener
        workbenchSelectionListener = new ISelectionListener() {
            @Override
            public void selectionChanged(IWorkbenchPart part, ISelection selection) {               
                if (!(part instanceof DocumentView)) {
                    handleWorkbenchSelection(selection);   
                }
            }
        };
        selectionService.addPostSelectionListener(workbenchSelectionListener);
       
        // Add workbench part listener
        workbenchPartListener = new IPartListener() {
            @Override
            public void partOpened(IWorkbenchPart part) {
                if (part instanceof DocumentView) {
                    handleWorkbenchSelection(selectionService.getSelection());
                }
            }
            @Override
            public void partDeactivated(IWorkbenchPart part) {
                // Nothing
View Full Code Here

        gridData.widthHint = 500;
        gridData.heightHint = 200;
        description.setLayoutData( gridData );
       
        selectionListener = new WorkbenchSelectionListener();
        ISelectionService selectionService = getSite().getWorkbenchWindow().getSelectionService();
        selectionService.addPostSelectionListener(selectionListener);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.ISelectionService

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.