Package javax.swing.text

Examples of javax.swing.text.AbstractDocument$SearchElement


              {
                blankfields();
              }
            }
          });
          AbstractDocument doc = (AbstractDocument) jTextFieldSSCC.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBPallet.field_sscc));
          jDesktopPane1.setLayout(null);
          jDesktopPane1.add(jTextFieldSSCC);
          jTextFieldSSCC.setEditable(true);
          jTextFieldSSCC.setEnabled(true);
          jTextFieldSSCC.setBounds(147, 14, 147, 21);
        }
        {
          jButtonSave = new JButton4j(Common.icon_scanner);
          jDesktopPane1.add(jButtonSave);
          jButtonSave.setEnabled(true);
          jButtonSave.setText(lang.get("btn_Confirm"));
          jButtonSave.setMnemonic(lang.getMnemonicChar());
          jButtonSave.setBounds(63, 450, 100, 32);
          jButtonSave.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              boolean result = true;

              if (pallet.isConfirmed() == false)
              {
                pallet.setDateOfManufacture(JUtility.getSQLDateTime());
                pallet.setTransactionRef(0);
                result = pallet.confirm();
                if (result == true)
                {
                  checkBoxConfirmed.setSelected(true);
                  jStatusText.setText("SSCC " + pallet.getSSCC() + " confirmed.");
                }
                else
                {
                  jStatusText.setText(pallet.getErrorMessage());
                }
              }
              else
              {
                jStatusText.setText("SSCC " + pallet.getSSCC() + " already confirmed.");
                // already confirmed
              }

              if (result == false)
              {
                JOptionPane.showMessageDialog(Common.mainForm, pallet.getErrorMessage(), lang.get("err_Error"), JOptionPane.ERROR_MESSAGE,Common.icon_confirm);
              }
              else
              {
                jFormattedTextFieldBaseQuantity.setText(pallet.getBaseQuantity().toString());
                jButtonSave.setEnabled(false);
              }
            }
          });
        }
        {
          jButtonHelp = new JButton4j(Common.icon_help);
          jDesktopPane1.add(jButtonHelp);
          jButtonHelp.setText(lang.get("btn_Help"));
          jButtonHelp.setMnemonic(lang.getMnemonicChar());
          jButtonHelp.setBounds(169, 450, 100, 32);
        }
        {
          jButtonCancel = new JButton4j(Common.icon_close);
          jDesktopPane1.add(jButtonCancel);
          jButtonCancel.setText(lang.get("btn_Close"));
          jButtonCancel.setMnemonic(lang.getMnemonicChar());
          jButtonCancel.setBounds(275, 450, 100, 32);
          jButtonCancel.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              dispose();
            }
          });
        }

        {
          jLabel1 = new JLabel4j_std();
          jDesktopPane1.add(jLabel1);
          jLabel1.setText(lang.get("lbl_Pallet_SSCC"));
          jLabel1.setBounds(7, 14, 133, 21);
          jLabel1.setHorizontalAlignment(SwingConstants.TRAILING);
        }
        {
          jLabel5 = new JLabel4j_std();
          jDesktopPane1.add(jLabel5);
          jLabel5.setBounds(7, 275, 133, 21);
          jLabel5.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel5.setText(lang.get("lbl_Material_UOM"));
        }

        {
          jLabel2 = new JLabel4j_std();
          jDesktopPane1.add(jLabel2);
          jLabel2.setText(lang.get("lbl_Material"));
          jLabel2.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel2.setBounds(7, 98, 133, 21);
        }
        {
          jTextFieldMaterial = new JTextField4j();
          AbstractDocument doc = (AbstractDocument) jTextFieldMaterial.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBMaterial.field_material));
          jDesktopPane1.add(jTextFieldMaterial);
          jTextFieldMaterial.setBounds(147, 98, 119, 21);
          jTextFieldMaterial.setEnabled(false);
        }
        {
          jLabel3 = new JLabel4j_std();
          jDesktopPane1.add(jLabel3);
          jLabel3.setText(lang.get("lbl_Material_Batch"));
          jLabel3.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel3.setBounds(7, 185, 133, 21);
        }
        {
          jTextFieldBatch = new JTextField4j();
          AbstractDocument doc = (AbstractDocument) jTextFieldBatch.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBMaterialBatch.field_batch_number));
          jDesktopPane1.add(jTextFieldBatch);
          jTextFieldBatch.setBounds(147, 185, 119, 21);
          jTextFieldBatch.setEnabled(false);
        }

        {
          jLabelProcessOrder = new JLabel4j_std();
          jDesktopPane1.add(jLabelProcessOrder);
          jLabelProcessOrder.setText(lang.get("lbl_Process_Order"));
          jLabelProcessOrder.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabelProcessOrder.setBounds(7, 42, 133, 21);
        }
        {
          jTextFieldProcessOrder = new JTextField4j();
          AbstractDocument doc = (AbstractDocument) jTextFieldProcessOrder.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBProcessOrder.field_process_order));
          jDesktopPane1.add(jTextFieldProcessOrder);
          jTextFieldProcessOrder.setBounds(147, 42, 119, 21);
          jTextFieldProcessOrder.setEnabled(false);

        }
