Class TypeFilterImpl
java.lang.Object
com.nomagic.magicdraw.ui.dialogs.selection.TypeFilterImpl
- All Implemented Interfaces:
TypeFilter
,com.nomagic.magicdraw.ui.ElementFilter
Default
TypeFilter
implementation.-
Constructor Summary
ConstructorDescriptionConstructor.TypeFilterImpl
(Collection<?> types) Constructor.TypeFilterImpl
(Collection all, Collection restricted) An utility constructor for compatibility with old approach when all and restricted types were used. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
accept
(BaseElement obj) Tests element to satisfy filter condition.boolean
accept
(BaseElement baseElement, boolean checkType) Tests element to satisfy filter condition.protected boolean
acceptByType
(Collection<?> types, BaseElement baseElement) Test for acceptable element type.Collection<?>
getTypes()
Get the acceptable element types.
-
Constructor Details
-
TypeFilterImpl
public TypeFilterImpl()Constructor. Any element will be accepted -
TypeFilterImpl
Constructor.- Parameters:
types
- acceptable types. Can be null.
-
TypeFilterImpl
An utility constructor for compatibility with old approach when all and restricted types were used. It uses "restricted" types if they are not null, otherwise "all" types are used.- Parameters:
all
- all typesrestricted
- restricted types.
-
-
Method Details
-
getTypes
Description copied from interface:TypeFilter
Get the acceptable element types.- Specified by:
getTypes
in interfaceTypeFilter
- Returns:
- acceptable element types. If null - all element types are accepted.
-
accept
Description copied from interface:com.nomagic.magicdraw.ui.ElementFilter
Tests element to satisfy filter condition.- Specified by:
accept
in interfacecom.nomagic.magicdraw.ui.ElementFilter
- Parameters:
obj
- element.- Returns:
- true if obj satisfies filter condition otherwise false.
-
accept
Description copied from interface:TypeFilter
Tests element to satisfy filter condition.- Specified by:
accept
in interfaceTypeFilter
- Parameters:
baseElement
- element.checkType
- check object type- Returns:
- true if obj satisfies filter condition otherwise false.
-
acceptByType
Test for acceptable element type.- Parameters:
types
- acceptable types. Null means ANY typebaseElement
- element to be tested. Can not be null.- Returns:
- true if tested element is acceptable.
-