Class AbstractConfigurationFilter

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractConfigurationFilter()
      Constructor for inherited classes.
      All nested elements of a displayed variable will be shown independently whether they matches this filter criteria.
      protected AbstractConfigurationFilter​(boolean showAllNestedElements)
      Constructor for inherited classes.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract boolean checkVariable​(GUIVariable variable)
      Determines whether a given variable should be shown inside the editor or not.
      protected boolean checkVariableRecursivley​(GUIVariable variable)
      Calls checkVariable(GUIVariable) recursively on variable.
      private boolean recursiveCheck​(GUIVariable variable)
      Determines whether a given variable should be shown inside the editor or not.
      boolean select​(org.eclipse.jface.viewers.Viewer viewer, java.lang.Object parentElement, java.lang.Object element)  
      • Methods inherited from class org.eclipse.jface.viewers.ViewerFilter

        filter, filter, isFilterProperty
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • showAllNestedElements

        private boolean showAllNestedElements
    • 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.
    • Method Detail

      • select

        public final boolean select​(org.eclipse.jface.viewers.Viewer viewer,
                                    java.lang.Object parentElement,
                                    java.lang.Object element)
        Specified by:
        select in class org.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. The AbstractConfigurationFilter ensures 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)
        Calls checkVariable(GUIVariable) recursively on variable.
        Parameters:
        variable - the variable to check
        Returns:
        true if the variable should be displayed, false otherwise.