Package clips.job

Source Code of clips.job.DialogJob

/*
* DialogJob.java
*
* Created on 15 Февраль 2008 г., 17:38
*/
package clips.job;

import cli_fmw.delegate.client.Address;
import clips.delegate.directory.simple.appointment.DirectoryAppointmentItem;
import clips.delegate.directory.simple.profession.DirectoryProfessionItem;
import clips.delegate.job.DangerExamChunk;
import clips.delegate.directory.complex.DirectoryDangerItem;
import cli_fmw.delegate.directory.complex.DirectoryLocator;
import clips.delegate.client.ClientLocal;
import clips.delegate.directory.complex.DirectoryDanger;
import cli_fmw.main.ClipsException;
import clips.delegate.job.JobLocal;
import cli_fmw.directory.dialogs.DirectoryDialogDefault;
import cli_fmw.report.FormReportCreator;
import cli_fmw.report.ReporterFactory;
import cli_fmw.address.DialogAddressM;
import cli_fmw.report.panels.model.delegate.DirectorySimpleFilteredComboBoxModel;
import cli_fmw.utils.DefaultColors;
import cli_fmw.utils.Selector;
import cli_fmw.utils.MessageBox;
import cli_fmw.utils.ModalDialog;
import cli_fmw.utils.sorted_table.renderer.LabelRenderer;
import cli_fmw.utils.table_config_states.StateSaver;
import clips.delegate.config.ConfigLocal;
import clips.delegate.directory.complex.DirectoryEnterprise;
import clips.delegate.directory.complex.DirectoryEnterpriseItem;
import clips.delegate.directory.simple.appointment.DirectoryAppointment;
import clips.delegate.directory.simple.profession.DirectoryProfession;
import org.infotechservice.ICalendar.components.ICDateChooserCellEditor;
import beans.user.job.entity.DangerJobDetails;
import cli_fmw.main.audit.AuditManager;
import clips.login.UserInfo;
import java.awt.Color;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.util.Date;
import java.util.HashMap;
import javax.swing.JTable;
import javax.swing.RowSorter;
import javax.swing.table.TableRowSorter;

/**
*
* @author  vip
*/
public class DialogJob extends ModalDialog {

    private JobLocal jobLocal;
    private ClientLocal client;
    private DirectoryEnterprise directoryEnterprise;
    private DirectoryProfession directoryProf;
    private DirectoryDanger directoryDanger;
    private DirectoryAppointment directoryAppointment;


    public DialogJob(java.awt.Frame parent, JobLocal jobLocal, ClientLocal client, AuditManager am) throws ClipsException {
        super(parent, "Работа пациента", am);
        initComponents();
        this.jobLocal = jobLocal;
        this.client = client;
       
        this.setSize(750, 600);
       
        Dimension scrSize = Toolkit.getDefaultToolkit().getScreenSize();
        Rectangle dlgSize = this.getBounds();
        this.setLocation((scrSize.width - dlgSize.width) / 2, (scrSize.height - dlgSize.height) / 2);
       
        directoryEnterprise = DirectoryLocator.getDirectory(DirectoryEnterprise.class);
        directoryProf = DirectoryLocator.getDirectory(DirectoryProfession.class);
        directoryDanger = DirectoryLocator.getDirectory(DirectoryDanger.class);
        directoryAppointment = DirectoryLocator.getDirectory(DirectoryAppointment.class);

        //комбобокс должность
        DirectoryAppointment dirAppointment = DirectoryLocator.getDirectory(DirectoryAppointment.class);
        new DirectorySimpleFilteredComboBoxModel<JobLocal, DirectoryAppointmentItem> (cbAppointment, jobLocal, dirAppointment) {

            @Override
            public DirectoryAppointmentItem getSelectedDirectoryItem() throws ClipsException {
                return getObject().getAppointment();
            }

            @Override
            public void setSelectedDirectoryItem(DirectoryAppointmentItem item) throws ClipsException {
                getObject().setAppointment(item);
            }
        };

        //комбобокс должность
        DirectoryProfession dirProfession = DirectoryLocator.getDirectory(DirectoryProfession.class);
        new DirectorySimpleFilteredComboBoxModel<JobLocal, DirectoryProfessionItem> (cbProfession, jobLocal, dirProfession) {

            @Override
            public DirectoryProfessionItem getSelectedDirectoryItem() throws ClipsException {
                return getObject().getProfession();
            }

            @Override
            public void setSelectedDirectoryItem(DirectoryProfessionItem item) throws ClipsException {
                getObject().setProfession(item);
            }
        };

        setScreenFields();
        StateSaver.attachTo(this);
    }

