Package com._1c.g5.v8.dt.qw.ui.utils
Class QuerySchemaExpressionEditableTextBuilder
- java.lang.Object
-
- com._1c.g5.v8.dt.qw.ui.utils.QuerySchemaExpressionEditableTextBuilder
-
public class QuerySchemaExpressionEditableTextBuilder extends Object
Build text for QuerySchemaExpression for editing
-
-
Constructor Summary
Constructors Constructor Description QuerySchemaExpressionEditableTextBuilder(org.eclipse.core.resources.IProject context, ExpressionEditingType editingType, QueryWizardSource source)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.xtext.util.Triple<String,String,String>
getEditableText(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 Detail
-
QuerySchemaExpressionEditableTextBuilder
public QuerySchemaExpressionEditableTextBuilder(org.eclipse.core.resources.IProject context, ExpressionEditingType editingType, QueryWizardSource source)
- Parameters:
context
- project
-
-
Method Detail
-
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,String> getEditableText(QuerySchemaOperator operator, Object editableObject)
Get editable text for editable object- Parameters:
operator
- operatoreditableObject
- edited object- Returns:
- strings array with prefix, editable part and suffix
-
-