Java Code Examples for sun.awt.AppContext#removePropertyChangeListener()

The following examples show how to use sun.awt.AppContext#removePropertyChangeListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SunClipboard.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected void lostOwnershipNow(final AppContext disposedContext) {
    final SunClipboard sunClipboard = SunClipboard.this;
    ClipboardOwner owner = null;
    Transferable contents = null;

    synchronized (sunClipboard) {
        final AppContext context = sunClipboard.contentsContext;

        if (context == null) {
            return;
        }

        if (disposedContext == null || context == disposedContext) {
            owner = sunClipboard.owner;
            contents = sunClipboard.contents;
            sunClipboard.contentsContext = null;
            sunClipboard.owner = null;
            sunClipboard.contents = null;
            sunClipboard.clearNativeContext();
            context.removePropertyChangeListener
                    (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
        } else {
            return;
        }
    }
    if (owner != null) {
        owner.lostOwnership(sunClipboard, contents);
    }
}
 
Example 2
Source File: SunClipboard.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected void lostOwnershipNow(final AppContext disposedContext) {
    final SunClipboard sunClipboard = SunClipboard.this;
    ClipboardOwner owner = null;
    Transferable contents = null;

    synchronized (sunClipboard) {
        final AppContext context = sunClipboard.contentsContext;

        if (context == null) {
            return;
        }

        if (disposedContext == null || context == disposedContext) {
            owner = sunClipboard.owner;
            contents = sunClipboard.contents;
            sunClipboard.contentsContext = null;
            sunClipboard.owner = null;
            sunClipboard.contents = null;
            sunClipboard.clearNativeContext();
            context.removePropertyChangeListener
                    (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
        } else {
            return;
        }
    }
    if (owner != null) {
        owner.lostOwnership(sunClipboard, contents);
    }
}
 
Example 3
Source File: BasicLookAndFeel.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void uninitialize() {
    AppContext context = AppContext.getAppContext();
    synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
        Object grabber = context.get(BasicPopupMenuUI.MOUSE_GRABBER_KEY);
        if (grabber != null) {
            ((BasicPopupMenuUI.MouseGrabber)grabber).uninstall();
        }
    }
    synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
        Object helper =
                context.get(BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY);
        if (helper != null) {
            ((BasicPopupMenuUI.MenuKeyboardHelper)helper).uninstall();
        }
    }

    if(invocator != null) {
        AccessController.doPrivileged(invocator);
        invocator = null;
    }

    if (disposer != null) {
        // Note that we're likely calling removePropertyChangeListener()
        // during the course of AppContext.firePropertyChange().
        // However, EventListenerAggreggate has code to safely modify
        // the list under such circumstances.
        context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
                                             disposer);
        disposer = null;
    }
}
 
Example 4
Source File: BasicLookAndFeel.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void uninitialize() {
    AppContext context = AppContext.getAppContext();
    synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
        Object grabber = context.get(BasicPopupMenuUI.MOUSE_GRABBER_KEY);
        if (grabber != null) {
            ((BasicPopupMenuUI.MouseGrabber)grabber).uninstall();
        }
    }
    synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
        Object helper =
                context.get(BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY);
        if (helper != null) {
            ((BasicPopupMenuUI.MenuKeyboardHelper)helper).uninstall();
        }
    }

    if(invocator != null) {
        AccessController.doPrivileged(invocator);
        invocator = null;
    }

    if (disposer != null) {
        // Note that we're likely calling removePropertyChangeListener()
        // during the course of AppContext.firePropertyChange().
        // However, EventListenerAggreggate has code to safely modify
        // the list under such circumstances.
        context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
                                             disposer);
        disposer = null;
    }
}
 
Example 5
Source File: BasicLookAndFeel.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void uninitialize() {
    AppContext context = AppContext.getAppContext();
    synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
        Object grabber = context.get(BasicPopupMenuUI.MOUSE_GRABBER_KEY);
        if (grabber != null) {
            ((BasicPopupMenuUI.MouseGrabber)grabber).uninstall();
        }
    }
    synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
        Object helper =
                context.get(BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY);
        if (helper != null) {
            ((BasicPopupMenuUI.MenuKeyboardHelper)helper).uninstall();
        }
    }

    if(invocator != null) {
        AccessController.doPrivileged(invocator);
        invocator = null;
    }

    if (disposer != null) {
        // Note that we're likely calling removePropertyChangeListener()
        // during the course of AppContext.firePropertyChange().
        // However, EventListenerAggreggate has code to safely modify
        // the list under such circumstances.
        context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
                                             disposer);
        disposer = null;
    }
}
 
