Engineering template

The SuperMap iDesktopX package provides the Extension Development sample template project, that is, the installation directory/templates/SampleCode folder. Select the SuperMap iDesktopX package \ templates \ SampleCode directory through IDEA-> File-> Open-> to open the Extension Development sample template project.

The SampleCode sample template project has two modules, namely SampleCode Module and Develop Module. The sample template project is the SampleCode project, and the Develop Module is our Development Module.

SampleCode Module

SampleCode Module mainly uses the module's pomFile Management remote Repository Address and all sub-modules (Customized Plugin), and does not implement any specific functions. See the POM. XML file for SampleCode for details. Note: The path generated by jar cannot be modified.

Develop Module

Develop module is an Extension development sample module. There are three main internal classes, namely MyStartUp, DevelopPlugin, and CtrlActionS ampleCode.

 MyStartUp

MyStartUp is the entry point for the Secondary Development launch.

 DevelopePlugin

DevelopePlugin is a "plug-in class" and must be implemented. The naming rule is module name + "Plugin". You must inherit the implementation of AbstractPlugin class, otherwise it cannot be used Develop moduleAll Functions. See the DevelopePlugin class for the specific implementation.

CtrlActionSampleCode

CtrlActionS ampleCode is an example development class. The CtrlActionS ampleCode class contains the content to be executed in response to the triggering of the control event, that is, the class bound to the UI control, which must inherit from the CtrlAction class. See the CtrlActionS ampleCode class for the specific implementation method.

public class MyStartUp {
  public static void main(String args) {
      // user.dir must be the directory where iDesktop.jar is located
      // user.dir 必须是iDesktop.jar所在的目录路径
      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: The user. Dir must be the directory where the idesktop. Jar is located, that is, the installation directory; the custom startup module cannot execute any function related to Start iDesktopX, and is only responsible for Start iDesktopX; Start iDesktopX through customization, eliminating the need to manually execute Maven clean and Maven install or Maven package.

Related content

Environment deployment

Plug-in configuration overview

Interface configuration

Ribbon configuration

Config File menu

Configure the status bar

Configure the Context Menu

Configure Dock Bars

Attributes