use of javafx.scene.layout.Region in project TestFX by TestFX.
the class NodeMatchersTest method hasText_filters_nodes.
@Test
public void hasText_filters_nodes() throws Exception {
// given:
List<Node> nodes = FxToolkit.setupFixture(() -> {
List<Node> temp = new ArrayList<>(3);
temp.add(new Region());
temp.add(new Button("foo"));
temp.add(new TextField("bar"));
return temp;
});
// then:
NodeQuery query1 = from(nodes).match(LabeledMatchers.hasText("foo"));
assertThat(query1.queryAll(), hasItems(nodes.get(1)));
NodeQuery query2 = from(nodes).match(TextInputControlMatchers.hasText("bar"));
assertThat(query2.queryAll(), hasItems(nodes.get(2)));
}
use of javafx.scene.layout.Region in project TestFX by TestFX.
the class NodeAssertTest method hasText_filters_nodes.
@Test
public void hasText_filters_nodes() throws Exception {
// given:
List<Node> nodes = FxToolkit.setupFixture(() -> {
List<Node> temp = new ArrayList<>(3);
temp.add(new Region());
temp.add(new Button("foo"));
temp.add(new TextField("bar"));
return temp;
});
// then:
NodeQuery query1 = from(nodes).match(LabeledMatchers.hasText("foo"));
assertThat(query1.queryAll()).containsExactly(nodes.get(1));
NodeQuery query2 = from(nodes).match(TextInputControlMatchers.hasText("bar"));
assertThat(query2.queryAll()).containsExactly(nodes.get(2));
}
use of javafx.scene.layout.Region in project phoenicis by PhoenicisOrg.
the class WinePrefixContainerInformationTab method populate.
private void populate() {
final VBox informationPane = new VBox();
final Text title = new TextWithStyle(tr("Information"), TITLE_CSS_CLASS);
informationPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
informationPane.getChildren().add(title);
final GridPane informationContentPane = new GridPane();
informationContentPane.getStyleClass().add("grid");
informationContentPane.add(new TextWithStyle(tr("Name:"), CAPTION_TITLE_CSS_CLASS), 0, 0);
Label name = new Label(container.getName());
name.setWrapText(true);
informationContentPane.add(name, 1, 0);
informationContentPane.add(new TextWithStyle(tr("Path:"), CAPTION_TITLE_CSS_CLASS), 0, 1);
Label path = new Label(container.getPath());
path.setWrapText(true);
informationContentPane.add(path, 1, 1);
informationContentPane.add(new TextWithStyle(tr("Installed shortcuts:"), CAPTION_TITLE_CSS_CLASS), 0, 2);
Label installedShortcuts = new Label(container.getInstalledShortcuts().stream().map(shortcutDTO -> shortcutDTO.getInfo().getName()).collect(Collectors.joining("; ")));
installedShortcuts.setWrapText(true);
informationContentPane.add(installedShortcuts, 1, 2);
informationContentPane.add(new TextWithStyle(tr("Wine version:"), CAPTION_TITLE_CSS_CLASS), 0, 3);
Label version = new Label(container.getVersion());
version.setWrapText(true);
informationContentPane.add(version, 1, 3);
informationContentPane.add(new TextWithStyle(tr("Wine architecture:"), CAPTION_TITLE_CSS_CLASS), 0, 4);
Label architecture = new Label(container.getArchitecture());
architecture.setWrapText(true);
informationContentPane.add(architecture, 1, 4);
informationContentPane.add(new TextWithStyle(tr("Wine distribution:"), CAPTION_TITLE_CSS_CLASS), 0, 5);
Label distribution = new Label(container.getDistribution());
distribution.setWrapText(true);
informationContentPane.add(distribution, 1, 5);
Region spacer = new Region();
spacer.setPrefHeight(20);
VBox.setVgrow(spacer, Priority.NEVER);
// changing engine does not work currently
// disabled combobox to avoid confusion of users
/*ComboBox<EngineVersionDTO> changeEngineComboBox = new ComboBox<EngineVersionDTO>(
FXCollections.observableList(engineVersions));
changeEngineComboBox.setConverter(new StringConverter<EngineVersionDTO>() {
@Override
public String toString(EngineVersionDTO object) {
return object.getVersion();
}
@Override
public EngineVersionDTO fromString(String string) {
return engineVersions.stream().filter(engineVersion -> engineVersion.getVersion().equals(string))
.findFirst().get();
}
});
changeEngineComboBox.getSelectionModel().select(engineVersions.stream()
.filter(engineVersion -> engineVersion.getVersion().equals(container.getVersion())).findFirst().get());*/
Button deleteButton = new Button(tr("Delete container"));
deleteButton.setOnMouseClicked(event -> this.onDeletePrefix.accept(container));
informationPane.getChildren().addAll(informationContentPane, spacer, /*changeEngineComboBox,*/
deleteButton);
this.setContent(informationPane);
}
use of javafx.scene.layout.Region in project trex-stateless-gui by cisco-system-traffic-generator.
the class ConfigTreeItem method initTreeItemValue.
private void initTreeItemValue() {
HBox itemContainer = new HBox();
itemContainer.setSpacing(5d);
itemContainer.getChildren().add(createLabel());
Region spacing = new Region();
spacing.setMaxHeight(0d);
HBox.setHgrow(spacing, Priority.ALWAYS);
itemContainer.getChildren().add(spacing);
if (configNode.isRemovable()) {
itemContainer.getChildren().add(createRemoveButton());
}
this.control = createControl();
if (control != null) {
itemContainer.getChildren().add(control);
}
setValue(itemContainer);
}
use of javafx.scene.layout.Region in project POL-POM-5 by PlayOnLinux.
the class ShortcutInformationPanelSkin method initialise.
/**
* {@inheritDoc}
*/
@Override
public void initialise() {
final GridPane controlButtons = createControlButtons();
if (getControl().getJavaFxSettingsManager().isAdvancedMode()) {
final Label descriptionLabel = new Label();
descriptionLabel.textProperty().bind(description);
descriptionLabel.setWrapText(true);
final GridPane propertiesGrid = createPropertiesGrid();
final Label environmentLabel = new Label(tr("Environment"));
environmentLabel.getStyleClass().add("sectionTitle");
environmentLabel.setWrapText(true);
final KeyAttributeList environmentAttributeList = createKeyAttributeList();
final Region spacer = new Region();
spacer.getStyleClass().add("detailsButtonSpacer");
final VBox container = new VBox(descriptionLabel, propertiesGrid, environmentLabel, environmentAttributeList, spacer, controlButtons);
getChildren().setAll(container);
} else {
final VBox container = new VBox(controlButtons);
getChildren().setAll(container);
}
}
Aggregations