Example 6
Source File: BasicLookAndFeel.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void uninitialize() {
    AppContext context = AppContext.getAppContext();
    synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
        Object grabber = context.get(BasicPopupMenuUI.MOUSE_GRABBER_KEY);
        if (grabber != null) {
            ((BasicPopupMenuUI.MouseGrabber)grabber).uninstall();
        }
    }
    synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
        Object helper =
                context.get(BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY);
        if (helper != null) {
            ((BasicPopupMenuUI.MenuKeyboardHelper)helper).uninstall();
        }
    }

    if(invocator != null) {
        AccessController.doPrivileged(invocator);
        invocator = null;
    }

    if (disposer != null) {
        // Note that we're likely calling removePropertyChangeListener()
        // during the course of AppContext.firePropertyChange().
        // However, EventListenerAggreggate has code to safely modify
        // the list under such circumstances.
        context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
                                             disposer);
        disposer = null;
    }
}
 
Example 7
Source File: SunClipboard.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected void lostOwnershipNow(final AppContext disposedContext) {
    final SunClipboard sunClipboard = SunClipboard.this;
    ClipboardOwner owner = null;
    Transferable contents = null;

    synchronized (sunClipboard) {
        final AppContext context = sunClipboard.contentsContext;

        if (context == null) {
            return;
        }

        if (disposedContext == null || context == disposedContext) {
            owner = sunClipboard.owner;
            contents = sunClipboard.contents;
            sunClipboard.contentsContext = null;
            sunClipboard.owner = null;
            sunClipboard.contents = null;
            sunClipboard.clearNativeContext();
            context.removePropertyChangeListener
                    (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
        } else {
            return;
        }
    }
    if (owner != null) {
        owner.lostOwnership(sunClipboard, contents);
    }
}
 
Example 8
Source File: BasicLookAndFeel.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void uninitialize() {
    AppContext context = AppContext.getAppContext();
    synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
        Object grabber = context.get(BasicPopupMenuUI.MOUSE_GRABBER_KEY);
        if (grabber != null) {
            ((BasicPopupMenuUI.MouseGrabber)grabber).uninstall();
        }
    }
    synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
        Object helper =
                context.get(BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY);
        if (helper != null) {
            ((BasicPopupMenuUI.MenuKeyboardHelper)helper).uninstall();
        }
    }

    if(invocator != null) {
        AccessController.doPrivileged(invocator);
        invocator = null;
    }

    if (disposer != null) {
        // Note that we're likely calling removePropertyChangeListener()
        // during the course of AppContext.firePropertyChange().
        // However, EventListenerAggreggate has code to safely modify
        // the list under such circumstances.
        context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
                                             disposer);
        disposer = null;
    }
}
 
Example 9
Source File: SunClipboard.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
protected void lostOwnershipNow(final AppContext disposedContext) {
    final SunClipboard sunClipboard = SunClipboard.this;
    ClipboardOwner owner = null;
    Transferable contents = null;

    synchronized (sunClipboard) {
        final AppContext context = sunClipboard.contentsContext;

        if (context == null) {
            return;
        }

        if (disposedContext == null || context == disposedContext) {
            owner = sunClipboard.owner;
            contents = sunClipboard.contents;
            sunClipboard.contentsContext = null;
            sunClipboard.owner = null;
            sunClipboard.contents = null;
            sunClipboard.clearNativeContext();
            context.removePropertyChangeListener
                    (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
        } else {
            return;
        }
    }
    if (owner != null) {
        owner.lostOwnership(sunClipboard, contents);
    }
}
 
Example 10
Source File: BasicLookAndFeel.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void uninitialize() {
    AppContext context = AppContext.getAppContext();
    synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
        Object grabber = context.get(BasicPopupMenuUI.MOUSE_GRABBER_KEY);
        if (grabber != null) {
            ((BasicPopupMenuUI.MouseGrabber)grabber).uninstall();
        }
    }
    synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
        Object helper =
                context.get(BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY);
        if (helper != null) {
            ((BasicPopupMenuUI.MenuKeyboardHelper)helper).uninstall();
        }
    }

    if(invocator != null) {
        AccessController.doPrivileged(invocator);
        invocator = null;
    }

    if (disposer != null) {
        // Note that we're likely calling removePropertyChangeListener()
        // during the course of AppContext.firePropertyChange().
        // However, EventListenerAggreggate has code to safely modify
        // the list under such circumstances.
        context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
                                             disposer);
        disposer = null;
    }
}
 
