Ejemplo n.º 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
Ejemplo n.º 2
0
  /**
   * 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);
    }
  }
Ejemplo n.º 3
0
  public void actionRefresh() {
    if (m_mLocator != null) {
      Object curValue = getValue();

      if (isReadWrite()) m_mLocator.refresh();
      if (curValue != null) {
        setValue(curValue);
      }
    }
  }
Ejemplo n.º 4
0
  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);
    }
  }
Ejemplo n.º 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
Ejemplo n.º 6
0
 @Override
 public void refreshValue() {
   if (m_mLocator != null) {
     m_mLocator.refresh();
   }
 }