Search in sources :

Example 71 with TextField

use of javafx.scene.control.TextField in project TestFX by TestFX.

the class NodeAssertTest method isFocused.

@Test
public void isFocused() throws Exception {
    // given:
    FxToolkit.setupSceneRoot(() -> {
        textField = new TextField("foo");
        return new StackPane(textField);
    });
    // when:
    Platform.runLater(() -> textField.requestFocus());
    WaitForAsyncUtils.waitForFxEvents();
    // then:
    assertThat(textField).isFocused();
}
Also used : TextField(javafx.scene.control.TextField) StackPane(javafx.scene.layout.StackPane) Test(org.junit.Test)

Example 72 with TextField

use of javafx.scene.control.TextField in project TestFX by TestFX.

the class NodeAssertTest method isNotFocused_fails.

@Test
public void isNotFocused_fails() throws Exception {
    // given:
    FxToolkit.setupSceneRoot(() -> {
        textField = new TextField("foo");
        return new StackPane(textField);
    });
    // when:
    Platform.runLater(() -> textField.requestFocus());
    WaitForAsyncUtils.waitForFxEvents();
    // then:
    assertThatThrownBy(() -> assertThat(textField).isNotFocused()).isExactlyInstanceOf(AssertionError.class).hasMessageStartingWith("Expected: Node does not have focus\n");
}
Also used : TextField(javafx.scene.control.TextField) StackPane(javafx.scene.layout.StackPane) Test(org.junit.Test)

Example 73 with TextField

use of javafx.scene.control.TextField in project TestFX by TestFX.

the class NodeAssertTest method isFocused_fails.

@Test
public void isFocused_fails() throws Exception {
    // given:
    FxToolkit.setupSceneRoot(() -> {
        textField = new TextField("foo");
        textField2 = new TextField("bar");
        return new StackPane(textField, textField2);
    });
    // when:
    Platform.runLater(() -> textField2.requestFocus());
    WaitForAsyncUtils.waitForFxEvents();
    // then:
    assertThatThrownBy(() -> assertThat(textField).isFocused()).isExactlyInstanceOf(AssertionError.class).hasMessageStartingWith("Expected: Node has focus\n");
}
Also used : TextField(javafx.scene.control.TextField) StackPane(javafx.scene.layout.StackPane) Test(org.junit.Test)

Example 74 with TextField

use of javafx.scene.control.TextField in project TestFX by TestFX.

the class TextInputControlAssertTest method setup.

@Before
public void setup() throws Exception {
    FxToolkit.setupFixture(() -> {
        foobarTextField = new TextField("foobar");
        quuxTextField = new TextField("quux");
    });
}
Also used : TextField(javafx.scene.control.TextField) Before(org.junit.Before)

Example 75 with TextField

use of javafx.scene.control.TextField in project TestFX by TestFX.

the class WriteHeadlessTest method setup.

@Before
public void setup() throws Exception {
    FxToolkit.setupSceneRoot(() -> {
        TextField textField = new TextField();
        textField.setId("name");
        return new HBox(textField);
    });
    FxToolkit.setupStage(Stage::show);
}
Also used : HBox(javafx.scene.layout.HBox) TextField(javafx.scene.control.TextField) Stage(javafx.stage.Stage) Before(org.junit.Before)

Aggregations

TextField (javafx.scene.control.TextField)224 Label (javafx.scene.control.Label)99 Button (javafx.scene.control.Button)71 Insets (javafx.geometry.Insets)62 HBox (javafx.scene.layout.HBox)46 GridPane (javafx.scene.layout.GridPane)44 Scene (javafx.scene.Scene)42 VBox (javafx.scene.layout.VBox)36 InputTextField (bisq.desktop.components.InputTextField)32 Node (javafx.scene.Node)30 Stage (javafx.stage.Stage)27 List (java.util.List)26 CheckBox (javafx.scene.control.CheckBox)24 ButtonType (javafx.scene.control.ButtonType)23 Tooltip (javafx.scene.control.Tooltip)23 StackPane (javafx.scene.layout.StackPane)22 ArrayList (java.util.ArrayList)21 Dialog (javafx.scene.control.Dialog)21 BorderPane (javafx.scene.layout.BorderPane)19 ImageView (javafx.scene.image.ImageView)18