Kie Workbench - Commom - Data modeller Client 6.2.0.CR2

org.kie.workbench.common.screens.datamodeller.client.util
Class DataModelerUtils

java.lang.Object
  extended by org.kie.workbench.common.screens.datamodeller.client.util.DataModelerUtils

public class DataModelerUtils
extends Object


Field Summary
static String BOOLEAN
           
static String BYTE
           
static String CHAR
           
static String CLIPPED_MARKER
           
static String DOUBLE
           
static String EXTERNAL_PREFIX
           
static String FLOAT
           
static String INT
           
static String LONG
           
static String MULTIPLE
           
static String NOT_SELECTED
           
static String SHORT
           
 
Constructor Summary
DataModelerUtils()
           
 
Method Summary
static String assembleClassName(String objPackage, String objName)
           
static String calculateExpectedClassName(org.uberfire.backend.vfs.Path projectRootPath, org.uberfire.backend.vfs.Path javaFilePath)
           
static String calculateExpectedClassName(String projectRootPathUri, String javaFilePathUri)
           
static String[] calculateSubPackages(String packageName)
           
static String extractClassName(String fullClassName)
           
static String extractPackageName(String fullClassName)
           
static String extractSimpleFileName(org.uberfire.backend.vfs.Path path)
           
static List<ObjectPropertyTO> filterPropertiesByType(Collection<ObjectPropertyTO> properties, List<String> expectedTypes, boolean skipUnmanaged)
           
static String getCanonicalClassName(String type)
           
static String getDataObjectFullLabel(DataObjectTO dataObject)
           
static String getDataObjectUILabel(DataObjectTO dataObject)
           
static String getDataObjectUILabel(DataObjectTO dataObject, boolean appendReadonlyMark, String readonlyMark)
           
static List<ObjectPropertyTO> getManagedProperties(DataObjectTO dataObjectTO)
           
static String getMaxLengthClippedString(String s, int maxLength)
           
static Integer getMaxPosition(DataObjectTO dataObjectTO)
           
static String[] getPackageTerms(String packageName)
           
static boolean hasPosition(ObjectPropertyTO propertyTO)
           
static void initList(com.github.gwtbootstrap.client.ui.ListBox listBox, boolean includeEmptyItem)
           
static void initTypeList(com.github.gwtbootstrap.client.ui.ListBox typeSelector, Collection<PropertyTypeTO> baseTypes, Collection<DataObjectTO> dataObjects, Collection<DataObjectTO> externalClasses, boolean includeEmptyItem)
           
static void initTypeList(com.github.gwtbootstrap.client.ui.ListBox typeSelector, Collection<PropertyTypeTO> baseTypes, Collection<DataObjectTO> dataObjects, Collection<DataObjectTO> externalClasses, String selectedType, boolean selectedTypeMultiple)
           
static void initTypeList(com.github.gwtbootstrap.client.ui.ListBox typeSelector, Collection<PropertyTypeTO> baseTypes, Collection<DataObjectTO> dataObjects, Collection<DataObjectTO> externalClasses, String selectedType, boolean selectedTypeMultiple, boolean includeEmptyItem)
           
static boolean isManagedProperty(ObjectPropertyTO propertyTO)
           
static Boolean isMultipleType(String type)
           
static void recalculatePositions(DataObjectTO dataObjectTO, Integer positionRemoved)
           
static void recalculatePositions(DataObjectTO dataObjectTO, Integer oldPosition, Integer newPosition)
          Recalculates the positions among the object's attributes, according to the following: Example 1: fieldPositions: 1 - 2 - 3 - 4 - 5 +------> oldPosition = 2, newPosition = 4 (nP > oP) implies: fieldPos 4 becomes 3 or: when oP < fP <= nP --> fP = fP - 1 fieldPos 3 becomes 2 fieldPos 2 becomes 4 or: when fP == oP --> fP = nP Example 2: fieldPositions: 1 - 2 - 3 - 4 - 5 <------+ oldPosition = 4 | newPosition = 2 (nP < oP) implies: fieldPos 2 becomes 3 or: when nP <= fP < oP --> fP = fP + 1 fieldPos 3 becomes 4 fieldPos 4 becomes 2 or: when fP == oP --> fP = nP
