78
79 protected AbstractTestableApplication getApplication() {
80 return application;
81 }
82
83 protected String getName() {
84 return getClass().getSimpleName();
85 }
86 protected void openPage(String name) {
87 if (application != null) {
88 application.openPage(name);
89 } else {
90 clickTextButton(name);
91 }
92 }
93 protected void clickTextButton(String name) {
94 /**
95 * new ControlDock because there is no ButtonDock Yet.
96 */
97 final ControlWrap<? extends Control> label =
98 new ControlDock(scene.as(Parent.class, Node.class), name).wrap();
99 label.mouse().move();
100 Utils.deferAction(new Runnable() {
101 public void run() {
102 EventHandler<? super MouseEvent> hndlr = label.getControl().getOnMouseClicked();
103 if (null == hndlr) {
104 hndlr = label.getControl().getOnMousePressed();
105 }
106 hndlr.handle(null);
107 }
108 });
109 }
110 protected void restoreSceneRoot() {
111 Utils.deferAction(new Runnable() {
112 public void run() {
113 ((BasicButtonChooserApp) application).restoreSceneRoot();
114 }
115 });
116 }
117 protected void verifyGetters() {
118 Assert.assertEquals("", application.getFailures());
|
78
79 protected AbstractTestableApplication getApplication() {
80 return application;
81 }
82
83 protected String getName() {
84 return getClass().getSimpleName();
85 }
86 protected void openPage(String name) {
87 if (application != null) {
88 application.openPage(name);
89 } else {
90 clickTextButton(name);
91 }
92 }
93 protected void clickTextButton(String name) {
94 /**
95 * new ControlDock because there is no ButtonDock Yet.
96 */
97 final ControlWrap<? extends Control> label =
98 new ControlDock((Parent <Node>)scene.as(Parent.class, Node.class), name).wrap();
99 label.mouse().move();
100 Utils.deferAction(new Runnable() {
101 public void run() {
102 EventHandler<? super MouseEvent> hndlr = label.getControl().getOnMouseClicked();
103 if (null == hndlr) {
104 hndlr = label.getControl().getOnMousePressed();
105 }
106 hndlr.handle(null);
107 }
108 });
109 }
110 protected void restoreSceneRoot() {
111 Utils.deferAction(new Runnable() {
112 public void run() {
113 ((BasicButtonChooserApp) application).restoreSceneRoot();
114 }
115 });
116 }
117 protected void verifyGetters() {
118 Assert.assertEquals("", application.getFailures());
|