Example 11
Source File: BasicLookAndFeel.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void uninitialize() {
    AppContext context = AppContext.getAppContext();
    synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
        Object grabber = context.get(BasicPopupMenuUI.MOUSE_GRABBER_KEY);
        if (grabber != null) {
            ((BasicPopupMenuUI.MouseGrabber)grabber).uninstall();
        }
    }
    synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
        Object helper =
                context.get(BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY);
        if (helper != null) {
            ((BasicPopupMenuUI.MenuKeyboardHelper)helper).uninstall();
        }
    }

    if(invocator != null) {
        AccessController.doPrivileged(invocator);
        invocator = null;
    }

    if (disposer != null) {
        // Note that we're likely calling removePropertyChangeListener()
        // during the course of AppContext.firePropertyChange().
        // However, EventListenerAggreggate has code to safely modify
        // the list under such circumstances.
        context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
                                             disposer);
        disposer = null;
    }
}
 
Example 12
Source File: SunClipboard.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected void lostOwnershipNow(final AppContext disposedContext) {
    final SunClipboard sunClipboard = SunClipboard.this;
    ClipboardOwner owner = null;
    Transferable contents = null;

    synchronized (sunClipboard) {
        final AppContext context = sunClipboard.contentsContext;

        if (context == null) {
            return;
        }

        if (disposedContext == null || context == disposedContext) {
            owner = sunClipboard.owner;
            contents = sunClipboard.contents;
            sunClipboard.contentsContext = null;
            sunClipboard.owner = null;
            sunClipboard.contents = null;
            sunClipboard.clearNativeContext();
            context.removePropertyChangeListener
                    (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
        } else {
            return;
        }
    }
    if (owner != null) {
        owner.lostOwnership(sunClipboard, contents);
    }
}
 
Example 13
Source File: SunClipboard.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void lostOwnershipNow(final AppContext disposedContext) {
    final SunClipboard sunClipboard = SunClipboard.this;
    ClipboardOwner owner = null;
    Transferable contents = null;

    synchronized (sunClipboard) {
        final AppContext context = sunClipboard.contentsContext;

        if (context == null) {
            return;
        }

        if (disposedContext == null || context == disposedContext) {
            owner = sunClipboard.owner;
            contents = sunClipboard.contents;
            sunClipboard.contentsContext = null;
            sunClipboard.owner = null;
            sunClipboard.contents = null;
            sunClipboard.clearNativeContext();
            context.removePropertyChangeListener
                    (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
        } else {
            return;
        }
    }
    if (owner != null) {
        owner.lostOwnership(sunClipboard, contents);
    }
}
 
Example 14
Source File: BasicLookAndFeel.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void uninitialize() {
    AppContext context = AppContext.getAppContext();
    synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
        Object grabber = context.get(BasicPopupMenuUI.MOUSE_GRABBER_KEY);
        if (grabber != null) {
            ((BasicPopupMenuUI.MouseGrabber)grabber).uninstall();
        }
    }
    synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
        Object helper =
                context.get(BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY);
        if (helper != null) {
            ((BasicPopupMenuUI.MenuKeyboardHelper)helper).uninstall();
        }
    }

    if(invocator != null) {
        AccessController.doPrivileged(invocator);
        invocator = null;
    }

    if (disposer != null) {
        // Note that we're likely calling removePropertyChangeListener()
        // during the course of AppContext.firePropertyChange().
        // However, EventListenerAggreggate has code to safely modify
        // the list under such circumstances.
        context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
                                             disposer);
        disposer = null;
    }
}
 
Example 15
Source File: BasicLookAndFeel.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void uninitialize() {
    AppContext context = AppContext.getAppContext();
    synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
        Object grabber = context.get(BasicPopupMenuUI.MOUSE_GRABBER_KEY);
        if (grabber != null) {
            ((BasicPopupMenuUI.MouseGrabber)grabber).uninstall();
        }
    }
    synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
        Object helper =
                context.get(BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY);
        if (helper != null) {
            ((BasicPopupMenuUI.MenuKeyboardHelper)helper).uninstall();
        }
    }

    if(invocator != null) {
        AccessController.doPrivileged(invocator);
        invocator = null;
    }

    if (disposer != null) {
        // Note that we're likely calling removePropertyChangeListener()
        // during the course of AppContext.firePropertyChange().
        // However, EventListenerAggreggate has code to safely modify
        // the list under such circumstances.
        context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
                                             disposer);
        disposer = null;
    }
}
 
