while (quoteServers.hasNext()) {
servers.add(quoteServers.next());
}
dataSourceComboBox.setModel(new DefaultComboBoxModel(servers.toArray()));
QuoteContract quoteContractTemplate = isNewSymbol
? UserOptionsManager.currentPreferredQuoteContract()
: quoteContract;
if (quoteContractTemplate == null) {
/** no currentPreferredQuoteContract */
quoteContractTemplate = quoteContract;
}
QuoteServer quoteServerTemplate = quoteContractTemplate.lookupServiceTemplate(QuoteServer.class, "DataServers").get();
dataSourceComboBox.setSelectedItem(quoteServerTemplate);
timeUnitField.setModel(new DefaultComboBoxModel(TUnit.values()));
timeUnitField.setSelectedItem(quoteContractTemplate.freq().unit());
unitTimesField.setValue(quoteContractTemplate.freq().nUnits());
refreshable.setSelected(quoteContractTemplate.isRefreshable());
refreshInterval.setValue(quoteContractTemplate.refreshInterval());
pathField.setText(quoteContractTemplate.urlString());
stockSymbolsField.setText(quoteContractTemplate.srcSymbol());
Calendar cal = Calendar.getInstance();
toDateField.setValue(cal.getTime());
cal.setTimeInMillis(quoteContractTemplate.fromTime());
fromDateField.setValue(cal.getTime());
DateFormat format = DateFormat.getDateInstance(DateFormat.DEFAULT);
if (format instanceof SimpleDateFormat) {
String pattern = new StringBuffer("(").append(((SimpleDateFormat) format).toPattern()).append(")").toString();
jLabel6.setText(pattern);
jLabel7.setText(pattern);
}
String dfPattern = "";
if (quoteContractTemplate.datePattern().isDefined()) {
dfPattern = quoteContractTemplate.datePattern().get();
}
formatStringField.setText(dfPattern);
SimpleDateFormat sdf = new SimpleDateFormat(dfPattern, Locale.US);
dateFormatSample.setText(sdf.format(sampleDate));