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


Java PhoenixTaskSheet类代码示例

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


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

示例1: getTask

import de.phoenix.rs.entity.PhoenixTaskSheet; //导入依赖的package包/类
public List<PhoenixTask> getTask(PhoenixTaskSheet taskSheet, String[] args) {
    List<PhoenixTask> tasks = new ArrayList<PhoenixTask>();
    String input;

    if (args.length < 3) {
        System.out.println("Please enter which task you want to download. If you want to download the entire tasksheet, press enter.");
        showTasks(taskSheet);
        input = Core.scanner.nextLine();
        tasks = userChosenTask(input, taskSheet, "download");
    } else {
        File file = new File(args[2]);
        if (file.exists()) {
            tasks = taskSheet.getTasks();
        } else {
            tasks = userChosenTask(args[2], taskSheet, "download");
        }
    }

    return tasks;
}
 
开发者ID:Project-Phoenix,项目名称:ConsoleClient,代码行数:21,代码来源:DownloadMenu.java

示例2: execute

import de.phoenix.rs.entity.PhoenixTaskSheet; //导入依赖的package包/类
public void execute(String[] args) {

        PhoenixTaskSheet taskSheet = getTaskSheet(args);
        List<PhoenixTask> tasks = getTask(taskSheet, args);
        String path = getPath(args);
        download.execute(taskSheet, tasks, path);
    }
 
开发者ID:Project-Phoenix,项目名称:ConsoleClient,代码行数:8,代码来源:DownloadMenu.java

示例3: getTaskSheet

import de.phoenix.rs.entity.PhoenixTaskSheet; //导入依赖的package包/类
public PhoenixTaskSheet getTaskSheet(String[] args) {
    PhoenixTaskSheet taskSheet = null;
    String taskSheetTitle = "";
    String input;

    List<PhoenixTaskSheet> taskSheetList = getAllTaskSheets();
    while (taskSheet == null) {
        if (args.length < 2) {
            System.out.println("Please choose a tasksheet to upload to:");
            showAllTaskSheets(taskSheetList);
            input = Core.scanner.nextLine();
            taskSheet = userChosenSheet(input, taskSheetList);
        } else {
            taskSheetTitle = args[1];
            for (int i = 0; i < taskSheetList.size(); i++) {
                if (taskSheetTitle.toLowerCase().equals(taskSheetList.get(i).getTitle().toLowerCase())) {
                    taskSheet = taskSheetList.get(i);
                }
            }
            if (taskSheet == null) {
                System.out.println("Sorry, wrong title of the taskSheet.");
                showAllTaskSheets(taskSheetList);
                input = Core.scanner.nextLine();
                taskSheet = userChosenSheet(input, taskSheetList);

            }
        }
    }

    return taskSheet;
}
 
开发者ID:Project-Phoenix,项目名称:ConsoleClient,代码行数:32,代码来源:UploadMenu.java

示例4: getTask

import de.phoenix.rs.entity.PhoenixTaskSheet; //导入依赖的package包/类
public PhoenixTask getTask(String[] args) {
    List<PhoenixTask> tasks = new ArrayList<PhoenixTask>();
    PhoenixTaskSheet taskSheet = getTaskSheet(args);
    String input;

    if (taskSheet == null) {
        return null;
    }

    while (tasks.isEmpty()) {
        if (args.length < 3) {
            System.out.println("Please choose a task to upload to:");
            showTasks(taskSheet);
            input = Core.scanner.nextLine();
            tasks = userChosenTask(input, taskSheet, "upload");
        } else {
            for (int i = 0; i < taskSheet.getTasks().size(); i++) {
                if (args[2].equals(taskSheet.getTasks().get(i).getTitle())) {
                    tasks.add(taskSheet.getTasks().get(i));
                }
            }
            if (tasks.isEmpty()) {
                System.out.println("Sorry, wrong title of the task. Please try again:");
                showTasks(taskSheet);
                input = Core.scanner.nextLine();
                tasks = userChosenTask(input, taskSheet, "upload");
            }
        }
    }
    return tasks.get(0);
}
 
开发者ID:Project-Phoenix,项目名称:ConsoleClient,代码行数:32,代码来源:UploadMenu.java

示例5: getAllTaskSheets

import de.phoenix.rs.entity.PhoenixTaskSheet; //导入依赖的package包/类
public List<PhoenixTaskSheet> getAllTaskSheets() {

        WebResource getTaskSheetResource = PhoenixTaskSheet.getResource(Core.client, Core.BASE_URL);
        ClientResponse response = getTaskSheetResource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class, new SelectAllEntity<PhoenixTask>());
        if (response.getStatus() == 404) {
            System.out.println("Sorry, there are no Tasks available");
            return null;
        }

        List<PhoenixTaskSheet> sheets = EntityUtil.extractEntityList(response);
        return sheets;
    }
 
开发者ID:Project-Phoenix,项目名称:ConsoleClient,代码行数:13,代码来源:Menu.java

示例6: showAllTaskSheets

import de.phoenix.rs.entity.PhoenixTaskSheet; //导入依赖的package包/类
public void showAllTaskSheets(List<PhoenixTaskSheet> taskSheets) {

        if (taskSheets.isEmpty()) {
            System.out.println("Sorry, there are no tasksheets available");
        } else {
            for (int i = 0; i < taskSheets.size(); i++) {
                System.out.println("(" + (i + 1) + ") " + taskSheets.get(i).getTitle());
            }
        }
    }
 
