@Override public void hideInfoPopup() { if (infoPopup != null) { infoPopup.hide(); infoPopup = null; } }
public void updateFeedback(Consumer<StackPane> consumer) { consumer.accept((StackPane) this.popupWindow.getScene().getRoot()); this.popupWindow.sizeToScene(); this.popupWindow.setX(this.screenX - this.popupWindow.getWidth() / 2); this.popupWindow.setY(this.screenY + 20); this.popupWindow.show(n.getScene().getWindow()); }
public void displayProposals(List<ICompletionProposal> proposalList, int offset, Point2D position) { setup(); this.prefix = ""; //$NON-NLS-1$ this.offset = offset; this.proposalList.setItems(FXCollections.observableArrayList(proposalList)); this.proposalList.getSelectionModel().select(0); this.stage.setX(position.getX()); this.stage.setY(position.getY()); this.stage.setWidth(300); this.stage.setHeight(200); this.stage.show(this.viewer.getTextWidget().getScene().getWindow()); this.stage.requestFocus(); }
this.stage.setAutoFix(false); this.stage.setWidth(300); this.stage.setHeight(200); BorderPane p = new BorderPane(); p.setPrefHeight(200); p.setPrefWidth(400); this.stage.getScene().addEventFilter(KeyEvent.KEY_TYPED, this::handleKeyTyped); this.stage.getScene().addEventFilter(KeyEvent.KEY_PRESSED, this::handleKeyPressed); this.stage.getScene().getStylesheets().addAll(this.viewer.getTextWidget().getScene().getStylesheets()); this.proposalList = new ListView<>(); this.proposalList.getStyleClass().add("content-proposal-list"); //$NON-NLS-1$ this.stage.getScene().setRoot(p); this.stage.focusedProperty().addListener((o) -> { if( this.stage != null && ! this.stage.isFocused() ) { Platform.runLater(this.stage::hide); this.stage.setOnHidden((o) -> { this.stage = null; });
public DragFeedbackPopup(Node n) { this.n = n; this.popupWindow = new PopupWindow() { // Empty }; this.popupWindow.setAutoFix(false); this.popupWindow.setUserData("findNodeExclude"); //$NON-NLS-1$ // this.stage.setAlwaysOnTop(true); StackPane root = new StackPane(); root.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, CornerRadii.EMPTY, Insets.EMPTY))); // Scene value = new Scene(root); // value.setFill(Color.TRANSPARENT); // this.stage.setScene(value); this.popupWindow.getScene().getStylesheets().setAll(n.getScene().getStylesheets()); this.popupWindow.getScene().setRoot(root); }
public TextViewerHoverManager(TextViewer textViewer) { this.textViewer = textViewer; this.popup = new PopupWindow() { }; this.popup.setAutoFix(false); this.popup.setAutoHide(false); this.textViewer.getTextWidget().sceneProperty().addListener( e -> { if( textViewer.getTextWidget().getScene() != null ) { popup.getScene().getStylesheets().setAll(textViewer.getTextWidget().getScene().getStylesheets()); } }); root = new BorderPane(); root.getStyleClass().add("styled-text-hover"); popup.getScene().setRoot(root); }
@Override public boolean apply( Window input ) { Window parent = null; if( input instanceof Stage ) { parent = ( ( Stage )input ).getOwner(); } else if( input instanceof PopupWindow ) { parent = ( ( PopupWindow )input ).getOwnerWindow(); } return parent == lastSeenWindow || parent != null && apply( parent ); } };
public DragFeedbackPopup(Node n) { this.n = n; this.popupWindow = new PopupWindow() { // Empty }; this.popupWindow.setAutoFix(false); this.popupWindow.setUserData("findNodeExclude"); //$NON-NLS-1$ // this.stage.setAlwaysOnTop(true); StackPane root = new StackPane(); root.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, CornerRadii.EMPTY, Insets.EMPTY))); // Scene value = new Scene(root); // value.setFill(Color.TRANSPARENT); // this.stage.setScene(value); this.popupWindow.getScene().getStylesheets().setAll(n.getScene().getStylesheets()); this.popupWindow.getScene().setRoot(root); }
@Override public boolean apply( Window input ) { Window parent = null; if( input instanceof Stage) { parent = ( ( Stage )input ).getOwner(); } else if( input instanceof PopupWindow) { parent = ( ( PopupWindow )input ).getOwnerWindow(); } return parent == window || parent != null && apply( parent ); } };
public void updateFeedback(Consumer<StackPane> consumer) { consumer.accept((StackPane) this.popupWindow.getScene().getRoot()); this.popupWindow.sizeToScene(); this.popupWindow.setX(this.screenX - this.popupWindow.getWidth() / 2); this.popupWindow.setY(this.screenY + 20); this.popupWindow.show(n.getScene().getWindow()); }
@Override public void hideErrorPopup() { if (errorPopup != null) { errorPopup.hide(); errorPopup = null; } }
owner = ((Stage)window).getOwner(); } else if( window instanceof PopupWindow ) { owner = ((PopupWindow)window).getOwnerWindow(); } else { owner = null;
public void dispose() { this.popupWindow.hide(); } }
ownerWindow = ((PopupWindow) ownerWindow).getOwnerWindow();
@Override public void hideInfoPopup() { if (infoPopup != null) { infoPopup.hide(); infoPopup = null; } }
public void dispose() { this.popupWindow.hide(); } }
private void updateProposals() { List<ICompletionProposal> list = this.proposalComputer.apply(new ContentAssistContextData(this.offset,this.viewer.getDocument()/*,prefix*/)); if( ! list.isEmpty() ) { this.proposalList.setItems(FXCollections.observableArrayList(list)); this.proposalList.scrollTo(0); this.proposalList.getSelectionModel().select(0); } else { this.stage.hide(); } }
private void applySelection() { ICompletionProposal selectedItem = this.proposalList.getSelectionModel().getSelectedItem(); if( selectedItem != null ) { IDocument document = this.viewer.getDocument(); selectedItem.apply(document); this.viewer.getTextWidget().setSelection(selectedItem.getSelection(document)); this.stage.hide(); } }