use of javafx.scene.control.TextField in project Board-Instrumentation-Framework by intel.
the class Prompt_InputBox method SetupDialog.
@Override
protected Pane SetupDialog(Stage dialog) {
GridPane root = new GridPane();
root.setHgap(5.0);
root.setVgap(5.0);
root.setPadding(new Insets(5, 5, 2, 5));
Button btn = new Button();
btn.setText("OK");
Label lblMessage = new Label(getMessage());
Label lblSpacer = new Label(" ");
lblMessage.setWrapText(true);
TextField objPrompt = new TextField();
if (null != _PrevVal) {
objPrompt.setText(_PrevVal);
}
root.setAlignment(Pos.CENTER_LEFT);
GridPane.setColumnSpan(lblMessage, 2);
GridPane.setHalignment(btn, HPos.CENTER);
if (getWidth() > 0) {
objPrompt.setPrefWidth(getWidth());
}
if (getHeight() > 0) {
root.setPrefHeight(getHeight());
}
root.add(lblMessage, 0, 0);
root.add(objPrompt, 0, 2);
root.add(btn, 0, 3);
root.add(lblSpacer, 0, 4);
// place on correct screen and center
int xPos = (int) (Configuration.getConfig().getPrimaryScreen().getVisualBounds().getMinX());
int yPos = (int) (Configuration.getConfig().getPrimaryScreen().getVisualBounds().getMinY());
dialog.setX(xPos);
dialog.setY(yPos);
dialog.centerOnScreen();
btn.setOnAction((ActionEvent event) -> {
SetPromptedValue(objPrompt.getText());
_PrevVal = objPrompt.getText();
dialog.close();
});
return root;
}
use of javafx.scene.control.TextField in project drbookings by DrBookings.
the class JavaFXTest method start.
@Override
public void start(final Stage primaryStage) {
final StackPane root = new StackPane();
final TextFlow tf = new TextFlow();
final Text t0 = new Text("First part");
final Text t1 = new Text(", second");
final TextField t2 = new TextField(" and very, very, very long third");
t2.setEditable(false);
t2.setBackground(Background.EMPTY);
t2.setFocusTraversable(false);
tf.getChildren().addAll(t0, t1, t2);
root.getChildren().add(tf);
final Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
use of javafx.scene.control.TextField in project drbookings by DrBookings.
the class ICalSettingsController method initialize.
@Override
public void initialize(final URL location, final ResourceBundle resources) {
try {
final Map<String, String> map = SettingsManager.getInstance().getRoomNameMappings();
final List<Map.Entry<String, String>> l = new ArrayList<>(map.entrySet());
TextField vendor = null;
TextField our = null;
for (int i = 0; i < l.size(); i++) {
if (i == 0) {
vendor = vendorRoomName1;
our = ourRoomName1;
} else if (i == 1) {
vendor = vendorRoomName2;
our = ourRoomName2;
} else if (i == 2) {
vendor = vendorRoomName3;
our = ourRoomName3;
} else if (i == 3) {
vendor = vendorRoomName4;
our = ourRoomName4;
} else if (i == 4) {
vendor = vendorRoomName5;
our = ourRoomName5;
} else if (i == 5) {
vendor = vendorRoomName6;
our = ourRoomName6;
} else if (i == 6) {
vendor = vendorRoomName7;
our = ourRoomName7;
} else if (i == 7) {
vendor = vendorRoomName8;
our = ourRoomName8;
} else {
// no more mappings supported
break;
}
vendor.setText(l.get(i).getKey());
our.setText(l.get(i).getValue());
}
} catch (final Exception e) {
if (logger.isErrorEnabled()) {
logger.error(e.getLocalizedMessage(), e);
}
}
}
use of javafx.scene.control.TextField in project POL-POM-5 by PhoenicisOrg.
the class GitRepositoryDetailsPanel method populate.
/**
* Populates the repository details step for the git repository
*/
private void populate() {
this.urlField = new TextField();
this.branchField = new TextField("master");
Label urlLabel = new Label(tr("Git-Url:"));
urlLabel.setLabelFor(urlField);
Label branchLabel = new Label(tr("Branch:"));
branchLabel.setLabelFor(branchField);
GridPane grid = new GridPane();
grid.getStyleClass().add("grid");
grid.add(urlLabel, 0, 0);
grid.add(urlField, 1, 0);
grid.add(branchLabel, 0, 1);
grid.add(branchField, 1, 1);
this.setCenter(grid);
}
use of javafx.scene.control.TextField in project POL-POM-5 by PhoenicisOrg.
the class LocalRepositoryDetailsPanel method populate.
/**
* Populates the repository details step for the local repository
*/
private void populate() {
this.pathField = new TextField();
this.openBrowser = new Button(tr("Open directory chooser"));
openBrowser.setOnAction(event -> {
DirectoryChooser chooser = new DirectoryChooser();
File directory = chooser.showDialog(null);
pathField.setText(directory.toString());
});
HBox content = new HBox(pathField, openBrowser);
content.setId("addLocalRepository");
HBox.setHgrow(pathField, Priority.ALWAYS);
this.setCenter(content);
}
Aggregations