Package com._1c.g5.v8.dt.qw.ui.utils
Class FieldsMapping
- java.lang.Object
-
- com._1c.g5.v8.dt.qw.ui.utils.FieldsMapping
-
public class FieldsMapping extends Object
Matching of fields in queries and their aliases
-
-
Constructor Summary
Constructors Constructor Description FieldsMapping(FieldsMapping baseMapping)
FieldsMapping(QueryWizardSource source)
FieldsMapping(QueryWizardSource source, int fieldsCount)
FieldsMapping(QueryWizardSource source, QuerySchemaExpression field, FieldsMapping parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
changeFieldsMapping(QueryWizardSource source, FieldsMapping mapping, FieldsMapping newMapping)
Change matching of fieldsList<FieldsMapping>
children()
void
copyFields(FieldsMapping fieldsMapping)
Coping fields from given fields matchingstatic void
createNestedFieldMapping(QueryWizardSource source, int unionPos, QuerySchemaExpression field, FieldsMapping parentMapping)
Create nested field mappingstatic void
eraseAliasesWithEmptyFields(QueryWizardSource source)
Remove aliases with empty fields matchingvoid
eraseChildAt(int index)
Remove child fields matchingint
fieldsCount()
FieldsMapping
findChildByAlias(String alias)
Find child fields mapping by aliasQuerySchemaExpression
getField(int column)
Getting field from columnstatic FieldsMapping
getFieldMappingForField(QuerySchemaExpression field, FieldsMapping parentMapping)
Looking for fields matching for given fieldQuerySchemaExpression
getFirstNotNullField()
org.eclipse.swt.graphics.Image
getImage()
Get image for field mappingFieldsMapping
getParent()
boolean
isFieldsEmpty()
Is all columns have NULL expressions?boolean
isRoot()
Is fields matching rootvoid
moveChild(FieldsMapping fieldMapping, int newIndex)
Move fields mappingvoid
removeChild(FieldsMapping fieldMapping)
Removing child fields matchingvoid
setAlias(String alias)
Setting new aliasvoid
setChildAt(int index, FieldsMapping newMapping)
Setting new child fields matchingQuerySchemaExpression
setField(int column, QuerySchemaExpression newField)
Setting new field in columnvoid
synchronizeColumnsFieldsCount()
Synchronizing fields counts in operators and nested tables
-
-
-
Constructor Detail
-
FieldsMapping
public FieldsMapping(QueryWizardSource source)
- Parameters:
source
- QueryWizardSource
-
FieldsMapping
public FieldsMapping(QueryWizardSource source, QuerySchemaExpression field, FieldsMapping parent)
- Parameters:
source
- QueryWizardSourcefield
- field from one of the column from fields matchingparent
- parent fields matching
-
FieldsMapping
public FieldsMapping(QueryWizardSource source, int fieldsCount)
- Parameters:
source
- QueryWizardSourcefieldsCount
- count of columns with fields
-
FieldsMapping
public FieldsMapping(FieldsMapping baseMapping)
- Parameters:
baseMapping
- base fields matching
-
-
Method Detail
-
eraseAliasesWithEmptyFields
public static void eraseAliasesWithEmptyFields(QueryWizardSource source)
Remove aliases with empty fields matching- Parameters:
source
- query wizard source
-
changeFieldsMapping
public static void changeFieldsMapping(QueryWizardSource source, FieldsMapping mapping, FieldsMapping newMapping)
Change matching of fields- Parameters:
source
- QueryWizardSourcemapping
- old fields matchingnewMapping
- new fields matching
-
getFieldMappingForField
public static FieldsMapping getFieldMappingForField(QuerySchemaExpression field, FieldsMapping parentMapping)
Looking for fields matching for given field- Parameters:
field
- - field in the same fields matching. Can't be null.parentMapping
- - parent fields matching. Can't be null.- Returns:
- fields matching if found, else null
-
createNestedFieldMapping
public static void createNestedFieldMapping(QueryWizardSource source, int unionPos, QuerySchemaExpression field, FieldsMapping parentMapping)
Create nested field mapping- Parameters:
source
- QueryWizardSourceunionPos
-field
-parentMapping
-
-
findChildByAlias
public FieldsMapping findChildByAlias(String alias)
Find child fields mapping by alias- Parameters:
alias
- - alias. Can by like NestedTableAlias.NestedFieldAlias- Returns:
- fields mapping or null
-
getImage
public org.eclipse.swt.graphics.Image getImage()
Get image for field mapping- Returns:
- image
-
fieldsCount
public int fieldsCount()
- Returns:
- fields (columns) count
-
getField
public QuerySchemaExpression getField(int column)
Getting field from column- Parameters:
column
- given column- Returns:
- field in column
-
setField
public QuerySchemaExpression setField(int column, QuerySchemaExpression newField)
Setting new field in column- Parameters:
column
- given columnnewField
- new field- Returns:
- old field
-
getParent
public FieldsMapping getParent()
- Returns:
- parent fields matching
-
copyFields
public void copyFields(FieldsMapping fieldsMapping)
Coping fields from given fields matching- Parameters:
fieldsMapping
- base fields matching
-
removeChild
public void removeChild(FieldsMapping fieldMapping)
Removing child fields matching- Parameters:
fieldMapping
- fields matching which will be removed
-
isRoot
public boolean isRoot()
Is fields matching root- Returns:
- true if true
-
children
public List<FieldsMapping> children()
- Returns:
- children fields matching
-
isFieldsEmpty
public boolean isFieldsEmpty()
Is all columns have NULL expressions?- Returns:
- true if true
-
getFirstNotNullField
public QuerySchemaExpression getFirstNotNullField()
- Returns:
- first not null field
-
moveChild
public void moveChild(FieldsMapping fieldMapping, int newIndex)
Move fields mapping- Parameters:
fieldMapping
- field mappingnewIndex
- new index
-
setChildAt
public void setChildAt(int index, FieldsMapping newMapping)
Setting new child fields matching- Parameters:
index
-newMapping
- new fields matching
-
eraseChildAt
public void eraseChildAt(int index)
Remove child fields matching- Parameters:
index
-
-
synchronizeColumnsFieldsCount
public void synchronizeColumnsFieldsCount()
Synchronizing fields counts in operators and nested tables
-
setAlias
public void setAlias(String alias)
Setting new alias- Parameters:
alias
- new alias
-
-