Package com._1c.g5.v8.dt.qw.ui.utils
Class QuerySchemaExpressionEditableTextBuilder
java.lang.Object
com._1c.g5.v8.dt.qw.ui.utils.QuerySchemaExpressionEditableTextBuilder
Build text for QuerySchemaExpression for editing
-
Constructor Summary
ConstructorsConstructorDescriptionQuerySchemaExpressionEditableTextBuilder
(org.eclipse.core.resources.IProject context, ExpressionEditingType editingType, QueryWizardSource source) -
Method Summary
Modifier and TypeMethodDescriptiongetEditableText
(QuerySchemaOperator operator, Object editableObject) Get editable text for editable objectstatic List<QuerySchemaExpression>
getValidVariantsForAggrerate
(QuerySchemaExpression expression, QueryWizardSource source, boolean getOneVariant) Get available aggregate variants for expression.static List<QuerySchemaExpression>
getValidVariantsForTotalsExpressions
(QuerySchemaExpression expression, QueryWizardSource source, boolean getOneVariant) Get available aggregate variants for totals expression.static QuerySchemaExpression
replaceAggregate
(QuerySchemaExpression aggregateExpression, FunctionExpression newAggregateFunction, boolean distinct) Set new aggregate function for expression
-
Constructor Details
-
QuerySchemaExpressionEditableTextBuilder
public QuerySchemaExpressionEditableTextBuilder(org.eclipse.core.resources.IProject context, ExpressionEditingType editingType, QueryWizardSource source) - Parameters:
context
- project
-
-
Method Details
-
getValidVariantsForAggrerate
public static List<QuerySchemaExpression> getValidVariantsForAggrerate(QuerySchemaExpression expression, QueryWizardSource source, boolean getOneVariant) Get available aggregate variants for expression. If expression contain aggregate, aggregate will be replaced- Parameters:
expression
- query schema expressiongetOneVariant
- if true, return only one variant- Returns:
- aggregates variants
-
getValidVariantsForTotalsExpressions
public static List<QuerySchemaExpression> getValidVariantsForTotalsExpressions(QuerySchemaExpression expression, QueryWizardSource source, boolean getOneVariant) Get available aggregate variants for totals expression. If expression contain aggregate, aggregate will be replaced- Parameters:
expression
- query schema expressiongetOneVariant
- if true, return only one variant- Returns:
- aggregates variants
-
replaceAggregate
public static QuerySchemaExpression replaceAggregate(QuerySchemaExpression aggregateExpression, FunctionExpression newAggregateFunction, boolean distinct) Set new aggregate function for expression- Parameters:
aggregateExpression
- query schema expression with aggregate functionnewAggregateFunction
- aggregate function, if null, aggregate will be removeddistinct
- is distinct allowed- Returns:
- new query schema expression with aggregate function
-
getEditableText
public org.eclipse.xtext.util.Triple<String,String, getEditableTextString> (QuerySchemaOperator operator, Object editableObject) Get editable text for editable object- Parameters:
operator
- operatoreditableObject
- edited object- Returns:
- strings array with prefix, editable part and suffix
-