Changeset 376 for trunk/src/org/expeditee/agents/Format.java
- Timestamp:
- 11/02/08 13:05:01 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/agents/Format.java
r307 r376 5 5 import java.util.Collections; 6 6 import java.util.Comparator; 7 import java.util.HashSet; 7 8 import java.util.List; 8 9 … … 45 46 @Override 46 47 public Frame process(Frame start) { 47 //TODO What will happen if user runs the SIMPLE form of this... 48 //Does format box need to be disabled?!?! 49 //Check the position of the cursor and only format stuff inside the same box as the cursor 48 // TODO What will happen if user runs the SIMPLE form of this... 49 // Does format box need to be disabled?!?! 50 // Check the position of the cursor and only format stuff inside the 51 // same box as the cursor 50 52 Collection<Text> itemsToFormat = FrameUtils.getCurrentTextItems(); 51 if(itemsToFormat.size() < 1){ 53 54 // If the cursor is not inside a box... 55 if (itemsToFormat.size() < 1) { 56 // Add all the items that are in free space 52 57 itemsToFormat = start.getBodyTextItems(true); 58 // Remove all the enclosed items 59 Collection<Item> seen = new HashSet<Item>(); 60 for (Item i : start.getVisibleItems()) { 61 if (!seen.contains(i) && i.isEnclosed()) { 62 seen.addAll(i.getEnclosingDots()); 63 itemsToFormat.removeAll(i.getEnclosedItems()); 64 } 65 } 53 66 } 54 67 55 68 ArrayList<Item> columnHeads = new ArrayList<Item>(); 56 69 … … 175 188 overwriteMessage("Formatting complete."); 176 189 } 177 190 178 191 @Override 179 192 protected void message(String message) {
Note:
See TracChangeset
for help on using the changeset viewer.