<AWT Dev> Review-request for 8048731: JEP 272: Platform-Specific Desktop Features

Anthony Vanelverdinghe anthony.vanelverdinghe at gmail.com
Thu Nov 19 21:40:08 UTC 2015


Hi Alexander

One thing I strongly feel should be revisited, is the FileManager API. 
Here's my view on this:
- the functionality for the HFS/HFS+ attributes should be provided by 
interfaces in java.nio.file.attribute, analog to dos/posix file attributes
- the getResource/getPathToApplicationBundle methods should be moved to 
a separate, OS-independent "application bundle" feature in 
java.awt.Desktop. Even a .jar is in essence an application bundle.
- the findFolder methods are OS X-specific, even though most OSes 
provides analog functionality. For example, Windows calls this concept 
"Known Folders" [ 
https://msdn.microsoft.com/en-us/library/windows/desktop/bb776911%28v=vs.85%29.aspx 
]
- the moveToTrash method is a common and long-requested RFE, which 
should be supported on multiple platforms
- revealInFinder should be renamed to a common name like "explore", 
"browse" or "open"
In summary, I believe that the FileManager API should be made 
OS-independent, even if initially this feature is only supported on OS X.

On another note, I guess TaskbarPeer should be in the package 
java.awt.peer instead of java.awt?

Further, I went through the Javadoc of the public API:
- AppEvent has "{@link Application}" in its Javadoc. I think this should 
be removed, since there's no such class in the public API.

- AppEvent has the following Javadoc: "If the files were opened using 
the Spotlight search menu or a Finder search window, this method obtains 
the search term used to find the files.". In my opinion, this should be 
rephrased to be OS-independent, but use OS X as an example, for example: 
"The platform may additionally provide the search term that was used to 
find the files. This is for example the case on Mac OS X, when the files 
were opened using the Spotlight search menu or a Finder search window."

- Taskbar has the following Javadoc: "Linux support is limited to 
Unity". In my opinion, this should say "currently limited", and the 
paragraph should be prefixed with an @implNote annotation.

- Taskbar::getTaskbar mentions "browser context" 2 times. However, I 
have no clue what this means. Can this be reworded, or the term clarified?

Below is the remainder of my Javadoc nitpicking.

Kind regards,
Anthony


http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/00/src/java.desktop/share/classes/java/awt/Desktop.java.udiff.html
* Mac OS notifications -> Mac OS, notifications
* present in it's -> present in its
* a AppForegroundListener -> an AppForegroundListener
* a AppHiddenListener -> an AppHiddenListener
* a AppReopenedListener -> an AppReopenedListener
* a AboutHandler -> an AboutHandler
* a OpenFilesHandler -> an OpenFilesHandler
* a OpenURIHandler -> an OpenURIHandler
* platform specific -> platform-specific
* on current -> on the current (2x)
* user initiated -> user-initiated

http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/00/src/java.desktop/share/classes/java/awt/AppEvent.java.html
* it's about window -> its about window
* it's preferences window -> its preferences window
* @see AppReOpenedListener#appReOpened(AppEvent.AppReOpenedEvent) -> 
AppReopenedListener#appReopened(AppEvent.AppReopenedEvent)

http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/00/src/java.desktop/share/classes/java/awt/Taskbar.java.html
* system task area(Taskbar, Dock, etc.). -> the system task area 
(taskbar, Dock, etc.).
* on running platform -> on the current platform
* appending user specified menu to application -> appending a 
user-specified menu to the application
* Linux support is limited to Unity, however to make this features work 
on Unity the app [...] -> Linux support is currently limited to Unity. 
However to make these features work on Unity, the app [...]
* see https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles -> 
see <a 
href="https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles">https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles</a>
* by user -> by the user
* on platform -> on the platform
* by bouncing -> by a bouncing
* in task area -> in the task area
* It may has -> It may have
* platforms(e.g. Mac OS) -> platforms (e.g. Mac OS)
* On other platforms may require additional call -> Other platforms may 
require an additional call
* in system task area -> in the task area
* system provided -> system-provided (2x)
* Some platforms does -> Some platforms do
* and accepts only -> and accept only
* In this case pass an integer represented as string as a parameter. -> 
In this case, pass an integer represented as a string as parameter.

http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/00/src/java.desktop/share/classes/java/awt/desktop/AboutHandler.java.html
* it's about dialog -> its about dialog (2x)

http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/00/src/java.desktop/share/classes/java/awt/desktop/AppReopenedListener.java.html
* re-opened -> reopened
* re-open -> reopen

http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/00/src/java.desktop/share/classes/java/awt/desktop/FileManager.java.html
* a codes -> a code

http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/00/src/java.desktop/share/classes/java/awt/desktop/OpenFilesHandler.java.html
* it's Info.plist. -> its Info.plist.

http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/00/src/java.desktop/share/classes/java/awt/desktop/PreferencesHandler.java.html
* it's preferences UI -> its preferences UI (2x)

http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/00/src/java.desktop/share/classes/java/awt/desktop/QuitStrategy.java.html
* The strategy use to -> The strategy used to

http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/00/src/java.desktop/share/classes/java/awt/desktop/ScreenSleepListener.java.html
* have awoke -> have awoken

http://cr.openjdk.java.net/~azvegint/jdk/9/8143227/00/src/java.desktop/share/classes/java/awt/desktop/SystemSleepListener.java.html
* has awoke -> has awoken


On 18/11/2015 8:12, Alexander Zvegintsev wrote:
> Hello
>
> please review the fix
> http://cr.openjdk.java.net/~azvegint/jdk/9/8048731/
> for
> https://bugs.openjdk.java.net/browse/JDK-8048731
>
> This fix provides public support Mac OS X 
> features(com.apple.{eawt,eio}), adds support for various desktop
> features such as progress indication, dock overlays, dock menus, etc.
> This is done by extending java.awt.Desktop and adding java.awt.Taskbar 
> classes
>
> Linux support is limited by Unity, however this is not the only 
> limitation :) An app should be run via
> AppName.desktop file [0] with specified system property 
> -Djava.desktop.appName=AppName.desktop
>
> [0] https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles
>
>



More information about the awt-dev mailing list