@Override public void setVisible(boolean visible0) { if (isVisible() == visible0) { return; } // add/remove drop down from current screen or top overlay when its visibility changes FContainer container = FOverlay.getTopOverlay(); if (container == null) { container = Forge.getCurrentScreen(); } if (visible0) { updateSizeAndPosition(); if (autoHide()) { // add invisible backdrop if needed to allow auto-hiding when pressing // outide drop down backdrop = new Backdrop(); backdrop.setSize(container.getWidth(), container.getHeight()); container.add(backdrop); } container.add(this); } else { container.remove(this); if (backdrop != null) { backdrop.setVisible(false); container.remove(backdrop); backdrop = null; } } super.setVisible(visible0); }
public FDropDown() { super.setVisible(false); // hide by default }