inputedServCode = selectedService.getCode();
tfServiceCode.setText(inputedServCode);
}
};
modelServiceCode = new TextFieldModel(tfServiceCode) {
@Override
protected void setModelTextChecked(String text) throws ClipsException, ParseException, NumberFormatException {
selectedService = serviceMap.get(text);
jComboService.setSelectedItem(selectedService);
}
@Override
protected String getModelTextChecked() throws ClipsException {
return inputedServCode;
}
};
modelServiceCode.setModelText("");
//Код типа приема
resetCollFuncList(selectedColl);
modelCollFunc = new DelegateComboboxModel(jComboSpec, false) {
@Override
public boolean isSelectionVisible(){
return true;
}
@Override
public boolean isEnabled() {
return collFuncList.size() > 1;
}
@Override
public Object getElementAtImp(int index) throws ClipsException {
return collFuncList.get(index);
}
@Override
public int getSizeImp() throws ClipsException {
return collFuncList.size();
}
@Override
public Object getSelectedItemImp() throws ClipsException {
return selectedCollFunc;
}
@Override
public void setSelectedItemImp(Object anItem) throws ClipsException {
selectedCollFunc = (DCFI) anItem;
if (selectedCollFunc == null) {
jPanel2.remove(panUet);
tfUet.setText("1");
return;
}
inputedSpecCode = selectedCollFunc.getItem().getReceptionType().getExtKey();
if (!tfSpecCode.getText().equals(inputedSpecCode)) {
tfSpecCode.setText(inputedSpecCode);
}
if (inputedSpecCode.contains("29")) {
jPanel2.add(panUet, BorderLayout.SOUTH);
}
else {
jPanel2.remove(panUet);
tfUet.setText("1");
}
DialogQuickInput.this.validate();
DialogQuickInput.this.pack();
DialogQuickInput.this.repaint();
}
};
modelSpecCode = new TextFieldModel(tfSpecCode) {
@Override
protected boolean isEnabled() {
return collFuncList.size() > 1;
}