Changeset 4545
- Timestamp:
- 2003-06-11T09:37:48+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/util/DragTreeSelectionModel.java
r4514 r4545 52 52 private int type = -1; 53 53 54 private String suffix = null;55 56 54 private TreePath temp_path = null; 57 55 private TreePath temp_paths[] = null; … … 75 73 temp_path = null; 76 74 super.addSelectionPath(path); 77 suffix = null;78 75 } 79 76 } … … 87 84 temp_paths = null; 88 85 super.setSelectionPaths(paths); 89 suffix = null;90 86 } 91 87 } 92 88 93 89 public String getDetails() { 94 if(suffix == null) { 95 int file_count = 0; 96 int folder_count = 0; 97 for(int i = 0; selection != null && i < selection.length; i++) { 98 TreeNode node = (TreeNode) selection[i].getLastPathComponent(); 99 if(node.isLeaf()) { 100 file_count++; 101 } 102 else { 103 folder_count++; 104 } 105 } 106 // Update the metaaudit_suffix 107 String args[] = null; 108 if(file_count > 0 && folder_count > 0) { 109 if(file_count > 1 && folder_count > 1) { 110 args = new String[2]; 111 args[0] = String.valueOf(file_count); 112 args[1] = String.valueOf(folder_count); 113 suffix = Gatherer.dictionary.get("FileActions.Selected", args); 114 } 115 else if(file_count > 1) { 116 args = new String[1]; 117 args[0] = String.valueOf(file_count); 118 suffix = Gatherer.dictionary.get("FileActions.Files_And_Directory_Selected", args); 119 } 120 else if(folder_count > 1) { 121 args = new String[1]; 122 args[0] = String.valueOf(folder_count); 123 suffix = Gatherer.dictionary.get("FileActions.File_And_Directories_Selected", args); 124 } 125 else { 126 suffix = Gatherer.dictionary.get("FileActions.File_And_Directory_Selected"); 127 } 128 } 129 else if(file_count > 0) { 130 if(file_count > 1) { 131 args = new String[1]; 132 args[0] = String.valueOf(file_count); 133 suffix = Gatherer.dictionary.get("FileActions.Files_Selected", args); 134 } 135 else if(file_count == 1) { 136 suffix = Gatherer.dictionary.get("FileActions.File_Selected"); 137 } 138 } 139 else if(folder_count > 0) { 140 if(folder_count > 1) { 141 args = new String[1]; 142 args[0] = String.valueOf(folder_count); 143 suffix = Gatherer.dictionary.get("FileActions.Directories_Selected", args); 144 } 145 else { 146 suffix = Gatherer.dictionary.get("FileActions.Directory_Selected"); 147 } 90 String suffix = null; 91 int file_count = 0; 92 int folder_count = 0; 93 for(int i = 0; selection != null && i < selection.length; i++) { 94 TreeNode node = (TreeNode) selection[i].getLastPathComponent(); 95 if(node.isLeaf()) { 96 file_count++; 148 97 } 149 98 else { 150 suffix = null; 151 } 152 args = null; 153 } 99 folder_count++; 100 } 101 } 102 103 // Update the metaaudit_suffix 104 String args[] = null; 105 if(file_count > 0 && folder_count > 0) { 106 if(file_count > 1 && folder_count > 1) { 107 args = new String[2]; 108 args[0] = String.valueOf(file_count); 109 args[1] = String.valueOf(folder_count); 110 suffix = Gatherer.dictionary.get("FileActions.Selected", args); 111 } 112 else if(file_count > 1) { 113 args = new String[1]; 114 args[0] = String.valueOf(file_count); 115 suffix = Gatherer.dictionary.get("FileActions.Files_And_Directory_Selected", args); 116 } 117 else if(folder_count > 1) { 118 args = new String[1]; 119 args[0] = String.valueOf(folder_count); 120 suffix = Gatherer.dictionary.get("FileActions.File_And_Directories_Selected", args); 121 } 122 else { 123 suffix = Gatherer.dictionary.get("FileActions.File_And_Directory_Selected"); 124 } 125 } 126 else if(file_count > 0) { 127 if(file_count > 1) { 128 args = new String[1]; 129 args[0] = String.valueOf(file_count); 130 suffix = Gatherer.dictionary.get("FileActions.Files_Selected", args); 131 } 132 else if(file_count == 1) { 133 suffix = Gatherer.dictionary.get("FileActions.File_Selected"); 134 } 135 } 136 else if(folder_count > 0) { 137 if(folder_count > 1) { 138 args = new String[1]; 139 args[0] = String.valueOf(folder_count); 140 suffix = Gatherer.dictionary.get("FileActions.Directories_Selected", args); 141 } 142 else { 143 suffix = Gatherer.dictionary.get("FileActions.Directory_Selected"); 144 } 145 } 146 args = null; 147 154 148 return suffix; 155 149 } … … 204 198 } 205 199 this.type = this.NONE; 206 suffix = null;207 200 break; 208 201 case 1: // this.SET … … 216 209 } 217 210 this.type = this.NONE; 218 suffix = null;219 211 break; 220 212 } … … 234 226 temp_path = null; 235 227 super.setSelectionPath(path); 236 suffix = null;237 228 } 238 229 } … … 246 237 temp_paths = null; 247 238 super.setSelectionPaths(paths); 248 suffix = null;249 239 } 250 240 } … … 282 272 } 283 273 } 284 274 // Now we check the current selection against the first node in our new selection 285 275 if(appropriate && check_current) { 286 276 appropriate = isAppropriate(paths[0]);
Note:
See TracChangeset
for help on using the changeset viewer.