use of javafx.scene.control.Label in project POL-POM-5 by PlayOnLinux.
the class DetailsView method populateHeader.
/**
* Populate the header with a label for the title of this details view and a close button
*/
private void populateHeader() {
this.titleLabel = new Label();
this.titleLabel.getStyleClass().add("descriptionTitle");
this.titleLabel.setAlignment(Pos.CENTER_LEFT);
this.titleLabel.setWrapText(true);
this.closeButton = new Button();
this.closeButton.getStyleClass().add("closeIcon");
this.closeButton.setOnAction(event -> onClose.run());
this.closeButton.setAlignment(Pos.CENTER_RIGHT);
Region filler = new Region();
HBox headerBox = new HBox();
headerBox.getChildren().setAll(titleLabel, filler, closeButton);
HBox.setHgrow(filler, Priority.ALWAYS);
this.setTop(headerBox);
}
use of javafx.scene.control.Label in project POL-POM-5 by PlayOnLinux.
the class AppPanel method refreshScripts.
/**
* Refreshes the shown scripts.
* When this method is called it begins by clearing the <code>scriptGrid</code>.
* Afterwards this method refills it.
*/
private void refreshScripts() {
scriptGrid.getChildren().clear();
for (int i = 0; i < filteredScripts.size(); i++) {
ScriptDTO script = filteredScripts.get(i);
Label scriptName = new Label(script.getScriptName());
if (settingsManager.isViewScriptSource()) {
final Tooltip tooltip = new Tooltip(tr("Source: {0}", script.getScriptSource()));
Tooltip.install(scriptName, tooltip);
}
Button installButton = new Button(tr("Install"));
installButton.setOnMouseClicked(evt -> {
try {
onScriptInstall.accept(script);
} catch (IllegalArgumentException e) {
LOGGER.error("Failed to get script", e);
new ErrorMessage(tr("Error while trying to download the installer"), e).show();
}
});
scriptGrid.addRow(i, scriptName, installButton);
GridPane.setHgrow(scriptName, Priority.ALWAYS);
}
}
use of javafx.scene.control.Label in project POL-POM-5 by PlayOnLinux.
the class StepRepresentationPresentation method drawStepContent.
@Override
protected void drawStepContent() {
final String title = this.getParentWizardTitle();
VBox contentPane = new VBox();
contentPane.setId("presentationBackground");
Label titleWidget = new Label(title + "\n\n");
titleWidget.setId("presentationTextTitle");
Text textWidget = new Text(textToShow);
textWidget.setId("presentationText");
TextFlow flow = new TextFlow();
flow.getChildren().add(textWidget);
ScrollPane scrollPane = new ScrollPane();
scrollPane.setId("presentationScrollPane");
scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
scrollPane.setFitToWidth(true);
scrollPane.setContent(flow);
VBox.setVgrow(scrollPane, Priority.ALWAYS);
contentPane.getChildren().add(scrollPane);
getParent().getRoot().setCenter(contentPane);
}
use of javafx.scene.control.Label in project SmartCity-Market by TechnionYP5777.
the class ManageCatalogProductDetailsTab method initialize.
@Override
public void initialize(URL location, ResourceBundle __) {
createManufacturerList();
createIngredientList();
filterManu.textProperty().addListener(obs -> {
String filter = filterManu.getText();
filteredDataManu.setPredicate(filter == null || filter.length() == 0 ? s -> true : s -> s.contains(filter));
});
manufacturerList.setCellFactory(CheckBoxListCell.forListView(new Callback<String, ObservableValue<Boolean>>() {
@Override
public ObservableValue<Boolean> call(String item) {
BooleanProperty observable = new SimpleBooleanProperty();
observable.set(selectedManu.contains(item));
observable.addListener((obs, wasSelected, isNowSelected) -> {
if (isNowSelected)
selectedManu.add(item);
else
selectedManu.remove(item);
enableButtons();
});
return observable;
}
}));
filterIngr.textProperty().addListener(obs -> {
String filter = filterIngr.getText();
filteredDataIngr.setPredicate(filter == null || filter.length() == 0 ? s -> true : s -> s.contains(filter));
});
ingredientsList.setCellFactory(CheckBoxListCell.forListView(new Callback<String, ObservableValue<Boolean>>() {
@Override
public ObservableValue<Boolean> call(String item) {
BooleanProperty observable = new SimpleBooleanProperty();
observable.set(selectedIngr.contains(item));
observable.addListener((obs, wasSelected, isNowSelected) -> {
if (isNowSelected)
selectedIngr.add(item);
else
selectedIngr.remove(item);
enableButtons();
});
return observable;
}
}));
Label lbl1 = new Label("Insert New Manufacturar");
newManu = new JFXTextField();
okNewManu = new JFXButton("Done!");
okNewManu.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent __) {
addManuPressed();
}
});
VBox manuContainer = new VBox();
manuContainer.getChildren().addAll(lbl1, newManu, okNewManu);
manuContainer.setPadding(new Insets(10, 50, 50, 50));
manuContainer.setSpacing(10);
JFXPopup popup1 = new JFXPopup(manuContainer);
addManuBtn.setOnMouseClicked(e -> popup1.show(addManuBtn, PopupVPosition.TOP, PopupHPosition.LEFT));
newManu.textProperty().addListener((observable, oldValue, newValue) -> enableAddButtons());
Label lbl2 = new Label("Insert New Ingredient");
newIngr = new JFXTextField();
okNewIngr = new JFXButton("Done!");
okNewIngr.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent __) {
addIngPressed();
}
});
VBox ingrContainer = new VBox();
ingrContainer.getChildren().addAll(lbl2, newIngr, okNewIngr);
ingrContainer.setPadding(new Insets(10, 50, 50, 50));
ingrContainer.setSpacing(10);
JFXPopup popup2 = new JFXPopup(ingrContainer);
addIngrBtn.setOnMouseClicked(e -> popup2.show(addIngrBtn, PopupVPosition.TOP, PopupHPosition.LEFT));
newIngr.textProperty().addListener((observable, oldValue, newValue) -> enableAddButtons());
Label lbl3 = new Label("Rename Selected Manufacturar");
renameManuLbl = new JFXTextField();
okRenameManu = new JFXButton("Done!");
okRenameManu.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent __) {
renameManuPressed();
}
});
VBox renameManuContainer = new VBox();
renameManuContainer.getChildren().addAll(lbl3, renameManuLbl, okRenameManu);
renameManuContainer.setPadding(new Insets(10, 50, 50, 50));
renameManuContainer.setSpacing(10);
JFXPopup popup3 = new JFXPopup(renameManuContainer);
renameManu.setOnMouseClicked(e -> popup3.show(renameManu, PopupVPosition.TOP, PopupHPosition.LEFT));
renameManuLbl.textProperty().addListener((observable, oldValue, newValue) -> enableAddButtons());
Label lbl4 = new Label("Rename Selected Ingredient");
renameIngrLbl = new JFXTextField();
okRenameIngr = new JFXButton("Done!");
okRenameIngr.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent __) {
renameIngrPressed();
}
});
VBox renameIngrContainer = new VBox();
renameIngrContainer.getChildren().addAll(lbl4, renameIngrLbl, okRenameIngr);
renameIngrContainer.setPadding(new Insets(10, 50, 50, 50));
renameIngrContainer.setSpacing(10);
JFXPopup popup4 = new JFXPopup(renameIngrContainer);
renameIngr.setOnMouseClicked(e -> popup4.show(renameIngr, PopupVPosition.TOP, PopupHPosition.LEFT));
renameIngrLbl.textProperty().addListener((observable, oldValue, newValue) -> enableAddButtons());
enableButtons();
enableAddButtons();
}
use of javafx.scene.control.Label in project Smartcity-Smarthouse by TechnionYP5777.
the class MessageViewController method buildStreamModePane.
void buildStreamModePane() {
streamFieldMap = new HashMap<>();
int currentRow = 0;
streamMode.add(new Label("Name"), 0, currentRow);
streamMode.add(new Label("From"), 1, currentRow);
streamMode.add(new Label("To"), 2, currentRow++);
for (final SensorField ¢ : currentSensor.getFields()) {
streamMode.add(new Label(¢.getName()), 0, currentRow);
final List<Node> nodes = new ArrayList<>();
if (¢.getType() == Types.BOOLEAN) {
final ComboBox<BooleanValues> b = new ComboBox<>();
b.getItems().addAll(BooleanValues.values());
streamMode.add(b, 1, currentRow);
nodes.add(b);
} else {
final TextField t1 = new TextField(), t2 = new TextField();
streamMode.add(t1, 1, currentRow);
nodes.add(t1);
if (¢.getType() != Types.STRING) {
streamMode.add(t2, 2, currentRow);
nodes.add(t2);
}
}
streamFieldMap.put(¢, nodes);
++currentRow;
}
streamMode.add(new Label("Send Interval(integer only):"), 0, currentRow);
final TextField t1 = new TextField(), t2 = new TextField();
streamMode.add(t1, 1, currentRow);
streamMode.add(t2, 2, currentRow);
timeInput = new Pair<>(t1, t2);
}
Aggregations