< prev index next >

src/java.desktop/share/classes/java/awt/Desktop.java

Print this page




 975      *
 976      * @implNote Please note that for Mac OS, it opens the native help viewer
 977      * application if a Help Book has been added to the application bundler
 978      * and registered in the Info.plist with CFBundleHelpBookFolder
 979      *
 980      * @throws SecurityException if a security manager exists and it denies the
 981      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 982      * @throws UnsupportedOperationException if the current platform
 983      * does not support the {@link Desktop.Action#APP_HELP_VIEWER} action
 984      * @since 9
 985      */
 986     public void openHelpViewer() {
 987         checkEventsProcessingPermission();
 988         checkActionSupport(Action.APP_HELP_VIEWER);
 989         peer.openHelpViewer();
 990     }
 991 
 992     /**
 993      * Sets the default menu bar to use when there are no active frames.
 994      *
 995      * @implNote Aqua Look and Feel should be active to support this on Mac OS.
 996      *
 997      * @param menuBar to use when no other frames are active
 998      * @throws SecurityException if a security manager exists and it denies the
 999      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
1000      * @throws UnsupportedOperationException if the current platform
1001      * does not support the {@link Desktop.Action#APP_MENU_BAR} action
1002      * @since 9
1003      */
1004     public void setDefaultMenuBar(final JMenuBar menuBar) {
1005         checkEventsProcessingPermission();
1006         checkActionSupport(Action.APP_MENU_BAR);
1007         peer.setDefaultMenuBar(menuBar);
1008     }
1009 
1010     /**
1011      * Opens a folder containing the {@code file} and selects it
1012      * in a default system file manager.
1013      * @param file the file
1014      * @throws SecurityException If a security manager exists and its
1015      *         {@link SecurityManager#checkRead(java.lang.String)} method
1016      *         denies read access to the file




 975      *
 976      * @implNote Please note that for Mac OS, it opens the native help viewer
 977      * application if a Help Book has been added to the application bundler
 978      * and registered in the Info.plist with CFBundleHelpBookFolder
 979      *
 980      * @throws SecurityException if a security manager exists and it denies the
 981      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 982      * @throws UnsupportedOperationException if the current platform
 983      * does not support the {@link Desktop.Action#APP_HELP_VIEWER} action
 984      * @since 9
 985      */
 986     public void openHelpViewer() {
 987         checkEventsProcessingPermission();
 988         checkActionSupport(Action.APP_HELP_VIEWER);
 989         peer.openHelpViewer();
 990     }
 991 
 992     /**
 993      * Sets the default menu bar to use when there are no active frames.
 994      *


 995      * @param menuBar to use when no other frames are active
 996      * @throws SecurityException if a security manager exists and it denies the
 997      * {@code RuntimePermission("canProcessApplicationEvents")} permission.
 998      * @throws UnsupportedOperationException if the current platform
 999      * does not support the {@link Desktop.Action#APP_MENU_BAR} action
1000      * @since 9
1001      */
1002     public void setDefaultMenuBar(final JMenuBar menuBar) {
1003         checkEventsProcessingPermission();
1004         checkActionSupport(Action.APP_MENU_BAR);
1005         peer.setDefaultMenuBar(menuBar);
1006     }
1007 
1008     /**
1009      * Opens a folder containing the {@code file} and selects it
1010      * in a default system file manager.
1011      * @param file the file
1012      * @throws SecurityException If a security manager exists and its
1013      *         {@link SecurityManager#checkRead(java.lang.String)} method
1014      *         denies read access to the file


< prev index next >