예제 #1
0
 /** Create new Account and Charge */
 private void createNew() {
   log.info("");
   //  Get Input
   String value = valueField.getText();
   if (value.length() == 0) {
     valueField.setBackground(AdempierePLAF.getFieldBackground_Error());
     return;
   }
   String name = nameField.getText();
   if (name.length() == 0) {
     nameField.setBackground(AdempierePLAF.getFieldBackground_Error());
     return;
   }
   //  Create Element
   int C_ElementValue_ID = createElementValue(value, name, isExpense.isSelected());
   if (C_ElementValue_ID == 0) {
     ADialog.error(m_WindowNo, panel, "ChargeNotCreated", name);
     return;
   }
   //  Create Charge
   int C_Charge_ID = createCharge(name, C_ElementValue_ID);
   if (C_Charge_ID == 0) {
     ADialog.error(m_WindowNo, panel, "ChargeNotCreated", name);
     return;
   }
   ADialog.info(m_WindowNo, panel, "ChargeCreated", name);
 } //  createNew
예제 #2
0
 /** Update Display with Connection info */
 public void setDisplay() {
   m_text.setText(getDisplay());
   if (m_value == null) return;
   //  Text
   if (m_value.isAppsServerOK(false) || m_value.isDatabaseOK()) {
     m_text.setForeground(AdempierePLAF.getTextColor_OK());
     setBackground(false);
     if (!m_value.isAppsServerOK(false))
       m_server.setBackground(AdempierePLAF.getFieldBackground_Error());
     if (!m_value.isDatabaseOK()) m_db.setBackground(AdempierePLAF.getFieldBackground_Error());
   } else {
     m_text.setForeground(AdempierePLAF.getTextColor_Issue());
     setBackground(true);
   }
 } //  setDisplay
예제 #3
0
 /**
  * Set Background based on editable / mandatory / error
  *
  * @param error if true, set background to error color, otherwise mandatory/editable
  */
 @Override
 public void setBackground(boolean error) {
   if (error) setBackground(AdempierePLAF.getFieldBackground_Error());
   else if (!isReadWrite()) setBackground(AdempierePLAF.getFieldBackground_Inactive());
   else if (isMandatory()) setBackground(AdempierePLAF.getFieldBackground_Mandatory());
   else setBackground(AdempierePLAF.getFieldBackground_Normal());
 } //  setBackground
예제 #4
0
 /**
  * Set Background based on editable / mandatory / error
  *
  * @param error if true, set background to error color, otherwise mandatory/editable
  */
 public void setBackground(boolean error) {
   Color c = null;
   if (error) c = AdempierePLAF.getFieldBackground_Error();
   else if (!m_rw) c = AdempierePLAF.getFieldBackground_Inactive();
   else if (m_mandatory) c = AdempierePLAF.getFieldBackground_Mandatory();
   else c = AdempierePLAF.getFieldBackground_Normal();
   setBackground(c);
 } //  setBackground
예제 #5
0
 /**
  * Set Background
  *
  * @param error Error
  */
 public void setBackground(boolean error) {
   if (error) setBackground(AdempierePLAF.getFieldBackground_Error());
   else if (!m_readWrite) setBackground(AdempierePLAF.getFieldBackground_Inactive());
   else if (m_mandatory) setBackground(AdempierePLAF.getFieldBackground_Mandatory());
   else setBackground(AdempierePLAF.getInfoBackground());
 } //	setBackground