本文整理汇总了Java中javafx.stage.DirectoryChooser.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java DirectoryChooser.setTitle方法的具体用法?Java DirectoryChooser.setTitle怎么用?Java DirectoryChooser.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.stage.DirectoryChooser
的用法示例。
在下文中一共展示了DirectoryChooser.setTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exportAllGroups
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
public void exportAllGroups() {
LOGGER.traceEntry();
if (!isCatalogueLoaded()) {
LOGGER.debug(":exportAllGroups - No catalogue set. Returning");
return;
}
DirectoryChooser dc = new DirectoryChooser();
if (manager.hasLastExportLocation()) {
dc.setInitialDirectory(manager.getLastExportLocation());
}
dc.setTitle("Choose an export folder");
File dir = dc.showDialog(evaluator.getScene().getWindow());
for (Group g : manager.groupList()) {
assemble(g);
}
manager.exportAllGroups(dir);
}
示例2: handle
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
@Override
public void handle(ActionEvent event) {
DirectoryChooser dc = new DirectoryChooser();
dc.setTitle("Choose directory to import from");
File directory = dc.showDialog(Amperfi.ui.getWindow());
if(directory == null) return;
Amperfi.db.addFolder(directory.getAbsolutePath()); // TODO Check for duplicate/invalid folder
Amperfi.ui.mp3Import.reloadFolders();
TaskSyncFolders task = new TaskSyncFolders(directory);
Amperfi.ui.mp3ImportProgress.btnCancel.setOnAction(action -> task.cancel());
new Thread(task).start();
Amperfi.ui.mp3ImportProgress.pbImporting.progressProperty().bind(task.progressProperty());
Amperfi.ui.mp3ImportProgress.lblPath.textProperty().bind(task.messageProperty());
}
示例3: selectStorageDirectory
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
@FXML
private void selectStorageDirectory() {
Stage stage = (Stage) root.getScene().getWindow();
DirectoryChooser directoryChooser = new DirectoryChooser();
directoryChooser.setTitle("Open Telemetry Storage Directory");
directoryChooser.setInitialDirectory(
new File(System.getProperty("user.home")));
File directory = directoryChooser.showDialog(stage);
if (directory != null && directory.isDirectory()) {
try {
String directoryName = directory.getCanonicalPath();
txtStorageDirectory.setText(directoryName);
} catch (IOException e) {
e.printStackTrace();
}
}
}
示例4: handleBrowse
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
private void handleBrowse(Event event) {
DirectoryChooser directoryChooser = new DirectoryChooser();
directoryChooser.setTitle("Export Ort wählen");
if (exportFolder != null) {
directoryChooser.setInitialDirectory(new File(exportFolder));
}
File directory = directoryChooser.showDialog(null);
if (directory == null || !directory.exists()) {
getLogger().info("Invalid directory selected.");
return;
}
directoryField.setText(directory.getPath());
exportFolder = directory.getPath();
}
示例5: selectPspDir
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
public void selectPspDir(ActionEvent actionEvent) {
DirectoryChooser chooser = new DirectoryChooser();
chooser.setTitle("Vyberte kořenový adresář PSP balíku");
File lastPspDir = getConfigurationManager().getFileOrNull(ConfigurationManager.PROP_LAST_PSP_DIR);
if (lastPspDir != null && lastPspDir.exists()) {
File parent = lastPspDir.getParentFile();
if (parent != null && parent.exists()) {
chooser.setInitialDirectory(parent);
}
}
File selectedDir = chooser.showDialog(stage);
if (selectedDir != null) {
getConfigurationManager().setFile(ConfigurationManager.PROP_LAST_PSP_DIR, selectedDir);
try {
pspDirTextField.setText(selectedDir.getCanonicalPath());
} catch (IOException e) {
//should never happen
throw new RuntimeException(e);
}
}
}
示例6: exportChunkAction
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
public void exportChunkAction() {
Chunk chunk = (Chunk) chunksListView.getSelectionModel().getSelectedItem();
if (chunk != null) {
// FileChooser fileChooser = new FileChooser();
// fileChooser.setTitle("Save File");
DirectoryChooser directoryChooser = new DirectoryChooser();
directoryChooser.setInitialDirectory(lastFileChooserPath);
directoryChooser.setTitle("Choose directory");
File dir = directoryChooser.showDialog(stage);
if (dir != null) {
try {
lastFileChooserPath = dir;
ObservableList<Chunk> chunks = chunksListView.getSelectionModel().getSelectedItems();
for (Chunk c : chunks) {
c.export(dir.getPath());
}
} catch (IOException e) {
System.err.println(e.getMessage());
}
}
}
}
示例7: handleSwitchWorkspaceAction
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
@FXML private void handleSwitchWorkspaceAction(ActionEvent event) throws IOException{
DirectoryChooser fileChooser = new DirectoryChooser();
fileChooser.setInitialDirectory(MainApp.getDefaultHome());
fileChooser.setTitle(Configuration.getBundle().getString("ui.dialog.switchworkspace"));
File selectedDirectory = fileChooser.showDialog(MainApp.getPrimaryStage());
if(selectedDirectory!=null) {
MainApp.getConfig().setWorkspacePath(selectedDirectory.getAbsolutePath());
MainApp.getConfig().loadWorkspace();
Alert alert = new CustomAlert(AlertType.INFORMATION);
alert.setTitle(Configuration.getBundle().getString("ui.options.workspace"));
alert.setHeaderText(Configuration.getBundle().getString("ui.dialog.workspace.header"));
alert.setContentText(Configuration.getBundle().getString("ui.dialog.workspace.text") + " " + MainApp.getConfig().getWorkspacePath());
alert.setResizable(true);
alert.showAndWait();
}
}
示例8: editLocation
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
private void editLocation ()
{
DirectoryChooser chooser = new DirectoryChooser ();
chooser.setTitle ("Choose Spy Folder");
File currentLocation = spyFolder.isEmpty () ? null : new File (spyFolder);
if (currentLocation != null && currentLocation.exists ())
chooser.setInitialDirectory (currentLocation);
File selectedDirectory = chooser.showDialog (this);
if (selectedDirectory != null)
{
spyFolder = selectedDirectory.getAbsolutePath ();
fileComboBox.getItems ().clear ();
ObservableList<String> files = getSessionFiles (spyFolder);
fileComboBox.setItems (files);
if (files.size () > 0)
fileComboBox.getSelectionModel ().select (0);
}
}
示例9: saveAsDialogue
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
/**
* Lets the user chose a project output directory.
* <p>
*
* @return Were the directories created, or has the user canceled?
*/
public boolean saveAsDialogue() {
DirectoryChooser directoryChooser = new DirectoryChooser();
directoryChooser.setTitle("Choose an output directory");
File directory = directoryChooser.showDialog(new Stage());
if (directory == null) {
return false;
}
if (directory.getName().equals("DEM")) {
projectOutputDirectory = directory;
return true;
}
for (File child : directory.listFiles()) {
if (child != null && child.getName().equals("DEM")) {
projectOutputDirectory = child;
return true;
}
}
projectOutputDirectory = new File(directory.getPath() + File.separator + "DEM" + File.separator);
return projectOutputDirectory.mkdir();
}
示例10: setUTxFolder
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
/**
* Sets and save ut path to xml user config file on click "Select"
*
* @param utGame
* UT game to set path
* @param utPathTxtField
* Textfield for path game display in settings
*/
private void setUTxFolder(UTGame utGame, TextField utPathTxtField) {
DirectoryChooser chooser = new DirectoryChooser();
chooser.setTitle("Select " + utGame.name + " folder");
if (utPathTxtField != null && utPathTxtField.getText() != null && new File(utPathTxtField.getText()).exists()) {
chooser.setInitialDirectory(new File(utPathTxtField.getText()));
}
if (utGame == UTGame.UT4) {
chooser.setTitle("Select " + utGame.name + " editor folder");
}
File utxFolder = chooser.showDialog(new Stage());
if (utxFolder != null) {
utPathTxtField.setText(utxFolder.getAbsolutePath());
saveGamePath(utPathTxtField, utGame);
}
}
示例11: handleSelectOutputFolder
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
@FXML
private void handleSelectOutputFolder() {
progressBar.setProgress(0.50);
taskProgress.setProgress(0.10);
// Choose folder where the documents will be saved.
DirectoryChooser fileChooser = new DirectoryChooser();
fileChooser.setTitle("Select The Folder Where You Would Like To Save The YearPlanners To");
fileChooser.setInitialDirectory(new File(System.getProperty("user.home")));
outputFolder = fileChooser.showDialog(YearPlanner.getPrimaryStage());
if (outputFolder != null && outputFolder.isDirectory()) {
statusArea.appendText("Setting up "+ outputFolder.getAbsolutePath() + " to save yearplanners in...\n\n");
taskProgress.setProgress(1.0);
statusArea.appendText("\n\t<<<Task Completed Select Output Folder>>>\n\n");
statusArea.appendText("Ready To Calculate Year Planners\n");
calculateBtn.setDisable(false);
} else {
statusArea.appendText("\nNo Folder Chosen\n");
statusArea.appendText("Please Choose An Output Folder");
}
}
示例12: choosePathButtonAction
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
/**
* When the user presses the "..." button, a {@code DirectoryChooser} is opened where they can specify the
* desired location for their new project file.
*/
@FXML private void choosePathButtonAction() {
DirectoryChooser dirChooser = new DirectoryChooser();
dirChooser.setTitle("Choose Project Location");
File file = dirChooser.showDialog(MainWindow.getPrimaryStage());
if (file != null) {
String fileName = file.getPath();
if (fileName.length() > MAX_FILE_NAME_LENGTH) {
fileName = "..." + fileName.substring(fileName.length() - MAX_FILE_NAME_LENGTH);
}
setProjectLocation(file);
pathTextField.setText(fileName);
}
}
示例13: printSSS
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
@FXML protected void printSSS(ActionEvent event) {
if(shares == null || shares.size() == 0) {
GuiUtils.informationalAlert("Error !", "Make sure you split the wallet's seed and then print the pieces");
return;
}
DirectoryChooser dirChooser = new DirectoryChooser();
dirChooser.setTitle("Save Pieces");
File destination = dirChooser.showDialog(Main.startup);
if(!destination.exists())
destination.mkdir();
for(Share s: shares) {
try {
PaperSSSController.createAndSavePaperSSS(s, walletSeed.getCreationTimeSeconds(), destination);
} catch (IOException e) {
e.printStackTrace();
GuiUtils.informationalAlert("Error !", "Failed to print all the pieces.");
return;
}
}
GuiUtils.informationalAlert("Done !", "Saved all pieces to " + destination.getAbsolutePath() + "\n" +
"We suggest you give the pieces to close friends and family for safe keeping.");
}
示例14: onSelectOutputDirClicked
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
@FXML
void onSelectOutputDirClicked(ActionEvent event) {
DirectoryChooser directoryChooser = new DirectoryChooser();
directoryChooser.setTitle(i18nBundle.getString("app.dialog.select_output_dir.title"));
File initialDirectory = new File(System.getProperty("user.home"));
if(inputFilePath != null) {
File inputFile = new File(inputFilePath);
if(inputFile.exists()) {
initialDirectory = inputFile.getParentFile();
}
}
directoryChooser.setInitialDirectory(initialDirectory);
File dir = directoryChooser.showDialog(this);
if(dir != null) {
outputDirPath = dir.getPath();
outputDirTextField.setText(outputDirPath);
updateBottomStatus(STATUS.DIR_PREPARED);
}
}
示例15: handleAddButtonAction
import javafx.stage.DirectoryChooser; //导入方法依赖的package包/类
@FXML
public void handleAddButtonAction(final ActionEvent event) {
DirectoryChooser directoryChooser = new DirectoryChooser();
directoryChooser.setTitle(Config.SUPERD.getString("addbutton.directorychooser.title"));
Stage dialog = null;
dialog = ThemedStageFactory.getNewThemedDialogStage();
File file = null;
if (dialog != null) {
file = directoryChooser.showDialog(dialog);
} else {
throw new RuntimeException("Unable to display Window!");
}
if ("".equals(getTargetText()) || getTargetText() == null) {
setTargetText(file.getAbsolutePath());
} else {
setDelimiter();
if (isDelimiterChanged() && LAST_DELIMITER != null) {
setTargetText(getTargetText().replaceAll(Pattern.quote(LAST_DELIMITER), CURRENT_DELIMITER));
}
appendTargetText(getDelimiter() + file.getAbsolutePath());
}
}