コード例 #1
0
  private void dynInit() {
    fDateFrom = new WDateEditor();

    int AD_Column_ID = 2893; //  C_BPartner.C_BPartner_ID
    MLookup teacher =
        MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, AD_Column_ID, DisplayType.Search);
    fBPartner = new WSearchEditor("C_BPartner_ID", true, false, true, teacher);
    fBPartner.addValueChangeListener(this);

    AD_Column_ID = 1000734; //  CA_CourseDef.CA_CourseDef_ID
    MLookup group =
        MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, AD_Column_ID, DisplayType.TableDir);
    fGroup = new WTableDirEditor("CA_CourseDef_ID", true, false, true, group);
    fGroup.addValueChangeListener(this);

    AD_Column_ID = 1000934; //  CA_SubjectMatter.CA_SubjectMatter_ID
    MLookup subject =
        MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, AD_Column_ID, DisplayType.TableDir);
    fSubject = new WTableDirEditor("CA_SubjectMatter_ID", true, false, true, subject);
    fSubject.addValueChangeListener(this);

    for (int x = 0; x <= 4; x++) {
      PlanBookDay planDay = new PlanBookDay();
      // Add missing parameters
      planDays.add(planDay);
    }
  }
コード例 #2
0
  /**
   * Initialize Lookups
   *
   * @return true if OK
   */
  private boolean initLookups() {
    try {
      int AD_Column_ID = COLUMN_S_RESOURCE_S_RESOURCETYPE_ID; // 	S_Resource.S_ResourceType_ID

      fieldResourceType =
          new WSearchEditor(
              MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir),
              Msg.translate(Env.getCtx(), "S_ResourceType_ID"),
              "",
              false,
              false,
              true);

      AD_Column_ID =
          COLUMN_S_RESOURCEASSIGNMENT_S_RESOURCE_ID; //	S_ResourceAssignment.S_Resource_ID

      fieldResource =
          new WSearchEditor(
              MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir),
              Msg.translate(Env.getCtx(), "S_Resource_ID"),
              "",
              false,
              false,
              true);
    } catch (Exception e) {
      log.log(Level.SEVERE, "InfoAssignment.initLookup");
      return false;
    }

    bNew.setImage(ThemeManager.getThemeResource("images/New16.png"));

    return true;
  } // initLookups
  /** Dynamic Init. - Create GridController & Panel - AD_Column_ID from C_Order */
  public void dynInit() throws Exception {
    // Order Distribution
    MLookup orderL =
        MLookupFactory.get(
            Env.getCtx(),
            m_WindowNo,
            0,
            MColumn.getColumn_ID(MDDOrder.Table_Name, MDDOrder.COLUMNNAME_DD_Order_ID),
            DisplayType.Search);
    fOrder = new VLookup(MDDOrder.COLUMNNAME_DD_Order_ID, true, false, true, orderL);
    lOrder.setText(Msg.translate(Env.getCtx(), MDDOrder.COLUMNNAME_DD_Order_ID));
    fOrder.addVetoableChangeListener(this);
    lOrder.setVisible(false);
    fOrder.setVisible(false);

    MLookup llocator = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, 53950, DisplayType.TableDir);
    fLocator = new VLookup(MLocator.COLUMNNAME_M_Locator_ID, true, false, true, llocator);
    lLocator.setText(Msg.translate(Env.getCtx(), "M_Locator_ID"));
    fLocator.addVetoableChangeListener(this);
    m_M_Locator_ID = fLocator.getValue();

    MLookup llocatorto =
        MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, 53949, DisplayType.TableDir);
    fLocatorTo = new VLookup("M_LocatorTo_ID", false, false, true, llocatorto);
    lLocatorTo.setText(Msg.translate(Env.getCtx(), "M_LocatorTo_ID"));
    fLocatorTo.addVetoableChangeListener(this);
    m_M_LocatorTo_ID = fLocatorTo.getValue();

    //	C_Order.C_BPartner_ID
    MLookup bpL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, 2762, DisplayType.Search);
    fBPartner = new VLookup("C_BPartner_ID", false, false, true, bpL);
    lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
    fBPartner.addVetoableChangeListener(this);
    panel.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InventoryMoveGenerateSel"));
  } //	dynInit