static String unCapitalize(String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTERNAL_PREFIX

public static final String EXTERNAL_PREFIX
See Also:
Constant Field Values

CLIPPED_MARKER

public static final String CLIPPED_MARKER
See Also:
Constant Field Values

MULTIPLE

public static final String MULTIPLE
See Also:
Constant Field Values

NOT_SELECTED

public static final String NOT_SELECTED
See Also:
Constant Field Values

BYTE

public static final String BYTE
See Also:
Constant Field Values

SHORT

public static final String SHORT
See Also:
Constant Field Values

INT

public static final String INT
See Also:
Constant Field Values

LONG

public static final String LONG
See Also:
Constant Field Values

FLOAT

public static final String FLOAT
See Also:
Constant Field Values

DOUBLE

public static final String DOUBLE
See Also:
Constant Field Values

CHAR

public static final String CHAR
See Also:
Constant Field Values

BOOLEAN

public static final String BOOLEAN
See Also:
Constant Field Values
Constructor Detail

DataModelerUtils

public DataModelerUtils()
Method Detail

isMultipleType

public static Boolean isMultipleType(String type)

getCanonicalClassName

public static String getCanonicalClassName(String type)

getDataObjectUILabel

public static String getDataObjectUILabel(DataObjectTO dataObject)

getDataObjectUILabel

public static String getDataObjectUILabel(DataObjectTO dataObject,
                                          boolean appendReadonlyMark,
                                          String readonlyMark)

getMaxLengthClippedString

public static String getMaxLengthClippedString(String s,
                                               int maxLength)

getDataObjectFullLabel

public static String getDataObjectFullLabel(DataObjectTO dataObject)

assembleClassName

public static String assembleClassName(String objPackage,
                                       String objName)

extractClassName

public static String extractClassName(String fullClassName)

extractPackageName

public static String extractPackageName(String fullClassName)

extractSimpleFileName

public static String extractSimpleFileName(org.uberfire.backend.vfs.Path path)

getPackageTerms

public static String[] getPackageTerms(String packageName)

calculateSubPackages

public static String[] calculateSubPackages(String packageName)

unCapitalize

public static String unCapitalize(String str)

getMaxPosition

public static Integer getMaxPosition(DataObjectTO dataObjectTO)

recalculatePositions

public static void recalculatePositions(DataObjectTO dataObjectTO,
                                        Integer positionRemoved)

recalculatePositions

public static void recalculatePositions(DataObjectTO dataObjectTO,
                                        Integer oldPosition,
                                        Integer newPosition)
Recalculates the positions among the object's attributes, according to the following: Example 1: fieldPositions: 1 - 2 - 3 - 4 - 5 +------> oldPosition = 2, newPosition = 4 (nP > oP) implies: fieldPos 4 becomes 3 or: when oP < fP <= nP --> fP = fP - 1 fieldPos 3 becomes 2 fieldPos 2 becomes 4 or: when fP == oP --> fP = nP Example 2: fieldPositions: 1 - 2 - 3 - 4 - 5 <------+ oldPosition = 4 | newPosition = 2 (nP < oP) implies: fieldPos 2 becomes 3 or: when nP <= fP < oP --> fP = fP + 1 fieldPos 3 becomes 4 fieldPos 4 becomes 2 or: when fP == oP --> fP = nP


hasPosition

public static boolean hasPosition(ObjectPropertyTO propertyTO)

getManagedProperties

public static List<ObjectPropertyTO> getManagedProperties(DataObjectTO dataObjectTO)

isManagedProperty

public static boolean isManagedProperty(ObjectPropertyTO propertyTO)

calculateExpectedClassName

public static String calculateExpectedClassName(org.uberfire.backend.vfs.Path projectRootPath,
                                                org.uberfire.backend.vfs.Path javaFilePath)

calculateExpectedClassName

public static String calculateExpectedClassName(String projectRootPathUri,
                                                String javaFilePathUri)

filterPropertiesByType

public static List<ObjectPropertyTO> filterPropertiesByType(Collection<ObjectPropertyTO> properties,
                                                            List<String> expectedTypes,
                                                            boolean skipUnmanaged)

initList

public static void initList(com.github.gwtbootstrap.client.ui.ListBox listBox,
                            boolean includeEmptyItem)

initTypeList

public static void initTypeList(com.github.gwtbootstrap.client.ui.ListBox typeSelector,
                                Collection<PropertyTypeTO> baseTypes,
                                Collection<DataObjectTO> dataObjects,
                                Collection<DataObjectTO> externalClasses,
                                boolean includeEmptyItem)

initTypeList

public static void initTypeList(com.github.gwtbootstrap.client.ui.ListBox typeSelector,
                                Collection<PropertyTypeTO> baseTypes,
                                Collection<DataObjectTO> dataObjects,
                                Collection<DataObjectTO> externalClasses,
                                String selectedType,
                                boolean selectedTypeMultiple)

initTypeList

public static void initTypeList(com.github.gwtbootstrap.client.ui.ListBox typeSelector,
                                Collection<PropertyTypeTO> baseTypes,
                                Collection<DataObjectTO> dataObjects,
                                Collection<DataObjectTO> externalClasses,
                                String selectedType,
                                boolean selectedTypeMultiple,
                                boolean includeEmptyItem)

Kie Workbench - Commom - Data modeller Client 6.2.0.CR2

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.