(boolean visible0)
| 110 | } |
| 111 | |
| 112 | @Override |
| 113 | public void setVisible(boolean visible0) { |
| 114 | if (isVisible() == visible0) { |
| 115 | return; |
| 116 | } |
| 117 | |
| 118 | //add/remove drop down from its container, current screen, or top overlay when its visibility changes |
| 119 | FContainer container = getContainer(); |
| 120 | if (visible0) { |
| 121 | updateSizeAndPosition(); |
| 122 | |
| 123 | if (autoHide()) { //add invisible backdrop if needed to allow auto-hiding when pressing outside drop down |
| 124 | backdrop = new Backdrop(); |
| 125 | backdrop.setSize(container.getWidth(), container.getHeight()); |
| 126 | container.add(backdrop); |
| 127 | } |
| 128 | container.add(this); |
| 129 | } else { |
| 130 | container.remove(this); |
| 131 | if (backdrop != null) { |
| 132 | backdrop.setVisible(false); |
| 133 | container.remove(backdrop); |
| 134 | backdrop = null; |
| 135 | } |
| 136 | onHidden(); |
| 137 | } |
| 138 | super.setVisible(visible0); |
| 139 | } |
| 140 | |
| 141 | protected void onHidden() { |
| 142 | } |
no test coverage detected