コード例 #1
0
 public void startUpload() {
   final List<FileSource> fileSources = Lists.newArrayList();
   for (final TreeItem treeItem : getTreeItems()) {
     final FileSource fileSource = new FileSource(treeItem.getId(), treeItem.getName(), false);
     fileSources.add(fileSource);
   }
   options.getCompletionCallback().onSuccess(fileSources);
 }
コード例 #2
0
 public List<ScaffoldSample> getScaffoldSamples() {
   final List<ScaffoldSample> samples = Lists.newArrayListWithCapacity(records.size());
   for (final ListGridRecord record : records) {
     final ScaffoldSample sample = new ScaffoldSample();
     @SuppressWarnings("unchecked")
     final Collection<TreeItem> selectionItems =
         (Collection<TreeItem>) record.getAttributeAsObject("Selection");
     final List<String> analysisIds = Lists.newArrayListWithCapacity(selectionItems.size());
     for (final TreeItem treeItem : selectionItems) {
       analysisIds.add(treeItem.getId());
     }
     final String sampleName = record.getAttributeAsString("Name");
     final String categoryName = record.getAttributeAsString("Category");
     final boolean analyzeAsMudpit = (Boolean) record.getAttributeAsBoolean("Mudpit");
     sample.setIdentificationAnalysisIds(IdList.forIterable(analysisIds));
     sample.setSampleName(sampleName);
     sample.setAnalyzeAsMudpit(analyzeAsMudpit);
     if (StringUtils.hasText(categoryName)) {
       sample.setCategory(categoryName);
     }
     samples.add(sample);
   }
   return samples;
 }