Class MacApplication

java.lang.Object
org.rapidcontext.app.ui.MacApplication

public class MacApplication extends Object
A Mac application wrapper. This class is used to avoid a direct dependency on the Apple-specific AWT classes used on the Mac. Instead, all calls to this class are forwarded via reflection to the real application handler. This avoids ClassNotFoundException when loading this class on other environments.
Version:
1.0
  • Method Details

    • get

      public static MacApplication get() throws Exception
      Returns the Mac application wrapper instance.
      Returns:
      the Mac application wrapper instance
      Throws:
      Exception - if the Apple-specific classes weren't found
    • setDockIconImage

      public void setDockIconImage(Image image) throws Exception
      Sets the dock icon image for the application.
      Parameters:
      image - the image to use
      Throws:
      Exception - if the image couldn't be added
    • setAboutHandler

      public void setAboutHandler(ActionListener listener) throws Exception
      Sets an about handler for the application.
      Parameters:
      listener - the handler to use, or null for default
      Throws:
      Exception - if the handler couldn't be added
    • setPreferencesHandler

      public void setPreferencesHandler(ActionListener listener) throws Exception
      Sets a preferences handler for the application.
      Parameters:
      listener - the handler to use, or null for none
      Throws:
      Exception - if the handler couldn't be added