/*
* PanelContractInfo.java
*
* Created on 27 Февраль 2008 г., 13:03
*/
package clips.contract.info;
import beans.contract.entity.Contract;
import clips.contract.info.contractService.PanelContractService;
import cli_fmw.delegate.directory.complex.DirectoryLocator;
import cli_fmw.main.ClipsException;
import clips.delegate.contract.ContractLocal;
import clips.contract.info.polis.PanelPolisView;
import clips.contract.info.packet.PanelContractPackets;
import clips.delegate.contract.ServisePriceData;
import clips.delegate.directory.complex.DirectoryPacketTemplateItem;
import cli_fmw.delegate.DelegateLine2;
import cli_fmw.delegate.utils.TimeLocal;
import cli_fmw.directory.dialogs.DirectoryDialogDefault;
import cli_fmw.main.PageContainer;
import cli_fmw.main.PageException;
import cli_fmw.main.PageGeneric;
import cli_fmw.main.Persistentable;
import cli_fmw.main.PrintCreators;
import cli_fmw.main.Printable;
import cli_fmw.utils.ErrorValue;
import cli_fmw.utils.Selector;
import cli_fmw.utils.MessageBox;
import cli_fmw.utils.ModalDialog;
import cli_fmw.utils.delegate_models.DelegateDateModel;
import cli_fmw.utils.table_config_states.StateSaver;
import clips.delegate.directory.complex.DirectoryEnterprise;
import clips.delegate.directory.complex.DirectoryEnterpriseItem;
import clips.login.UserInfo;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JPanel;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableModel;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import framework.utils.Converter;
import framework.utils.PairIntStr;
/**
* Панель, отображающая информацию о договоре.
* Внутри себя будет содержать панель дерева услуг и панель списка клиентов
* @author vip
*/
public class PanelContractInfo extends PageGeneric
implements Persistentable, Printable, PageContainer {
private ContractLocal contractLocal;
private PageGeneric innerPanel;
private PanelPolisView panelPolisView;
/** Creates new form PanelContractInfo
* @param container
* @param cl
* @throws ClipsException
*/
public PanelContractInfo(PageContainer container, DelegateLine2 cl) throws ClipsException {
super(container);
initComponents();
contractLocal = (ContractLocal) cl;
contractLocal.addContentStateListener(getContainer());
contractLocal.getContractServiceList();
lblLpu.setText("ЛПУ: " + (contractLocal.getLpu() != null ? contractLocal.getLpu().getTitle() : "все"));
//слушатель для датачузера начало действия договора
new DelegateDateModel<ContractLocal>(contractLocal, chooserBegin) {
@Override
protected Date getDateImp() throws ClipsException {
return getDelegate().getBegin();
}
@Override
protected void setDateImp(Date date) throws ClipsException {
getDelegate().setBegin(date);
}
};
new DelegateDateModel<ContractLocal>(contractLocal, chooserEnd) {
@Override
protected Date getDateImp() throws ClipsException {
return getDelegate().getEnd();
}
@Override
protected void setDateImp(Date date) throws ClipsException {
getDelegate().setEnd(date);
}
};
//слушатель для номера договора
editContractIndex.getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent arg0) {
setField(arg0.getDocument());
}
@Override
public void removeUpdate(DocumentEvent arg0) {
setField(arg0.getDocument());
}
@Override
public void changedUpdate(DocumentEvent arg0) {
}
private void setField(Document doc) {
try {
String s = doc.getText(0, doc.getLength());
contractLocal.setIndex(s);
} catch (BadLocationException ex) {
MessageBox.showException(ex);
} catch (ClipsException ex) {
MessageBox.showException(ex);
}
}
});
setScreenFields();
StateSaver.attachTo(this);
}
private void setScreenFields() throws ClipsException {
editContractIndex.setText(contractLocal.getIndex());
cbBegin.setSelected(contractLocal.getBegin() != null);
if (!cbBegin.isSelected()) {
chooserBegin.setEnabled(false);
}
cbEnd.setSelected(contractLocal.getEnd() != null);
if (!cbEnd.isSelected()) {
chooserEnd.setEnabled(false);
}
DirectoryEnterpriseItem ent = contractLocal.getEnterprise();
tfEnterprice.setText(ent.getTitle());
int i = 0;
short tp = contractLocal.getType();
while (i < Contract.TYPES_ARRAY.length && Contract.TYPES_ARRAY[i].num != tp) {
i++;
}
cbContractType.setSelectedIndex(i);
chbOpenForAll.setSelected(contractLocal.isOpenForAll());
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel8 = new javax.swing.JPanel();
jPanel1 = new javax.swing.JPanel();
labContractIndex = new javax.swing.JLabel();
editContractIndex = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
cbBegin = new javax.swing.JCheckBox();
chooserBegin = new org.infotechservice.ICalendar.components.ICDateChooser();
jLabel2 = new javax.swing.JLabel();
cbEnd = new javax.swing.JCheckBox();
chooserEnd = new org.infotechservice.ICalendar.components.ICDateChooser();
jLabel1 = new javax.swing.JLabel();
cbContractType = new javax.swing.JComboBox();
jPanel2 = new javax.swing.JPanel();
jPanel3 = new javax.swing.JPanel();
lab = new javax.swing.JLabel();
tfEnterprice = new javax.swing.JTextField();
btChangeEnterprice = new javax.swing.JButton();
lblLpu = new javax.swing.JLabel();
chbOpenForAll = new javax.swing.JCheckBox();
jPanel5 = new javax.swing.JPanel();
jPanel9 = new javax.swing.JPanel();
tbtPolis = new javax.swing.JToggleButton();
tbtPackTemplates = new javax.swing.JToggleButton();
tbtServicePrices = new javax.swing.JToggleButton();
jSeparator1 = new javax.swing.JSeparator();
jPanel4 = new javax.swing.JPanel();
btCopyContract = new javax.swing.JButton();
btDeleteContract = new javax.swing.JButton();
pnlInner = new javax.swing.JPanel();
setLayout(new java.awt.BorderLayout());
jPanel8.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 10, 5));
jPanel8.setLayout(new javax.swing.BoxLayout(jPanel8, javax.swing.BoxLayout.PAGE_AXIS));
jPanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
labContractIndex.setText("Номер договора: ");
jPanel1.add(labContractIndex);
editContractIndex.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
editContractIndex.setPreferredSize(new java.awt.Dimension(132, 23));
jPanel1.add(editContractIndex);
jLabel3.setText(" ");
jPanel1.add(jLabel3);
cbBegin.setText("Срок действия с ");
cbBegin.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cbBeginActionPerformed(evt);
}
});
jPanel1.add(cbBegin);
chooserBegin.setMinSelectableDate(new java.util.Date(-2208995919000L));
chooserBegin.setPreferredSize(new java.awt.Dimension(124, 23));
jPanel1.add(chooserBegin);
jLabel2.setText(" ");
jPanel1.add(jLabel2);
cbEnd.setText("по");
cbEnd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cbEndActionPerformed(evt);
}
});
jPanel1.add(cbEnd);
chooserEnd.setMinSelectableDate(new java.util.Date(-2208995919000L));
chooserEnd.setPreferredSize(new java.awt.Dimension(124, 23));
jPanel1.add(chooserEnd);
jLabel1.setText(" Тип");
jPanel1.add(jLabel1);
cbContractType.setModel(new DefaultComboBoxModel(Contract.TYPES_ARRAY));
cbContractType.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ContractTypeChanged(evt);
}
});
jPanel1.add(cbContractType);
jPanel8.add(jPanel1);
jPanel2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 0, 5));
jPanel2.setLayout(new java.awt.BorderLayout(5, 0));
jPanel3.setLayout(new java.awt.BorderLayout());
lab.setText("с предприятием : ");
jPanel3.add(lab, java.awt.BorderLayout.WEST);
tfEnterprice.setColumns(20);
tfEnterprice.setEditable(false);
tfEnterprice.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
jPanel3.add(tfEnterprice, java.awt.BorderLayout.CENTER);
btChangeEnterprice.setText("...");
btChangeEnterprice.setPreferredSize(new java.awt.Dimension(20, 20));
btChangeEnterprice.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btChangeEnterpriceActionPerformed(evt);
}
});
jPanel3.add(btChangeEnterprice, java.awt.BorderLayout.EAST);
jPanel2.add(jPanel3, java.awt.BorderLayout.WEST);
lblLpu.setText("jLabel4");
jPanel2.add(lblLpu, java.awt.BorderLayout.EAST);
chbOpenForAll.setText("доступен всем пациентам");
chbOpenForAll.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
chbOpenForAllActionPerformed(evt);
}
});
jPanel2.add(chbOpenForAll, java.awt.BorderLayout.CENTER);
jPanel8.add(jPanel2);
jPanel5.setLayout(new java.awt.BorderLayout());
tbtPolis.setText("Полисы");
tbtPolis.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tbtPolisActionPerformed(evt);
}
});
tbtPackTemplates.setText("Шаблоны пакетов");
tbtPackTemplates.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tbtPackTemplatesActionPerformed(evt);
}
});
tbtServicePrices.setText("Цены услуг");
tbtServicePrices.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
tbtServicePricesActionPerformed(evt);
}
});
jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
jSeparator1.setPreferredSize(new java.awt.Dimension(10, 29));
jSeparator1.setRequestFocusEnabled(false);
javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
jPanel9.setLayout(jPanel9Layout);
jPanel9Layout.setHorizontalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addGap(5, 5, 5)
.addComponent(tbtPolis)
.addGap(5, 5, 5)
.addComponent(tbtPackTemplates)
.addGap(5, 5, 5)
.addComponent(tbtServicePrices)
.addGap(5, 5, 5)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
jPanel9Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {tbtPackTemplates, tbtPolis, tbtServicePrices});
jPanel9Layout.setVerticalGroup(
jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel9Layout.createSequentialGroup()
.addGap(5, 5, 5)
.addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(tbtPolis)
.addComponent(tbtPackTemplates)
.addComponent(tbtServicePrices)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
);
jPanel5.add(jPanel9, java.awt.BorderLayout.WEST);
btCopyContract.setText("Копировать договор");
btCopyContract.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btCopyContractActionPerformed(evt);
}
});
jPanel4.add(btCopyContract);
btDeleteContract.setText("Удалить договор");
btDeleteContract.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btDeleteContractActionPerformed(evt);
}
});
jPanel4.add(btDeleteContract);
jPanel5.add(jPanel4, java.awt.BorderLayout.EAST);
jPanel8.add(jPanel5);
add(jPanel8, java.awt.BorderLayout.PAGE_START);
pnlInner.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
pnlInner.setLayout(new java.awt.BorderLayout());
add(pnlInner, java.awt.BorderLayout.CENTER);
}// </editor-fold>//GEN-END:initComponents
private void btChangeEnterpriceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btChangeEnterpriceActionPerformed
try {
DirectoryEnterprise directoryEnterprise = DirectoryLocator.getDirectory(DirectoryEnterprise.class, false);
DirectoryDialogDefault dlg = new DirectoryDialogDefault(false,
contractLocal.getEnterprise(), "\\", directoryEnterprise);
dlg.setVisible(true);
if (dlg.getDlgResult() == ModalDialog.DLG_OK) {
Selector items = dlg.getSelectedItems();
DirectoryEnterpriseItem enterprice = (DirectoryEnterpriseItem) items.get(0);
contractLocal.setEnterprise(enterprice);
tfEnterprice.setText(enterprice.getTitle());
}
} catch (ClipsException ex) {
ex.printStackTrace();
}
}//GEN-LAST:event_btChangeEnterpriceActionPerformed
private void cbEndActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbEndActionPerformed
if (!cbEnd.isSelected()) {
chooserEnd.setDate(null);
}
chooserEnd.setEnabled(cbEnd.isSelected());
}//GEN-LAST:event_cbEndActionPerformed
private void tbtPolisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbtPolisActionPerformed
if (tbtPolis.isSelected()) {
tbtPackTemplates.setSelected(false);
tbtServicePrices.setSelected(false);
try {
if (panelPolisView == null) {
panelPolisView = new PanelPolisView(this, contractLocal);
}
innerPanel = panelPolisView;
if (innerPanel != null) {
addNewPage(innerPanel, null);
}
} catch (Exception ex) {
MessageBox.showException(ex);
}
} else {
try {
removePage(innerPanel, false);
} catch (Exception ex) {
MessageBox.showException(ex);
}
}
repaint();
}//GEN-LAST:event_tbtPolisActionPerformed
private void tbtPackTemplatesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbtPackTemplatesActionPerformed
if (tbtPackTemplates.isSelected()) {
tbtPolis.setSelected(false);
tbtServicePrices.setSelected(false);
try {
//Добавляем панель с редактором пакетов услуг
innerPanel = new PanelContractPackets(this, contractLocal);
if (innerPanel != null) {
addNewPage(innerPanel, null);
}
} catch (Exception ex) {
MessageBox.showException(ex);
}
} else {
try {
removePage(innerPanel, false);
} catch (Exception ex) {
MessageBox.showException(ex);
}
}
repaint();
}//GEN-LAST:event_tbtPackTemplatesActionPerformed
private void tbtServicePricesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tbtServicePricesActionPerformed
if (tbtServicePrices.isSelected()) {
tbtPolis.setSelected(false);
tbtPackTemplates.setSelected(false);
try {
//Добавляем панель с редактором списка услуг и цен
innerPanel = new PanelContractService(this, contractLocal);
addNewPage(innerPanel, null);
//((PanelContractService) innerPanel).contractServiceListModified();
} catch (Exception ex) {
MessageBox.showException(ex);
}
} else {
try {
removePage(innerPanel, false);
} catch (Exception ex) {
MessageBox.showException(ex);
}
}
repaint();
}//GEN-LAST:event_tbtServicePricesActionPerformed
private void btDeleteContractActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btDeleteContractActionPerformed
try {
contractLocal.remove();
getContainer().removePage(this, true);
} catch (ClipsException ex) {
MessageBox.showException(ex);
}
}//GEN-LAST:event_btDeleteContractActionPerformed
private void btCopyContractActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCopyContractActionPerformed
if (contractLocal.isDirty()) {
MessageBox.showWarning(MessageBox.W_NOT_CLOSE_EDITING);
} else {
try {
PanelContractInfo panel = new PanelContractInfo(getContainer(), contractLocal.copy());
PageGeneric page = getContainer().addNewPage(panel, this);
getContainer().activatePage(page);
} catch (ClipsException ex) {
MessageBox.showException(ex);
}
}
}//GEN-LAST:event_btCopyContractActionPerformed
private void ContractTypeChanged(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ContractTypeChanged
try {
PairIntStr p = (PairIntStr) cbContractType.getSelectedItem();
int type = p.num;
if (contractLocal.isNewlyCreated()) {
if (type != Contract.TYPE_OMI) {
contractLocal.setLpu(UserInfo.get().getCollaborator().getLpu());
} else {
contractLocal.setLpu(null);
}
}
contractLocal.setType(type);
} catch (Exception ex) {
MessageBox.showException(ex);
}
}//GEN-LAST:event_ContractTypeChanged
private void cbBeginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbBeginActionPerformed
try {
if (cbBegin.isSelected()) {
chooserBegin.setEnabled(true);
Date current = TimeLocal.getCurrentTime().getTime();
chooserBegin.setDate(current);
} else {
chooserBegin.setDate(null);
chooserBegin.setEnabled(false);
}
} catch (ClipsException ex) {
MessageBox.showException(ex);
}
}//GEN-LAST:event_cbBeginActionPerformed
private void chbOpenForAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chbOpenForAllActionPerformed
try {
contractLocal.setOpenForAll(chbOpenForAll.isSelected());
} catch (ClipsException ex) {
MessageBox.showException(ex);
}
}//GEN-LAST:event_chbOpenForAllActionPerformed
private void updateInnerPanel(){
if (tbtPolis.isSelected()){
tbtPolisActionPerformed(null);
}else if(tbtPackTemplates.isSelected()){
tbtPackTemplatesActionPerformed(null);
}else if (tbtServicePrices.isSelected()){
tbtServicePricesActionPerformed(null);
}
}
@Override
public String getPageTitle() {
return "Редактор договора";
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btChangeEnterprice;
private javax.swing.JButton btCopyContract;
private javax.swing.JButton btDeleteContract;
private javax.swing.JCheckBox cbBegin;
private javax.swing.JComboBox cbContractType;
private javax.swing.JCheckBox cbEnd;
private javax.swing.JCheckBox chbOpenForAll;
private org.infotechservice.ICalendar.components.ICDateChooser chooserBegin;
private org.infotechservice.ICalendar.components.ICDateChooser chooserEnd;
private javax.swing.JTextField editContractIndex;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel8;
private javax.swing.JPanel jPanel9;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JLabel lab;
private javax.swing.JLabel labContractIndex;
private javax.swing.JLabel lblLpu;
private javax.swing.JPanel pnlInner;
private javax.swing.JToggleButton tbtPackTemplates;
private javax.swing.JToggleButton tbtPolis;
private javax.swing.JToggleButton tbtServicePrices;
private javax.swing.JTextField tfEnterprice;
// End of variables declaration//GEN-END:variables
@Override
public boolean isDirty() {
return contractLocal == null ? false : contractLocal.isDirty();
}
@Override
public void save() throws ClipsException {
//Проверим, можно ли сохраняться (введены ли все цены)
if (contractLocal.isContractServicesGood()) {
contractLocal.save1();
} else {
MessageBox.showWarning(MessageBox.W_NOT_ALL_PRICES_SETTED);
}
}
@Override
public void restore() {
try {
if (contractLocal.isNewlyCreated()) {
getContainer().removePage(this, true);
}
else {
contractLocal.restore();
setScreenFields();
updateInnerPanel();
}
} catch (ClipsException ex) {
MessageBox.showException(ex);
}
}
@Override
public boolean readyForPrint() {
return !isDirty();
}
@Override
public void print() {
try {
if (readyForPrint()) {
HashMap<String, Object> data = new LinkedHashMap<String, Object>();
data.put("index", "Номер: " + contractLocal.getIndex());
data.put("dateFrom", "Срок действия с: " + Converter.dateToString(contractLocal.getBegin())
+ " по: " + Converter.dateToString(contractLocal.getEnd()));
data.put("type", "Тип договора: " + Contract.TYPES_ARRAY[contractLocal.getType()].toString());
data.put("type", "Тип договора: " + cbContractType.getSelectedItem());
data.put("enterprise", "Предприятие: " + tfEnterprice.getText());
TableModel model = null;
String title = "Данные о договоре";
if (tbtPolis.isSelected()) {
model = ((PanelPolisView)innerPanel).getTableModel();
title += ": полисы";
}
else if (tbtServicePrices.isSelected()) {
model = new AbstractTableModel() {
Selector<ServisePriceData> sel = contractLocal.getContractServiceList();
@Override
public int getRowCount() {
return sel.size();
}
@Override
public String getColumnName(int column) {
switch (column) {
case 0: return "Название услуги";
case 1: return "Цена услуги";
case 2: return "Оплачивается по договору";
default: return "";
}
}
@Override
public int getColumnCount() {
return 3;
}
@Override
public Object getValueAt(int rowIndex, int col) {
try {
ServisePriceData data = sel.get(rowIndex);
if (col == 0) {
return data.getService().getTitle();
}
else if (col == 1) {
return String.format("%.2f", ((float) data.getPrice()) / 100);
}
else if (col == 2) {
return String.format("%.2f", ((float) data.getMoney()) / 100);
}
else {
return "";
}
} catch (ClipsException ex) {
return new ErrorValue(ex);
}
}
};
title += ": включенные услуги";
}
else if (tbtPackTemplates.isSelected()) {
String templates = "";
Iterator<DirectoryPacketTemplateItem> it = contractLocal.getTemplates().iterator();
while (it.hasNext()) {
DirectoryPacketTemplateItem item = it.next();
templates += " - " + item.getTitle();
templates += "\n";
}
data.put("packetTemplates", "Включенные пакеты услуг:\n" + templates);
title += ": доступные пакеты услуг";
}
PrintCreators.createGeneratedReport(title, null, data.entrySet(), null, model, getClass());
}
} catch (ClipsException ex) {
MessageBox.showException(ex);
}
}
@Override
public PageGeneric addNewPage(PageGeneric pageToAdd, PageGeneric afterPage) throws PageException {
removePage(null, false);
pnlInner.add((JPanel) pageToAdd);
pnlInner.revalidate();
return pageToAdd;
}
@Override
public void removePage(PageGeneric page, boolean forced) throws PageException {
//изменения происходят в делегате, принадлежащем этой панели.
//никаких проверок на закрытие внутренних не надо
pnlInner.removeAll();
}
@Override
public void activatePage(PageGeneric page) throws PageException {
}
@Override
public PageGeneric getActivePage() {
return null;
}
@Override
public void contentStateChanged() {
getContainer().contentStateChanged();
}
@Override
public int getPageCount() {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public PageGeneric getPage(int index) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public DelegateLine2 getDelegate() {
return contractLocal;
}
}