当前位置: 首页>>代码示例>>Java>>正文


Java DirectoryChooser.setTitle方法代码示例

本文整理汇总了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);
}
 
开发者ID:dbisUnibas,项目名称:ReqMan,代码行数:20,代码来源:EvaluatorHandler.java

示例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());
}
 
开发者ID:MolaynoxX,项目名称:amperfi,代码行数:18,代码来源:Mp3ImportController.java

示例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();
        }
    } 
}
 
开发者ID:SenorPez,项目名称:project-cars-replay-enhancer-ui,代码行数:18,代码来源:PacketCaptureController.java

示例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();
}
 
开发者ID:travelimg,项目名称:travelimg,代码行数:17,代码来源:ExportDialog.java

示例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);
        }
    }
}
 
开发者ID:NLCR,项目名称:komplexni-validator,代码行数:22,代码来源:PspValidationConfigurationDialogController.java

示例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());
                }
            }
        }
    }
 
开发者ID:Polprzewodnikowy,项目名称:KorgPackage,代码行数:23,代码来源:MainController.java

示例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();
    }
}
 
开发者ID:firm1,项目名称:zest-writer,代码行数:19,代码来源:MenuController.java

示例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);
  }
}
 
开发者ID:dmolony,项目名称:dm3270,代码行数:20,代码来源:OptionStage.java

示例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();
}
 
开发者ID:pericles-project,项目名称:EcoBuilder,代码行数:27,代码来源:AbstractSaver.java

示例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);
	}
}
 
开发者ID:xtremexp,项目名称:UT4Converter,代码行数:29,代码来源:SettingsSceneController.java

示例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");
    }
    
}
 
开发者ID:EtienneBoshoff,项目名称:YearPlanner,代码行数:26,代码来源:YearPlannerController.java

示例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);
    }
}
 
开发者ID:CIRDLES,项目名称:Topsoil,代码行数:22,代码来源:ProjectTitleController.java

示例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.");
}
 
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:26,代码来源:StartupController.java

示例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);
	}
}
 
开发者ID:liudonghua123,项目名称:signapk_fx,代码行数:20,代码来源:MainPaneController.java

示例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());
    }
}
 
开发者ID:SnakeDoc,项目名称:superD,代码行数:24,代码来源:MainWindowController.java


注:本文中的javafx.stage.DirectoryChooser.setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。