2016-06-12 09:15:50 -04:00
|
|
|
package polling_station_dashboard.search;
|
|
|
|
|
|
|
|
import javafx.event.Event;
|
|
|
|
import javafx.event.EventHandler;
|
2016-06-18 06:17:46 -04:00
|
|
|
import javafx.stage.Stage;
|
|
|
|
import polling_station_dashboard.search.VotersFetcher.VotersFetcher;
|
|
|
|
import polling_station_dashboard.search.addVoter.java.AddVoterLoader;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.List;
|
2016-06-12 09:15:50 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Created by Vladimir Eliezer Tokarev on 12/06/2016.
|
|
|
|
* SearchHandler trying to fetch wanted users by given strings (VotersFetcher) and then
|
|
|
|
* Starts the eddit/add panel based on what the VotersFetcher Have fetched.
|
|
|
|
*/
|
2016-06-18 06:17:46 -04:00
|
|
|
public class SearchHandler implements EventHandler, VotersFetcher {
|
2016-06-12 09:15:50 -04:00
|
|
|
|
2016-06-18 06:17:46 -04:00
|
|
|
private Stage currentStage;
|
2016-06-12 09:15:50 -04:00
|
|
|
|
2016-06-18 06:17:46 -04:00
|
|
|
public SearchHandler(Stage primaryStage){
|
|
|
|
this.currentStage = primaryStage;
|
|
|
|
}
|
2016-06-12 09:15:50 -04:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void handle(Event event) {
|
2016-06-18 06:17:46 -04:00
|
|
|
try {
|
|
|
|
AddVoterLoader addVoterLoader = new AddVoterLoader(currentStage);
|
|
|
|
} catch (IOException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
2016-06-12 09:15:50 -04:00
|
|
|
|
2016-06-18 06:17:46 -04:00
|
|
|
@Override
|
|
|
|
public Object FetchVoters(List<String> filters) {
|
|
|
|
return null;
|
2016-06-12 09:15:50 -04:00
|
|
|
}
|
|
|
|
}
|