public final void onReady() { if (!isReady()) return; ActionCallback[] ready = getReadyCallbacks(true); for (ActionCallback each : ready) { if (each != null) { each.setDone(); } } }
public MyDialog( Window owner, DialogWrapper dialogWrapper, Project project, @NotNull ActionCallback focused, @NotNull ActionCallback typeAheadDone, ActionCallback typeAheadCallback) { super(owner); myDialogWrapper = new WeakReference<DialogWrapper>(dialogWrapper); myProject = project != null ? new WeakReference<Project>(project) : null; setFocusTraversalPolicy( new LayoutFocusTraversalPolicyExt() { @Override protected boolean accept(Component aComponent) { if (UIUtil.isFocusProxy(aComponent)) return false; return super.accept(aComponent); } }); myFocusedCallback = focused; myTypeAheadDone = typeAheadDone; myTypeAheadCallback = typeAheadCallback; final long typeAhead = getDialogWrapper().getTypeAheadTimeoutMs(); if (typeAhead <= 0) { myTypeAheadDone.setDone(); } setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); myWindowListener = new MyWindowListener(); addWindowListener(myWindowListener); myComponentListener = new MyComponentListener(); addComponentListener(myComponentListener); }