    /**
     * Прорисовывает предприятие и его адрес.
     */
    private void setScreenEnterprise() throws ClipsException {
        DirectoryEnterpriseItem ent = jobLocal.getEnterprise();
        String s = "Предприятие не выбрано";
        if (ent != null) {
            StringBuffer ss = new StringBuffer("<HTML>" + ent.getFullTitle(true));   // Взяли инфу о всей иерархической цепочке предприятий
                /*
             * Вся дальнейшая фигня всего лишь для того чтобы
             * в HTMLке в каждой строчке добавлять пробелы - в первой 2,
             * во второй 4 и т.д.
             */
            int pos = 0;                                    //последняя позиция тега <p>
            int k = 0;                                      //счетчик отступов
            while (ss.indexOf("<p>", pos + 1) != -1) {
                pos = ss.indexOf("<p>", pos + 1);
                for (int j = 1; j <= k * 2; j++) {
                    ss.insert(pos + 3, "&nbsp ");             //типа пробел
                }
                k++;
                pos++;
            }
            s = ss + "<p color = green>Адрес</p>";
            s += "<p color = green>" + ent.getAddress().toString() + "</p>" + "</html>";
        }
        lblAdressEnt.setText(s);
        resetDangersList();
    }

    private void resetDangersList() throws ClipsException{
       
        TableModelDangers model = new TableModelDangers(jobLocal);
        tblDangers.setModel(model);
        RowSorter<TableModelDangers> rowSorter = new TableRowSorter(model);
        tblDangers.setRowSorter(rowSorter);
        tblDangers.getColumnModel().getColumn(TableModelDangers.CL_LAST_EXAM).setCellEditor(new ICDateChooserCellEditor());
        tblDangers.getColumnModel().getColumn(TableModelDangers.CL_LAST_EXAM).setCellRenderer(new LabelRenderer(){

            @Override
            protected void modifyErrorTableCellRendererComponent(JTable table, Object value, int row, int col) {
                if (table.getModel() instanceof TableModelDangers && value instanceof Date){
                    TableModelDangers dangers = (TableModelDangers) table.getModel();
                    Date d = (Date) value;
                    String s = framework.utils.Converter.dateToString(d);
                    if (dangers.isManually(row)){
                        s += " (вручную)";
                        render().setBackground(Color.YELLOW);   
                    }else{
                        render().setBackground(DefaultColors.TABLE_BACKGROUND);
                    }
                    render().setText(s);
                }else{
                    render().setBackground(DefaultColors.TABLE_BACKGROUND);
                }
            }
           
        });
    }
   
    /**
     * Заполняет экранные поля данными из делегата JobLocal
     * @throws cli_fmw.delegate.ClipsException
     */
    private void setScreenFields() throws ClipsException {
        //прорисовать предприятие
        setScreenEnterprise();
        //прорисовать даты, профессию и вредные факторы
        if (jobLocal.getBegin() != null) {
            dateBegin.setDate(jobLocal.getBegin());
        }
        if (jobLocal.getEnd() != null) {
            cbEnd.setSelected(true);
        } else {
            cbEnd.setSelected(false);
            dateEnd.setEnabled(false);
        }
        dateEnd.setDate(jobLocal.getEnd());
    }

    /**
     * Помещает данные из экранных полей в делегат. При этом выполняет проверку
     * правильности введенных данных
     * @return
     */
    private boolean getScreenFields() throws ClipsException {
        // проверка правильности введенных данных
        //if (!directoryProf.objectInDirectory(editProf.getText())) throw new Exception();
        //if (!directoryDanger.objectInDirectory(editDanger.getText())) throw new Exception();
        // конец проверки правильности
        if (dateBegin.getDate() != null) {
            jobLocal.setBegin(dateBegin.getDate());
        }
        if (cbEnd.isSelected()) {
            if (dateEnd.getDate() != null) {
                jobLocal.setEnd(dateEnd.getDate());
            }
        } else {
            jobLocal.setEnd(null);
        }
    if (tblDangers.isEditing()) {
      tblDangers.getCellEditor().stopCellEditing();
    }
        //jobLocal.setProf(editProf.getText());
        //jobLocal.setDangerFactors(editDanger.getText());
        return true;
    }

