本文整理汇总了Java中org.controlsfx.control.PopOver.setDetached方法的典型用法代码示例。如果您正苦于以下问题:Java PopOver.setDetached方法的具体用法?Java PopOver.setDetached怎么用?Java PopOver.setDetached使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.controlsfx.control.PopOver
的用法示例。
在下文中一共展示了PopOver.setDetached方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: call
import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
@Override
public Node call(DateControl.EntryDetailsPopOverContentParameter param) {
PopOver popOver = param.getPopOver();
GoogleEntry entry = (GoogleEntry) param.getEntry();
InvalidationListener listener = obs -> {
if (entry.isFullDay() && !popOver.isDetached()) {
popOver.setDetached(true);
}
};
entry.fullDayProperty().addListener(listener);
popOver.setOnHidden(evt -> entry.fullDayProperty().removeListener(listener));
return new GoogleEntryPopOverContentPane(entry, param.getDateControl().getCalendars());
}
示例2: EntryPopOverContentPane
import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
public EntryPopOverContentPane(PopOver popOver, DateControl dateControl, Entry<?> entry) {
getStylesheets().add(CalendarView.class.getResource("calendar.css").toExternalForm()); //$NON-NLS-1$
this.popOver = popOver;
this.dateControl = dateControl;
this.entry = Objects.requireNonNull(entry);
EntryDetailsView details = new EntryDetailsView(entry);
PopOverTitledPane detailsPane = new PopOverTitledPane(Messages.getString("EntryPopOverContentPane.DETAILS"), //$NON-NLS-1$
details);
EntryHeaderView header = new EntryHeaderView(entry, dateControl.getCalendars());
setHeader(header);
if (Boolean.getBoolean("calendarfx.developer")) {
EntryPropertiesView properties = new EntryPropertiesView(entry);
PopOverTitledPane propertiesPane = new PopOverTitledPane("Properties", properties);
getPanes().addAll(detailsPane, propertiesPane);
} else {
getPanes().addAll(detailsPane);
}
setExpandedPane(detailsPane);
InvalidationListener listener = obs -> {
if (entry.isFullDay() && !popOver.isDetached()) {
popOver.setDetached(true);
}
};
entry.fullDayProperty().addListener(listener);
popOver.setOnHidden(evt -> entry.fullDayProperty().removeListener(listener));
entry.calendarProperty().addListener(it -> {
if (entry.getCalendar() == null) {
popOver.hide(Duration.ZERO);
}
});
}
示例3: openEditor
import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
private void openEditor() {
final PopOver popOver = new PopOver();
final TextField textEditor = new TextField(targetText.getText());
BorderPane editorPane = new BorderPane(textEditor);
BorderPane.setMargin(textEditor, new Insets(12));
textEditor.setOnKeyReleased(e -> {
if ( KeyCode.ESCAPE.equals(e.getCode()) ) {
popOver.hide();
}
});
textEditor.setOnAction(e -> {
try {
setTargetValue(Double.parseDouble(textEditor.getText()));
fireTargeValueSet();
} catch ( NumberFormatException nfex ) {
Toolkit.getDefaultToolkit().beep();
} finally {
popOver.hide();
}
});
popOver.setContentNode(editorPane);
popOver.setDetachable(false);
popOver.setDetached(false);
popOver.setArrowLocation(PopOver.ArrowLocation.TOP_CENTER);
popOver.setHeaderAlwaysVisible(true);
popOver.setHideOnEscape(true);
popOver.setTitle("Set Target Value");
popOver.setAnimated(true);
popOver.setAutoHide(true);
popOver.setCloseButtonEnabled(true);
text.getScene().getStylesheets().stream().forEach(s -> popOver.getRoot().getStylesheets().add(s));
Bounds bounds = getBoundsInLocal();
Bounds screenBounds = localToScreen(bounds);
int x = (int) screenBounds.getMinX();
int y = (int) screenBounds.getMinY();
int w = (int) screenBounds.getWidth();
int h = (int) screenBounds.getHeight();
popOver.show(this, x + w / 2, y + h / 2);
}
示例4: showLogPopOver
import org.controlsfx.control.PopOver; //导入方法依赖的package包/类
private void showLogPopOver(Button logLink, Cache cache) {
PopOver popOver = new PopOver();
Window window = logLink.getScene().getWindow();
VBox vbox = new VBox();
vbox.setFillWidth(true);
vbox.setMaxWidth(window.getWidth() - 420);
vbox.setSpacing(60.0);
vbox.setPadding(new Insets(30,20,30,20));
vbox.setStyle("-fx-background-color: white");
for (Log log: cache.getLogs()) {
BorderPane borderPane = new BorderPane();
Text icon = new MaterialDesignIconView(CHECK);
Label date = new Label(log.getDate().toString());
date.setStyle("-fx-font-weight: bold; -fx-font-size: 1.2em;");
Label name = new Label(log.getFinder().getName());
name.setStyle("-fx-font-weight: bold; -fx-font-size: 1.2em;");
HBox.setHgrow(icon, Priority.NEVER);
HBox.setHgrow(date, Priority.NEVER);
HBox.setHgrow(name, Priority.ALWAYS);
HBox header = new HBox();
header.setSpacing(10.0);
header.getChildren().addAll(icon, date, name);
header.setPadding(new Insets(10, 10, 10, 10));
header.setStyle("-fx-border-color: transparent transparent gray transparent");
borderPane.setTop(header);
Label logText = new Label(log.getText());
logText.setWrapText(true);
logText.setPadding(new Insets(10,10,10,10));
BorderPane.setAlignment(logText, Pos.TOP_LEFT);
borderPane.setCenter(logText);
vbox.getChildren().add(borderPane);
}
ScrollPane scrollPane = new ScrollPane(vbox);
scrollPane.setFitToWidth(true);
AnchorPane.setBottomAnchor(scrollPane, 0.0);
AnchorPane.setLeftAnchor(scrollPane, 0.0);
AnchorPane.setTopAnchor(scrollPane, 0.0);
AnchorPane.setRightAnchor(scrollPane, 0.0);
AnchorPane anchorPane = new AnchorPane();
anchorPane.setPrefWidth(window.getWidth()-400);
anchorPane.setMaxWidth(window.getWidth() - 400);
anchorPane.setStyle("-fx-background-color: white");
anchorPane.setMaxHeight(window.getHeight() - 400);
anchorPane.setPadding(new Insets(20, 20, 20, 20));
anchorPane.getChildren().add(scrollPane);
anchorPane.setStyle("-fx-background-color: transparent");
popOver.setContentNode(anchorPane);
popOver.setDetached(true);
//popOver.setDetachedTitle("Log Entries");
popOver.show(logLink.getScene().getWindow());
}