java.awt.desktop.PreferencesHandler Java Examples

The following examples show how to use java.awt.desktop.PreferencesHandler. 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: _AppEventHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
synchronized void setHandler(final PreferencesHandler handler) {
    super.setHandler(handler);

    _AppMenuBarHandler.getInstance().setPreferencesMenuItemVisible(handler != null);
    _AppMenuBarHandler.getInstance().setPreferencesMenuItemEnabled(handler != null);
}
 
Example #2
Source File: _AppEventHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
void performUsing(final PreferencesHandler handler, final _NativeEvent event) {
    handler.handlePreferences(new PreferencesEvent());
}
 
Example #3
Source File: Desktop.java    From Bytecoder with Apache License 2.0 2 votes vote down vote up
/**
 * Installs a handler to show a custom Preferences window for your
 * application.
 * <p>
 * Setting the {@link PreferencesHandler} to {@code null} reverts it to
 * the default behavior
 *
 * @param preferencesHandler the handler to respond to the
 * {@link PreferencesHandler#handlePreferences(PreferencesEvent)}
 *
 * @throws SecurityException if a security manager exists and it
 * denies the
 * {@code RuntimePermission("canProcessApplicationEvents")} permission
 * @throws UnsupportedOperationException if the current platform
 * does not support the {@link Desktop.Action#APP_PREFERENCES} action
 * @since 9
 */
public void setPreferencesHandler(final PreferencesHandler preferencesHandler) {
    checkEventsProcessingPermission();
    checkActionSupport(Action.APP_PREFERENCES);
    peer.setPreferencesHandler(preferencesHandler);
}
 
Example #4
Source File: DesktopPeer.java    From Bytecoder with Apache License 2.0 2 votes vote down vote up
/**
 * Installs a handler to show a custom Preferences window for your
 * application.
 * <p>
 * Setting the {@link PreferencesHandler} to {@code null} reverts it to
 * the default behavior
 *
 * @param preferencesHandler the handler to respond to the
 * {@link java.awt.desktop.PreferencesHandler#handlePreferences(PreferencesEvent) }
 */
default void setPreferencesHandler(final PreferencesHandler preferencesHandler) {
}
 
Example #5
Source File: Desktop.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Installs a handler to show a custom Preferences window for your
 * application.
 * <p>
 * Setting the {@link PreferencesHandler} to {@code null} reverts it to
 * the default behavior
 *
 * @param preferencesHandler the handler to respond to the
 * {@link PreferencesHandler#handlePreferences(PreferencesEvent)}
 *
 * @throws SecurityException if a security manager exists and it
 * denies the
 * {@code RuntimePermission("canProcessApplicationEvents")} permission
 * @throws UnsupportedOperationException if the current platform
 * does not support the {@link Desktop.Action#APP_PREFERENCES} action
 * @since 9
 */
public void setPreferencesHandler(final PreferencesHandler preferencesHandler) {
    checkEventsProcessingPermission();
    checkActionSupport(Action.APP_PREFERENCES);
    peer.setPreferencesHandler(preferencesHandler);
}
 
Example #6
Source File: DesktopPeer.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Installs a handler to show a custom Preferences window for your
 * application.
 * <p>
 * Setting the {@link PreferencesHandler} to {@code null} reverts it to
 * the default behavior
 *
 * @param preferencesHandler the handler to respond to the
 * {@link java.awt.desktop.PreferencesHandler#handlePreferences(PreferencesEvent) }
 */
default void setPreferencesHandler(final PreferencesHandler preferencesHandler) {
}
 
Example #7
Source File: Application.java    From openjdk-jdk9 with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Installs a handler to create the Preferences menu item in your application's app menu.
 *
 * Setting the {@link PreferencesHandler} to {@code null} will remove the Preferences item from the app menu.
 *
 * @param preferencesHandler
 * @since Java for Mac OS X 10.6 Update 3
 * @since Java for Mac OS X 10.5 Update 8
 */
public void setPreferencesHandler(final PreferencesHandler preferencesHandler) {
    eventHandler.preferencesDispatcher.setHandler(preferencesHandler);
}