use of com.cosylab.logging.settings.LogTypeRenderer in project ACS by ACS-Community.
the class LogToolBar method getLogLevelCB.
/**
*
* @return The log level CB
*/
public JComboBox getLogLevelCB() {
if (logLevelCB == null) {
// Add the ComboBox for the log level
LogTypeHelper[] types = LogTypeHelper.values();
int t = 0;
// for (LogTypeHelper logType: LogTypeHelper.values()) {
// Descriptions[t++]=logType.logEntryType;
// }
logLevelCB = new JComboBox(types);
// Build the renderer for the combo boxes
LogTypeRenderer rendererCB = new LogTypeRenderer();
logLevelCB.setSelectedItem(initialLogLevel);
logLevelCB.setEditable(false);
logLevelCB.setMaximumRowCount(LogTypeHelper.values().length);
logLevelCB.setRenderer(rendererCB);
}
return logLevelCB;
}
use of com.cosylab.logging.settings.LogTypeRenderer in project ACS by ACS-Community.
the class ZoomPrefsDlg method buildLogLevelCB.
/**
* Build a log level combobox.
*
* @param initialLevel The initial log level
* @return The log level CB
*/
private JComboBox buildLogLevelCB(LogTypeHelper initialLevel) {
JComboBox temp;
// Add the ComboBox for the log level
LogTypeHelper[] types = LogTypeHelper.values();
int t = 0;
temp = new JComboBox(types);
// Build the renderer for the combo boxes
LogTypeRenderer rendererCB = new LogTypeRenderer();
if (initialLevel != null) {
temp.setSelectedItem(initialLevel);
} else {
temp.setSelectedItem(LogTypeHelper.TRACE);
}
temp.setEditable(false);
temp.setMaximumRowCount(LogTypeHelper.values().length);
temp.setRenderer(rendererCB);
return temp;
}
use of com.cosylab.logging.settings.LogTypeRenderer in project ACS by ACS-Community.
the class LogToolBar method getDiscardLevelCB.
/**
*
* @return The discard level CB
*/
public JComboBox getDiscardLevelCB() {
if (discardLevelCB == null) {
// Add the ComboBox for the log level
LogTypeRenderer discardRendererCB = new LogTypeRenderer();
String[] discardLevelStr = new String[LogTypeHelper.values().length + 1];
discardLevelStr[0] = "None";
int t = 0;
for (LogTypeHelper logType : LogTypeHelper.values()) {
discardLevelStr[++t] = logType.logEntryType;
}
discardLevelCB = new JComboBox(discardLevelStr);
discardLevelCB.setMaximumRowCount(discardLevelStr.length);
if (initialDiscardLevel == null) {
discardLevelCB.setSelectedIndex(0);
} else {
discardLevelCB.setSelectedIndex(initialDiscardLevel.ordinal() + 1);
}
discardLevelCB.setEditable(false);
discardLevelCB.setRenderer(discardRendererCB);
}
return discardLevelCB;
}
use of com.cosylab.logging.settings.LogTypeRenderer in project ACS by ACS-Community.
the class QueryDlg method setupTypeCB.
private JComboBox setupTypeCB(JComboBox box) {
String[] Descritpions = new String[LogTypeHelper.values().length];
int t = 0;
for (LogTypeHelper log : LogTypeHelper.values()) {
Descritpions[t++] = log.logEntryType;
}
JComboBox logLevelCB = new JComboBox(Descritpions);
// Build the renderer for the combo boxesx
LogTypeRenderer rendererCB = new LogTypeRenderer();
logLevelCB.setEditable(false);
logLevelCB.setMaximumRowCount(LogTypeHelper.values().length);
logLevelCB.setRenderer(rendererCB);
return logLevelCB;
}
Aggregations