org.eclipse.emf.emfstore.internal.client.model.changeTracking.merging.util
Class DecisionUtil

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.model.changeTracking.merging.util.DecisionUtil

public final class DecisionUtil
extends Object

Class offering common methods for the merge dialog.

Author:
wesendon

Field Summary
static String EDITABLE
          Editable detail provider.
static int OPTION_LENGTH
          Length of option label.
static String SEPERATOR
          Separator symbol for detail provider.
static String WIDGET_MULTILINE
          Multiline widget detail provider.
static String WIDGET_MULTILINE_EDITABLE
          Multiline editable widget detail provider.
 
Method Summary
static String cutString(String str, int length, boolean addPoints)
          Cuts a text to certain length and adds "..." at the end if needed.
static boolean detailsNeeded(VisualConflict conflict)
          Checks whether a conflict needs details.
static String getClassAndName(org.eclipse.emf.ecore.EObject modelElement)
          Returns Class and Name of EObject.
static ConflictOption getConflictOptionByType(List<ConflictOption> options, ConflictOption.OptionType type)
          Get Option by is type.
static String getDescription(String key, boolean isBranchMerge)
          Returns conflict descriptions on basis of the DescriptionProvider .
static String getLabel(Object obj, String unset)
          Uses the object's toString method or returns unset string.
static String getModelElementName(org.eclipse.emf.ecore.EObject modelElement)
          Returns name for an element by using MergeLabelProvider.
static String stripNewLine(String text)
          Strips line breaking characters from text.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTION_LENGTH

public static final int OPTION_LENGTH
Length of option label.

See Also:
Constant Field Values

SEPERATOR

public static final String SEPERATOR
Separator symbol for detail provider.

See Also:
Constant Field Values

EDITABLE

public static final String EDITABLE
Editable detail provider.

See Also:
Constant Field Values

WIDGET_MULTILINE

public static final String WIDGET_MULTILINE
Multiline widget detail provider.

See Also:
Constant Field Values

WIDGET_MULTILINE_EDITABLE

public static final String WIDGET_MULTILINE_EDITABLE
Multiline editable widget detail provider.

See Also:
Constant Field Values
Method Detail

cutString

public static String cutString(String str,
                               int length,
                               boolean addPoints)
Cuts a text to certain length and adds "..." at the end if needed.

Parameters:
str - text
length - length
addPoints - true, if ending dots
Returns:
shortened string

stripNewLine

public static String stripNewLine(String text)
Strips line breaking characters from text.

Parameters:
text - text
Returns:
line of text

getConflictOptionByType

public static ConflictOption getConflictOptionByType(List<ConflictOption> options,
                                                     ConflictOption.OptionType type)
Get Option by is type.

Parameters:
options - list of options
type - type
Returns:
resulting option or null

detailsNeeded

public static boolean detailsNeeded(VisualConflict conflict)
Checks whether a conflict needs details.

Parameters:
conflict - conflict
Returns:
true, if so

getDescription

public static String getDescription(String key,
                                    boolean isBranchMerge)
Returns conflict descriptions on basis of the DescriptionProvider .

Parameters:
key - key
isBranchMerge - if true, a prefix will be added to the key in order to get branch wording
Returns:
description

getLabel

public static String getLabel(Object obj,
                              String unset)
Uses the object's toString method or returns unset string.

Parameters:
obj - obj to string
unset - unset string
Returns:
obj.toString or unset

getClassAndName

public static String getClassAndName(org.eclipse.emf.ecore.EObject modelElement)
Returns Class and Name of EObject.

Parameters:
modelElement - modelelement
Returns:
string

getModelElementName

public static String getModelElementName(org.eclipse.emf.ecore.EObject modelElement)
Returns name for an element by using MergeLabelProvider.

Parameters:
modelElement - specified element
Returns:
name for element;


Copyright © 2015. All Rights Reserved.