Exemplo n.º 1
0
 public List<String> getNames() {
   final List<String> names = Lists.newArrayList();
   for (final TreeItem treeItem : getTreeItems()) {
     names.add(treeItem.getName());
   }
   return names;
 }
Exemplo n.º 2
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);
 }
 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;
 }