< prev index next >

functional/ControlsTests/src/javafx/scene/control/test/labeleds/newapps/LabeledsApp.java

Print this page




  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package javafx.scene.control.test.labeleds.newapps;
  26 
  27 import javafx.event.ActionEvent;
  28 import javafx.event.EventHandler;
  29 import javafx.geometry.Insets;
  30 import javafx.scene.Scene;
  31 import javafx.scene.control.Button;
  32 import javafx.scene.control.ButtonBuilder;
  33 import javafx.scene.control.Label;
  34 import javafx.scene.control.Labeled;
  35 import javafx.scene.control.test.utils.CommonPropertiesScene;
  36 import javafx.scene.control.test.utils.ptables.PropertiesTable;
  37 import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
  38 import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
  39 import javafx.scene.layout.HBox;
  40 import javafx.scene.layout.Pane;
  41 import javafx.scene.layout.VBox;
  42 import test.javaclient.shared.InteroperabilityApp;
  43 
  44 /**
  45  * @author Alexander Kirov
  46  */
  47 public abstract class LabeledsApp extends InteroperabilityApp {
  48 
  49     public final static String TESTED_LABELED_ID = "TESTED_LABELED_ID";
  50     public final static String RESET_BUTTON_ID = "RESET_LABELED_BUTTON_ID";
  51 
  52     protected abstract class LabeledScene extends CommonPropertiesScene {


  70             vb3 = new Pane();
  71             testedControl = getTestedLabeled();
  72             testedControl.setId(TESTED_LABELED_ID);
  73 
  74             tb = new PropertiesTable(testedControl);
  75             PropertyTablesFactory.explorePropertiesList(testedControl, tb);
  76             SpecialTablePropertiesProvider.provideForControl(testedControl, tb);
  77 
  78             vb3.setMinSize(220, 220);
  79             vb3.setPrefSize(220, 220);
  80             vb3.setStyle("-fx-border-color : red;");
  81             vb3.getChildren().add(testedControl);
  82 
  83             VBox vb = new VBox();
  84             vb.setSpacing(5);
  85 
  86             HBox hb = (HBox) getRoot();
  87             hb.setPadding(new Insets(5, 5, 5, 5));
  88             hb.setStyle("-fx-border-color : green;");
  89 
  90             Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();

  91             resetButton.setOnAction(new EventHandler<ActionEvent>() {
  92                 public void handle(ActionEvent t) {
  93                     HBox hb = (HBox) getRoot();
  94                     hb.getChildren().clear();
  95                     prepareScene();
  96                 }
  97             });
  98 
  99             setControllersContent(resetButton);
 100             setPropertiesContent(tb);
 101         }
 102     }
 103 }


  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package javafx.scene.control.test.labeleds.newapps;
  26 
  27 import javafx.event.ActionEvent;
  28 import javafx.event.EventHandler;
  29 import javafx.geometry.Insets;
  30 import javafx.scene.Scene;
  31 import javafx.scene.control.Button;

  32 import javafx.scene.control.Label;
  33 import javafx.scene.control.Labeled;
  34 import javafx.scene.control.test.utils.CommonPropertiesScene;
  35 import javafx.scene.control.test.utils.ptables.PropertiesTable;
  36 import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
  37 import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
  38 import javafx.scene.layout.HBox;
  39 import javafx.scene.layout.Pane;
  40 import javafx.scene.layout.VBox;
  41 import test.javaclient.shared.InteroperabilityApp;
  42 
  43 /**
  44  * @author Alexander Kirov
  45  */
  46 public abstract class LabeledsApp extends InteroperabilityApp {
  47 
  48     public final static String TESTED_LABELED_ID = "TESTED_LABELED_ID";
  49     public final static String RESET_BUTTON_ID = "RESET_LABELED_BUTTON_ID";
  50 
  51     protected abstract class LabeledScene extends CommonPropertiesScene {


  69             vb3 = new Pane();
  70             testedControl = getTestedLabeled();
  71             testedControl.setId(TESTED_LABELED_ID);
  72 
  73             tb = new PropertiesTable(testedControl);
  74             PropertyTablesFactory.explorePropertiesList(testedControl, tb);
  75             SpecialTablePropertiesProvider.provideForControl(testedControl, tb);
  76 
  77             vb3.setMinSize(220, 220);
  78             vb3.setPrefSize(220, 220);
  79             vb3.setStyle("-fx-border-color : red;");
  80             vb3.getChildren().add(testedControl);
  81 
  82             VBox vb = new VBox();
  83             vb.setSpacing(5);
  84 
  85             HBox hb = (HBox) getRoot();
  86             hb.setPadding(new Insets(5, 5, 5, 5));
  87             hb.setStyle("-fx-border-color : green;");
  88 
  89             Button resetButton = new Button("Reset");
  90             resetButton.setId(RESET_BUTTON_ID);
  91             resetButton.setOnAction(new EventHandler<ActionEvent>() {
  92                 public void handle(ActionEvent t) {
  93                     HBox hb = (HBox) getRoot();
  94                     hb.getChildren().clear();
  95                     prepareScene();
  96                 }
  97             });
  98 
  99             setControllersContent(resetButton);
 100             setPropertiesContent(tb);
 101         }
 102     }
 103 }
< prev index next >