Package com._1c.g5.v8.dt.qw.ui.utils
Class FieldsEditor
- java.lang.Object
-
- com._1c.g5.v8.dt.qw.ui.utils.FieldsEditor
-
public final class FieldsEditor extends Object
Editing operations with fields collection
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addField(QueryWizardSource source, QuerySchemaExpression newField, NestedTableExpression parentNestedTable)
Adds a new expressionstatic void
addField(QueryWizardSource source, QuerySchemaExpression newField, NestedTableExpression parentNestedTable, int mappingPos)
Adds a new expressionstatic void
addField(QueryWizardSource source, QuerySchemaExpression newField, NestedTableExpression parentNestedTable, int mappingPos, String alias)
Adds a new expressionstatic void
addField(QueryWizardSource source, QuerySchemaExpression newField, NestedTableExpression parentNestedTable, String alias)
Adds a new expressionstatic QuerySchemaExpression
createEmptyNestedTable()
Create empty nested tablestatic QuerySchemaExpression
createNullExpression()
Create NULL expressionstatic QuerySchemaExpression
createNullExpression(boolean emptyField)
Create NULL expressionstatic org.eclipse.emf.common.util.EList<QuerySchemaExpression>
getFieldContainerFields(QuerySchemaExpression field)
Get field containerstatic QuerySchemaExpression
getMatchedFieldInOperator(QuerySchemaExpression firstField, int operatorIndex, QueryWizardSource source)
Get matched field in operatorstatic int
getNotNullFieldsCount(List<QuerySchemaExpression> fields)
Calculating not null fields in collectionstatic boolean
isEmptyExpression(Object expression)
Check is expression emptystatic boolean
isEmptyNestedTable(AbstractExpression expression)
Check is expression is empty nested tablestatic boolean
isNullExpression(Object expression)
Check is expression is NULLstatic void
removeField(QueryWizardSource source, QuerySchemaExpression field)
Removes fieldsstatic boolean
similarNames(org.eclipse.emf.ecore.EObject field1, org.eclipse.emf.ecore.EObject field2, QueryWizardSource source)
Compare two expressions
-
-
-
Method Detail
-
addField
public static void addField(QueryWizardSource source, QuerySchemaExpression newField, NestedTableExpression parentNestedTable)
Adds a new expression- Parameters:
source
- - query wizard sourceparentNestedTable
- parent nested table, null if have nonewField
- new expression
-
addField
public static void addField(QueryWizardSource source, QuerySchemaExpression newField, NestedTableExpression parentNestedTable, String alias)
Adds a new expression- Parameters:
source
- query wizard sourcenewField
- new expressionparentNestedTable
- parent nested table, null if have noalias
- expression alias
-
addField
public static void addField(QueryWizardSource source, QuerySchemaExpression newField, NestedTableExpression parentNestedTable, int mappingPos)
Adds a new expression- Parameters:
source
- query wizard sourcenewField
- new expressionparentNestedTable
- parent nested table, null if have nomappingPos
- fields matching position
-
addField
public static void addField(QueryWizardSource source, QuerySchemaExpression newField, NestedTableExpression parentNestedTable, int mappingPos, String alias)
Adds a new expression- Parameters:
source
- query wizard sourcenewField
- new expressionparentNestedTable
- parent nested table, null if have nomappingPos
- fields matching positionalias
- expression alias
-
removeField
public static void removeField(QueryWizardSource source, QuerySchemaExpression field)
Removes fields- Parameters:
source
- - query wizard sourcefield
-
-
isNullExpression
public static boolean isNullExpression(Object expression)
Check is expression is NULL- Parameters:
expression
-- Returns:
- true if expression is NULL
-
isEmptyExpression
public static boolean isEmptyExpression(Object expression)
Check is expression empty- Parameters:
expression
-- Returns:
- true if expression is empty
-
isEmptyNestedTable
public static boolean isEmptyNestedTable(AbstractExpression expression)
Check is expression is empty nested table- Parameters:
expression
-- Returns:
- true if expression is empty nested table
-
createNullExpression
public static QuerySchemaExpression createNullExpression()
Create NULL expression- Returns:
- new NULL expression
-
createNullExpression
public static QuerySchemaExpression createNullExpression(boolean emptyField)
Create NULL expression- Parameters:
emptyField
- create empty field- Returns:
- new NULL expression
-
createEmptyNestedTable
public static QuerySchemaExpression createEmptyNestedTable()
Create empty nested table- Returns:
- new empty nested table
-
similarNames
public static boolean similarNames(org.eclipse.emf.ecore.EObject field1, org.eclipse.emf.ecore.EObject field2, QueryWizardSource source)
Compare two expressions- Parameters:
field1
- may be QuerySchemaExpression or AbstractExpressionfield2
- may be QuerySchemaExpression or AbstractExpression- Returns:
- true if field1 and field2 is the similar
-
getNotNullFieldsCount
public static int getNotNullFieldsCount(List<QuerySchemaExpression> fields)
Calculating not null fields in collection- Parameters:
fields
-- Returns:
- not null fields count
-
getFieldContainerFields
public static org.eclipse.emf.common.util.EList<QuerySchemaExpression> getFieldContainerFields(QuerySchemaExpression field)
Get field container- Parameters:
field
-- Returns:
- parent fields collection
-
getMatchedFieldInOperator
public static QuerySchemaExpression getMatchedFieldInOperator(QuerySchemaExpression firstField, int operatorIndex, QueryWizardSource source)
Get matched field in operator- Parameters:
field
- from first operatorindex
- of operator- Returns:
- Field matched with firstField by alias, or null if firstField is not funded in current query
-
-