private void cbExpiresAfterOpenedItemStateChanged(ItemEvent e) { if (initPhase) return; txtExpiresIn.setEnabled(e.getStateChange() == ItemEvent.SELECTED); cmbDaysWeeks.setEnabled(e.getStateChange() == ItemEvent.SELECTED); if (e.getStateChange() == ItemEvent.SELECTED) { txtExpiresIn.setText("7"); cmbDaysWeeks.setSelectedIndex(0); tradeForm.setDaysToExpireAfterOpened(7); } else { tradeForm.setDaysToExpireAfterOpened(null); } }
private void txtExpiresInFocusLost(FocusEvent e) { if (initPhase) return; Integer i = SYSTools.checkInteger(txtExpiresIn.getText()); if (i == null || i.compareTo(0) <= 0) { i = 7; txtExpiresIn.setText("7"); } if (cmbDaysWeeks.getSelectedIndex() == 1) { tradeForm.setDaysToExpireAfterOpened(i * 7); } else { tradeForm.setDaysToExpireAfterOpened(i); } }
private void cmbDaysWeeksItemStateChanged(ItemEvent e) { if (initPhase) return; if (e.getStateChange() == ItemEvent.SELECTED) { Integer i = SYSTools.checkInteger(txtExpiresIn.getText()); if (i == null || i.compareTo(0) <= 0) { i = 7; txtExpiresIn.setText("7"); } if (cmbDaysWeeks.getSelectedIndex() == 1) { tradeForm.setDaysToExpireAfterOpened(i * 7); } else { tradeForm.setDaysToExpireAfterOpened(i); } } }