Class AbstractConfigurationFilter
- java.lang.Object
-
- org.eclipse.jface.viewers.ViewerFilter
-
- net.ssehub.easy.producer.ui.productline_editor.configuration.AbstractConfigurationFilter
-
- Direct Known Subclasses:
AssignmentStateFilter,AttributeFilter,AttributeRegExFilter,ConfigNameFilter,InterfaceFilter,NamespaceFilter,NonFrozenFilter
public abstract class AbstractConfigurationFilter extends org.eclipse.jface.viewers.ViewerFilterAbstract filter for theConfigurationTableEditor.- Author:
- El-Sharkawy
-
-
Field Summary
Fields Modifier and Type Field Description private booleanshowAllNestedElements
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractConfigurationFilter()Constructor for inherited classes.
All nested elements of a displayed variable will be shown independently whether they matches this filter criteria.protectedAbstractConfigurationFilter(boolean showAllNestedElements)Constructor for inherited classes.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract booleancheckVariable(GUIVariable variable)Determines whether a given variable should be shown inside the editor or not.protected booleancheckVariableRecursivley(GUIVariable variable)CallscheckVariable(GUIVariable)recursively onvariable.private booleanrecursiveCheck(GUIVariable variable)Determines whether a given variable should be shown inside the editor or not.booleanselect(org.eclipse.jface.viewers.Viewer viewer, java.lang.Object parentElement, java.lang.Object element)
-
-
-
Constructor Detail
-
AbstractConfigurationFilter
protected AbstractConfigurationFilter()
Constructor for inherited classes.
All nested elements of a displayed variable will be shown independently whether they matches this filter criteria.- See Also:
AbstractConfigurationFilter(boolean)
-
AbstractConfigurationFilter
protected AbstractConfigurationFilter(boolean showAllNestedElements)
Constructor for inherited classes. Depending on the given parameter, nested elements of a shown variable will also be filtered.- Parameters:
showAllNestedElements-- true: If the parent is shown, than all nested elements will be shown.
Same behavior as
AbstractConfigurationFilter() - false: If the parent is shown, than the filter is also applied to nested elements. Consequently, not all nested elements must be shown.
- true: If the parent is shown, than all nested elements will be shown.
Same behavior as
-
-
Method Detail
-
select
public final boolean select(org.eclipse.jface.viewers.Viewer viewer, java.lang.Object parentElement, java.lang.Object element)- Specified by:
selectin classorg.eclipse.jface.viewers.ViewerFilter
-
recursiveCheck
private boolean recursiveCheck(GUIVariable variable)
Determines whether a given variable should be shown inside the editor or not. This function ensures that parents of of displayed nested elements will not be filtered.- Parameters:
variable- The variable which should be tested whether it should be displayed inside the editor- Returns:
- true if the variable should be displayed, false otherwise.
- See Also:
checkVariable(GUIVariable)
-
checkVariable
protected abstract boolean checkVariable(GUIVariable variable)
Determines whether a given variable should be shown inside the editor or not. Parents of variables which shall be shown should not be filtered. TheAbstractConfigurationFilterensures that.
This method must also ensure that nested elements of a shown variable are also displayed. Therefore, this method should also be written in a recursive manner to check nested elements of displayed variables. This should be done in the following way:
if(checkVariable(variable)) {
for(GUIVariable nestedVariable : variable.getNestedVars()) {
checkVariable(nestedVariable);
}
}- Parameters:
variable- The variable which should be tested whether it should be displayed inside the editor- Returns:
- true if the variable should be displayed, false otherwise.
-
checkVariableRecursivley
protected boolean checkVariableRecursivley(GUIVariable variable)
CallscheckVariable(GUIVariable)recursively onvariable.- Parameters:
variable- the variable to check- Returns:
- true if the variable should be displayed, false otherwise.
-
-