Project Template

  SuperMap iDesktopX product package provides an extension development sample template project, located in the installation directory /templates/SampleCode folder. You can open the extension development sample template project by navigating to IDEA -> File -> Open -> select the SuperMap iDesktopX product package \templates\SampleCode directory.

  The SampleCode sample template project consists of two Modules: the SampleCode Module and the Develop Module. The sample template project refers to the SampleCode project, where the Develop Module is our development module.

SampleCode Module

  The SampleCode Module mainly manages the remote repository address and all sub-modules (customized plugins) through this module's POM file management and does not implement any specific functionality. For details, please refer to the pom.xml file in SampleCode. Note: The JAR generation path cannot be modified.

Develop Module

  The Develop Module is an extension development sample module. There are three main classes inside: MyStartUp, DevelopPlugin, and CtrlActionSampleCode.

MyStartUp

MyStartUp is the entry point for secondary development startup.

DevelopePlugin

  DevelopePlugin is a required "plugin class". Its naming convention is the module name + "Plugin". It must inherit and implement the AbstractPlugin class; otherwise, all functions of the Develop Module will be unavailable. For specific implementation details, please refer to the DevelopePlugin class.

CtrlActionSampleCode

  CtrlActionSampleCode is a sample development class. The CtrlActionSampleCode class contains the content to be executed when responding to control event triggers, i.e., the class bound to UI controls. This class must inherit from the CtrlAction class. For specific implementation details, please refer to the CtrlActionSampleCode class.

public class MyStartUp {
  public static void main(String[] args) {
      // user.dir must be the directory where iDesktop.jar is located
      // user.dir must be the directory where iDesktop.jar is located
      System.setProperty("user.dir", System.getProperty("user.dir").replace(File.separator + "templates" + 
                         File.separator + "SampleCode", ""));
      // to do your things
      Application.setActiveApplication(new Application());
      if (!Application.getActiveApplication().initialize()) {
        System.exit(0);
      }
   }
}      

  Note: user.dir must be the directory where idesktop.jar is located, which is the installation directory. The custom startup module should not execute any functionality unrelated to starting iDesktopX; it is only responsible for starting iDesktopX. Starting iDesktopX via a custom startup does not require manually executing Maven clean, Maven install, or Maven package.

Related Topics

   Environment Deployment

   Plugin Configuration Overview

   Interface Configuration

   Ribbon Configuration

   Start Menu Configuration

   Status Bar Configuration

   Context Menu Configuration

   Dock Bars Configuration

   Attributes