Class FeatureConfigFunctionality


  • public class FeatureConfigFunctionality
    extends Object
    • Constructor Detail

      • FeatureConfigFunctionality

        public FeatureConfigFunctionality()
    • Method Detail

      • getConfiguration

        public Configuration getConfiguration​(Resource resource)
        Checks if the Configuration object can be accessed in the loaded resource and returns it if possible
        Parameters:
        resource - The resource from which the Configuration-object can be accessed (a *.featureconfig-file)
        Returns:
        Returns a Configuration-object or null, if it can be accessed (e.g. no *.featureconfig-file)
      • navigateToFeatureDiagram

        public FeatureDiagram navigateToFeatureDiagram​(Feature feature,
                                                       AdapterFactoryEditingDomain editingDomain)
        Navigates to the FeatureDiagram from a given Feature-object
        Parameters:
        feature - A Feature-object
        editingDomain - The necessary editingDomain
        Returns:
        the parent FeatureDiagram to the given Feature-object
      • initializeEditingDomain

        public AdapterFactoryEditingDomain initializeEditingDomain()
        Initializes the adapterFactory, the commandStack and with these objects the editingDomain
      • isFeatureDiagramReferenceCorrect

        public boolean isFeatureDiagramReferenceCorrect​(Resource existingResource)
        Checks if a newly loaded featureconfig-file references the opened FeatureDiagram resource
        Parameters:
        existingResource - Newly loaded Resource-object (should be a featureconfig-file)
        Returns:
        false, if existingResource doesn't include a Configuration-object or if no ConifgNode references to the opened model true otherwise
      • selectMandatoryFeatures

        public void selectMandatoryFeatures​(ChildRelation curRelation,
                                            CheckboxTreeViewer treeViewer,
                                            FeatureConfig overridesConfig)
        Selects recursively the mandatory Features
        Parameters:
        curRelation - The ChildRelation, where the selecting should start
      • uncheckInModel

        public void uncheckInModel​(Feature element,
                                   boolean state,
                                   FeatureConfig overridesConfig)
        Registers changes made in the TreeViewer to the resource
        Parameters:
        element - The changed Feature
        state - The checked/unchecked state
      • markDefaultConfig

        public void markDefaultConfig​(FeatureConfig defaultConfig,
                                      CheckboxTreeViewer treeViewer)
        Checks/unchecks the defaultConfiguration in the Viewer
      • markOverridesConfig

        public void markOverridesConfig​(FeatureConfig overridesConfig,
                                        CheckboxTreeViewer treeViewer)
        Checks/unchecks the configurationOverrides in the Viewer
      • checkMandatory

        public boolean checkMandatory​(Feature node,
                                      AdapterFactoryEditingDomain editingDomain)
        Checks if a Feature `node` is a mandatory Feature
        Parameters:
        node - The Feature which needs to be checked
        Returns:
        true, if node is a mandatory Feature false, else
      • grayFeatureGroups

        public void grayFeatureGroups​(ChildRelation curRelation,
                                      CheckboxTreeViewer treeViewer)
        Grays out the FeatureGroups in the treeViewer
        Parameters:
        curRoot - The current ChildRelation
      • isPersisted

        protected boolean isPersisted​(Resource resource,
                                      AdapterFactoryEditingDomain editingDomain)
        This returns whether something has been persisted to the URI of the specified resource. The implementation uses the URI converter from the editor's resource set to try to open an input stream.
        Generated class or method.