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


Java JFXSnackbar类代码示例

本文整理汇总了Java中com.jfoenix.controls.JFXSnackbar的典型用法代码示例。如果您正苦于以下问题:Java JFXSnackbar类的具体用法?Java JFXSnackbar怎么用?Java JFXSnackbar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JFXSnackbar类属于com.jfoenix.controls包,在下文中一共展示了JFXSnackbar类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addNotLinkedGame

import com.jfoenix.controls.JFXSnackbar; //导入依赖的package包/类
@FXML
void addNotLinkedGame(ActionEvent event) {
    if(notLinkedAppName.getText().isEmpty()){
        return;
    }
    NotLinkedSteamAppWithKey app = new NotLinkedSteamAppWithKey(notLinkedAppName.getText());

    if(userAppList.getAppList().contains(app))
    {
        JFXSnackbar error = new JFXSnackbar(root);
        error.show(I18n.getMessage("erroralreadyaddedgame"),3000);
        return;
    }
    userAppList.addApp(app);
    controllerBinder.appController.modified = true;
    controllerBinder.appController.appList.getSelectionModel().select(app);
    controllerBinder.appController.selectedGameInfo();
    controllerBinder.appController.updateListApp();
    Stage stage = (Stage) root.getScene().getWindow();
    stage.close();

}
 
开发者ID:Matthieu42,项目名称:Steam-trader-tools,代码行数:23,代码来源:AddCustomGameController.java

示例2: downloadImageCache

import com.jfoenix.controls.JFXSnackbar; //导入依赖的package包/类
@FXML
void downloadImageCache(ActionEvent event) {
    for(AbstractSteamAppWithKey app : controllerBinder.appController.userAppList.getAppList()){
        if(app instanceof LinkedSteamAppWithKey){
            imageCacheHandler.addImageToCache((LinkedSteamAppWithKey) app);
        }
    }
    try
    {
        imageCacheHandler.saveImageCache();
    } catch (ImageCacheError imageCacheError)
    {
        JFXSnackbar error = new JFXSnackbar(root);
        error.show(I18n.getMessage("errorcachefolder"), 3000);
    }
    imageCacheHandler.loadImageCache();
}
 
开发者ID:Matthieu42,项目名称:Steam-trader-tools,代码行数:18,代码来源:SettingsController.java

示例3: deleteImageCache

import com.jfoenix.controls.JFXSnackbar; //导入依赖的package包/类
@FXML
void deleteImageCache(ActionEvent event) {
    try
    {
        imageCacheHandler.deleteImageCache();
    } catch (ImageCacheError imageCacheError)
    {
        JFXSnackbar error = new JFXSnackbar(root);
        error.show(I18n.getMessage("errorcachefolder"), 3000);
    }
}
 
开发者ID:Matthieu42,项目名称:Steam-trader-tools,代码行数:12,代码来源:SettingsController.java

示例4: launchImport

import com.jfoenix.controls.JFXSnackbar; //导入依赖的package包/类
public void launchImport(File file){
    try
    {
        Stage stage = new Stage();
        stage.initStyle(StageStyle.UNDECORATED);
        ResourceBundle bundle = I18n.getResourceBundle();
        ImportFromCSVLoadingController importFromCSVLoadingController = new ImportFromCSVLoadingController();
        FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/matthieu42/steamtradertools/view/importfromcsvloadingview.fxml"), bundle);
        loader.setController(importFromCSVLoadingController);
        AnchorPane root;
        root = loader.load();
        Scene loading = new Scene(root);
        String css = AppController.class.getResource("/com/matthieu42/steamtradertools/view/style.css").toExternalForm();
        loading.getStylesheets().add(css);
        stage.setScene(loading);
        stage.show();

        Task<Void> importFromCSV = userAppList.importFromCSV(file);

        importFromCSVLoadingController.progressBar.progressProperty().bind(importFromCSV.progressProperty());
        importFromCSV.progressProperty().addListener((obs, oldProgress, newProgress) ->
        {
            double progress = (double) newProgress*100;
            DecimalFormat df = new DecimalFormat("#.##");
            importFromCSVLoadingController.statusLabel.setText(I18n.getMessage("percentageOfGameImported") + " " + df.format(progress) + "%");
        });

        importFromCSV.setOnSucceeded(t ->
        {
            System.out.println("done !");
            JFXSnackbar info = new JFXSnackbar(root);
            info.show(I18n.getMessage("CSVImportSuccess") + "importedData.xml", 3000);
            stage.close();
        });

        importFromCSV.setOnFailed(t ->
        {
            JFXSnackbar error = new JFXSnackbar(root);
            error.show(I18n.getMessage("errorImportingCSV"), 3000);
            return;
        });
        new Thread(importFromCSV).start();


    } catch (IOException e)
    {
        e.printStackTrace();
    }
}
 
开发者ID:Matthieu42,项目名称:Steam-trader-tools,代码行数:50,代码来源:CSVImportTool.java

示例5: showSnackbarMessage

import com.jfoenix.controls.JFXSnackbar; //导入依赖的package包/类
public void showSnackbarMessage(final String message) {
    controller.snackbar.enqueue(new JFXSnackbar.SnackbarEvent(message, "", 3000, event -> {

    }));
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:6,代码来源:HUPPAALPresentation.java

示例6: init

import com.jfoenix.controls.JFXSnackbar; //导入依赖的package包/类
/**
 * init fxml when loaded.
 */
@PostConstruct
public void init() {

    bindAction(burger1);
    bindAction(burger2);
    bindAction(burger3);
    bindAction(burger4);

    snackbar = new JFXSnackbar(root);
    snackbar.setPrefWidth(300);

    badge1.setOnMouseClicked((click) -> {
        int value = Integer.parseInt(badge1.getText());
        if (click.getButton() == MouseButton.PRIMARY) {
            value++;
        } else if (click.getButton() == MouseButton.SECONDARY) {
            value--;
        }

        if (value == 0) {
            badge1.setEnabled(false);
        } else {
            badge1.setEnabled(true);
        }
        badge1.setText(String.valueOf(value));

        // trigger snackbar
        if (count++ % 2 == 0) {
            snackbar.fireEvent(new SnackbarEvent("Toast Message " + count));
        } else {
            if (count % 4 == 0) {
                snackbar.fireEvent(new SnackbarEvent("Snackbar Message Persistant " + count,
                                                     "CLOSE",
                                                     3000,
                                                     true,
                                                     b -> snackbar.close()));
            } else {
                snackbar.fireEvent(new SnackbarEvent("Snackbar Message " + count, "UNDO", 3000, false, (b) -> {
                }));
            }
        }
    });
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:47,代码来源:IconsController.java


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