@Override public void handle(KeyEvent t) { if (window.isShowing() && ESCAPE_COMBO.match(t)) { window.hide(); } } }
private void showPasswordFieldPopup() { Scene scene = this.getScene(); if (scene != null) { Window owner = scene.getWindow(); if (owner != null && owner.isShowing()) { Point2D nodeCoord = encryptionIndicator.localToScene(encryptionIndicator.getWidth() / 2, encryptionIndicator.getHeight() / 1.5); double anchorX = Math.round(owner.getX() + scene.getX() + nodeCoord.getX() + 2); double anchorY = Math.round(owner.getY() + scene.getY() + nodeCoord.getY() + 2); passwordPopup.showFor(this, descriptor, anchorX, anchorY); } } }
@EventListener public void showPasswordFieldPopup(ShowPasswordFieldPopupRequest request) { Scene scene = this.getScene(); if (scene != null) { Window owner = scene.getWindow(); if (owner != null && owner.isShowing()) { Point2D nodeCoord = request.getRequestingNode().localToScene(request.getRequestingNode().getWidth() / 2, request.getRequestingNode().getHeight() / 1.5); double anchorX = Math.round(owner.getX() + scene.getX() + nodeCoord.getX() + 2); double anchorY = Math.round(owner.getY() + scene.getY() + nodeCoord.getY() + 2); passwordPopup.showFor(this, request.getPdfDescriptor(), anchorX, anchorY); } } }
private ErrorTooltipManager(String message) { require(isNotBlank(message), "Tooltip message cannot be blank"); this.tooltip = new Tooltip(message); this.tooltip.getStyleClass().add(ERROR_TOOLTIP_CLASS); hideTimer.getKeyFrames().add(new KeyFrame(new Duration(5000))); hideTimer.setOnFinished(e -> { tooltip.hide(); ErrorTooltipManager.this.active = false; }); activationTimer.getKeyFrames().add(new KeyFrame(new Duration(250))); activationTimer.setOnFinished(e -> { if (!ErrorTooltipManager.this.active) { Scene scene = getScene(); if (scene != null) { Window owner = scene.getWindow(); if (owner != null && owner.isShowing() && ValidableTextField.this.isVisible()) { Point2D where = getDisplayCoordiantes(owner, scene); tooltip.show(ValidableTextField.this, where.getX(), where.getY()); ErrorTooltipManager.this.active = true; hideTimer.playFromStart(); } } } }); }
@Override protected boolean isWindowVisible(@Nonnull Window window) { requireNonNull(window, ERROR_WINDOW_NULL); return window.isShowing(); }
public void handleClose(@Nonnull Window widget) { if (getApplication().getPhase() == ApplicationPhase.SHUTDOWN) { return; } List<Window> visibleWindows = new ArrayList<>(); for (Window window : getWindows()) { if (window.isShowing()) { visibleWindows.add(window); } } if (isAutoShutdown() && visibleWindows.size() <= 1 && visibleWindows.contains(widget) && !getApplication().shutdown()) { show(widget); } }
public UIConnectionHandler(Window mainWindow, REAUIMessager uiMessager) { this.mainWindow = mainWindow; this.uiMessager = uiMessager; uiMessager.registerModuleMessagerStateListener(isMessagerOpen -> { if (isMessagerOpen) new Thread(() -> { // It seems like the main window has to be up to have access to the communication. while (!mainWindow.isShowing()) ThreadTools.sleep(100); refreshUIControls(); }, "REAUIConnectionHandler").start(); else displayWarning(); }); }