Class AbstractNodeWithLabels

    • Constructor Detail

      • AbstractNodeWithLabels

        protected AbstractNodeWithLabels​(IPartialModelNode parent,
                                         ComparisonNode node,
                                         String mainLabel,
                                         String otherLabel,
                                         IImageProvider imageProvider,
                                         IComparisonSession comparisonSession)
        Constructs partial node for the specified comparison node.
        Parameters:
        parent - the parent partial model node
        node - the comparison node to build partial node for, cannot be null
        mainLabel - representation of the main side
        otherLabel - representation of the other side
        imageProvider - the image provider
        comparisonSession - the comparison session
      • AbstractNodeWithLabels

        protected AbstractNodeWithLabels​(IPartialModelNode parent,
                                         String label,
                                         ComparisonSide objectSide,
                                         IImageProvider imageProvider,
                                         IComparisonSession comparisonSession)
        Constructs partial node when the comparison node is absent. Called to create equal partial nodes, see IPartialEqualNode.
        Parameters:
        parent - the parent partial model node
        label - the object's representation
        objectSide - the object side, can be either null or MAIN or OTHER side
        imageProvider - the image provider
        comparisonSession - the comparison session
    • Method Detail

      • getSideLabel

        public String getSideLabel​(ComparisonSide side)
        Description copied from interface: IPartialModelNode
        Returns a label (textual representation) of the value referred from the specified side of the node.
        Specified by:
        getSideLabel in interface IPartialModelNode
        Parameters:
        side - the side of the node
        Returns:
        a label
      • hasDifferences

        public boolean hasDifferences​(ComparisonSide side1,
                                      ComparisonSide side2)
        Description copied from interface: IComparedElement
        Returns true if compared objects on the specified sides are different, i.e. they have changes or one of them is absent.
        Specified by:
        hasDifferences in interface IComparedElement
        Parameters:
        side1 - the first side of the comparison direction, not null
        side2 - the second side of the comparison direction, not null
        Returns:
        true if the compared objects are different
      • hasChanged

        public boolean hasChanged​(ComparisonSide side1,
                                  ComparisonSide side2)
        Description copied from interface: IComparedElement
        Returns true if compared objects on the specified sides have changed properties or elements. This implies that the compared objects must be present on both specified sides.
        Specified by:
        hasChanged in interface IComparedElement
        Parameters:
        side1 - the first side of the comparison direction, not null
        side2 - the second side of the comparison direction, not null
        Returns:
        true if the compared objects have changed properties
      • hasDoubleChanges

        public boolean hasDoubleChanges()
        Description copied from interface: IComparedElement
        Returns true if the compared objects have at least one property that was changed from the corresponding property of the common ancestor object both in the main and in the other objects. This flag is only relevant for three-way nodes.
        Specified by:
        hasDoubleChanges in interface IComparedElement
        Returns:
        true if the node has properties with double changes or a child node with this flag
      • hasPotentialMergeProblems

        public boolean hasPotentialMergeProblems()
        Description copied from interface: IComparedElement
        Tells whether the compared element has potential problems that could break a project after the merge.
        Specified by:
        hasPotentialMergeProblems in interface IComparedElement
        Returns:
        true if have potential merge problems, false otherwise
      • getTooltipText

        public String getTooltipText()
        Description copied from interface: IPartialModelNode
        Returns node's tooltip text.
        Specified by:
        getTooltipText in interface IPartialModelNode
        Returns:
        the text to be displayed as tooltip or null if no tooltip to be displayed
      • hasOnlyOnOneSide

        public boolean hasOnlyOnOneSide​(ComparisonSide side1,
                                        ComparisonSide side2)
        Description copied from interface: IComparedElement
        Returns true if the compared object is present on the specified first side, and absent on the specified other side.
        Specified by:
        hasOnlyOnOneSide in interface IComparedElement
        Parameters:
        side1 - the first side of the comparison direction, not null
        side2 - the second side of the comparison direction, not null
        Returns:
        true if the compared object is present on side1 and absent on side2
      • hasOrderChanged

        public boolean hasOrderChanged​(ComparisonSide side1,
                                       ComparisonSide side2)
        Description copied from interface: IComparedElement
        Returns true if the compared object's order in its parent collection was changed between the specified sides. This implies that the compared objects must be present on both specified sides.
        Specified by:
        hasOrderChanged in interface IComparedElement
        Parameters:
        side1 - the first side of the comparison direction, not null
        side2 - the second side of the comparison direction, not null
        Returns:
        true if the compared object's order was changed
      • hasUnchanged

        public boolean hasUnchanged​(ComparisonSide side1,
                                    ComparisonSide side2)
        Description copied from interface: IComparedElement
        Returns true if compared objects on the specified sides have unchanged properties or elements. This implies that the compared objects must be present on both specified sides.
        Specified by:
        hasUnchanged in interface IComparedElement
        Parameters:
        side1 - the first side of the comparison direction, not null
        side2 - the second side of the comparison direction, not null
        Returns:
        true if the compared objects have changed properties.
      • isCheckable

        public boolean isCheckable()
        Description copied from interface: IPartialModelNode
        Checks if the node is checkable.
        Specified by:
        isCheckable in interface IPartialModelNode
        Returns:
        true if the node is checkable, and false otherwise
      • isChecked

        public boolean isChecked()
        Description copied from interface: IPartialModelNode
        Checks whether this node is checked.
        Specified by:
        isChecked in interface IPartialModelNode
        Returns:
        true if the node is checked, and false otherwise
      • isGrayed

        public boolean isGrayed()
        Description copied from interface: IPartialModelNode
        Checks whether the checkbox of this node is grayed if applicable (i.e. it has some children checked and others unchecked). This means that the node has checkable/mergeable children that will not be merged.
        Specified by:
        isGrayed in interface IPartialModelNode
        Returns:
        true if the node's checkbox is grayed
      • setChecked

        public void setChecked​(boolean value)
        Description copied from interface: IPartialModelNode
        Sets the "Checked" state of the partial model node.
        Specified by:
        setChecked in interface IPartialModelNode
        Parameters:
        value - the value to set
      • setGrayed

        public void setGrayed​(boolean value)
      • setShowMergeRule

        public void setShowMergeRule​(boolean value)
        Description copied from interface: IMergeRulePartialModelNode
        Sets custom flag of merge rule showing for this node.
        Specified by:
        setShowMergeRule in interface IMergeRulePartialModelNode
        Parameters:
        value - true to show merge rule by default, false to always hide the merge rule