11.1.2.4 Adding custom Project Properties

The Project Properties dialog in autoload.py can display a custom JPanel , created using Java Swing objects from within jython.
  • To enable MPLAB X IDE to discover the new JPanel, autoload.py must contain a function called mplab_configure_XXXXXXX , where XXXXXX is a user-defined string of characters:. An entry named XXXXXXX will show up under the configuration node of the Project Properties.
  • If present,save_mplab_configure_XXXXXX is called when the user closes the Project Properties dialog or presses Apply. At this time, the script should read user input from the Java Swing objects and save them to the settings object using settings.setString().

Example

def mplab_configure_Bootstrap(confName):
    global bsOpt
    if bsOpt == None:
       bsOpt=BootstrapPane()
    return bsOpt.getPanel()

def save_mplab_configure_Bootstrap(confName):
    global bsOpt
    if bsOpt == None:
       return

    settings.setString("boot.path", bsOpt.binTxt.getText())
    settings.setString("boot.prj", bsOpt.prjTxt.getText())
    settings.setString("boot.load_adr", bsOpt.loadTxt.getText())
    settings.setString("boot.entry_adr", bsOpt.entryTxt.getText())
    settings.setString("boot.use", "true" if bsOpt.useBs.isSelected() else "false")

For a complete example, look in the j-link_cortex-a5.py file in the IDE pack folder . This script creates and declares a Bootstrap pane for MPU projects.