Class ModelHandle

java.lang.Object
org.netbeans.modules.maven.api.customizer.ModelHandle

public final class ModelHandle extends Object
ModelHandle instance is passed down to customizer panel providers in the context lookup.
  • Field Details

  • Method Details

    • getPOMModel

      public org.netbeans.modules.maven.model.pom.POMModel getPOMModel()
      pom.xml model
      Returns:
    • getProject

      public org.apache.maven.project.MavenProject getProject()
      the non changed (not-to-be-changed) instance of the complete project. NOT TO BE CHANGED.
      Returns:
    • getRawAuxiliaryProperty

      public String getRawAuxiliaryProperty(String propertyName, boolean shared)
      get the value of Auxiliary property defined in the project, however take only the content in nb-configurations.xml file into account, never consider values from pom.xml here.
      Parameters:
      propertyName -
      shared -
      Returns:
    • setRawAuxiliaryProperty

      public void setRawAuxiliaryProperty(String propertyName, String value, boolean shared)
      set the value of Auxiliary property, will be written to nb-configurations.xml file
      Parameters:
      propertyName -
      value -
      shared -
    • getActionMappings

      public ActionToGoalMapping getActionMappings()
      action mapping model
      Returns:
    • getActionMappings

      public ActionToGoalMapping getActionMappings(ModelHandle.Configuration config)
      action mapping model
      Parameters:
      config -
      Returns:
    • setUserActionMapping

      public static void setUserActionMapping(NetbeansActionMapping action, ActionToGoalMapping mapp)
      inserts the action definition in the right place based on matching action name. replaces old defintion or appends at the end.
      Parameters:
      action -
      mapp -
    • getDefaultMapping

      @CheckForNull public static NetbeansActionMapping getDefaultMapping(String action, org.netbeans.api.project.Project project)
      Since:
      2.19
    • getMapping

      @CheckForNull public static NetbeansActionMapping getMapping(String action, org.netbeans.api.project.Project project, org.netbeans.spi.project.ProjectConfiguration config)
      Load a particular action mapping.
      Parameters:
      action - an action name
      project - a Maven project
      config - a configuration of that project
      Returns:
      an action mapping model, or null
      Since:
      2.19
    • putMapping

      public static void putMapping(NetbeansActionMapping mapp, org.netbeans.api.project.Project project, org.netbeans.spi.project.ProjectConfiguration config) throws IOException
      Store a particular action mapping.
      Parameters:
      mapp - an action mapping model
      project - a Maven project
      config - a configuration of that project
      Throws:
      IOException - in case of trouble
      Since:
      2.19
    • getConfigurations

      public List<ModelHandle.Configuration> getConfigurations()
    • addConfiguration

      public void addConfiguration(ModelHandle.Configuration config)
    • removeConfiguration

      public void removeConfiguration(ModelHandle.Configuration config)
    • getActiveConfiguration

      public ModelHandle.Configuration getActiveConfiguration()
    • setActiveConfiguration

      public void setActiveConfiguration(ModelHandle.Configuration conf)
    • isModified

      public boolean isModified(Object obj)
    • markAsModified

      public void markAsModified(Object obj)
      always after modifying the models, mark them as modified. without the marking, the particular file will not be saved.
      Parameters:
      obj - either getPOMModel() or getActionMappings()
    • createProfileConfiguration

      public static ModelHandle.Configuration createProfileConfiguration(String id)
    • createDefaultConfiguration

      public static ModelHandle.Configuration createDefaultConfiguration()
    • createCustomConfiguration

      public static ModelHandle.Configuration createCustomConfiguration(String id)