Search in sources :

Example 6 with AppContext

use of sun.awt.AppContext in project jdk8u_jdk by JetBrains.

the class WindowsToggleButtonUI method createUI.

public static ComponentUI createUI(JComponent b) {
    AppContext appContext = AppContext.getAppContext();
    WindowsToggleButtonUI windowsToggleButtonUI = (WindowsToggleButtonUI) appContext.get(WINDOWS_TOGGLE_BUTTON_UI_KEY);
    if (windowsToggleButtonUI == null) {
        windowsToggleButtonUI = new WindowsToggleButtonUI();
        appContext.put(WINDOWS_TOGGLE_BUTTON_UI_KEY, windowsToggleButtonUI);
    }
    return windowsToggleButtonUI;
}
Also used : AppContext(sun.awt.AppContext)

Example 7 with AppContext

use of sun.awt.AppContext in project jdk8u_jdk by JetBrains.

the class SystemFlavorMap method getDefaultFlavorMap.

/**
     * Returns the default FlavorMap for this thread's ClassLoader.
     */
public static FlavorMap getDefaultFlavorMap() {
    AppContext context = AppContext.getAppContext();
    FlavorMap fm = (FlavorMap) context.get(FLAVOR_MAP_KEY);
    if (fm == null) {
        fm = new SystemFlavorMap();
        context.put(FLAVOR_MAP_KEY, fm);
    }
    return fm;
}
Also used : AppContext(sun.awt.AppContext)

Example 8 with AppContext

use of sun.awt.AppContext in project jdk8u_jdk by JetBrains.

the class InputMethodEvent method getMostRecentEventTimeForSource.

/**
     * Get the most recent event time in the {@code EventQueue} which the {@code source}
     * belongs to.
     *
     * @param source the source of the event
     * @exception  IllegalArgumentException  if source is null.
     * @return most recent event time in the {@code EventQueue}
     */
private static long getMostRecentEventTimeForSource(Object source) {
    if (source == null) {
        // throw the IllegalArgumentException to conform to EventObject spec
        throw new IllegalArgumentException("null source");
    }
    AppContext appContext = SunToolkit.targetToAppContext(source);
    EventQueue eventQueue = SunToolkit.getSystemEventQueueImplPP(appContext);
    return AWTAccessor.getEventQueueAccessor().getMostRecentEventTime(eventQueue);
}
Also used : AppContext(sun.awt.AppContext) EventQueue(java.awt.EventQueue)

Example 9 with AppContext

use of sun.awt.AppContext in project jdk8u_jdk by JetBrains.

the class SwingWorker method getDoSubmit.

private static AccumulativeRunnable<Runnable> getDoSubmit() {
    synchronized (DO_SUBMIT_KEY) {
        final AppContext appContext = AppContext.getAppContext();
        Object doSubmit = appContext.get(DO_SUBMIT_KEY);
        if (doSubmit == null) {
            doSubmit = new DoSubmitAccumulativeRunnable();
            appContext.put(DO_SUBMIT_KEY, doSubmit);
        }
        return (AccumulativeRunnable<Runnable>) doSubmit;
    }
}
Also used : AccumulativeRunnable(sun.swing.AccumulativeRunnable) AppContext(sun.awt.AppContext)

Example 10 with AppContext

use of sun.awt.AppContext in project jdk8u_jdk by JetBrains.

the class MenuSelectionManager method defaultManager.

/**
     * Returns the default menu selection manager.
     *
     * @return a MenuSelectionManager object
     */
public static MenuSelectionManager defaultManager() {
    synchronized (MENU_SELECTION_MANAGER_KEY) {
        AppContext context = AppContext.getAppContext();
        MenuSelectionManager msm = (MenuSelectionManager) context.get(MENU_SELECTION_MANAGER_KEY);
        if (msm == null) {
            msm = new MenuSelectionManager();
            context.put(MENU_SELECTION_MANAGER_KEY, msm);
            // installing additional listener if found in the AppContext
            Object o = context.get(SwingUtilities2.MENU_SELECTION_MANAGER_LISTENER_KEY);
            if (o != null && o instanceof ChangeListener) {
                msm.addChangeListener((ChangeListener) o);
            }
        }
        return msm;
    }
}
Also used : AppContext(sun.awt.AppContext)

Aggregations

AppContext (sun.awt.AppContext)74 HashMap (java.util.HashMap)3 Hashtable (java.util.Hashtable)3 Locale (java.util.Locale)3 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)3 EventListenerAggregate (sun.awt.EventListenerAggregate)3 FlavorListener (java.awt.datatransfer.FlavorListener)2 WeakReference (java.lang.ref.WeakReference)2 Map (java.util.Map)2 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)2 LookAndFeel (javax.swing.LookAndFeel)2 MetalLookAndFeel (javax.swing.plaf.metal.MetalLookAndFeel)2 MetalTheme (javax.swing.plaf.metal.MetalTheme)2 ValueNamePair (org.compiere.util.ValueNamePair)2 PeerEvent (sun.awt.PeerEvent)2 AccumulativeRunnable (sun.swing.AccumulativeRunnable)2 Container (java.awt.Container)1 EventQueue (java.awt.EventQueue)1 Font (java.awt.Font)1 Rectangle (java.awt.Rectangle)1