    /** 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() {

        pnlTop = new javax.swing.JPanel();
        lbEnterprice = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        lblAdressEnt = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        lbBegin = new javax.swing.JLabel();
        dateBegin = new org.infotechservice.ICalendar.components.ICDateChooser();
        cbEnd = new javax.swing.JCheckBox();
        dateEnd = new org.infotechservice.ICalendar.components.ICDateChooser();
        jPanel6 = new javax.swing.JPanel();
        btChangeEnterprice = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        lbAppoint = new javax.swing.JLabel();
        cbAppointment = new javax.swing.JComboBox();
        jPanel5 = new javax.swing.JPanel();
        lbProf = new javax.swing.JLabel();
        cbProfession = new javax.swing.JComboBox();
        pnlBottom = new javax.swing.JPanel();
        jPanel8 = new javax.swing.JPanel();
        btOK = new javax.swing.JButton();
        btCancel = new javax.swing.JButton();
        jPanel9 = new javax.swing.JPanel();
        btPrint = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        btAdd = new javax.swing.JButton();
        btRemove = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblDangers = new cli_fmw.utils.sorted_table.SortedTable();

        setTitle("Диалог редактирования места работы");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        });

        pnlTop.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
        pnlTop.setPreferredSize(new java.awt.Dimension(696, 350));

        lbEnterprice.setText("Предприятие:");

        jPanel1.setPreferredSize(new java.awt.Dimension(10, 100));
        jPanel1.setLayout(new java.awt.BorderLayout());

        lblAdressEnt.setText("jLabel1");
        jPanel1.add(lblAdressEnt, java.awt.BorderLayout.PAGE_START);

        jPanel2.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

        lbBegin.setText("Принят");
        jPanel2.add(lbBegin);

        dateBegin.setPreferredSize(new java.awt.Dimension(130, 27));
        jPanel2.add(dateBegin);

        cbEnd.setText("Уволен");
        cbEnd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cbEndActionPerformed(evt);
            }
        });
        jPanel2.add(cbEnd);

        dateEnd.setPreferredSize(new java.awt.Dimension(130, 27));
        jPanel2.add(dateEnd);

        jPanel6.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

        btChangeEnterprice.setText("Предприятие");
        btChangeEnterprice.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btChangeEnterpriceActionPerformed(evt);
            }
        });
        jPanel6.add(btChangeEnterprice);

        jPanel7.setLayout(new java.awt.BorderLayout());

        lbAppoint.setText("Должность");
        jPanel7.add(lbAppoint, java.awt.BorderLayout.PAGE_START);

        cbAppointment.setEditable(true);
        cbAppointment.setPreferredSize(new java.awt.Dimension(25, 27));
        jPanel7.add(cbAppointment, java.awt.BorderLayout.PAGE_END);

        jPanel5.setLayout(new java.awt.BorderLayout());

        lbProf.setText("Профессия");
        jPanel5.add(lbProf, java.awt.BorderLayout.PAGE_START);

        cbProfession.setEditable(true);
        cbProfession.setPreferredSize(new java.awt.Dimension(25, 27));
        jPanel5.add(cbProfession, java.awt.BorderLayout.PAGE_END);

        javax.swing.GroupLayout pnlTopLayout = new javax.swing.GroupLayout(pnlTop);
        pnlTop.setLayout(pnlTopLayout);
        pnlTopLayout.setHorizontalGroup(
            pnlTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lbEnterprice, javax.swing.GroupLayout.DEFAULT_SIZE, 699, Short.MAX_VALUE)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 699, Short.MAX_VALUE)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 699, Short.MAX_VALUE)
            .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, 699, Short.MAX_VALUE)
            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, 699, Short.MAX_VALUE)
            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, 699, Short.MAX_VALUE)
        );
        pnlTopLayout.setVerticalGroup(
            pnlTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlTopLayout.createSequentialGroup()
                .addComponent(lbEnterprice, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pnlBottom.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
        pnlBottom.setLayout(new java.awt.BorderLayout());

        jPanel8.setLayout(new java.awt.GridLayout(1, 0, 5, 0));

        btOK.setText("     ОК     ");
        btOK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btOKActionPerformed(evt);
            }
        });
        jPanel8.add(btOK);

        btCancel.setText("Отмена");
        btCancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCancelActionPerformed(evt);
            }
        });
        jPanel8.add(btCancel);

        pnlBottom.add(jPanel8, java.awt.BorderLayout.LINE_END);

        jPanel9.setLayout(new java.awt.GridLayout(1, 0));

        btPrint.setText("Печать");
        btPrint.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btPrintActionPerformed(evt);
            }
        });
        jPanel9.add(btPrint);

        pnlBottom.add(jPanel9, java.awt.BorderLayout.LINE_START);

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Вредные факторы"));

        jPanel10.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));

        btAdd.setText("Добавить");
        btAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btAddActionPerformed(evt);
            }
        });
        jPanel10.add(btAdd);

        btRemove.setText("Удалить");
        btRemove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btRemoveActionPerformed(evt);
            }
        });
        jPanel10.add(btRemove);

        jScrollPane1.setViewportView(tblDangers);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, 697, Short.MAX_VALUE)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 697, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(pnlTop, javax.swing.GroupLayout.DEFAULT_SIZE, 709, Short.MAX_VALUE)
            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(pnlBottom, javax.swing.GroupLayout.DEFAULT_SIZE, 709, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(pnlTop, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(pnlBottom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    /** Closes the dialog */
    private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
        jobLocal.restore();
        setDlgResult(DLG_CANCEL);
        dispose();
    }//GEN-LAST:event_closeDialog

    private void btCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCancelActionPerformed
        jobLocal.restore();
        setDlgResult(DLG_CANCEL);
        dispose();
    }//GEN-LAST:event_btCancelActionPerformed

    private void btOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btOKActionPerformed
        try {
            if (getScreenFields()) {
                    jobLocal.save1();
                    setDlgResult(DLG_OK);
                    dispose();
            } else {
                MessageBox.showWarning(MessageBox.W_INCORRECT_DATA);
            }
        } catch (ClipsException ex) {
            MessageBox.showException(ex);
        }
    }//GEN-LAST:event_btOKActionPerformed

    private void btAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btAddActionPerformed
        try {
            DirectoryDialogDefault ddd = new DirectoryDialogDefault(this, true, null, directoryDanger.getDirectoryTitle(), directoryDanger);
            ddd.setVisible(true);
            if (ddd.getDlgResult() == ModalDialog.DLG_OK) {
                Selector s = ddd.getSelectedItems();
                for (int i = 0; i < s.size(); i++) {
                    DangerJobDetails djd = new DangerJobDetails();
                    DirectoryDangerItem ddi = (DirectoryDangerItem)s.get(i);
                    djd.dangerId = ddi.getID();
                    djd.jobId = jobLocal.getID();
                    DangerExamChunk chunk = new DangerExamChunk(djd);
                    System.out.println("create DANGER CHUNK, job: " + chunk.getDetails().jobId);
                    jobLocal.dangerFactors().append(chunk);
                   
                }
            }
            resetDangersList();
        } catch (ClipsException ex) {
            MessageBox.showException(ex);
        }
}//GEN-LAST:event_btAddActionPerformed

