* @see com.vaadin.ui.Component#setVisible(boolean)
*/
public void setVisible(boolean visible) {
- if (getState().isVisible() != visible) {
- getState().setVisible(visible);
- requestRepaint();
- if (getParent() != null) {
- // Must always repaint the parent (at least the hierarchy) when
- // visibility of a child component changes.
- getParent().requestRepaint();
- }
+ if (getState().isVisible() == visible) {
+ return;
+ }
+
+ getState().setVisible(visible);
+ requestRepaint();
+ if (getParent() != null) {
+ // Must always repaint the parent (at least the hierarchy) when
+ // visibility of a child component changes.
+ getParent().requestRepaint();
}
}