@Override public Connection once () { for (Connection c : conns) c.once(); return this; } @Override public Connection atPrio (int priority) {
@Override public Connection once () { for (Connection c : conns) c.once(); return this; } @Override public Connection atPrio (int priority) {
@Override public void onEmit (Menu event) { // due to animations, deactivation can happen during layout, so do it next frame iface.frame.connect(cleanup).once(); } });
@Override public RFuture<T> next () { final RPromise<T> result = RPromise.create(); connect(result.succeeder()).once(); return result; }
@Override public RFuture<T> next () { final RPromise<T> result = RPromise.create(); connect(result.succeeder()).once(); return result; }
/** * Attempts to scroll the given element into view. * @return true if successful */ public static boolean makeVisible (final Element<?> elem) { Scroller scroller = findScrollParent(elem); if (scroller == null) return false; // the element in question may have been added and then immediately scrolled to, which // means it hasn't been laid out yet and does not have its proper position; in that case // defer this process a tick to allow it to be laid out if (!scroller.isSet(Flag.VALID)) { elem.root().iface.frame.connect(new UnitSlot() { @Override public void onEmit () { makeVisible(elem); } }).once(); return true; } Point offset = Layers.transform(new Point(0, 0), elem.layer, scroller.content.layer); scroller.scroll(offset.x, offset.y); return true; }