Package org.apache.pivot.util.concurrent

Examples of org.apache.pivot.util.concurrent.Task


                        searchCriterias.add(criteriaType + ":" + selectedViewItem.getId());
                    }
                }
            }
        }
        Task task = null;
        if (listButton != null) {
            task = browserMap.get(mainType).createTask(viewMap.get(listButton), type, searchCriterias);
        } else {
            task = browserMap.get(mainType).createTask(tracksTableView, type, searchCriterias);
        }

        // Activate search indicator
        searchActivity.setActive(true);
        searchActivity.setVisible(true);
        task.execute(new TaskAdapter<Void>(new TaskListener<Void>() {
            public void executeFailed(Task<Void> voidTask) {
                taskExecuted(voidTask);
            }

            public void taskExecuted(Task<Void> voidTask) {
View Full Code Here


         * @param type Type of object to browse, for example "Artist.composer"
         * @param searchCriterias   List of search criterias besided the type of object that should be used, should be in format "Artist:xxxx"
         * @return A new Task object, you need to call the execute method to actually execute the task
         */
        public Task createTask(final TableView tableView, final String type, final List<String> searchCriterias) {
            Task task = new Task<Void>() {
                @Override
                public Void execute() throws TaskExecutionException {
                    if (tableView == tracksTableView && searchCriterias.getLength() == 0) {
                        tableView.getTableData().clear();
                        ((List<TableViewItem>) tableView.getTableData()).add(new TableViewItem(null, "(Too many matching tracks, select some criterias)", null));
View Full Code Here

TOP

Related Classes of org.apache.pivot.util.concurrent.Task

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.