Class SectionDefinitionBuilder<R,​T extends SectionDefinitionBuilder<R,​T>>

    • Constructor Detail

      • SectionDefinitionBuilder

        protected SectionDefinitionBuilder​(Supplier<SectionDefinition> provider,
                                           Consumer<SectionDefinition> endAction,
                                           R endSectionResult)
        Instantiates a new builder.
        Parameters:
        provider - the provider of section definition, cannot be null.
        endAction - the action performed when the builder ends section building.
        endSectionResult - the object that is returned by endSection().
    • Method Detail

      • builder

        public static <R> SectionDefinitionBuilder<R,​?> builder​(Supplier<SectionDefinition> provider,
                                                                      Consumer<SectionDefinition> endAction,
                                                                      R endSectionResult)
        Creates a new builder.
        Parameters:
        provider - the provider of section definition, cannot be null.
        endAction - the action performed the builder ends section building.
        endSectionResult - the object that is returned by endSection().
        Returns:
        a newly created builder instance, never null.
      • element

        public T element​(String label,
                         org.eclipse.emf.ecore.EStructuralFeature... features)
        Creates a new FieldDefinition and adds it to the section.
        Parameters:
        label - the label of the field or null to disable label creation
        features - the features that represents the feature path, may be empty
        Returns:
        the builder instance, never null.
      • multiFeatureElement

        public T multiFeatureElement​(String label,
                                     org.eclipse.emf.ecore.EStructuralFeature... features)
        Creates a new FieldDefinition with specified single-feature paths and adds it to the section.
        Parameters:
        label - the label of the field or null to disable label creation
        features - the features each of which defines its own single-feature path
        Returns:
        the builder instance, never null.
      • element

        public T element​(String label,
                         org.eclipse.emf.ecore.EOperation operation)
        Creates a new OperationFieldDefinition and adds to the section.
        Parameters:
        label - the label of the field or null to disable label creation
        operation - the operation, cannot be null.
        Returns:
        the builder instance, never null.
      • element

        public T element​(String label,
                         IDefinitionIdentifier definitionIdentifier)
        Creates a new ILabeledDefinition and adds to the section.
        Parameters:
        label - the label of the field or null to disable label creation
        definitionIdentifier - the definition identifier, cannot be null.
        Returns:
        the builder instance, never null.
      • element

        public T element​(String label,
                         String stringIdentifier)
        Creates a new ILabeledDefinition and adds to the section.
        Parameters:
        label - the label of the field or null to disable label creation
        stringIdentifier - the string that identifies definition uniquely, cannot be null.
        Returns:
        the builder instance, never null.
      • navigateTo

        public T navigateTo​(IDefinitionIdentifier definitionIdentifier)
        Finds the definition with the given identifier.
        Parameters:
        definitionIdentifier - the definition identifier, cannot be null.
        Returns:
        the builder instance, never null.
      • navigateTo

        public T navigateTo​(String stringIdentifier)
        Finds the definition with the given string identifier.
        Parameters:
        stringIdentifier - the string identifier, cannot be null.
        Returns:
        the builder instance, never null.
      • navigateTo

        public T navigateTo​(org.eclipse.emf.ecore.EStructuralFeature... features)
        Finds the definition with the given feature path and positions to it.
        Parameters:
        features - the features that represent the feature path, cannot be null
        Returns:
        the builder instance, never null.
      • navigateTo

        public T navigateTo​(org.eclipse.emf.ecore.EOperation operation)
        Finds the definition with the given operation and positions to it.
        Parameters:
        operation - operation the operation, cannot be null.
        Returns:
        the builder instance, never null.
      • separator

        public T separator()
        Creates SeparatorDefinition and adds it to section definition.
        Returns:
        the builder instance, never null.
      • endSection

        public R endSection()
        Ends section and performs the action that is given while instantiating the builder.
        Returns:
        the object given in constructor, never null.
      • fieldDefinition

        protected IDefinition fieldDefinition​(Class<? extends IComponent<?>> componentClass,
                                              IParameterization parameterization,
                                              String label,
                                              org.eclipse.emf.databinding.FeaturePath... featurePaths)
        Cretets field definition for the provided parameters.
        Parameters:
        componentClass - the component class, cannot be null
        parameterization - the component parameterization, cannot be null
        label - the component label or null if none
        featurePaths - the EMF feature pathes, cannot be null
        Returns:
        the created definition, never null
      • operationFieldDefinition

        protected IDefinition operationFieldDefinition​(Class<? extends IComponent<?>> componentClass,
                                                       IParameterization parameterization,
                                                       String label,
                                                       org.eclipse.emf.ecore.EOperation operation)
        Cretets operation field definition for the provided parameters.
        Parameters:
        componentClass - the component class, cannot be null
        parameterization - the component parameterization, cannot be null
        label - the component label or null if none
        operation - the EMF operation, cannot be null
        Returns:
        the created definition, never null
      • stringIdDefiniton

        protected IDefinition stringIdDefiniton​(Class<? extends IComponent<?>> componentClass,
                                                IParameterization parameterization,
                                                String label,
                                                String stringId)
        Cretets string identified field definition for the provided parameters.
        Parameters:
        componentClass - the component class, cannot be null
        parameterization - the component parameterization, cannot be null
        label - the component label or null if none
        stringId - the string identifier of the definition, cannot be null
        Returns:
        the created definition, never null
      • labeledDefinition

        protected IDefinition labeledDefinition​(Class<? extends IComponent<?>> componentClass,
                                                IParameterization parameterization,
                                                String label,
                                                IDefinitionIdentifier definitionIdentifier)
        Cretets labeled definition for the provided parameters.
        Parameters:
        componentClass - the component class, cannot be null
        parameterization - the component parameterization, cannot be null
        label - the component label or null if none
        definitionIdentifier - the IDefinitionIdentifier instance, cannot be null.
        Returns:
        the created definition, never null.
      • getLastFeature

        protected static final org.eclipse.emf.ecore.EStructuralFeature getLastFeature​(org.eclipse.emf.ecore.EStructuralFeature... features)
        Returns the last feature of the given feature array.
        Parameters:
        features - the features, may be null
        Returns:
        an EStructuralFeature instance or null