public void run() { browser.webEngine.titleProperty().addListener(new ChangeListener<String>() { public void changed(ObservableValue<? extends String> ov, String t, String t1) { if (frame != null) { frame.setTitle(t1); if (browser.webEngine.getLocation().startsWith("https")) { frame.setIconImage(getImageSmallIcon(UIMessage.LOCK_TYPE)); } else { frame.setIconImage(getImageSmallIcon(UIMessage.WEB_TYPE)); } } } }); } };
@Override public void updateItem(T item, boolean empty) { super.updateItem(item, empty); if (item != null) { if (dataSupplier.apply(item)!=null){ if (displayText!=null){ displayText.removeListener(changeListener); } displayText= new DataObservableDisplayText(dataSupplier.apply(item)).get(); changeListenerGarbageCollectionSave = (observable, oldValue, newValue) -> { setText(dataSupplier.apply(item).internal().getDisplayText()); }; changeListener = new WeakChangeListener<>(changeListenerGarbageCollectionSave); displayText.addListener(changeListener); changeListener.changed(displayText,null,displayText.get()); } else { setText(alternativeDisplayText.apply(item)); } } //CellUtils.updateItem(this, getConverter(), hbox, getTreeItemGraphic(), textField); }
public String path() { return pathProperty().get(); }
public static void observeView(WebView view, Stage stage) { Title t = new Title(view, stage); view.getEngine().titleProperty().addListener(t); t.changed(null, null, null); }
@Override public void start(final Stage stage) { browser = new Browser(this, homepage, null); Scene scene = browser.createScene(); // show stage stage.setScene(scene); browser.webEngine.titleProperty().addListener(new ChangeListener<String>() { public void changed(ObservableValue<? extends String> ov, String t, String t1) { if (stage != null) { stage.setTitle(t1); } } }); stage.show(); initialized = true; }
stage.setScene(new Scene(root, width, height)); stage.sizeToScene(); engine.titleProperty().addListener(new TitleListener(stage)); stage.show(); synchronized (lock) {
fxView.getCurrentViewTitleProperty().addListener((a, b, c) -> { primaryStage.setTitle(c); });
webEngine.locationProperty().addListener(new ChangeListener<String>() {
webView.getEngine().locationProperty().addListener(new ChangeListener<String>() { @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
public FXGLMenu(GameApplication app, MenuType type) { this.app = app; this.type = type; this.listener = FXGL.getMenuHandler(); getContentRoot().getChildren().addAll( createBackground(app.getWidth(), app.getHeight()), createTitleView(app.getSettings().getTitle()), createVersionView(makeVersionString()), menuRoot, contentRoot); // we don't data-bind the name because menu subclasses // might use some fancy UI without Text / Label listener.profileNameProperty().addListener((o, oldName, newName) -> { if (!oldName.isEmpty()) { // remove last node which *should* be profile view getContentRoot().getChildren().remove(getContentRoot().getChildren().size() - 1); } getContentRoot().getChildren().add(createProfileView(getLocalizedString("profile.profile")+": " + newName)); }); }
textField.onKeyPressedProperty().addListener((observable, oldValue, newValue) -> updateLastChange("key pressed")); textField.focusedProperty().addListener((observable, oldValue, newValue) -> updateLastChange("focus changed")); textField.selectedTextProperty().addListener((observable, oldValue, newValue) -> updateLastChange("selected text changed"));