-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
cchantep
committed
Jan 6, 2014
1 parent
3ad35ce
commit 927d412
Showing
17 changed files
with
315 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package acolyte; | ||
|
||
import java.lang.reflect.Method; | ||
|
||
import java.awt.Image; | ||
|
||
/** | ||
* Native utility. | ||
* | ||
* @author Cedric Chantepie | ||
*/ | ||
final class Native { | ||
|
||
/** | ||
* Sets |icon| for Mac OS X dock. | ||
* @return true if set | ||
*/ | ||
public static boolean setDockIcon(final Image icon) { | ||
try { | ||
final Class<?> clazz = Class.forName("com.apple.eawt.Application"); | ||
final Method am = clazz.getMethod("getApplication"); | ||
final Object app = am.invoke(null, new Object[0]); | ||
final Method si = clazz.getMethod("setDockIconImage", | ||
new Class[] { Image.class }); | ||
|
||
si.invoke(app, new Object[] { icon }); | ||
|
||
return true; | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} // end of catch | ||
|
||
return false; | ||
} // end of setDockIcon | ||
} // end of class Native |
Oops, something went wrong.