/*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.linuxtools.internal.tmf.ui.Activator;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimestampFormat;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestampFormat;
/**
* TMF Time format preferences
*
- * @version 1.0
* @author Francois Chouinard
+ * @version 1.0
+ * @since 2.0
*/
@SuppressWarnings("javadoc")
public class TmfTimePreferences {
static final String TIME_NO_FMT = ""; //$NON-NLS-1$
static final String SUBSEC_MILLI_FMT = "SSS"; //$NON-NLS-1$
- static final String SUBSEC_MICRO_FMT = "SSS_CCC"; //$NON-NLS-1$
- static final String SUBSEC_NANO_FMT = "SSS_CCC_NNN"; //$NON-NLS-1$
+ static final String SUBSEC_MICRO_FMT = "SSS CCC"; //$NON-NLS-1$
+ static final String SUBSEC_NANO_FMT = "SSS CCC NNN"; //$NON-NLS-1$
static final String SUBSEC_NO_FMT = ""; //$NON-NLS-1$
static final String DELIMITER_NONE = ""; //$NON-NLS-1$
fPreferenceStore.setDefault(TmfTimePreferences.SUBSEC, SUBSEC_NANO_FMT);
fPreferenceStore.setDefault(TmfTimePreferences.DATE_DELIMITER, DELIMITER_DASH);
fPreferenceStore.setDefault(TmfTimePreferences.TIME_DELIMITER, DELIMITER_COLON);
- fPreferenceStore.setDefault(TmfTimePreferences.SSEC_DELIMITER, DELIMITER_UNDERLINE);
+ fPreferenceStore.setDefault(TmfTimePreferences.SSEC_DELIMITER, DELIMITER_SPACE);
// Create the singleton and initialize format preferences
getInstance();
void updatePatterns() {
String dateFmt = fDateFormat.replaceAll("-", fDateFieldSep); //$NON-NLS-1$
String timeFmt = fTimeFormat.replaceAll(":", fTimeFieldSep); //$NON-NLS-1$
- String ssecFmt = fSSecFormat.replaceAll("_", fSSecFieldSep); //$NON-NLS-1$
+ String ssecFmt = fSSecFormat.replaceAll(" ", fSSecFieldSep); //$NON-NLS-1$
fTimestampPattern = dateFmt + timeFmt + "." + ssecFmt; //$NON-NLS-1$
fIntervalPattern = "TTT." + ssecFmt; //$NON-NLS-1$
setSSecFormat(TmfTimePreferences.SUBSEC_NANO_FMT);
setDateFieldSep(TmfTimePreferences.DELIMITER_DASH);
setTimeFieldSep(TmfTimePreferences.DELIMITER_COLON);
- setSSecFieldSep(TmfTimePreferences.DELIMITER_UNDERLINE);
+ setSSecFieldSep(TmfTimePreferences.DELIMITER_SPACE);
updatePatterns();
}