< prev index next >

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

Print this page




 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
1015      * @throws UnsupportedOperationException if the current platform
1016      *         does not support the {@link Desktop.Action#BROWSE_FILE_DIR} action
1017      * @throws NullPointerException if {@code file} is {@code null}
1018      * @throws IllegalArgumentException if the specified file doesn't
1019      * exist
1020      * @since 9
1021      */
1022     public void browseFileDirectory(File file) {
1023         checkRead();
1024         checkActionSupport(Action.BROWSE_FILE_DIR);




 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 
1006         if (menuBar != null) {
1007             Container parent = menuBar.getParent();
1008             if (parent != null) {
1009                 parent.remove(menuBar);
1010                 menuBar.updateUI();
1011             }
1012         }
1013 
1014         peer.setDefaultMenuBar(menuBar);
1015     }
1016 
1017     /**
1018      * Opens a folder containing the {@code file} and selects it
1019      * in a default system file manager.
1020      * @param file the file
1021      * @throws SecurityException If a security manager exists and its
1022      *         {@link SecurityManager#checkRead(java.lang.String)} method
1023      *         denies read access to the file
1024      * @throws UnsupportedOperationException if the current platform
1025      *         does not support the {@link Desktop.Action#BROWSE_FILE_DIR} action
1026      * @throws NullPointerException if {@code file} is {@code null}
1027      * @throws IllegalArgumentException if the specified file doesn't
1028      * exist
1029      * @since 9
1030      */
1031     public void browseFileDirectory(File file) {
1032         checkRead();
1033         checkActionSupport(Action.BROWSE_FILE_DIR);


< prev index next >