Class ProjectRootPropCnr

  • All Implemented Interfaces:
    EventListener, IGProp<GProp<?>[]>, IPropCnr, java.lang.Cloneable
    Direct Known Subclasses:
    JavaProjectRootPropCnr, ModuleRootPropCnr

    public abstract class ProjectRootPropCnr
    extends PropCnr
    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 Detail

      • ProjectRootPropCnr

        protected ProjectRootPropCnr​(org.eclipse.core.resources.IProject project)
        Default for clipboard/drag-drop.
    • Method Detail

      • getAnyPropFromReference

        public static GProp<?> getAnyPropFromReference​(java.lang.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​(org.eclipse.core.resources.IResource resource,
                                                       java.lang.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 org.eclipse.core.resources.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.
      • 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.
      • getPropRootPropMgr

        public 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<?>[]>
        Overrides:
        getPropRootPropMgr in class GProp<GProp<?>[]>
        Returns:
        The Property Manager, or null when not attached to a root.
      • getRootName

        public final java.lang.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,
                                       java.lang.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 java.lang.String getProjectName​(GProp<?> requestor,
                                               java.lang.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 java.lang.String getAliasName​(GProp<?> requestor,
                                             java.lang.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.