示例#1
0
  /**
   * ActionListener
   *
   * @param e ActionEvent
   */
  @Override
  public void actionPerformed(ActionEvent e) {
    //	Warehouse/Product
    int only_Warehouse_ID = getOnly_Warehouse_ID();
    int only_Product_ID = getOnly_Product_ID();
    log.info("Only Warehouse_ID=" + only_Warehouse_ID + ", Product_ID=" + only_Product_ID);

    //	Text Entry ok
    if (e.getSource() == m_text && actionText(only_Warehouse_ID, only_Product_ID)) return;

    //	 Button - Start Dialog
    int M_Locator_ID = 0;
    if (m_value instanceof Integer) M_Locator_ID = ((Integer) m_value).intValue();
    //
    m_mLocator.setOnly_Warehouse_ID(only_Warehouse_ID);
    m_mLocator.setOnly_Product_ID(getOnly_Product_ID());
    VLocatorDialog ld =
        new VLocatorDialog(
            Env.getFrame(this),
            Services.get(IMsgBL.class).translate(Env.getCtx(), m_columnName),
            m_mLocator,
            M_Locator_ID,
            isMandatory(),
            only_Warehouse_ID);
    //	display
    ld.setVisible(true);
    m_mLocator.setOnly_Warehouse_ID(0);

    //	redisplay
    if (!ld.isChanged()) return;
    setValue(ld.getValue(), true);
  } //	actionPerformed
  /**
   * Set Value
   *
   * @param value value
   * @param fire data binding
   */
  private void setValue(Object value, boolean fire) {
    if (value != null) {
      m_mLocator.setOnly_Warehouse_ID(getOnly_Warehouse_ID());
      m_mLocator.setOnly_Product_ID(getOnly_Product_ID());

      if (!m_mLocator.isValid(value)) value = null;
    }

    m_value = value;
    getComponent().setText(m_mLocator.getDisplay(value)); // 	loads value

    //	Data Binding
    if (fire) {
      ValueChangeEvent val = new ValueChangeEvent(this, getColumnName(), null, value);
      fireValueChange(val);
    }
  }
  public void actionRefresh() {
    if (m_mLocator != null) {
      Object curValue = getValue();

      if (isReadWrite()) m_mLocator.refresh();
      if (curValue != null) {
        setValue(curValue);
      }
    }
  }
  public void onEvent(Event event) throws Exception {
    if (Events.ON_CLICK.equalsIgnoreCase(event.getName())) {
      //	Warehouse/Product
      int only_Warehouse_ID = getOnly_Warehouse_ID();
      int only_Product_ID = getOnly_Product_ID();

      log.config("Only Warehouse_ID=" + only_Warehouse_ID + ", Product_ID=" + only_Product_ID);

      //	Text Entry ok

      if (event.getTarget() == getComponent() && actionText(only_Warehouse_ID, only_Product_ID))
        return;

      //	 Button - Start Dialog

      int M_Locator_ID = 0;

      if (m_value instanceof Integer) M_Locator_ID = ((Integer) m_value).intValue();

      m_mLocator.setOnly_Warehouse_ID(only_Warehouse_ID);
      m_mLocator.setOnly_Product_ID(getOnly_Product_ID());

      WLocatorDialog ld =
          new WLocatorDialog(
              Msg.translate(Env.getCtx(), getColumnName()),
              m_mLocator,
              M_Locator_ID,
              isMandatory(),
              only_Warehouse_ID,
              this.m_WindowNo);

      //	display
      ld.setVisible(true);
      AEnv.showWindow(ld);

      m_mLocator.setOnly_Warehouse_ID(0);

      //	redisplay

      if (!ld.isChanged()) return;
      setValue(ld.getValue(), true);
    }
  }
示例#5
0
  /**
   * Set Value
   *
   * @param value value
   * @param fire data binding
   */
  private void setValue(Object value, boolean fire) {
    if (m_mLocator == null) {
      return;
    }

    if (value != null) {
      m_mLocator.setOnly_Warehouse_ID(getOnly_Warehouse_ID());
      m_mLocator.setOnly_Product_ID(getOnly_Product_ID());
      if (!m_mLocator.isValid(value)) value = null;
    }
    //
    m_value = value;
    m_text.setText(m_mLocator.getDisplay(value)); // 	loads value

    //	Data Binding
    try {
      fireVetoableChange(m_columnName, null, value);
    } catch (PropertyVetoException pve) {
    }
  } //	setValue
示例#6
0
 @Override
 public void refreshValue() {
   if (m_mLocator != null) {
     m_mLocator.refresh();
   }
 }