luni, 27 aprilie 2015

[OmniFaces utilities (2.0)] Check if the given class instance could also be an instance of one of the given classes


[OmniFaces utilities] The isOneInstanceOf() method returns true if an instance of a class could also be an instance of one of the given classes.

Method:
Usage:

UIComponent currentComponent = Components.getCurrentComponent();
       
// check if the current component is an UICommand
boolean isCommand = Utils.isOneInstanceOf(currentComponent.getClass(), HtmlCommandButton.class, HtmlCommandLink.class);

Niciun comentariu:

Trimiteți un comentariu