Commits

Samir Hadzic  committed debafed Merge

Merged controlsfx/controlsfx into default

  • Participants
  • Parent commits 950399c, 6b9ca9e

Comments (0)

Files changed (5)

File controlsfx/src/main/java/org/controlsfx/validation/ValidationSupport.java

 import java.util.function.Predicate;
 
 import javafx.application.Platform;
+import javafx.beans.property.BooleanProperty;
 import javafx.beans.property.ObjectProperty;
+import javafx.beans.property.ReadOnlyBooleanProperty;
 import javafx.beans.property.ReadOnlyObjectProperty;
 import javafx.beans.property.ReadOnlyObjectWrapper;
+import javafx.beans.property.SimpleBooleanProperty;
 import javafx.beans.property.SimpleObjectProperty;
 import javafx.beans.value.ObservableValue;
 import javafx.collections.FXCollections;
         return validationResultProperty.getReadOnlyProperty();
     }
 
-    private ReadOnlyObjectWrapper<Boolean> invalidProperty = new ReadOnlyObjectWrapper<Boolean>(); 
-
+    private BooleanProperty invalidProperty = new SimpleBooleanProperty();
 
     /**
      * Returns current validation state. 
     }
 
     /**
-     * @return the Validation state property
+     * Validation state property 
+     * @return validation state property
      */
-    public ReadOnlyObjectProperty<Boolean> invalidProperty() {
-        return invalidProperty.getReadOnlyProperty();
+    public ReadOnlyBooleanProperty invalidProperty() {
+        return invalidProperty;
     }
 
 

File fxsampler/src/main/java/fxsampler/FXSampler.java

 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.net.URISyntaxException;
 import java.net.URL;
 import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
 import javafx.geometry.Rectangle2D;
 import javafx.scene.Node;
 import javafx.scene.Scene;
+import javafx.scene.control.Label;
 import javafx.scene.control.Tab;
 import javafx.scene.control.TabPane;
 import javafx.scene.control.TabPane.TabClosingPolicy;
 import javafx.scene.control.TreeView;
 import javafx.scene.layout.GridPane;
 import javafx.scene.layout.Priority;
+import javafx.scene.layout.VBox;
 import javafx.scene.web.WebView;
 import javafx.stage.Screen;
 import javafx.stage.Stage;
 import fxsampler.model.SampleTree.TreeNode;
 import fxsampler.model.WelcomePage;
 import fxsampler.util.SampleScanner;
-import javafx.scene.control.Label;
-import javafx.scene.layout.VBox;
 
 public class FXSampler extends Application {
     

File fxsampler/src/main/java/fxsampler/Sample.java

      * the sample.
      */
     public Node getControlPanel();
+    
+    /**
+     * Returns divider position to use for split between main panel and control panel 
+     */
+    public double getControlPanelDividerPosition();
 
     /**
      * A full URL to the javadoc for the API being demonstrated in this sample.
      */
     public String getJavaDocURL();
     
+    /**
+     * Returns URL for control's stylsheet 
+     */
     public String getControlStylesheetURL();
     
     /**

File fxsampler/src/main/java/fxsampler/SampleBase.java

     }
     
     /** {@inheritDoc} */
+    @Override
+    public double getControlPanelDividerPosition() {
+    	return 0.6;
+    }
+    
+    /** {@inheritDoc} */
     @Override public String getSampleDescription() {
         return "";
     }
      */
     public static Node buildSample(Sample sample, Stage stage) {
         SplitPane splitPane = new SplitPane();
-        splitPane.setDividerPosition(0, 0.6);
+        
         
         // we guarantee that the build order is panel then control panel.
         final Node samplePanel = sample.getPanel(stage);
         final Node controlPanel = sample.getControlPanel();
+        splitPane.setDividerPosition(0, sample.getControlPanelDividerPosition());
         
         if (samplePanel != null) {
             splitPane.getItems().add(samplePanel);

File fxsampler/src/main/java/fxsampler/model/EmptySample.java

     @Override public Node getControlPanel() {
         return null;
     }
+    
+    public double getControlPanelDividerPosition() {
+    	return 0.6;
+    }
 
 	@Override
 	public String getControlStylesheetURL() {