- Timestamp:
- 11/29/19 15:17:33 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/encryption/items/surrogates/Label.java
r1443 r1457 4 4 import java.util.Arrays; 5 5 import java.util.Base64; 6 import java.util.Collection;7 6 import java.util.List; 8 7 import java.util.function.Predicate; … … 11 10 12 11 import org.expeditee.gui.ItemsList; 13 import org.expeditee.gui.MessageBay;14 12 import org.expeditee.items.Item; 15 13 import org.expeditee.items.Text; … … 125 123 } 126 124 } else { 127 return getLabelsFromContext(itemsList); 125 List<String> labelsFromContext = getLabelsFromContext(itemsList); 126 ArrayList<String> copy = new ArrayList<String>(labelsFromContext); 127 copy.retainAll(userLabels); 128 return copy; 128 129 } 129 130 } … … 146 147 surrogateStep = 0; 147 148 isInSurrogateMode = false; 148 MessageBay.displayMessage("You have lost access to the encryption label " 149 // MessageBay.displayMessage("You have lost access to the encryption label " 150 // + surrogateMode + ". Dropping out of surrogate mode."); 151 System.out.println("You have lost access to the encryption label " 149 152 + surrogateMode + ". Dropping out of surrogate mode."); 150 153 } … … 179 182 private static List<String> getLabelsFromContext(ItemsList context) { 180 183 Predicate<Item> hasEncryptionLabel = item -> item.getEncryptionLabel() != null && !item.getEncryptionLabel().isEmpty(); 181 Collection<Item> local = new ItemsList(context).underlying();184 List<Item> local = context.cloneList(); 182 185 Stream<Item> itemsWithLabel = local.stream().filter(hasEncryptionLabel); 183 186 Stream<String> labels = itemsWithLabel.map(item -> item.getEncryptionLabel()).distinct();
Note:
See TracChangeset
for help on using the changeset viewer.