當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。