Class QuerySchemaExpressionEditableTextBuilder


  • public class QuerySchemaExpressionEditableTextBuilder
    extends Object
    Build text for QuerySchemaExpression for editing
    • 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 expression
        getOneVariant - 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 expression
        getOneVariant - 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 function
        newAggregateFunction - aggregate function, if null, aggregate will be removed
        distinct - 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 - operator
        editableObject - edited object
        Returns:
        strings array with prefix, editable part and suffix