View Full Code Here


    fld_password.setLocation(137, 46);
    fld_password.setDisabledTextColor(Common.color_textdisabled);
    fld_new_password =  new JPasswordField(10);
    fld_new_password.setBounds(137, 80, 128, 22);
   
    AbstractDocument doc1 = (AbstractDocument) fld_new_password.getDocument();
    doc1.setDocumentFilter(new JFixedSizeFilter(JDBUser.field_password));
   
    fld_verify_new_password = new JPasswordField(10);
    fld_verify_new_password.setSize(128, 22);
    fld_verify_new_password.setLocation(137, 114);
   
    AbstractDocument doc2 = (AbstractDocument) fld_verify_new_password.getDocument();
    doc2.setDocumentFilter(new JFixedSizeFilter(JDBUser.field_password));

    if (DefaultUserName.equals("") == false)
    {
      fld_userName.setText(DefaultUserName);
      fld_userName.setEnabled(false);
View Full Code Here

        }
        {
          jTextFieldText = new JTextField4j();
          jTextFieldText.setBounds(130, 76, 561, 21);
          jDesktopPane1.add(jTextFieldText);
          AbstractDocument doc = (AbstractDocument) jTextFieldText.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBLanguage.field_Text_size));
          jTextFieldText.setPreferredSize(new java.awt.Dimension(40, 20));
          jTextFieldText.setFocusCycleRoot(true);
          jTextFieldText.addKeyListener(new KeyAdapter() {
            public void keyTyped(KeyEvent evt) {
              jButtonUpdate.setEnabled(true);
View Full Code Here

      jTextFieldUserID.setPreferredSize(new java.awt.Dimension(100, 20));
      jTextFieldUserID.setDisabledTextColor(Common.color_textdisabled);
      jDesktopPane1.add(jTextFieldUserID);
      jTextFieldUserID.setBounds(172, 7, 100, 20);

      AbstractDocument doc = (AbstractDocument) jTextFieldComment.getDocument();
      doc.setDocumentFilter(new JFixedSizeFilter(JDBUser.field_comment));
      jDesktopPane1.add(jTextFieldComment);
      jTextFieldComment.setBounds(172, 34, 217, 21);
      jTextFieldComment.addKeyListener(new KeyAdapter() {
        public void keyTyped(KeyEvent evt) {
          jTextFieldCommentKeyTyped(evt);
        }
      });

      jPasswordField1.setPreferredSize(new java.awt.Dimension(100, 20));
      AbstractDocument doc1 = (AbstractDocument) jPasswordField1.getDocument();
      doc1.setDocumentFilter(new JFixedSizeFilter(JDBUser.field_password));
      jDesktopPane1.add(jPasswordField1);
      jPasswordField1.setBounds(172, 62, 100, 20);
      jPasswordField1.addKeyListener(new KeyAdapter() {
        public void keyTyped(KeyEvent evt) {
          jPasswordField1KeyTyped(evt);
        }
      });

      jPasswordField2.setPreferredSize(new java.awt.Dimension(100, 20));
      AbstractDocument doc2 = (AbstractDocument) jPasswordField2.getDocument();
      doc2.setDocumentFilter(new JFixedSizeFilter(JDBUser.field_password));
      jDesktopPane1.add(jPasswordField2);
      jPasswordField2.setBounds(172, 89, 100, 20);
      jPasswordField2.addKeyListener(new KeyAdapter() {
        public void keyTyped(KeyEvent evt) {
          jPasswordField2KeyTyped(evt);
View Full Code Here

    KeyboardHandler keyboardhandler = new KeyboardHandler();
    getContentPane().setLayout(null);
    fld_userName = new JTextField4j(20);
    fld_userName.setBounds(103, 12, 150, 22);
    getContentPane().add(fld_userName);
    AbstractDocument doc1 = (AbstractDocument) fld_userName.getDocument();
    doc1.setDocumentFilter(new JFixedSizeFilter(JDBUser.field_user_id));

    fld_userName.setFont(Common.font_std);
    fld_userName.setText(System.getProperty("user.name"));
    fld_userName.setCaretPosition(fld_userName.getText().length());
    btn_close = new JButton4j("Close", Common.icon_cancel);
    btn_close.setBounds(142, 101, 104, 25);
    getContentPane().add(btn_close);
    btn_close.setMnemonic('C');
    btn_close.setToolTipText("Click to cancel logon.");
    btn_login = new JButton4j("Login", Common.icon_ok);
    btn_login.setBounds(19, 101, 104, 25);
    getContentPane().add(btn_login);
    btn_login.setMnemonic('L');
    btn_login.setToolTipText("Click to validate logon.");
    btn_login.addActionListener(buttonhandler);

    btn_login.addKeyListener(keyboardhandler);

    getRootPane().setDefaultButton(btn_login);
    chgPassword = new JCheckBox("Change Password");
    chgPassword.setBounds(81, 70, 133, 20);
    getContentPane().add(chgPassword);
    chgPassword.setFont(Common.font_std);
    chgPassword.setMnemonic('P');
    chgPassword.setToolTipText("Check to change password.");
    fld_password = new JPasswordField(10);
    fld_password.setBounds(103, 40, 150, 22);
    getContentPane().add(fld_password);
    AbstractDocument doc2 = (AbstractDocument) fld_password.getDocument();
    doc2.setDocumentFilter(new JFixedSizeFilter(JDBUser.field_password));
    fld_password.setFont(Common.font_std);

    JLabel lblUsername = new JLabel("Username :");
    lblUsername.setHorizontalAlignment(SwingConstants.TRAILING);
    lblUsername.setBounds(12, 14, 83, 16);
View Full Code Here

          jTextFieldModuleId.setBounds(164, 10, 280, 21);
          jTextFieldModuleId.setEnabled(false);
        }
        {
          jTextFieldResourceKey = new JTextField4j();
          AbstractDocument doc = (AbstractDocument) jTextFieldResourceKey.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBModule.field_description));
          jDesktopPane1.add(jTextFieldResourceKey);
          jTextFieldResourceKey.setFocusCycleRoot(true);
          jTextFieldResourceKey.setBounds(164, 35, 280, 21);
          jTextFieldResourceKey.addKeyListener(new KeyAdapter() {
            public void keyTyped(KeyEvent evt) {
              jButtonUpdate.setEnabled(true);
            }
          });
        }
        {

          jButtonUpdate = new JButton4j(Common.icon_update);
          jDesktopPane1.add(jButtonUpdate);
          jButtonUpdate.setEnabled(false);
          jButtonUpdate.setText(lang.get("btn_Save"));
          jButtonUpdate.setHorizontalTextPosition(SwingConstants.RIGHT);
          jButtonUpdate.setMnemonic(lang.getMnemonicChar());
          jButtonUpdate.setBounds(136, 345, 112, 28);
          jButtonUpdate.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {

              module.setResourceKey(jTextFieldResourceKey.getText());

              module.setIconFilename(jTextFieldIconFilename.getText());
              module.setHelpSetID(jTextFieldHelpsetid.getText());

              module.setType((String) jComboBoxType.getSelectedItem());
              module.setReportType((String) comboBox.getSelectedItem());

              if (jCheckBoxDesktop.isSelected())
                module.setDKActive("Y");
              else
                module.setDKActive("N");

              if (jCheckBoxScanner.isSelected())
                module.setRFActive("Y");
              else
                module.setRFActive("N");

              if (jCheckBoxPrintPreview.isSelected())
                module.setPrintPreview("Y");
              else
                module.setPrintPreview("N");

              if (jCheckBoxPrintDialog.isSelected())
                module.setPrintDialog("Y");
              else
                module.setPrintDialog("N");

              module.setPrintCopies(Integer.valueOf(jSpinnerPrintCopies.getValue().toString()));

              module.setReportFilename(jTextFieldReportFilename.getText());
              module.setExecFilename(jTextFieldExecFilename.getText());
              module.setExecDir(jTextFieldExecDir.getText());

              if (module.update() == false)
              {
                JUtility.errorBeep();
                JOptionPane.showMessageDialog(null, module.getErrorMessage(), "Error", JOptionPane.ERROR_MESSAGE);
              }

              jButtonUpdate.setEnabled(false);
            }
          });
        }
        {

          jButtonClose = new JButton4j(Common.icon_close);
          jDesktopPane1.add(jButtonClose);
          jButtonClose.setText(lang.get("btn_Close"));
          jButtonClose.setMnemonic(lang.getMnemonicChar());
          jButtonClose.setBounds(364, 345, 112, 28);
          jButtonClose.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              dispose();
            }
          });
        }
        {
          jLabel3 = new JLabel4j_std();
          jDesktopPane1.add(jLabel3);
          jLabel3.setText(lang.get("lbl_Module_Type"));
          jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
          jLabel3.setHorizontalTextPosition(SwingConstants.RIGHT);
          jLabel3.setBounds(0, 93, 152, 21);
        }
        {
          jLabel4 = new JLabel4j_std();
          jDesktopPane1.add(jLabel4);
          jLabel4.setText(lang.get("lbl_Module_Desktop"));
          jLabel4.setHorizontalAlignment(SwingConstants.RIGHT);
          jLabel4.setHorizontalTextPosition(SwingConstants.RIGHT);
          jLabel4.setBounds(0, 122, 152, 21);
        }
        {
          jLabel5 = new JLabel4j_std();
          jDesktopPane1.add(jLabel5);
          jLabel5.setText(lang.get("lbl_Description"));
          jLabel5.setHorizontalAlignment(SwingConstants.RIGHT);
          jLabel5.setHorizontalTextPosition(SwingConstants.RIGHT);
          jLabel5.setBounds(0, 60, 152, 21);
        }
        {
          comboBox = new JComboBox4j();
          comboBox.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
              jButtonUpdate.setEnabled(true);
            }
          });
          comboBox.setBounds(164, 206, 180, 23);
          comboBox.addItem("");
          comboBox.addItem("Standard");
          comboBox.addItem("Label");
          jDesktopPane1.add(comboBox);
        }
        {
          jComboBoxType = new JComboBox4j();
          jDesktopPane1.add(jComboBoxType);
          jComboBoxType.setEnabled(true);
          jComboBoxType.setEditable(false);
          jComboBoxType.setLightWeightPopupEnabled(true);
          jComboBoxType.setIgnoreRepaint(false);
          jComboBoxType.setBounds(164, 93, 180, 23);
          jComboBoxType.addItem("EXEC");
          jComboBoxType.addItem("FORM");
          jComboBoxType.addItem("FUNCTION");
          jComboBoxType.addItem("MENU");
          jComboBoxType.addItem("REPORT");
          jComboBoxType.addItem("USER");
          jComboBoxType.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              new_type = jComboBoxType.getSelectedItem();
              if (new_type != null)
              {
                if (new_type.equals(current_type) != true)
                {
                  // module_updated = true;
                  jButtonUpdate.setEnabled(true);
                  jButtonIconPreview.setIcon(JDBModule.getModuleIcon(jTextFieldIconFilename.getText(), (String) jComboBoxType.getSelectedItem()));
                }

                if (new_type.equals("REPORT") || new_type.equals("USER"))
                {
                  jTextFieldReportFilename.setEnabled(true);
                  jButtonReportFileChooser.setEnabled(true);
                  jCheckBoxPrintPreview.setEnabled(true);
                  jCheckBoxPrintDialog.setEnabled(true);
                  jSpinnerPrintCopies.setEnabled(true);
                  comboBox.setEnabled(true);
                }
                else
                {
                  jTextFieldReportFilename.setEnabled(false);
                  jButtonReportFileChooser.setEnabled(false);
                  jCheckBoxPrintPreview.setEnabled(false);
                  jCheckBoxPrintDialog.setEnabled(false);
                  jSpinnerPrintCopies.setEnabled(false);
                  comboBox.setEnabled(false);
                }

                if (new_type.equals("EXEC"))
                {
                  jTextFieldExecFilename.setEnabled(true);
                  jButtonExecFileChooser.setEnabled(true);
                  jTextFieldExecDir.setEnabled(true);
                  jButtonExecDirChooser.setEnabled(true);
                }
                else
                {
                  jTextFieldExecFilename.setEnabled(false);
                  jButtonExecFileChooser.setEnabled(false);
                  jTextFieldExecDir.setEnabled(false);
                  jButtonExecDirChooser.setEnabled(false);
                }
              }
            }
          });
        }
        {
          jCheckBoxScanner = new JCheckBox();
          jDesktopPane1.add(jCheckBoxScanner);
          jCheckBoxScanner.setSelected(true);
          jCheckBoxScanner.setBounds(164, 146, 21, 21);
          jCheckBoxScanner.setBackground(new java.awt.Color(255, 255, 255));
          jCheckBoxScanner.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              // module_updated = true;
              jButtonUpdate.setEnabled(true);
            }
          });
        }
        {
          jCheckBoxDesktop = new JCheckBox();
          jDesktopPane1.add(jCheckBoxDesktop);
          jCheckBoxDesktop.setSelected(true);
          jCheckBoxDesktop.setBounds(164, 122, 21, 21);
          jCheckBoxDesktop.setBackground(new java.awt.Color(255, 255, 255));
          jCheckBoxDesktop.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              // module_updated = true;
              jButtonUpdate.setEnabled(true);
            }
          });
        }
        {
          jLabel6 = new JLabel4j_std();
          jDesktopPane1.add(jLabel6);
          jLabel6.setText(lang.get("lbl_Module_Scanner"));
          jLabel6.setHorizontalAlignment(SwingConstants.RIGHT);
          jLabel6.setHorizontalTextPosition(SwingConstants.RIGHT);
          jLabel6.setBounds(0, 146, 152, 21);
        }

        {
          jLabelMnemonic = new JLabel4j_std();
          jDesktopPane1.add(jLabelMnemonic);
          jLabelMnemonic.setText(lang.get("lbl_Language_Mnemonic"));
          jLabelMnemonic.setBounds(449, 60, 112, 21);
          jLabelMnemonic.setHorizontalAlignment(SwingConstants.RIGHT);
          jLabelMnemonic.setHorizontalTextPosition(SwingConstants.RIGHT);
        }
        {
          jTextFieldMnemonic = new JTextField4j();
          jTextFieldMnemonic.setEditable(false);
          AbstractDocument doc = (AbstractDocument) jTextFieldMnemonic.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBModule.field_mneumonic));

          jDesktopPane1.add(jTextFieldMnemonic);
          jTextFieldMnemonic.setText("");

          jTextFieldMnemonic.setBounds(566, 60, 42, 21);
          jTextFieldMnemonic.setToolTipText("Character to underline");
          jTextFieldMnemonic.addKeyListener(new KeyAdapter() {
            public void keyTyped(KeyEvent evt) {
              jButtonUpdate.setEnabled(true);
            }
          });
        }
        {
          jLabel2 = new JLabel4j_std();
          jDesktopPane1.add(jLabel2);
          jLabel2.setText(lang.get("lbl_Module_Executable_Directory"));
          jLabel2.setBounds(0, 290, 152, 21);
          jLabel2.setHorizontalAlignment(SwingConstants.TRAILING);
        }
        {
          jTextFieldIconFilename = new JTextField4j();
          jDesktopPane1.add(jTextFieldIconFilename);
          jTextFieldIconFilename.setBounds(164, 177, 163, 22);
          jTextFieldIconFilename.addKeyListener(new KeyAdapter() {
            public void keyReleased(KeyEvent evt) {
              jButtonIconPreview.setIcon(JDBModule.getModuleIcon(jTextFieldIconFilename.getText(), (String) jComboBoxType.getSelectedItem()));
            }

            public void keyTyped(KeyEvent evt) {
              jButtonUpdate.setEnabled(true);
            }
          });
        }
        {
          jButtonIconFileChooser = new JButton4j();
          jDesktopPane1.add(jButtonIconFileChooser);
          jButtonIconFileChooser.setText("..");
          jButtonIconFileChooser.setBounds(327, 177, 17, 21);
          jButtonIconFileChooser.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {

              JFileChooser loadIco = new JFileChooser();

              try
              {
                File f = new File(new File("./images").getCanonicalPath());
                loadIco.setCurrentDirectory(f);
                loadIco.addChoosableFileFilter(new JFileFilterImages());
                loadIco.setSelectedFile(new File(jTextFieldIconFilename.getText()));
              }
              catch (Exception e)
              {
              }

              if (loadIco.showOpenDialog(jButtonIconFileChooser) == JFileChooser.APPROVE_OPTION)
              {
                File selectedFile;
                selectedFile = loadIco.getSelectedFile();

                if (selectedFile != null)
                {
                  if (jTextFieldIconFilename.getText().compareTo(selectedFile.getName()) != 0)
                  {
                    jTextFieldIconFilename.setText(selectedFile.getName());
                    jButtonIconPreview.setIcon(JDBModule.getModuleIcon(jTextFieldIconFilename.getText(), (String) jComboBoxType.getSelectedItem()));
                    jButtonUpdate.setEnabled(true);
                  }
                }
              }
            }
          });
        }
        {
          jButtonIconPreview = new JButton4j();
          jDesktopPane1.add(jButtonIconPreview);
          jButtonIconPreview.setBounds(292, 177, 23, 22);
          jButtonIconPreview.setBorderPainted(false);
          jButtonIconPreview.setContentAreaFilled(false);
          jButtonIconPreview.setRolloverEnabled(false);
          jButtonIconPreview.setRequestFocusEnabled(false);
        }
        {
          jTextFieldHelpsetid = new JTextField4j();
          AbstractDocument doc = (AbstractDocument) jTextFieldHelpsetid.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBModule.field_helpset_id));
          jDesktopPane1.add(jTextFieldHelpsetid);
          jTextFieldHelpsetid.setBounds(164, 317, 427, 21);
          jTextFieldHelpsetid.addKeyListener(new KeyAdapter() {
            public void keyTyped(KeyEvent evt) {
View Full Code Here

        }
        {
          jTextFieldDescription = new JTextField4j();
          jDesktopPane1.add(jTextFieldDescription);
          AbstractDocument doc = (AbstractDocument) jTextFieldDescription.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBControl.field_description));
          jTextFieldDescription.setPreferredSize(new java.awt.Dimension(40, 20));
          jTextFieldDescription.setFocusCycleRoot(true);
          jTextFieldDescription.setBounds(180, 173, 337, 21);
          jTextFieldDescription.addKeyListener(new KeyAdapter() {
            public void keyTyped(KeyEvent evt) {
View Full Code Here

          jTextFieldArchiveID.setEnabled(false);
        }
        {
          jTextFieldDescription = new JTextField4j();
          jDesktopPane1.add(jTextFieldDescription);
          AbstractDocument doc = (AbstractDocument) jTextFieldDescription.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBControl.field_key_value));
          jTextFieldDescription.setPreferredSize(new java.awt.Dimension(40, 20));
          jTextFieldDescription.setFocusCycleRoot(true);
          jTextFieldDescription.setBounds(202, 49, 260, 21);
          jTextFieldDescription.addKeyListener(new KeyAdapter() {
            public void keyTyped(KeyEvent evt) {
              jButtonUpdate.setEnabled(true);
            }
          });

        }
        {
          jTextFieldSQLTable = new JTextField4j();
          jDesktopPane1.add(jTextFieldSQLTable);
          AbstractDocument doc = (AbstractDocument) jTextFieldSQLTable.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBControl.field_description));
          jTextFieldSQLTable.setPreferredSize(new java.awt.Dimension(40, 20));
          jTextFieldSQLTable.setFocusCycleRoot(true);
          jTextFieldSQLTable.setBounds(202, 84, 260, 21);
          jTextFieldSQLTable.addKeyListener(new KeyAdapter() {
            public void keyTyped(KeyEvent evt) {
View Full Code Here

          jTextFieldSystemKey.setEnabled(false);
        }
        {
          jTextFieldKeyValue = new JTextField4j();
          jDesktopPane1.add(jTextFieldKeyValue);
          AbstractDocument doc = (AbstractDocument) jTextFieldKeyValue.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBControl.field_key_value));
          jTextFieldKeyValue.setPreferredSize(new java.awt.Dimension(40, 20));
          jTextFieldKeyValue.setFocusCycleRoot(true);
          jTextFieldKeyValue.setBounds(106, 39, 252, 21);
          jTextFieldKeyValue.addKeyListener(new KeyAdapter() {
            public void keyTyped(KeyEvent evt) {
              jButtonUpdate.setEnabled(true);
            }
          });

        }
        {
          jTextFieldDescription = new JTextField4j();
          jDesktopPane1.add(jTextFieldDescription);
          AbstractDocument doc = (AbstractDocument) jTextFieldDescription.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(JDBControl.field_description));
          jTextFieldDescription.setPreferredSize(new java.awt.Dimension(40, 20));
          jTextFieldDescription.setFocusCycleRoot(true);
          jTextFieldDescription.setBounds(106, 65, 337, 21);
          jTextFieldDescription.addKeyListener(new KeyAdapter() {
            public void keyTyped(KeyEvent evt) {
View Full Code Here

          jTextFieldMaterial.setEnabled(false);
          jTextFieldMaterial.setBounds(172, 9, 146, 21);
        }
        {
          jTextFieldDescription = new JTextField4j();
          AbstractDocument doc = (AbstractDocument) jTextFieldDescription.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(80));
          jDesktopPane1.add(jTextFieldDescription);
          jTextFieldDescription.setBounds(172, 38, 428, 21);
          jTextFieldDescription.addKeyListener(new KeyAdapter() {
            public void keyTyped(KeyEvent evt) {
              jButtonSave.setEnabled(true);
            }
          });
        }
        {
          jButtonSave = new JButton4j(Common.icon_update);
          jDesktopPane1.add(jButtonSave);
          jButtonSave.setEnabled(false);
          jButtonSave.setText(lang.get("btn_Save"));
          jButtonSave.setMnemonic(lang.getMnemonicChar());
          jButtonSave.setBounds(110, 522, 139, 32);
          jButtonSave.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              boolean result = true;

              material.setDescription(jTextFieldDescription.getText());
              material.setMaterialType(((JDBMaterialType) jComboBoxMaterialType.getSelectedItem()).getType());
              material.setBaseUom(((JDBUom) jComboBoxBaseUOM.getSelectedItem()).getInternalUom());

              material.setShelfLife((Integer) jSpinnerShelfLife.getValue());
              material.setShelfLifeUom(((JShelfLifeUom) jComboBoxShelfLifeUOM.getSelectedItem()).getUom());
              material.setShelfLifeRule(((JShelfLifeRoundingRule) jComboBoxRoundingRule.getSelectedItem()).getRule());

              material.setDefaultBatchStatus((String) jComboBoxDefaultBatchStatus.getSelectedItem());

              BigDecimal bd = new BigDecimal(0).setScale(3, BigDecimal.ROUND_HALF_UP);
              bd = BigDecimal.valueOf(grossweightnumbermodel.getNumber().doubleValue()).setScale(3, BigDecimal.ROUND_HALF_UP);
              material.setGrossWeight(bd);
              bd = BigDecimal.valueOf(netweightnumbermodel.getNumber().doubleValue()).setScale(3, BigDecimal.ROUND_HALF_UP);
              material.setNetWeight(bd);

              try
              {
                material.setWeightUom(((JDBUom) jComboBoxWeightUOM.getSelectedItem()).getInternalUom());
              }
              catch (Exception e)
              {
                material.setWeightUom("");
              }

              material.setOldMaterial(jTextFieldLegacyCode.getText());

              material.setEquipmentType(jTextFieldEquipmentType.getText());
             
              material.setInspectionID(jTextFieldInspectionID.getText());

              if (checkBoxOverridePackLabel.isSelected())
              {
                if (comboBoxPackModuleID.getSelectedItem().toString().equals(""))
                {
                  material.setOverridePackLabel("N");
                  material.setPackLabelModuleID("");
                }
                else
                {
                  material.setOverridePackLabel("Y");
                  material.setPackLabelModuleID(comboBoxPackModuleID.getSelectedItem().toString());
                }
               
              }
              else
              {
                material.setOverridePackLabel("N");
                material.setPackLabelModuleID("");
              }
             
              if (checkBoxOverridePalletLabel.isSelected())
              {
                if (comboBoxPalletModuleID.getSelectedItem().toString().equals(""))
                {
                  material.setOverridePalletLabel("N");
                  material.setPalletLabelModuleID("");
                }
                else
                {
                  material.setOverridePalletLabel("Y");
                  material.setPalletLabelModuleID(comboBoxPalletModuleID.getSelectedItem().toString());
                }
              }
              else
              {
                material.setOverridePalletLabel("N");
                material.setPalletLabelModuleID("");
             

             
             
             
              if (material.isValidMaterial() == false)
              {
                result = material.create();
                if (result == true)
                {
                  result = material.update();
                }
              }
              else
              {
                result = material.update();
              }
              if (result == false)
              {
                JOptionPane.showMessageDialog(Common.mainForm, material.getErrorMessage(), lang.get("dlg_Error"), JOptionPane.ERROR_MESSAGE,Common.icon_confirm);
              }
              else
              {
                jButtonSave.setEnabled(false);
              }

            }
          });
        }
        {
          jButtonHelp = new JButton4j(Common.icon_help);
          jDesktopPane1.add(jButtonHelp);
          jButtonHelp.setText(lang.get("btn_Help"));
          jButtonHelp.setMnemonic(lang.getMnemonicChar());
          jButtonHelp.setBounds(254, 522, 139, 32);
        }
        {
          jButtonCancel = new JButton4j(Common.icon_close);
          jDesktopPane1.add(jButtonCancel);
          jButtonCancel.setText(lang.get("btn_Close"));
          jButtonCancel.setMnemonic(lang.getMnemonicChar());
          jButtonCancel.setBounds(395, 522, 139, 32);
          jButtonCancel.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              dispose();
            }
          });
        }
        {
          ComboBoxModel<JDBUom> jComboBoxBaseUOMModel = new DefaultComboBoxModel<JDBUom>(uomList);
          jComboBoxBaseUOM = new JComboBox4j<JDBUom>();
          jDesktopPane1.add(jComboBoxBaseUOM);
          jComboBoxBaseUOM.setModel(jComboBoxBaseUOMModel);
          jComboBoxBaseUOM.setMaximumRowCount(12);
          jComboBoxBaseUOM.setBounds(172, 97, 248, 23);
          jComboBoxBaseUOM.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              jButtonSave.setEnabled(true);
            }
          });

          jComboBoxBaseUOMModel.setSelectedItem(baseuom);

        }
        {
          ComboBoxModel<JDBMaterialType> jComboBoxMaterialTypeModel = new DefaultComboBoxModel<JDBMaterialType>(typeList);
          jComboBoxMaterialType = new JComboBox4j<JDBMaterialType>();
          jDesktopPane1.add(jComboBoxMaterialType);
          jComboBoxMaterialType.setModel(jComboBoxMaterialTypeModel);
          jComboBoxMaterialType.setBounds(172, 68, 248, 23);
          jComboBoxMaterialType.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              jButtonSave.setEnabled(true);
            }
          });

          jComboBoxMaterialTypeModel.setSelectedItem(materialtype);
        }
        {
          jLabel12 = new JLabel4j_std();
          jDesktopPane1.add(jLabel12);
          jLabel12.setText(lang.get("lbl_Material_Default_Batch_Status"));
          jLabel12.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel12.setBounds(6, 332, 159, 21);
        }
        {
          jLabel13 = new JLabel4j_std();
          jDesktopPane1.add(jLabel13);
          jLabel13.setText(lang.get("lbl_Material_Shelf_Life_UOM"));
          jLabel13.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel13.setBounds(6, 155, 159, 21);
        }
        {
          ComboBoxModel<JShelfLifeUom> jComboBoxShelfLifeUOMModel = new DefaultComboBoxModel<JShelfLifeUom>(shelfLifeUomList);
          jComboBoxShelfLifeUOM = new JComboBox4j<JShelfLifeUom>();
          jDesktopPane1.add(jComboBoxShelfLifeUOM);
          jComboBoxShelfLifeUOM.setModel(jComboBoxShelfLifeUOMModel);
          jComboBoxShelfLifeUOM.setMaximumRowCount(12);
          jComboBoxShelfLifeUOM.setBounds(172, 156, 165, 21);
          jComboBoxShelfLifeUOM.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              jButtonSave.setEnabled(true);
            }
          });

          jComboBoxShelfLifeUOMModel.setSelectedItem(sluom);
        }
        {
          jLabel14 = new JLabel4j_std();
          jDesktopPane1.add(jLabel14);
          jLabel14.setText(lang.get("lbl_Material_Shelf_Life_Rounding_Rule"));
          jLabel14.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel14.setBounds(6, 184, 159, 21);
        }
        {
          ComboBoxModel<JShelfLifeRoundingRule> jComboBoxRoundingRuleModel = new DefaultComboBoxModel<JShelfLifeRoundingRule>(shelfLifeRule);
          jComboBoxRoundingRule = new JComboBox4j<JShelfLifeRoundingRule>();
          jDesktopPane1.add(jComboBoxRoundingRule);
          jComboBoxRoundingRule.setModel(jComboBoxRoundingRuleModel);
          jComboBoxRoundingRule.setBounds(172, 185, 165, 21);
          jComboBoxRoundingRule.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
              jButtonSave.setEnabled(true);
            }
          });

          jComboBoxRoundingRuleModel.setSelectedItem(slrr);
        }
        {
          jLabel1 = new JLabel4j_std();
          jDesktopPane1.add(jLabel1);
          jLabel1.setText(lang.get("lbl_Material"));
          jLabel1.setBounds(6, 8, 159, 21);
          jLabel1.setHorizontalAlignment(SwingConstants.TRAILING);
        }
        {
          jLabel3 = new JLabel4j_std();
          jDesktopPane1.add(jLabel3);
          jLabel3.setText(lang.get("lbl_Description"));
          jLabel3.setBounds(6, 38, 159, 21);
          jLabel3.setHorizontalAlignment(SwingConstants.TRAILING);
        }
        {
          jLabel5 = new JLabel4j_std();
          jDesktopPane1.add(jLabel5);
          jLabel5.setText(lang.get("lbl_Material_Base_UOM"));
          jLabel5.setBounds(6, 96, 159, 21);
          jLabel5.setHorizontalAlignment(SwingConstants.TRAILING);
        }
        {
          jLabel2 = new JLabel4j_std();
          jDesktopPane1.add(jLabel2);
          jLabel2.setText(lang.get("lbl_Material_Type"));
          jLabel2.setBounds(6, 67, 159, 21);
          jLabel2.setHorizontalAlignment(SwingConstants.TRAILING);
        }
        {
          jLabel4 = new JLabel4j_std();
          jDesktopPane1.add(jLabel4);
          jLabel4.setText(lang.get("lbl_Material_Shelf_Life"));
          jLabel4.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel4.setBounds(6, 126, 159, 21);
        }
        {
          jLabel8 = new JLabel4j_std();
          jDesktopPane1.add(jLabel8);
          jLabel8.setText(lang.get("lbl_Material_Gross_Weight"));
          jLabel8.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel8.setBounds(6, 214, 159, 21);
          jLabel8.setFocusTraversalPolicyProvider(true);
        }
        {
          jLabel9 = new JLabel4j_std();
          jDesktopPane1.add(jLabel9);
          jLabel9.setText(lang.get("lbl_Material_Net_Weight"));
          jLabel9.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel9.setBounds(6, 244, 159, 21);
        }
        {
          jLabel10 = new JLabel4j_std();
          jDesktopPane1.add(jLabel10);
          jLabel10.setText(lang.get("lbl_Material_Weight_UOM"));
          jLabel10.setHorizontalAlignment(SwingConstants.TRAILING);
          jLabel10.setBounds(6, 273, 159, 21);
        }
        {
          jTextFieldLegacyCode = new JTextField4j();
          AbstractDocument doc = (AbstractDocument) jTextFieldLegacyCode.getDocument();
          doc.setDocumentFilter(new JFixedSizeFilter(20));
          jDesktopPane1.add(jTextFieldLegacyCode);
          jTextFieldLegacyCode.setBounds(172, 303, 125, 21);
          jTextFieldLegacyCode.addKeyListener(new KeyAdapter() {
            public void keyTyped(KeyEvent evt) {
              jButtonSave.setEnabled(true);
View Full Code Here

TOP

Related Classes of javax.swing.text.AbstractDocument$SearchElement

Copyright © 2018 www.massapicom. 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.