List of usage examples for javafx.scene.control ButtonType ButtonType
public ButtonType(@NamedArg("text") String text, @NamedArg("buttonData") ButtonData buttonData)
From source file:com.cdd.bao.editor.EditSchema.java
public void actionFileAssayStats() { List<String> stats = new ArrayList<>(); SchemaUtil.gatherAssayStats(stack.peekSchema(), stats); String text = String.join("\n", stats); Dialog<Boolean> showdlg = new Dialog<>(); showdlg.setTitle("Assay Stats"); TextArea area = new TextArea(text); area.setWrapText(true);//from ww w .j av a2 s. c om area.setPrefWidth(700); area.setPrefHeight(500); showdlg.getDialogPane().setContent(area); showdlg.getDialogPane().getButtonTypes().addAll(new ButtonType("OK", ButtonBar.ButtonData.OK_DONE)); showdlg.setResultConverter(buttonType -> true); showdlg.showAndWait(); }
From source file:ruleprunermt2.FXMLDocumentController.java
@FXML private void removeMinSupport() throws IOException, InterruptedException { isRemoverContext = true;// ww w .jav a 2s . c om File directory = new File("removerResults"); FileUtils.cleanDirectory(directory); int iterator = 1; double error = 1.0; while (true) { pruneExtendedly(); File[] inputFiles; File inputDirectory = new File("."); inputFiles = inputDirectory.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return name.toLowerCase().startsWith("resultsaverage"); } }); if (inputFiles.length > 0) { String fileName = inputFiles[0].getName(); String[] splitFileName = fileName.split("resultsAverage=|std=|.csv"); double tmpError = Double.parseDouble(splitFileName[1]); if (tmpError < error) { error = tmpError; File f1 = new File("removerResults/" + iterator + "_" + inputFiles[0].getName()); inputFiles[0].renameTo(f1); } else { break; } } else { break; } Thread thread = new Thread(new SupportRemover()); thread.start(); //waiting for the thread to die thread.join(); iterator++; } ButtonType buttonOK = new ButtonType("OK", ButtonData.OK_DONE); Dialog<String> dialog = new Dialog<>(); dialog.getDialogPane().getButtonTypes().add(buttonOK); dialog.setContentText("Operation successful!"); dialog.showAndWait(); isRemoverContext = false; }
From source file:ruleprunermt2.FXMLDocumentController.java
@FXML private void removeMinCoverage() throws IOException, InterruptedException { isRemoverContext = true;//from w ww .j a v a 2s. c o m File directory = new File("removerResults"); FileUtils.cleanDirectory(directory); int iterator = 1; double error = 1.0; while (true) { pruneExtendedly(); File[] inputFiles; File inputDirectory = new File("."); inputFiles = inputDirectory.listFiles(new FilenameFilter() { public boolean accept(File dir, String name) { return name.toLowerCase().startsWith("resultsaverage"); } }); if (inputFiles.length > 0) { String fileName = inputFiles[0].getName(); String[] splitFileName = fileName.split("resultsAverage=|std=|.csv"); double tmpError = Double.parseDouble(splitFileName[1]); if (tmpError < error) { error = tmpError; File f1 = new File("removerResults/" + iterator + "_" + inputFiles[0].getName()); inputFiles[0].renameTo(f1); } else { break; } } else { break; } Thread thread = new Thread(new CoverageRemover()); thread.start(); //waiting for the thread to die thread.join(); iterator++; } ButtonType buttonOK = new ButtonType("OK", ButtonData.OK_DONE); Dialog<String> dialog = new Dialog<>(); dialog.getDialogPane().getButtonTypes().add(buttonOK); dialog.setContentText("Operation successful!"); dialog.showAndWait(); isRemoverContext = false; }
From source file:com.bekwam.resignator.ResignatorAppMainViewController.java
protected void doClose() { if (logger.isDebugEnabled()) { logger.debug("[DO CLOSE] shutting down"); }/* w w w. j av a 2 s.c om*/ if (needsSave.get()) { if (logger.isDebugEnabled()) { logger.debug("[CLOSE] profile needs saving"); } ButtonType myCancel = new ButtonType("Discard Changes", ButtonBar.ButtonData.CANCEL_CLOSE); Alert alert = new Alert(Alert.AlertType.CONFIRMATION, "Save profile?", ButtonType.OK, myCancel); alert.setHeaderText("Unsaved profile"); Optional<ButtonType> response = alert.showAndWait(); if (!response.isPresent() || response.get() != ButtonType.OK) { if (logger.isDebugEnabled()) { logger.debug("[CLOSE] skipping save"); } } else { if (logger.isDebugEnabled()) { logger.debug("[CLOSE] saving"); } saveProfile(); needsSave.set(false); // needed in case failure infinite cycle } } Platform.exit(); System.exit(0); // close webstart }