Class FunctionTagListingMerger

  • All Implemented Interfaces:
    ListingMergeConstants

    public class FunctionTagListingMerger
    extends java.lang.Object
    Handles merging of function tags when they are added/removed from functions. Most merging can be done automatically; the exception being when a tag has been added to a function by one user, but deleted from the program by another. Note that there are other tag related conflict cases, but they are handled by the FunctionTagMerger, which handles all aspects of creation/deletion/editing of tags independent of functions. THIS CLASS ONLY DEALS WITH FUNCTION-RELATED ADDS/REMOVES. The specific cases handled by the class are described below: - X and Y are tags - ** indicates a conflict User A | Add X Add Y Delete X Delete Y | User B | ------------------------------------------------------- Add X | X X,Y ** X | Add Y | X,Y Y Y ** | Delete X | ** Y - - | Delete Y | X ** - -
    • Field Detail

      • MERGE_HIGHLIGHT_COLOR

        protected static final java.awt.Color MERGE_HIGHLIGHT_COLOR
      • conflictOption

        protected int conflictOption
      • currentAddress

        protected Address currentAddress
      • resultPgm

        protected Program resultPgm
      • originalPgm

        protected Program originalPgm
      • latestPgm

        protected Program latestPgm
      • diffOriginalLatest

        protected ProgramDiff diffOriginalLatest
      • errorBuf

        protected java.lang.StringBuffer errorBuf
      • infoBuf

        protected java.lang.StringBuffer infoBuf
      • totalChanges

        protected long totalChanges
      • changeNum

        protected long changeNum
      • minPhaseProgressPercentage

        protected int minPhaseProgressPercentage
      • maxPhaseProgressPercentage

        protected int maxPhaseProgressPercentage
      • currentConflictPanel

        protected ConflictPanel currentConflictPanel
      • numConflictsResolved

        protected int numConflictsResolved
    • Constructor Detail

      • FunctionTagListingMerger

        public FunctionTagListingMerger​(ListingMergeManager listingMergeMgr)
        Constructor.
        Parameters:
        listingMergeMgr - the listing merge manager that owns this merger.
    • Method Detail

      • init

        public void init()
        PUBLIC METHODS
      • getConflictType

        public java.lang.String getConflictType()
      • getConflictCount

        public int getConflictCount​(Address addr)
      • apply

        public boolean apply()
      • setConflictResolution

        public void setConflictResolution​(int option)
        Stores the users' selection for how to handle a conflict.
        Parameters:
        option - user option, from ListingMergeConstants
      • hasConflict

        public boolean hasConflict​(Address addr)
      • initializeAutoMerge

        protected void initializeAutoMerge​(java.lang.String progressMessage,
                                           int progressMin,
                                           int progressMax,
                                           TaskMonitor monitor)
      • getCodeUnitAddressSet

        protected AddressSetView getCodeUnitAddressSet​(Address addr)
        Return an address set that contains all addresses that make up the code units containing the indicated address in the LATEST, MY, & ORIGINAL programs.
        Parameters:
        addr - the address
        Returns:
        the code unit address set
      • getCodeUnitAddressSet

        protected AddressSetView getCodeUnitAddressSet​(AddressSet addrs)
        Return an address set that contains all addresses that make up the code units containing the indicated addresses in the LATEST, MY, & ORIGINAL programs.
        Parameters:
        addr - the addresses
        Returns:
        the code unit address set
      • cancel

        public void cancel()
      • getNumConflictsResolved

        public int getNumConflictsResolved()
      • incrementProgress

        protected void incrementProgress​(int increment)
        Updates the progress bar associated with this phase of the merge. Before beginning to auto-merge the totalChanges and changeNum<\code> must be set. This method should then be called as changes are made to update the change bar. This assumes that each change is equivalent in terms of shown progress.
        Parameters:
        increment - the number of changes completed relative to the total number of changes for this auto-merger.
      • updateProgressMessage

        protected void updateProgressMessage​(java.lang.String message)
        Updates the progress message details associated with this phase of the merge.
        Parameters:
        progressMessage - a message indicating what is currently occurring in this phase. Null indicates to use the default message.
      • updateProgress

        protected void updateProgress​(int myPercentComplete)
        Updates the progress bar associated with this phase of the merge.
        Parameters:
        myPercentComplete - the progress percentage completed for this merger. This should be a value from 0 to 100.
      • updateProgress

        protected void updateProgress​(int myPercentComplete,
                                      java.lang.String message)
        Updates the progress bar and the progress message details associated with this phase of the merge.
        Parameters:
        myPercentComplete - the progress percentage completed for this merger. This should be a value from 0 to 100.
        progressMessage - a message indicating what is currently occurring in this phase. Null indicates to use the default message.