001package ca.bc.webarts.javaFX.wizard.survey; 002 003import javafx.collections.*; 004import javafx.event.*; 005import javafx.scene.*; 006import javafx.scene.control.*; 007import javafx.scene.layout.*; 008 009import ca.bc.webarts.javaFX.wizard.WizardPage; 010 011/** This page gathers more information about the complaint */ 012public class MoreInformationPage extends WizardPage 013{ 014 MoreInformationPage() 015 { 016 super("More Info"); 017 } 018 019 Parent getContent() 020 { 021 TextArea textArea = TextAreaBuilder.create() 022 .wrapText(true) 023 .text("Tell me what's wrong Dave...") 024 .build(); 025 nextButton.setDisable(true); 026 textArea.textProperty().addListener(new ChangeListener<String>() 027 { @Override 028 public void changed(ObservableValue<? extends String> observableValue, String oldValue, String newValue) 029 { 030 nextButton.setDisable(newValue.isEmpty()); 031 } 032 } ); 033 SurveyData.instance.complaints.bind(textArea.textProperty()); 034 return VBoxBuilder.create() 035 .spacing(5) 036 .children 037 ( 038 new Label("Please enter your complaints."), 039 textArea 040 ) 041 .build(); 042 } 043}