Revision 1077

tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java (revision 1077)
143 143
		super(uuid, parent);
144 144
		this.persistable = true;
145 145
		this.userPersistable = false;
146
		
147
		try { // lazily create Parts 
148
			compute();
149
		} catch (Exception e) {
150
			// TODO Auto-generated catch block
151
			e.printStackTrace();
152
		}
153 146
	}
154 147
	
155 148
	
......
220 213

  
221 214
		Corpus corpus = getParent();
222 215
		if (pName == null || pName.length() == 0) {
223
			pName = corpus.getName()+ "_" + pProperty.getFullName(); //$NON-NLS-1$
216
			pName = corpus.getName() + "_" + pProperty.getFullName(); //$NON-NLS-1$
224 217
		}
225 218

  
226 219
		if (pValues == null) {
......
236 229
		}
237 230
		if (type == null || type.trim().length() == 0 || type.equals("String")) { //$NON-NLS-1$
238 231
			Collections.sort(pValues, Collator.getInstance(Locale.getDefault())); // alpha sort
239
		} else if (type.equals("Integer")) { //$NON-NLS-1$
232
		}
233
		else if (type.equals("Integer")) { //$NON-NLS-1$
240 234
			Collections.sort(pValues, new Comparator<String>() {
241 235
				@Override
242 236
				public int compare(String arg0, String arg1) {
......
245 239
					return i0 - i1;
246 240
				}
247 241
			}); 
248
		} else if (type.equals("Date")) { //$NON-NLS-1$
242
		}
243
		else if (type.equals("Date")) { //$NON-NLS-1$
249 244
			String format = infos.get("inputFormat"); //$NON-NLS-1$
250 245
			final DateFormat formater = new SimpleDateFormat(format);
251 246
			Collections.sort(pValues, new Comparator<String>() {
......
260 255
					}
261 256
				}
262 257
			}); 
263
		} else  if(type.contains("|")){ //$NON-NLS-1$
258
		}
259
		else if (type.contains("|")){ //$NON-NLS-1$
264 260
			final List<String> sortedValues = Arrays.asList(type.split("\\|")); //$NON-NLS-1$
265 261
			Collections.sort(pValues, new Comparator<String>() {
266 262
				@Override
......
293 289
		
294 290
		if (pProperty != null) {
295 291
			_compute_with_property();
296
		} else {
292
		}
293
		else {
297 294
			_compute_with_lists();
298 295
		}
299 296
		return true;
tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/CreatePartition.java (revision 1077)
94 94
								Log.severe(TXMUIMessages.CreatePartition_2);
95 95
								return Status.CANCEL_STATUS;
96 96
							}
97
							try {
98
								partition.compute(monitor);
99
							}
100
							catch (Exception e) {
101
								// TODO Auto-generated catch block
102
								e.printStackTrace();
103
							}
97 104
							monitor.worked(95);
98 105

  
99 106
							Log.info(NLS.bind(TXMUIMessages.CreatePartition_6, partition.getNPart()));
100 107
							
101

  
102 108
							monitor.subTask(TXMUIMessages.RefreshingCorporaView);
103 109
							syncExec(new Runnable() {
104 110
								@Override
tmp/org.txm.rcp/src/main/java/org/txm/rcp/actions/CreatePartitionDialog.java (revision 1077)
605 605
				org.txm.rcp.utils.Logger.printStackTrace(e);
606 606
				return null;
607 607
			}
608
		} else if (isAssistedSelected) {
608
		}
609
		else if (isAssistedSelected) {
609 610
			p = this.compositeForAssisted.getPartition(getName());
610
		} else if (isAdvancedSelected) {
611
		}
612
		else if (isAdvancedSelected) {
611 613
			try {
612 614
				p = new Partition(corpus);
613 615
				p.setParameters(getName(), getQueries(), getAdvancePartNames());

Also available in: Unified diff