Package org.eclipse.ui

Examples of org.eclipse.ui.IPartListener2


     * Set up the MultiEditor to propagate events like partClosed().
     *
     * @since 3.2
     */
    private void setupEvents() {
    propagationListener = new IPartListener2() {
      public void partActivated(IWorkbenchPartReference partRef) {
      }

      public void partBroughtToTop(IWorkbenchPartReference partRef) {
      }
View Full Code Here


     * Creates a new NavigationHistory to keep the NavigationLocation
     * entries of the specified page.
     */
    public NavigationHistory(final WorkbenchPage page) {
        this.page = page;
        page.addPartListener(new IPartListener2() {
            public void partActivated(IWorkbenchPartReference partRef) {
            }

            public void partBroughtToTop(IWorkbenchPartReference partRef) {
            }
View Full Code Here

                updateActionsStates();
            }
        } );

        // Initializing the PartListener
        getSite().getPage().addPartListener( new IPartListener2()
        {
            /**
              * This implementation deactivates the shortcuts when the part is deactivated.
              */
            public void partDeactivated( IWorkbenchPartReference partRef )
View Full Code Here

    /**
     * Initializes the PartListener.
     */
    private void initPartListener()
    {
        view.getSite().getPage().addPartListener( new IPartListener2()
        {
            /**
              * This implementation deactivates the shortcuts when the part is deactivated.
              */
            public void partDeactivated( IWorkbenchPartReference partRef )
View Full Code Here

        saveSplitterRatio();
        settings.put( "orientation", orientation.ordinal() );         //$NON-NLS-1$
    }
    private void addPartListener() {
        final String ID = getViewSite().getId();
        partListener= new IPartListener2() {
                    public void partActivated(IWorkbenchPartReference partRef) { }
                    public void partBroughtToTop(IWorkbenchPartReference partRef) { }
                    public void partClosed(IWorkbenchPartReference partRef) {
                        if (ID.equals(partRef.getId()))
                            saveViewSettings();
View Full Code Here

        if (partListeners.containsKey(editorManager)) {
            log.error("EditorPartListener was added twice: ", new StackTrace());
            removeEditorPartListener(editorManager);
        }

        IPartListener2 partListener = new SafePartListener2(log,
            new EditorPartListener(editorManager));

        partListeners.put(editorManager, partListener);

        // TODO This can fail if a shared project is started when no
View Full Code Here

                updateActionsStates();
            }
        } );

        // Initializing the PartListener
        getSite().getPage().addPartListener( new IPartListener2()
        {
            /**
              * This implementation deactivates the shortcuts when the part is deactivated.
              */
            public void partDeactivated( IWorkbenchPartReference partRef )
View Full Code Here

     * Notifies the listener that a part has been activated.
     */
    public void firePartActivated(final IWorkbenchPartReference ref) {
        Object[] array = getListeners();
        for (int i = 0; i < array.length; i++) {
            final IPartListener2 l = (IPartListener2) array[i];
            fireEvent(new SafeRunnable() {
                public void run() {
                    l.partActivated(ref);
                }
            }, l, ref, "activated::"); //$NON-NLS-1$
        }
    }
View Full Code Here

     * Notifies the listener that a part has been brought to top.
     */
    public void firePartBroughtToTop(final IWorkbenchPartReference ref) {
        Object[] array = getListeners();
        for (int i = 0; i < array.length; i++) {
            final IPartListener2 l = (IPartListener2) array[i];
            fireEvent(new SafeRunnable() {
                public void run() {
                    l.partBroughtToTop(ref);
                }
            }, l, ref, "broughtToTop::"); //$NON-NLS-1$
        }
    }
View Full Code Here

     * Notifies the listener that a part has been closed
     */
    public void firePartClosed(final IWorkbenchPartReference ref) {
        Object[] array = getListeners();
        for (int i = 0; i < array.length; i++) {
            final IPartListener2 l = (IPartListener2) array[i];
            fireEvent(new SafeRunnable() {
                public void run() {
                    l.partClosed(ref);
                }
            }, l, ref, "closed::"); //$NON-NLS-1$
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.IPartListener2

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.