コード例 #4
0
  public void initComponents() {
    lblDocumentNo = new Label(Util.cleanAmp(Msg.translate(Env.getCtx(), "DocumentNo")));
    lblDescription = new Label(Msg.translate(Env.getCtx(), "Description"));
    lblDateOrdered = new Label(Msg.translate(Env.getCtx(), "DateOrdered"));
    lblOrderRef = new Label(Msg.translate(Env.getCtx(), "POReference"));
    lblGrandTotal = new Label(Msg.translate(Env.getCtx(), "GrandTotal"));

    txtDocumentNo = new Textbox();
    txtDescription = new Textbox();
    txtOrderRef = new Textbox();

    dateFrom = new Datebox();
    dateTo = new Datebox();

    amountFrom = new NumberBox(false);
    amountTo = new NumberBox(false);

    isSoTrx = new Checkbox();
    isSoTrx.setLabel(Msg.translate(Env.getCtx(), "IsSOTrx"));
    isSoTrx.setChecked(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx")));
    MLookup lookupBP = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search);
    editorBPartner =
        new WSearchEditor(
            lookupBP, Msg.translate(Env.getCtx(), "C_BPartner_ID"), "", true, false, true);
    editorBPartner.addValueChangeListener(this);
  }
コード例 #5
0
ファイル: PayPrint.java プロジェクト: makezjdq/adempiere-1
  /** Bank changed - load PaymentRule */
  public ArrayList<ValueNamePair> loadPaymentRule(int C_PaySelection_ID) {
    ArrayList<ValueNamePair> data = new ArrayList<ValueNamePair>();

    // load PaymentRule for Bank
    int AD_Reference_ID = 195; //  MLookupInfo.getAD_Reference_ID("All_Payment Rule");
    Language language = Language.getLanguage(Env.getAD_Language(Env.getCtx()));
    MLookupInfo info = MLookupFactory.getLookup_List(language, AD_Reference_ID);
    String sql =
        info.Query.substring(0, info.Query.indexOf(" ORDER BY"))
            + " AND "
            + info.KeyColumn
            + " IN (SELECT PaymentRule FROM C_PaySelectionCheck WHERE C_PaySelection_ID=?) "
            + info.Query.substring(info.Query.indexOf(" ORDER BY"));
    try {
      PreparedStatement pstmt = DB.prepareStatement(sql, null);
      pstmt.setInt(1, C_PaySelection_ID);
      ResultSet rs = pstmt.executeQuery();
      //
      while (rs.next()) {
        ValueNamePair pp = new ValueNamePair(rs.getString(2), rs.getString(3));
        data.add(pp);
      }
      rs.close();
      pstmt.close();
    } catch (SQLException e) {
      log.log(Level.SEVERE, sql, e);
    }

    if (data.size() == 0)
      log.config("PaySel=" + C_PaySelection_ID + ", BAcct=" + m_C_BankAccount_ID + " - " + sql);

    return data;
  } //  loadPaymentRule
