Package de.uka.ipd.sdq.featureinstance
Class FeatureConfigFunctionality
- java.lang.Object
-
- de.uka.ipd.sdq.featureinstance.FeatureConfigFunctionality
-
public class FeatureConfigFunctionality extends Object
-
-
Constructor Summary
Constructors Constructor Description FeatureConfigFunctionality()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkMandatory(Feature node, AdapterFactoryEditingDomain editingDomain)
Checks if a Feature `node` is a mandatory Featureprotected void
checkParents(Object current, CheckboxTreeViewer treeViewer, FeatureConfig overridesConfig, AdapterFactoryEditingDomain editingDomain)
Checks recursively parent nodes, if a Node is checkedConfiguration
getConfiguration(Resource resource)
Checks if the Configuration object can be accessed in the loaded resource and returns it if possiblevoid
grayFeatureGroups(ChildRelation curRelation, CheckboxTreeViewer treeViewer)
Grays out the FeatureGroups in the treeViewerAdapterFactoryEditingDomain
initializeEditingDomain()
Initializes the adapterFactory, the commandStack and with these objects the editingDomainboolean
isFeatureDiagramReferenceCorrect(Resource existingResource)
Checks if a newly loaded featureconfig-file references the opened FeatureDiagram resourceprotected boolean
isPersisted(Resource resource, AdapterFactoryEditingDomain editingDomain)
This returns whether something has been persisted to the URI of the specified resource.void
markDefaultConfig(FeatureConfig defaultConfig, CheckboxTreeViewer treeViewer)
Checks/unchecks the defaultConfiguration in the Viewervoid
markOverridesConfig(FeatureConfig overridesConfig, CheckboxTreeViewer treeViewer)
Checks/unchecks the configurationOverrides in the ViewerFeatureDiagram
navigateToFeatureDiagram(Feature feature, AdapterFactoryEditingDomain editingDomain)
Navigates to the FeatureDiagram from a given Feature-objectvoid
selectMandatoryFeatures(ChildRelation curRelation, CheckboxTreeViewer treeViewer, FeatureConfig overridesConfig)
Selects recursively the mandatory Featuresvoid
uncheckInModel(Feature element, boolean state, FeatureConfig overridesConfig)
Registers changes made in the TreeViewer to the resourcevoid
uncheckParents(Object current, CheckboxTreeViewer treeViewer, FeatureConfig overridesConfig, AdapterFactoryEditingDomain editingDomain)
Unchecks recursively parent nodes, if no children nodes are checked
-
-
-
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)
-
uncheckParents
public void uncheckParents(Object current, CheckboxTreeViewer treeViewer, FeatureConfig overridesConfig, AdapterFactoryEditingDomain editingDomain)
Unchecks recursively parent nodes, if no children nodes are checked- Parameters:
current
- The unchecked Feature
-
checkParents
protected void checkParents(Object current, CheckboxTreeViewer treeViewer, FeatureConfig overridesConfig, AdapterFactoryEditingDomain editingDomain)
Checks recursively parent nodes, if a Node is checked- Parameters:
current
- The checked Feature
-
navigateToFeatureDiagram
public FeatureDiagram navigateToFeatureDiagram(Feature feature, AdapterFactoryEditingDomain editingDomain)
Navigates to the FeatureDiagram from a given Feature-object- Parameters:
feature
- A Feature-objecteditingDomain
- 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 modeltrue
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 Featurestate
- 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 Featurefalse
, 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.
-
-