private void btPrintActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btPrintActionPerformed
    try {
        FormReportCreator creater = ReporterFactory.createFormReporter(getClass());
        HashMap<String, Object> extraFields = jobLocal.getPrintFields();
        extraFields.put("clientFIO", client.toString());
        creater.createReport(null, null, extraFields.entrySet(), null);
        creater.finish();
    } catch (ClipsException ex) {
        MessageBox.showException(ex);
    }
}//GEN-LAST:event_btPrintActionPerformed

private void btRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btRemoveActionPerformed
    try {
        int[] vs = tblDangers.getSelectedRowsSorted();
        for (int i = vs.length-1; i>=0; i-- ) {
            jobLocal.dangerFactors().remove(vs[i]);
        }
       
        resetDangersList();
    } catch (ClipsException ex) {
        MessageBox.showException(ex);
    }
}//GEN-LAST:event_btRemoveActionPerformed

private void cbEndActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbEndActionPerformed
    dateEnd.setEnabled(cbEnd.isSelected());
}//GEN-LAST:event_cbEndActionPerformed

private void btChangeEnterpriceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btChangeEnterpriceActionPerformed
    try {
        DirectoryDialogDefault dlg = new DirectoryDialogDefault(false,
                jobLocal.getEnterprise(), "\\", directoryEnterprise);
        dlg.setAlwaysOnTop(true);
        dlg.setVisible(true);
        if (dlg.getDlgResult() == ModalDialog.DLG_OK) {
            Selector items = dlg.getSelectedItems();
            DirectoryEnterpriseItem enterprice = (DirectoryEnterpriseItem) items.get(0);
            jobLocal.setEnterprise(enterprice);
            setScreenEnterprise();
        }
    } catch (ClipsException ex) {
        MessageBox.showException(ex);
    }
}//GEN-LAST:event_btChangeEnterpriceActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btAdd;
    private javax.swing.JButton btCancel;
    private javax.swing.JButton btChangeEnterprice;
    private javax.swing.JButton btOK;
    private javax.swing.JButton btPrint;
    private javax.swing.JButton btRemove;
    private javax.swing.JComboBox cbAppointment;
    private javax.swing.JCheckBox cbEnd;
    private javax.swing.JComboBox cbProfession;
    private org.infotechservice.ICalendar.components.ICDateChooser dateBegin;
    private org.infotechservice.ICalendar.components.ICDateChooser dateEnd;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lbAppoint;
    private javax.swing.JLabel lbBegin;
    private javax.swing.JLabel lbEnterprice;
    private javax.swing.JLabel lbProf;
    private javax.swing.JLabel lblAdressEnt;
    private javax.swing.JPanel pnlBottom;
    private javax.swing.JPanel pnlTop;
    private cli_fmw.utils.sorted_table.SortedTable tblDangers;
    // End of variables declaration//GEN-END:variables

}
TOP

Related Classes of clips.job.DialogJob

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.