コード例 #6
0
  private void init() {
    label.setValue(" ");
    getComponent().setLabel(gridField.getHeader());
    getComponent().setTooltiptext(gridField.getDescription());

    String columnName = super.getColumnName();
    if (columnName.equals("PaymentRule")) {
      readReference(REFERENCE_PAYMENTRULE);
      getComponent().setImage(ThemeManager.getThemeResource("images/Payment16.png")); //  29*14
    } else if (columnName.equals("DocAction")) {
      readReference(REFERENCE_DOCUMENTACTION);
      getComponent().setImage(ThemeManager.getThemeResource("images/Process16.png")); //  16*16
    } else if (columnName.equals("CreateFrom")) {
      getComponent().setImage(ThemeManager.getThemeResource("images/Copy16.png")); //  16*16
    } else if (columnName.equals("Record_ID")) {
      getComponent().setImage(ThemeManager.getThemeResource("images/Zoom16.png")); //  16*16
      getComponent().setLabel(Msg.getMsg(Env.getCtx(), "ZoomDocument"));
    } else if (columnName.equals("Posted")) {
      readReference(REFERENCE_POSTED);
      getComponent().setImage(ThemeManager.getThemeResource("images/InfoAccount16.png")); //  16*16
    }

    if (gridField.getColumnName().endsWith("_ID")
        && !gridField.getColumnName().equals("Record_ID")) {
      m_lookup =
          MLookupFactory.get(
              Env.getCtx(),
              gridField.getWindowNo(),
              0,
              gridField.getAD_Column_ID(),
              DisplayType.Search);
    } else if (gridField.getAD_Reference_Value_ID() != 0) {
      //  Assuming List
      m_lookup =
          MLookupFactory.get(
              Env.getCtx(),
              gridField.getWindowNo(),
              0,
              gridField.getAD_Column_ID(),
              DisplayType.List);
    }
  }
コード例 #7
0
  private Info_Column createColumnInfo(final I_AD_InfoColumn field) {
    final Properties ctx = getCtx();

    String columnName = field.getAD_Element().getColumnName();
    String name = msgBL.translate(ctx, columnName);
    final int displayType = field.getAD_Reference_ID();
    Class<?> colClass = DisplayType.getClass(displayType, true);
    String colSQL =
        Check.isEmpty(field.getDisplayField(), true)
            ? field.getSelectClause()
            : field.getDisplayField();
    String idColSQL = null;

    if (DisplayType.isLookup(field.getAD_Reference_ID())) {
      colClass = KeyNamePair.class;
      idColSQL = field.getSelectClause();
      final String displayColumnSQL =
          MLookupFactory.getLookupEmbed(
              ctx,
              colSQL, // BaseColumn
              null, // BaseTable
              field.getAD_Reference_ID(),
              field.getAD_Reference_Value_ID());
      if (!Check.isEmpty(displayColumnSQL, true)) {
        colSQL = "(" + displayColumnSQL + ")";
      }
    }
    if (DisplayType.List == field.getAD_Reference_ID()) {
      columnName = field.getName();
    }
    if (columnName.endsWith("_ID")
        && DisplayType.ID == field.getAD_Reference_ID()) // should be only ID, 02883
    {
      name = " ";
      colClass = IDColumn.class;
    }

    final Info_Column ic = new Info_Column(name, columnName, colClass);
    ic.setDisplayType(displayType);
    ic.setIDcolSQL(idColSQL);
    ic.setColSQL(colSQL);
    ic.setColumnName(columnName);

    //
    // Check/Load Column Controller
    final IInfoColumnController columnController = getInfoColumnControllerOrNull(field);
    if (columnController != null) {
      ic.setColumnController(columnController);
      columnController.customize(this, ic);
    }

    return ic;
  }
コード例 #8
0
ファイル: WWFActivity.java プロジェクト: makezjdq/adempiere-1
  protected void initForm() {
    loadActivities();

    fAnswerList.setMold("select");

    bZoom.setImage("/images/Zoom16.png");
    bOK.setImage("/images/Ok24.png");

    MLookup lookup = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, 10443, DisplayType.Search);
    fForward =
        new WSearchEditor(lookup, Msg.translate(Env.getCtx(), "AD_User_ID"), "", true, false, true);

    init();
    display(-1);
  }
