Class MergeUiUtils

java.lang.Object
com._1c.g5.v8.dt.compare.ui.util.MergeUiUtils

public class MergeUiUtils extends Object
Utility methods of UI Comparison and Merge.
  • Field Details

    • TEMPLATE_TYPED_CREATOR

      public static final ITypedElementCreator TEMPLATE_TYPED_CREATOR
      Template typed element creator.
    • TEXT_DOCUMENT_TYPED_CREATOR

      public static final IThreeSideTypedMergeCreator TEXT_DOCUMENT_TYPED_CREATOR
      Text document template three side typed merge creator.
  • Method Details

    • processExternalPropertyUsingExternalTool

      public static void processExternalPropertyUsingExternalTool(ExternalPropertyPartialModelNode node, IPartialModel partialModel, PartialModelController partialModelController, org.eclipse.swt.widgets.Shell shell, boolean readOnly, String mainComparisonSideName, String otherComparisonSideName, IThreeSideTypedMergeCreator typedCreator, IExternalMergeToolProvider externalMergeToolProvider, ISymbolicLinkLocalizer symbolicLinkLocalizer, IQualifiedNameFilePathConverter filePathConverter)
      Processes the external property using external tool. Compares or merges an external property, depends on merge rules.
      Parameters:
      node - the external property partial model node, cannot be null
      partialModel - the partial model, cannot be null
      partialModelController - the partial model controller, cannot be null
      shell - the shell, cannot be null
      readOnly - true if the external property is read-only, and false otherwise
      mainComparisonSideName - the main comparison side name, cannot be null
      otherComparisonSideName - the other comparison side name, cannot be null
      typedCreator - the three side typed merge creator, cannot be null
      externalMergeToolProvider - the external merge tool provider, cannot be null
      symbolicLinkLocalizer - the symbolic link localizer, cannot be null
      filePathConverter - the file path converter, cannot be null
    • mergeExternalPropertyUsingExternalTool

      public static void mergeExternalPropertyUsingExternalTool(ExternalPropertyPartialModelNode node, IPartialModel partialModel, PartialModelController partialModelController, String symlinkPostfix, org.eclipse.swt.widgets.Shell shell, String mainComparisonSideName, String otherComparisonSideName, IExternalMergeToolProvider externalMergeToolProvider, ISymbolicLinkLocalizer symbolicLinkLocalizer, IQualifiedNameFilePathConverter filePathConverter)
      Merges the external property using external tool.
      Parameters:
      node - the external property partial model node, cannot be null
      partialModel - the partial model, cannot be null
      partialModelController - the partial model controller, cannot be null
      shell - the shell, cannot be null
      symlinkPostfix - the symlink postfix, cannot be null
      mainComparisonSideName - the main comparison side name, cannot be null
      otherComparisonSideName - the other comparison side name, cannot be null
      externalMergeToolProvider - the external merge tool provider, cannot be null
      symbolicLinkLocalizer - the symbolic link localizer, cannot be null
      filePathConverter - the file path converter, cannot be null
    • compareExternalPropertyUsingExternalTool

      public static void compareExternalPropertyUsingExternalTool(ExternalPropertyPartialModelNode node, String symlinkPostfix, org.eclipse.swt.widgets.Shell shell, String mainComparisonSideName, String otherComparisonSideName, IExternalMergeToolProvider externalMergeToolProvider, ISymbolicLinkLocalizer symbolicLinkLocalizer, IQualifiedNameFilePathConverter filePathConverter)
      Compares the external property using external tool.
      Parameters:
      node - the external property partial model node, cannot be null
      symlinkPostfix - the symlink postfix, cannot be null
      shell - the shell, cannot be null
      mainComparisonSideName - the main comparison side name, cannot be null
      otherComparisonSideName - the other comparison side name, cannot be null
      externalMergeToolProvider - the external merge tool provider, cannot be null
      symbolicLinkLocalizer - the symbolic link localizer, cannot be null
      filePathConverter - the file path converter, cannot be null
    • getExternalMergeToolConfiguration

      public static ExternalMergeToolConfiguration getExternalMergeToolConfiguration(IPartialModelNode node, boolean readOnly, IExternalMergeToolProvider externalMergeToolProvider)
      Gets external merge tool configuration to given node.
      Parameters:
      node - the partial model node, cannot be null
      readOnly - true if the external property is read-only, and false otherwise
      externalMergeToolProvider - the external merge tool provider, cannot be null
      Returns:
      the external merge tool configuration, may be null
    • createMergeEditorInput

      public static TextFileThreeSideMergeEditorInput createMergeEditorInput(ExternalPropertyPartialModelNode node, String mainComparisonSideName, String otherComparisonSideName, IThreeSideTypedMergeCreator typedCreator, ISymbolicLinkLocalizer symbolicLinkLocalizer, IQualifiedNameFilePathConverter filePathConverter)
      Creates a text file three side merge editor input for the specified typed elements.
      Parameters:
      node - the external property partial model node, cannot be null
      mainComparisonSideName - the main comparison side name, cannot be null
      otherComparisonSideName - the other comparison side name, cannot be null
      typedCreator - the three side typed merge creator, cannot be null
      symbolicLinkLocalizer - the symbolic link localizer, cannot be null
      filePathConverter - the file path converter, cannot be null
      Returns:
      the text file three side merge editor input, never null
    • createCompareEditorInput

      public static DtCompareEditorInput createCompareEditorInput(ExternalPropertyPartialModelNode node, String mainComparisonSideName, String otherComparisonSideName, ITypedElementCreator typedCreator, ISymbolicLinkLocalizer symbolicLinkLocalizer, IQualifiedNameFilePathConverter filePathConverter)
      Creates compare editor input.
      Parameters:
      node - the external property partial model node, cannot be null
      mainComparisonSideName - the main comparison side name, cannot be null
      otherComparisonSideName - the other comparison side name, cannot be null
      typedCreator - the typed element creator, cannot be null
      symbolicLinkLocalizer - the symbolic link localizer, cannot be null
      filePathConverter - the file path converter, cannot be null
      Returns:
      dt compare editor input, never null
    • createTextMergeInput

      public static IThreeSideTextMergeInput createTextMergeInput(ComparisonNode node, boolean isThreeWay, org.eclipse.compare.ITypedElement mainElement, org.eclipse.compare.ITypedElement otherElement, org.eclipse.compare.ITypedElement ancestorElement, IThreeSideTypedMergeCreator typedCreator)
      Creates a three side text merge input for the specified typed elements.
      Parameters:
      node - the comparison node to create merge input for, now should be instance of SolidResourceComparisonNode, BslModuleComparisonNode or BslModuleSectionComparisonNode, cannot be null
      isThreeWay - true if the comparison session is three-way, and false if it is two-way
      mainTypedElement - the main typed element, cannot be null
      otherTypedElement - the other typed element, cannot be null
      ancestorTypedElement - the ancestor typed element, may be null
      typedCreator - the three side typed merge creator, cannot be null
      Returns:
      the three side text merge input, never null
    • getTypedElement

      public static org.eclipse.compare.ITypedElement getTypedElement(ExternalPropertyComparisonNode node, IComparisonSession session, ComparisonSide side, String comparisonSideName, org.eclipse.compare.CompareConfiguration compareConfiguration, ITypedElementCreator typedCreator, ISymbolicLinkLocalizer symbolicLinkLocalizer, IQualifiedNameFilePathConverter filePathConverter)
      Returns the external property node typed element.
      Parameters:
      node - the external property comparison node, cannot be null
      session - the comparison session, cannot be null
      side - the comparison side to get section typed element on, cannot be null
      comparisonSideName - the comparison side name, cannot be null
      compareConfiguration - the compare configuration, cannot be null
      typedCreator - the typed element creator, cannot be null
      symbolicLinkLocalizer - the symbolic link localizer, cannot be null
      filePathConverter - the file path converter, cannot be null
      Returns:
      the node typed element, may be null
    • saveMergeSettings

      public static void saveMergeSettings(IMergeRulePartialModelNode node, IPartialModel partialModel, PartialModelController partialModelController, File mergeResultFile)
      Saves the merge settings for the specified node.
      Parameters:
      node - the node to save settings for, cannot be null
      partialModel - the partial model, cannot be null
      partialModelController - the partial model controller, cannot be null
      mergeResultFile - the file containing merge result, cannot be null
    • saveMergeSettings

      public static void saveMergeSettings(IMergeRulePartialModelNode node, IThreeSideTextMergeInput input, MergeRule newRule, IPartialModel partialModel, PartialModelController partialModelController)
      Saves the merge settings for the specified node.
      Parameters:
      node - the partial model node to save the merge settings for, cannot be null
      input - the text merge input to get a new merge settings from, cannot be null
      newRule - a new merge rule to set, cannot be null
      partialModel - the partial model, cannot be null
      partialModelController - the partial model controller, cannot be null