开发者ID:Project-Phoenix,项目名称:ConsoleClient,代码行数:11,代码来源:Menu.java

示例7: showTasks

import de.phoenix.rs.entity.PhoenixTaskSheet; //导入依赖的package包/类
public void showTasks(PhoenixTaskSheet taskSheet) {

        List<PhoenixTask> taskTitles = taskSheet.getTasks();
        for (int i = 0; i < taskTitles.size(); i++) {
            System.out.println("(" + (i + 1) + ") " + taskTitles.get(i).getTitle());
        }
    }
 
开发者ID:Project-Phoenix,项目名称:ConsoleClient,代码行数:8,代码来源:Menu.java

示例8: userChosenSheet

import de.phoenix.rs.entity.PhoenixTaskSheet; //导入依赖的package包/类
public PhoenixTaskSheet userChosenSheet(String input, List<PhoenixTaskSheet> listedSheets) {

        PhoenixTaskSheet sheet = null;
        String title;

        while (sheet == null) {
            // String consists only of a number
            if (input.matches("[0-9]+")) {
                int inputInt = Integer.parseInt(input);

                if (inputInt > listedSheets.size()) {
                    System.out.println("invalid input, try again: ");
                    input = Core.scanner.nextLine();
                    continue;
                }
                sheet = listedSheets.get(Integer.parseInt(input) - 1);

                // User entered the title
            } else {
                title = input;

                for (int j = 0; j < listedSheets.size(); j++) {
                    if (title.toLowerCase().equals(listedSheets.get(j).getTitle().toLowerCase())) {
                        sheet = listedSheets.get(j);
                    }
                }

                if (sheet == null) {
                    System.out.println("Sorry, wrong title for tasksheet. Please try again: ");
                    showAllTaskSheets(getAllTaskSheets());
                    input = Core.scanner.nextLine();
                }
            }
        }
        return sheet;
    }
 
开发者ID:Project-Phoenix,项目名称:ConsoleClient,代码行数:37,代码来源:Menu.java

示例9: userChosenTask

import de.phoenix.rs.entity.PhoenixTaskSheet; //导入依赖的package包/类
public List<PhoenixTask> userChosenTask(String input, PhoenixTaskSheet taskSheet, String type) {
    List<PhoenixTask> tasks = new ArrayList<PhoenixTask>();
    String title;
    List<PhoenixTask> listedTasks = taskSheet.getTasks();

    while (tasks.isEmpty()) {

        if (input.equals("") && type.equals("download")) {
            tasks = taskSheet.getTasks();
        }
        // String consists only of a number
        if (input.matches("[0-9]+")) {
            int inputInt = Integer.parseInt(input);

            if (inputInt > listedTasks.size()) {
                System.out.println("invalid input, try again: ");
                input = Core.scanner.nextLine();
                continue;
            }
            tasks.add(listedTasks.get(Integer.parseInt(input) - 1));

            // User entered the title
        } else {
            title = input;

            for (int i = 0; i < listedTasks.size(); i++) {
                if (title.equals(listedTasks.get(i).getTitle())) {
                    tasks.add(listedTasks.get(i));
                }
            }

            if (tasks.isEmpty()) {
                System.out.println("Sorry, wrong title for task. Please try again:");
                showTasks(taskSheet);
                input = Core.scanner.nextLine();
            }
        }
    }
    return tasks;
}
 
开发者ID:Project-Phoenix,项目名称:ConsoleClient,代码行数:41,代码来源:Menu.java

示例10: getTaskSheet

import de.phoenix.rs.entity.PhoenixTaskSheet; //导入依赖的package包/类
public PhoenixTaskSheet getTaskSheet(String[] args) {

        String input;

        PhoenixTaskSheet taskSheet = null;

        List<PhoenixTaskSheet> taskSheetList = getAllTaskSheets();

        if (args.length < 2) {

            System.out.println("Please choose which tasksheet you want to download:");
            showAllTaskSheets(taskSheetList);
            input = Core.scanner.nextLine();
            taskSheet = userChosenSheet(input, taskSheetList);

        } else {

            taskSheet = userChosenSheet(args[1], taskSheetList);

        }

        return taskSheet;
    }
 
开发者ID:Project-Phoenix,项目名称:ConsoleClient,代码行数:24,代码来源:DownloadMenu.java

示例11: downloadChosenTaskSheet

import de.phoenix.rs.entity.PhoenixTaskSheet; //导入依赖的package包/类
public void downloadChosenTaskSheet(PhoenixTaskSheet taskSheet, List<PhoenixTask> tasks, String path) {

       // Überordner
        File file = new File(path, taskSheet.getTitle());
        
        file.mkdir();
        
        for (int i = 0; i < tasks.size(); i++) {
            PhoenixTask task = tasks.get(i);
            createTaskOnComputer(taskSheet, task, path);
        }
     
    }
 
开发者ID:Project-Phoenix,项目名称:ConsoleClient,代码行数:14,代码来源:Download.java

示例12: execute

import de.phoenix.rs.entity.PhoenixTaskSheet; //导入依赖的package包/类
public void execute(PhoenixTaskSheet taskSheet, List<PhoenixTask> tasks, String path) {
    
    downloadChosenTaskSheet(taskSheet, tasks, path);
}
 
开发者ID:Project-Phoenix,项目名称:ConsoleClient,代码行数:5,代码来源:Download.java


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