コード例 #9
0
ファイル: RColumn.java プロジェクト: makezjdq/adempiere-1
  /**
   * Create Report Column
   *
   * @param ctx context
   * @param columnName column name
   * @param displayType display type
   * @param sql sql (if null then columnName is used).
   * @param AD_Reference_Value_ID List/Table Reference
   * @param refColumnName UserReference column name Will be overwritten if TableDir or Search
   */
  public RColumn(
      Properties ctx,
      String columnName,
      int displayType,
      String sql,
      int AD_Reference_Value_ID,
      String refColumnName) {
    m_columnName = columnName;
    m_colHeader = Msg.translate(ctx, columnName);
    if (refColumnName != null) m_colHeader = Msg.translate(ctx, refColumnName);
    m_displayType = displayType;
    m_colSQL = sql;
    if (m_colSQL == null || m_colSQL.length() == 0) m_colSQL = columnName;

    //  Strings
    if (DisplayType.isText(displayType)) m_colClass = String.class; //  default size=30
    //  Amounts
    else if (displayType == DisplayType.Amount) {
      m_colClass = BigDecimal.class;
      m_colSize = 70;
    }
    //  Boolean
    else if (displayType == DisplayType.YesNo) m_colClass = Boolean.class;
    //  Date
    else if (DisplayType.isDate(displayType)) m_colClass = Timestamp.class;
    //  Number
    else if (displayType == DisplayType.Quantity
        || displayType == DisplayType.Number
        || displayType == DisplayType.CostPrice) {
      m_colClass = Double.class;
      m_colSize = 70;
    }
    //  Integer
    else if (displayType == DisplayType.Integer) m_colClass = Integer.class;
    //  List
    else if (displayType == DisplayType.List) {
      Language language = Language.getLanguage(Env.getAD_Language(ctx));
      m_colSQL =
          "("
              + MLookupFactory.getLookup_ListEmbed(language, AD_Reference_Value_ID, columnName)
              + ")";
      m_displaySQL = m_colSQL;
      m_colClass = String.class;
      m_isIDcol = false;
    } else if (displayType == DisplayType.ID) {
      m_colClass = Integer.class;
    }
    /**
     * Table else if (displayType == DisplayType.Table) { Language language =
     * Language.getLanguage(Env.getAD_Language(ctx)); m_colSQL += ",(" +
     * MLookupFactory.getLookup_TableEmbed( language, columnName, RModel.TABLE_ALIAS,
     * AD_Reference_Value_ID) + ")"; m_colClass = String.class; m_isIDcol = false; } *
     */
    //  TableDir, Search,...
    else {
      m_colClass = String.class;
      Language language = Language.getLanguage(Env.getAD_Language(ctx));
      if (columnName.equals("Account_ID")
          || columnName.equals("User1_ID")
          || columnName.equals("User2_ID")) {
        m_displaySQL =
            "("
                + MLookupFactory.getLookup_TableDirEmbed(
                    language, "C_ElementValue_ID", RModel.TABLE_ALIAS, columnName)
                + ")";
        m_colSQL += "," + m_displaySQL;
        m_isIDcol = true;
      } else if (columnName.startsWith("UserElement") && refColumnName != null) {
        m_displaySQL =
            "("
                + MLookupFactory.getLookup_TableDirEmbed(
                    language, refColumnName, RModel.TABLE_ALIAS, columnName)
                + ")";
        m_colSQL += "," + m_displaySQL;
        m_isIDcol = true;
      } else if (columnName.equals("C_LocFrom_ID") || columnName.equals("C_LocTo_ID")) {
        m_displaySQL =
            "("
                + MLookupFactory.getLookup_TableDirEmbed(
                    language, "C_Location_ID", RModel.TABLE_ALIAS, columnName)
                + ")";
        m_colSQL += "," + m_displaySQL;
        m_isIDcol = true;
      } else if (columnName.equals("AD_OrgTrx_ID")) {
        m_displaySQL =
            "("
                + MLookupFactory.getLookup_TableDirEmbed(
                    language, "AD_Org_ID", RModel.TABLE_ALIAS, columnName)
                + ")";
        m_colSQL += "," + m_displaySQL;
        m_isIDcol = true;
      } else if (displayType == DisplayType.TableDir) {
        m_displaySQL =
            "("
                + MLookupFactory.getLookup_TableDirEmbed(language, columnName, RModel.TABLE_ALIAS)
                + ")";
        m_colSQL += "," + m_displaySQL;
        m_isIDcol = true;
      }
    }
  } //  RColumn