Example 16
Source File: SunClipboard.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected void lostOwnershipNow(final AppContext disposedContext) {
    final SunClipboard sunClipboard = SunClipboard.this;
    ClipboardOwner owner = null;
    Transferable contents = null;

    synchronized (sunClipboard) {
        final AppContext context = sunClipboard.contentsContext;

        if (context == null) {
            return;
        }

        if (disposedContext == null || context == disposedContext) {
            owner = sunClipboard.owner;
            contents = sunClipboard.contents;
            sunClipboard.contentsContext = null;
            sunClipboard.owner = null;
            sunClipboard.contents = null;
            sunClipboard.clearNativeContext();
            context.removePropertyChangeListener
                    (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
        } else {
            return;
        }
    }
    if (owner != null) {
        owner.lostOwnership(sunClipboard, contents);
    }
}
 
Example 17
Source File: BasicLookAndFeel.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void uninitialize() {
    AppContext context = AppContext.getAppContext();
    synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
        Object grabber = context.get(BasicPopupMenuUI.MOUSE_GRABBER_KEY);
        if (grabber != null) {
            ((BasicPopupMenuUI.MouseGrabber)grabber).uninstall();
        }
    }
    synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
        Object helper =
                context.get(BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY);
        if (helper != null) {
            ((BasicPopupMenuUI.MenuKeyboardHelper)helper).uninstall();
        }
    }

    if(invocator != null) {
        AccessController.doPrivileged(invocator);
        invocator = null;
    }

    if (disposer != null) {
        // Note that we're likely calling removePropertyChangeListener()
        // during the course of AppContext.firePropertyChange().
        // However, EventListenerAggreggate has code to safely modify
        // the list under such circumstances.
        context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
                                             disposer);
        disposer = null;
    }
}
 
Example 18
Source File: SunClipboard.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected void lostOwnershipNow(final AppContext disposedContext) {
    final SunClipboard sunClipboard = SunClipboard.this;
    ClipboardOwner owner = null;
    Transferable contents = null;

    synchronized (sunClipboard) {
        final AppContext context = sunClipboard.contentsContext;

        if (context == null) {
            return;
        }

        if (disposedContext == null || context == disposedContext) {
            owner = sunClipboard.owner;
            contents = sunClipboard.contents;
            sunClipboard.contentsContext = null;
            sunClipboard.owner = null;
            sunClipboard.contents = null;
            sunClipboard.clearNativeContext();
            context.removePropertyChangeListener
                    (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
        } else {
            return;
        }
    }
    if (owner != null) {
        owner.lostOwnership(sunClipboard, contents);
    }
}
 
Example 19
Source File: BasicLookAndFeel.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void uninitialize() {
    AppContext context = AppContext.getAppContext();
    synchronized (BasicPopupMenuUI.MOUSE_GRABBER_KEY) {
        Object grabber = context.get(BasicPopupMenuUI.MOUSE_GRABBER_KEY);
        if (grabber != null) {
            ((BasicPopupMenuUI.MouseGrabber)grabber).uninstall();
        }
    }
    synchronized (BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY) {
        Object helper =
                context.get(BasicPopupMenuUI.MENU_KEYBOARD_HELPER_KEY);
        if (helper != null) {
            ((BasicPopupMenuUI.MenuKeyboardHelper)helper).uninstall();
        }
    }

    if(invocator != null) {
        AccessController.doPrivileged(invocator);
        invocator = null;
    }

    if (disposer != null) {
        // Note that we're likely calling removePropertyChangeListener()
        // during the course of AppContext.firePropertyChange().
        // However, EventListenerAggreggate has code to safely modify
        // the list under such circumstances.
        context.removePropertyChangeListener(AppContext.GUI_DISPOSED,
                                             disposer);
        disposer = null;
    }
}
 
Example 20
Source File: SunClipboard.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected void lostOwnershipNow(final AppContext disposedContext) {
    final SunClipboard sunClipboard = SunClipboard.this;
    ClipboardOwner owner = null;
    Transferable contents = null;

    synchronized (sunClipboard) {
        final AppContext context = sunClipboard.contentsContext;

        if (context == null) {
            return;
        }

        if (disposedContext == null || context == disposedContext) {
            owner = sunClipboard.owner;
            contents = sunClipboard.contents;
            sunClipboard.contentsContext = null;
            sunClipboard.owner = null;
            sunClipboard.contents = null;
            sunClipboard.clearNativeContext();
            context.removePropertyChangeListener
                    (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
        } else {
            return;
        }
    }
    if (owner != null) {
        owner.lostOwnership(sunClipboard, contents);
    }
}