net.i2p.desktopgui

## Class Main

- java.lang.Object
- - net.i2p.desktopgui.Main

- All Implemented Interfaces:
    ClientApp, NotificationService, RouterApp

      public class Main
      extends Object
      implements RouterApp, NotificationService

  Main entry point for the I2P Desktop GUI application. Implements RouterApp and NotificationService to provide system tray functionality with full router context access for comprehensive I2P management.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PROP_ENABLE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Main()`
    `Main(RouterContext ctx, ClientAppManager mgr, String[] args)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `cancel(int id)` Cancel a notification if possible.
    `String` | `getDisplayName()` The display name of the ClientApp, used in user interfaces.
    `String` | `getName()` The generic name of the ClientApp, used for registration, e.g.
    `ClientAppState` | `getState()` The current state of the ClientApp.
    `static void` | `main(String[] args)`
    `int` | `notify(String source, String category, int priority, String title, String message, String path)` Send a notification to the user.
    `void` | `shutdown(String[] args)` Do not take a long time.
    `void` | `startup()` Do not take a long time.
    `boolean` | `update(int id, String title, String message, String path)` Update the text of a notification if possible.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PROP_ENABLE

          public static final String PROP_ENABLE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Main

          public Main()

    - #### Main

          public Main(RouterContext ctx,
                      ClientAppManager mgr,
                      String[] args)

  - ### Method Detail

    - #### cancel

          public boolean cancel(int id)

      Cancel a notification if possible. Unsupported.
      Specified by:
        `cancel` in interface `NotificationService`
      Parameters:
        `id` - as received from notify()
      Returns:
        false always

    - #### getDisplayName

          public String getDisplayName()

      Description copied from interface: `ClientApp`
      The display name of the ClientApp, used in user interfaces. The app must translate.
      Specified by:
        `getDisplayName` in interface `ClientApp`
      Returns:
        non-null

    - #### getName

          public String getName()

      Description copied from interface: `ClientApp`
      The generic name of the ClientApp, used for registration, e.g. "console". Do not translate.
      Specified by:
        `getName` in interface `ClientApp`
      Returns:
        non-null

    - #### getState

          public ClientAppState getState()

      Description copied from interface: `ClientApp`
      The current state of the ClientApp.
      Specified by:
        `getState` in interface `ClientApp`
      Returns:
        non-null

    - #### main

          public static void main(String[] args)

    - #### notify

          public int notify(String source,
                            String category,
                            int priority,
                            String title,
                            String message,
                            String path)

      Send a notification to the user.
      Specified by:
        `notify` in interface `NotificationService`
      Parameters:
        `source` - unsupported
        `category` - unsupported
        `priority` - unsupported
        `title` - for the popup, translated
        `message` - translated
        `path` - unsupported
      Returns:
        0, or -1 on failure

    - #### shutdown

          public void shutdown(String[] args)

      Description copied from interface: `ClientApp`
      Do not take a long time. Do not block. Use a thread if necessary. If previously running, client must call ClientAppManager.notify() at least once within this method to change the state to STOPPING or STOPPED. May be called multiple times on the same object, in any state.
      Specified by:
        `shutdown` in interface `ClientApp`
      Parameters:
        `args` - generally null but could be stopArgs from clients.config

    - #### startup

          public void startup()

      Description copied from interface: `ClientApp`
      Do not take a long time. Do not block. Start threads here if necessary. Client must call ClientAppManager.notify() at least once within this method to change the state from INITIALIZED to something else. Will not be called multiple times on the same object.
      Specified by:
        `startup` in interface `ClientApp`

    - #### update

          public boolean update(int id,
                                String title,
                                String message,
                                String path)

      Update the text of a notification if possible. Unsupported.
      Specified by:
        `update` in interface `NotificationService`
      Parameters:
        `id` - as received from notify()
        `title` - for the popup, translated
        `message` - translated
        `path` - in console starting with /, must be URL-escaped, or null
      Returns:
        false always