Class ProjectRootPropCnr

java.lang.Object
com.iizix.prop.GProp<GProp<?>[]>
com.iizix.prop.PropCnr
com.iizigo.project.ProjectRootPropCnr
All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, IPropRoot, Cloneable
Direct Known Subclasses:
JavaProjectRootPropCnr, ModuleRootPropCnr

public abstract class ProjectRootPropCnr extends PropCnr implements IPropRoot
The project root property container. This class is used for both Java projects and Module projects, the latter uses a subclasses instance of ProjectRootPropCnr.
Author:
Christopher Mindus
  • Constructor Details

    • ProjectRootPropCnr

      protected ProjectRootPropCnr(IProject project)
      Default for clipboard/drag-drop.
  • Method Details

    • getAnyPropFromReference

      public static GProp<?> getAnyPropFromReference(String reference)
      Gets a property from a reference, when no root property is available. This method does not support relative references ".:/path/name" nor aliases "*alias:/path/name".
      Parameters:
      reference - The reference name.
      Returns:
      A property, or null if not found.
    • getAnyPropFromReference

      public static GProp<?> getAnyPropFromReference(IResource resource, String reference)
      Gets a property from a reference, when no root property is available. If the resource is located in a Module project, alias references "*alias:/path/name" and relative references ".:/path/name" is supported.
      Parameters:
      resource - Any resource in a project, or the project.
      reference - The reference name.
      Returns:
      A property, or null if not found.
    • getProject

      public final IProject getProject()
      Gets the project.
    • isPropRoot

      public final boolean isPropRoot()
      Checks if this is a root property container. It is overridden by the root property.
      Specified by:
      isPropRoot in interface IGProp<GProp<?>[]>
      Overrides:
      isPropRoot in class GProp<GProp<?>[]>
      Returns:
      true for the root, false otherwise.
    • isPropReferenceTreeValid

      public boolean isPropReferenceTreeValid()
      Verifies if the tree is valid for reference creation. This method is typically overridden in a root property that has a Property Manager owner that in turn is checked for a particular configuration (e.g. Client-related references such as LabelForReference that does not create references when communicating).

      The code implementation for a root property should be:

           return (!isDisposed() invalid input: '&'invalid input: '&' getPropRootPropMgr()!=null);
       

      Specified by:
      isPropReferenceTreeValid in interface IGProp<GProp<?>[]>
      Specified by:
      isPropReferenceTreeValid in interface IPropRoot
      Overrides:
      isPropReferenceTreeValid in class GProp<GProp<?>[]>
      Returns:
      true if the root property manager is found, false otherwise.
    • getPropRootPropMgr

      public final PropMgr getPropRootPropMgr()
      Gets the Property Manager used for communication for the root container. If this is not the root container, the parent function is called upwards in tree.
      Specified by:
      getPropRootPropMgr in interface IGProp<GProp<?>[]>
      Specified by:
      getPropRootPropMgr in interface IPropRoot
      Overrides:
      getPropRootPropMgr in class GProp<GProp<?>[]>
      Returns:
      The Property Manager, or null when not attached to a root.
    • getEnvironment

      public EnvProps getEnvironment()
      Gets the environment properties. The default is to delegate the request to the parent container.
      Specified by:
      getEnvironment in interface IGProp<GProp<?>[]>
      Overrides:
      getEnvironment in class GProp<GProp<?>[]>
      Returns:
      The EnvProps for the client/server environment or null if not found.
    • getRootName

      public final String getRootName(GProp<?> requestor)
      Gets and checks if this container is the root. The name returned is in the Designer "module:".
      Overrides:
      getRootName in class GProp<GProp<?>[]>
      Parameters:
      requestor - The requestor property.
      Returns:
      The name of the project followed by ':'.
    • getRootFromName

      public PropCnr getRootFromName(GProp<?> requestor, String module)
      Gets the module root for a name. As this is the Designer, the module is the project.
      Overrides:
      getRootFromName in class GProp<GProp<?>[]>
      Parameters:
      requestor - The requestor property.
      module - The module name (without colon), i.e. the project name in the Designer.
      Returns:
      The root property container, or null if the module name is not found.
    • getProjectName

      public String getProjectName(GProp<?> requestor, String alias)
      Gets the project name from an alias, the alias does NOT begin with "*".
      Overrides:
      getProjectName in class GProp<GProp<?>[]>
      Parameters:
      requestor - The requestor property.
      alias - The alias.
      Returns:
      The project name for the alias, or null if not found.
    • getAliasName

      public String getAliasName(GProp<?> requestor, String projectName)
      Gets an alias name for a project name, the alias does NOT begin with "*".
      Overrides:
      getAliasName in class GProp<GProp<?>[]>
      Parameters:
      requestor - The requestor property.
      projectName - The project name (without ending ':').
      Returns:
      The alias name without leading '*' for the project name, or null if not found.
    • doReValidateReferences

      public static void doReValidateReferences(PropCnr pc)
      Rechecks and validates the references for a property container, with a "null" progress monitor that cannot be canceled.
      Parameters:
      pc - The property to re-verify, careful of the container depth for speed and CPU usage.
    • doValidateReferences

      public static void doValidateReferences(PropCnr pc, boolean doReCheck)
      Validates the references for a property container.
      Parameters:
      doReCheck - If a re-check of all references must be done.
    • resolveReferences

      public void resolveReferences(boolean doReCheck)
      Resolves references for this container and its children by sending resolve references events.
      Overrides:
      resolveReferences in class PropCnr
      Parameters:
      doReCheck - Recheck flag, avoid true unless really required.
    • onResetDependencyModulesAndProjects

      protected abstract void onResetDependencyModulesAndProjects()
      Method called to clear and initialize the initially dependent projects and modules of the project.
    • onEventSelf

      public void onEventSelf(GEvent event)
      Called when a property event is send to this property.

      A subclass can override this method to perform appropriate processing and is not required to call super.onEventSelf(e).

      Specified by:
      onEventSelf in interface IGProp<GProp<?>[]>
      Overrides:
      onEventSelf in class GProp<GProp<?>[]>
      Parameters:
      event - The property event.