本文整理了Java中javafx.scene.control.Label.visibleProperty()
方法的一些代码示例,展示了Label.visibleProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.visibleProperty()
方法的具体详情如下:
包路径:javafx.scene.control.Label
类名称:Label
方法名:visibleProperty
暂无
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
public void buildInput() {
allOverContainer.getChildren().add(0, errorMessage);
errorMessage.getStyleClass().add("form-input-inline-editor-errorMessage");
errorMessage.visibleProperty().bind(errorMessage.textProperty().isNotEmpty());
allOverContainer.getChildren().add(editInputComponent.getDisplay());
}
代码示例来源:origin: stackoverflow.com
getColumns().addListener(new ListChangeListener<TableColumn<S, ?>>() {
@Override
public void onChanged(final ListChangeListener.Change<? extends TableColumn<S, ?>> change) {
while (change.next()) {
Label label;
TextField search;
VBox graphic;
for (TableColumn<S, ?> column : change.getAddedSubList()) {
label = new Label(column.getText());
search = new TextField();
graphic = new VBox();
graphic.getStyleClass().add("k-column-graphic");
graphic.getChildren().addAll(label, search);
column.setGraphic(graphic);
/* ======= add the following two lines ============== */
label.visibleProperty().bind(column.visibleProperty());
search.visibleProperty().bind(column.visibleProperty());
}
}
}
});
代码示例来源:origin: org.controlsfx/controlsfx
private Label createProgressIndicator() {
Label graphic = new Label();
graphic.setGraphic(getSkinnable().getProgressNode());
graphic.visibleProperty().bind(getSkinnable().progressVisibleProperty());
graphic.getStyleClass().add("masker-graphic"); //$NON-NLS-1$
return graphic;
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
/**
* Constructor
*/
public SimpleDetailsPaneTitle() {
setStyle(
"-fx-background-color: transparent;" + "-fx-pref-height: 64;" + "-fx-padding: 2em;" + "-fx-border-color: -grey-color-300;" + "-fx-border-width: 0 1 0.4 1;" + "-fx-alignment: CENTER_LEFT;");
titleDescriptionContainer.setStyle("-fx-background-color: transparent;" + "-fx-spacing: 10;" + "-fx-alignment:CENTER_LEFT;");
titleLabel = new Label();
titleLabel.getStyleClass().add("h2");
titleDescriptionContainer.getChildren().add(titleLabel);
descriptionLabel = new Label();
descriptionLabel.setOpacity(0.44);
descriptionLabel.visibleProperty().bind(descriptionLabel.textProperty().isNotEmpty());
descriptionLabel.managedProperty().bind(descriptionLabel.visibleProperty());
titleDescriptionContainer.getChildren().add(descriptionLabel);
getChildren().add(titleDescriptionContainer);
getChildren().add(rightContainer);
NodeHelper.setHVGrow(titleDescriptionContainer);
NodeHelper.setHgrow(rightContainer);
rightContainer.setStyle("-fx-alignment:CENTER_RIGHT;");
}
代码示例来源:origin: Tristan971/Lyrebird
@Override
public void initialize() {
notificationPane.visibleProperty().bind(shouldDisplay);
notificationPane.managedProperty().bind(shouldDisplay);
notificationPane.setOnMouseClicked(e -> shouldDisplay.setValue(false));
notificationContent.textProperty().addListener((observable, oldValue, newValue) -> {
notificationContent.visibleProperty().setValue(!newValue.isEmpty());
notificationContent.managedProperty().setValue(!newValue.isEmpty());
});
LOG.debug("Starting internal notification system. Listening on new notification requests.");
internalNotificationSystem.notificationProperty().addListener((o, prev, cur) -> this.handleChange(cur));
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
/**
* @{inheritedDoc}
*/
@Override
public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) {
super.buildFrom(controller, configuration);
AnchorPane.setTopAnchor(iconContainer, -2.0);
AnchorPane.setRightAnchor(iconContainer, 8.0);
AnchorPane.setTopAnchor(link, 4.0);
AnchorPane.setLeftAnchor(link, 0.0);
AnchorPane.setRightAnchor(link, 0.0);
container.getChildren().addAll(link);
container.getChildren().add(label);
// buildCircleIcon();
label.getStyleClass().add("ep-countable-button-count");
label.visibleProperty().bind(Bindings.greaterThan(count, 0));
Bindings.bindBidirectional(label.textProperty(), count, NumberFormat.getInstance());
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
private void buildCollpaseExpandIndicator() {
final boolean collapsible = blocConfig.booleanPropertyValueOf("collapsible").orElse(true);
if (collapsible) {
// action on the mouse event on the hbox only
addEventFilter(MouseEvent.MOUSE_CLICKED, e -> onCollapseExpand());
buildCollapsedIcon();
buildExpandedcon();
final StackPane wrapper = new StackPane();
collpasedLabel.managedProperty().bind(Bindings.not(expanded));
collpasedLabel.getStyleClass().addAll(FORM_BLOC_TITLE_LABEL_COLLAPSE_ICON, "hand-hover");
collpasedLabel.visibleProperty().bind(collpasedLabel.managedProperty());
expandedLabel.managedProperty().bind(expanded);
expandedLabel.getStyleClass().addAll(FORM_BLOC_TITLE_LABEL_COLLAPSE_ICON, "hand-hover");
expandedLabel.visibleProperty().bind(expandedLabel.managedProperty());
expanded.set(true);
wrapper.getChildren().add(0, collpasedLabel);
wrapper.getChildren().add(0, expandedLabel);
wrapper.setStyle("-fx-max-width:28;-fx-min-width:28;");
internalLayout.getChildren().addAll( NodeHelper.horizontalSpacer(),wrapper);
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxplatform-components
/**
* Build the header
*/
private void buildHeader() {
NodeHelper.setTitle(title, configuration, controller);
NodeHelper.styleClassAddAll(title, configuration, "titleStyleClass", "h4");
title.managedProperty().bind(title.visibleProperty());
boolean displayTitle = configuration.getBooleanProperty("displayTitle", true);
title.visibleProperty().set(displayTitle);
String listViewId = configuration.getPropertyValue("listViewId");
if (StringUtils.isNotBlank(listViewId)) {
listView.setId(listViewId);
}
// description
String description = configuration.getPropertyValue("description");
NodeHelper.setHVGrow(this.description);
if (StringUtils.isNotBlank(description)) {
String lb = controller.getLocalised(description);
Text text = new Text();
NodeHelper.styleClassAddAll(text, configuration, "descriptionStyleClass", "medium-description");
text.setText(lb);
this.description.getChildren().add(text);
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
counterText.visibleProperty().bind(input.getDisplay().focusedProperty());
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
protected void buildCollpaseExpand() {
StackPane wrapper = new StackPane();
FontIcon collpasedLabelicon = new FontIcon("fa-arrow-right:20");
collpasedLabel.setGraphic(collpasedLabelicon);
FontIcon expandedLabelicon = new FontIcon("fa-arrow-left:20");
expandedLabel.setGraphic(expandedLabelicon);
collpasedLabel.managedProperty().bind(Bindings.not(collpased));
collpasedLabel.visibleProperty().bind(collpasedLabel.managedProperty());
expandedLabel.managedProperty().bind(collpased);
expandedLabel.visibleProperty().bind(expandedLabel.managedProperty());
collpased.set(true);
wrapper.getChildren().addAll(collpasedLabel, expandedLabel);
wrapper.setStyle("-fx-max-width:48;-fx-min-width:48;");
collpasedLabel.addEventFilter(MouseEvent.MOUSE_CLICKED, e -> onCollapseExpand());
expandedLabel.addEventFilter(MouseEvent.MOUSE_CLICKED, e -> onCollapseExpand());
// !! should be las items
// child class should handle this
rootContainer.getChildren().add(wrapper);
}
代码示例来源:origin: com.dlsc.formsfx/formsfx-core
/**
* {@inheritDoc}
*/
@Override
public void setupBindings() {
super.setupBindings();
fieldLabel.textProperty().bind(field.labelProperty());
comboBox.visibleProperty().bind(field.editableProperty());
readOnlyLabel.visibleProperty().bind(field.editableProperty().not());
readOnlyLabel.textProperty().bind(comboBox.valueProperty().asString());
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
@Override
public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) {
this.configuration = configuration;
this.controller = (AbstractViewController) controller;
NodeHelper.loadFXML(getFxmlLocation(), this);
filterTextField.managedProperty().bind(filterTextField.visibleProperty());
filterTextField.setVisible(false);
filterTextField.setPromptText("Find in table");
if (configuration != null) {
NodeHelper.setTitle(title, configuration, (AbstractViewController) controller, true);
NodeHelper.styleClassSetAll(title, configuration, "titleStyleClass", "ep-edit-structure-title-label");
NodeHelper.styleClassAddAll(tableHeaderRootPane, configuration, "styleClass");
title.visibleProperty().bind(Bindings.isNotEmpty(title.textProperty()));
elementsCountProperty().addListener((ChangeListener<Number>) (observable, oldValue, newValue) -> {
if (newValue.intValue() > 0) {
itemsCount.textProperty().set("");
} else {
itemsCount.textProperty().set(String.format(dynMessageFormat, newValue.intValue()));
}
});
((FullTableStructureController) controller).processedElementProperty().addListener((ChangeListener<Object>) (observable, oldValue, newValue) -> {
final AbstractTableStructure ts = (AbstractTableStructure) ((FullTableStructureController) controller).processedElementProperty().get();
doLayout(ts);
buildFiltering(ts);
});
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
/**
* {@inheritDoc}
*/
@Override
public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) {
this.configuration = configuration;
this.controller = (AbstractViewController) controller;
loadFXML();
NodeHelper.styleClassAddAll(tableHeaderRootPane, configuration, "styleClass");
NodeHelper.setTitle(headerTitle, configuration, (AbstractViewController) controller, true);
NodeHelper.styleClassSetAll(headerTitle, configuration, "titleStyleClass", "ep-table-title-label");
NodeHelper.styleClassAddAll(titleContainer, configuration, "titleContainerStyleClass");
filterTextField.managedProperty().bind(filterTextField.visibleProperty());
filterTextField.setPromptText("Find in table");
boolean filtrable = configuration.getBooleanProperty("filtrable", true);
filterTextField.setVisible(filtrable);
((FullTableStructureController) controller).processedElementProperty().addListener((ChangeListener<Object>) (observable, oldValue, newValue) -> {
AbstractTableStructure ts = (AbstractTableStructure) ((FullTableStructureController) controller).processedElementProperty().get();
if (ts.getToolbar().isPresent()) {
Node tb = ts.getToolbar().get();
HBox.setHgrow(tb, Priority.NEVER);
actionsContainer.getChildren().add(tb);
}
});
setRootModel();
headerTitle.managedProperty().bind(headerTitle.visibleProperty());
headerTitle.visibleProperty().bind(Bindings.size(titleContainer.getChildren()).isEqualTo(0));
titleContainer.visibleProperty().bind(Bindings.size(titleContainer.getChildren()).greaterThan(0));
titleContainer.managedProperty().bind(titleContainer.visibleProperty());
}
代码示例来源:origin: com.dlsc.formsfx/formsfx-core
/**
* {@inheritDoc}
*/
@Override
public void setupBindings() {
super.setupBindings();
editableSpinner.visibleProperty().bind(field.editableProperty());
readOnlyLabel.visibleProperty().bind(field.editableProperty().not());
editableSpinner.getEditor().textProperty().bindBidirectional(field.userInputProperty());
readOnlyLabel.textProperty().bind(field.userInputProperty());
fieldLabel.textProperty().bind(field.labelProperty());
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
/**
* Constructor
*/
public PaginationBar() {
rowsPerPageLabel.visibleProperty().bind(rowsPerPageCombo.visibleProperty());
rowsPerPageCombo.managedProperty().bind(rowsPerPageCombo.visibleProperty());
rowsPerPageCombo.getStyleClass().addAll("simple-pagination-combo");
model.addListener((ChangeListener<MultipleResult>) (observable, oldValue, newValue) -> {
modelUpdated();
});
rowsPerPageCombo.getItems().addAll("5", "10", "15", "20");
rowsPerPageCombo.getSelectionModel().selectFirst();
rowsPerPageCombo.getSelectionModel().selectedItemProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> {
firstPage();
});
}
代码示例来源:origin: com.dlsc.formsfx/formsfx-core
@Override
public void setupBindings() {
super.setupBindings();
picker.disableProperty().bind(field.editableProperty().not());
readOnlyLabel.visibleProperty().bind(field.editableProperty().not());
picker.getEditor().textProperty().bindBidirectional(field.userInputProperty());
fieldLabel.textProperty().bind(field.labelProperty());
picker.promptTextProperty().bind(field.placeholderProperty());
picker.managedProperty().bind(picker.visibleProperty());
}
代码示例来源:origin: com.dlsc.formsfx/formsfx-core
/**
* {@inheritDoc}
*/
@Override
public void setupBindings() {
super.setupBindings();
editableField.visibleProperty().bind(field.editableProperty());
readOnlyLabel.visibleProperty().bind(field.editableProperty().not());
editableField.textProperty().bindBidirectional(field.userInputProperty());
obfuscatedUserInputBinding = Bindings.createStringBinding(() -> obfuscate(field.getUserInput()), field.userInputProperty());
readOnlyLabel.textProperty().bind(obfuscatedUserInputBinding);
fieldLabel.textProperty().bind(field.labelProperty());
editableField.promptTextProperty().bind(field.placeholderProperty());
editableField.managedProperty().bind(editableField.visibleProperty());
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
private void buildProcessing() {
waitingIndicator.maxHeightProperty().bind(waitingIndicator.maxWidthProperty());
waitingIndicator.maxWidthProperty().set(30);
BooleanBinding isWaiting = Bindings.equal(ProcessingState.WAITING, status);
BooleanBinding isDoneError = Bindings.equal(ProcessingState.DONE_KO, status);
doneOKLabel.visibleProperty().bind(Bindings.equal(ProcessingState.DONE_OK, status));
waitingIndicator.visibleProperty().bind(Bindings.equal(ProcessingState.PROCESSING, status));
allOverContainer.visibleProperty().bind(Bindings.or(isWaiting, isDoneError));
// ok icon
doneOKLabel.setText("DONE");
status.addListener((ChangeListener<ProcessingState>) (observable, oldValue, newValue) -> {
if (newValue == ProcessingState.DONE_KO) {
pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), true);
pseudoClassStateChanged(PseudoClass.getPseudoClass("status"), false);
} else if (newValue == ProcessingState.PROCESSING) {
pseudoClassStateChanged(PseudoClass.getPseudoClass("status"), true);
pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), false);
}
});
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
private void buildProcessing() {
waitingIndicator.maxHeightProperty().bind(waitingIndicator.maxWidthProperty());
waitingIndicator.maxWidthProperty().set(30);
BooleanBinding isWaiting = Bindings.equal(ProcessingState.WAITING, status);
BooleanBinding isDoneError = Bindings.equal(ProcessingState.DONE_KO, status);
doneOKLabel.visibleProperty().bind(Bindings.equal(ProcessingState.DONE_OK, status));
waitingIndicator.visibleProperty().bind(Bindings.equal(ProcessingState.PROCESSING, status));
allOverContainer.visibleProperty().bind(Bindings.or(isWaiting, isDoneError));
// ok icon
FontIcon fontIcon = new FontIcon();
fontIcon.setStyle("-fx-icon-color:-accent-color-500;-fx-icon-code:mdi-check;-fx-icon-size:30;");
doneOKLabel.setGraphic(fontIcon);
status.addListener((ChangeListener<ProcessingState>) (observable, oldValue, newValue) -> {
if (newValue == ProcessingState.DONE_KO) {
pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), true);
pseudoClassStateChanged(PseudoClass.getPseudoClass("status"), false);
}
else if (newValue == ProcessingState.PROCESSING) {
pseudoClassStateChanged(PseudoClass.getPseudoClass("status"), true);
pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), false);
}
});
}
代码示例来源:origin: com.dlsc.formsfx/formsfx-core
/**
* {@inheritDoc}
*/
@Override
public void setupBindings() {
super.setupBindings();
editableArea.visibleProperty().bind(Bindings.and(field.editableProperty(),
field.multilineProperty()));
editableField.visibleProperty().bind(Bindings.and(field.editableProperty(),
field.multilineProperty().not()));
readOnlyLabel.visibleProperty().bind(field.editableProperty().not());
editableField.textProperty().bindBidirectional(field.userInputProperty());
editableArea.textProperty().bindBidirectional(field.userInputProperty());
readOnlyLabel.textProperty().bind(field.userInputProperty());
fieldLabel.textProperty().bind(field.labelProperty());
editableField.promptTextProperty().bind(field.placeholderProperty());
editableArea.promptTextProperty().bind(field.placeholderProperty());
editableArea.managedProperty().bind(editableArea.visibleProperty());
editableField.managedProperty().bind(editableField.visibleProperty());
}
内容来源于网络,如有侵权,请联系作者删除!