Search in sources :

Example 1 with VDate

use of org.compiere.grid.ed.VDate in project adempiere by adempiere.

the class VTrxMaterial method dynParameter.

//  jbInit
/**
	 *  Initialize Parameter fields
	 *  @throws Exception if Lookups cannot be initialized
	 */
private void dynParameter() throws Exception {
    Properties ctx = Env.getCtx();
    //  Organization
    MLookup orgLookup = MLookupFactory.get(ctx, m_WindowNo, 0, 3660, DisplayType.TableDir);
    orgField = new VLookup("AD_Org_ID", false, false, true, orgLookup);
    //	orgField.addVetoableChangeListener(this);
    //  Locator
    MLocatorLookup locatorLookup = new MLocatorLookup(ctx, m_WindowNo);
    locatorField = new VLocator("M_Locator_ID", false, false, true, locatorLookup, m_WindowNo);
    //	locatorField.addVetoableChangeListener(this);
    //  Product
    MLookup productLookup = MLookupFactory.get(ctx, m_WindowNo, 0, 3668, DisplayType.Search);
    productField = new VLookup("M_Product_ID", false, false, true, productLookup);
    productField.addVetoableChangeListener(this);
    //  Movement Type
    MLookup mtypeLookup = MLookupFactory.get(ctx, m_WindowNo, 0, 3666, DisplayType.List);
    mtypeField = new VLookup("MovementType", false, false, true, mtypeLookup);
    //  Dates
    dateFField = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.getMsg(Env.getCtx(), "DateFrom"));
    dateTField = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.getMsg(Env.getCtx(), "DateTo"));
    //
    confirmPanel.addActionListener(this);
    statusBar.setStatusLine("");
}
Also used : MLocatorLookup(org.compiere.model.MLocatorLookup) MLookup(org.compiere.model.MLookup) VLookup(org.compiere.grid.ed.VLookup) VDate(org.compiere.grid.ed.VDate) VLocator(org.compiere.grid.ed.VLocator) Properties(java.util.Properties)

Example 2 with VDate

use of org.compiere.grid.ed.VDate in project adempiere by adempiere.

the class VCollectDetail method loadCheckPanel.

/**
	 * Load Check Panel
	 * @return void
	 */
private void loadCheckPanel() {
    //	Instance Panel
    checkPanel = new CPanel(layout);
    //	For Check No
    String m_CheckNo = Msg.translate(ctx, "CheckNo");
    fieldCheckNo = new POSTextField(m_CheckNo, keyboard);
    fieldCheckNo.setPlaceholder(m_CheckNo);
    fieldCheckNo.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
    fieldCheckNo.setFont(font);
    fieldCheckNo.addKeyListener(this);
    fieldCheckNo.addActionListener(this);
    // For Check Route No
    String m_RoutingNo = Msg.translate(ctx, "RoutingNo");
    fieldCheckRoutingNo = new POSTextField(m_RoutingNo, keyboard);
    fieldCheckRoutingNo.setPlaceholder(m_RoutingNo);
    fieldCheckRoutingNo.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
    fieldCheckRoutingNo.setFont(font);
    fieldCheckRoutingNo.addKeyListener(this);
    fieldCheckRoutingNo.addActionListener(this);
    //	For Check Date
    String languageName = Env.getAD_Language(ctx);
    Language language = Language.getLanguage(languageName);
    Language.setLoginLanguage(language);
    //	Locale
    Locale locale = language.getLocale();
    Locale.setDefault(locale);
    fieldCheckDate = new VDate(DisplayType.Date);
    fieldCheckDate.setFormat();
    fieldCheckDate.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
    fieldCheckDate.setFont(font);
    fieldCheckDate.addActionListener(this);
    //	Add To Panel
    checkPanel.add(fieldCheckRoutingNo, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
    checkPanel.add(fieldCheckNo, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
    checkPanel.add(fieldCheckDate, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
    //	Default visible false
    checkPanel.setVisible(false);
}
Also used : Locale(java.util.Locale) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) Language(org.compiere.util.Language) CPanel(org.compiere.swing.CPanel) VDate(org.compiere.grid.ed.VDate) Dimension(java.awt.Dimension)

Example 3 with VDate

use of org.compiere.grid.ed.VDate in project adempiere by adempiere.

the class QueryOrderHistory method init.

/**
	 * 	Set up Panel
	 */
@Override
protected void init() {
    setTitle(Msg.translate(Env.getCtx(), "C_Order_ID"));
    //	North
    parameterPanel.setLayout(new MigLayout("fill", "", "[50][50][]"));
    parameterPanel.setBorder(new TitledBorder(Msg.getMsg(ctx, QUERY)));
    CLabel labelDocument = new CLabel(Msg.translate(ctx, DOCUMENTNO));
    parameterPanel.add(labelDocument, " growy");
    fieldDocumentNo = new POSTextField("", posPanel.getKeyboard());
    labelDocument.setLabelFor(fieldDocumentNo);
    parameterPanel.add(fieldDocumentNo, "h 30, w 200");
    fieldDocumentNo.addActionListener(this);
    //
    CLabel labelDateFrom = new CLabel(Msg.translate(ctx, DATEORDEREDFROM));
    parameterPanel.add(labelDateFrom, "growy");
    fieldDateFrom = new VDate();
    fieldDateFrom.setValue(Env.getContextAsDate(Env.getCtx(), "#Date"));
    labelDateFrom.setLabelFor(fieldDateFrom);
    parameterPanel.add(fieldDateFrom, "h 30, w 200");
    fieldDateFrom.addVetoableChangeListener(this);
    fieldAllowDate = new CCheckBox(Msg.translate(ctx, DATE));
    fieldAllowDate.setSelected(false);
    fieldAllowDate.addActionListener(this);
    parameterPanel.add(fieldAllowDate, "wrap");
    //	
    posTable.prepareTable(columnInfos, "C_Order", "C_POS_ID = " + posPanel.getC_POS_ID(), false, "C_Order");
    posTable.growScrollbars();
    // BPartner
    CLabel labelBPartner = new CLabel(Msg.translate(ctx, BPARTNERID));
    parameterPanel.add(labelBPartner, "growy");
    fieldBPartner = new POSTextField("", posPanel.getKeyboard());
    labelBPartner.setLabelFor(fieldBPartner);
    parameterPanel.add(fieldBPartner, "h 30, w 200");
    fieldBPartner.addActionListener(this);
    // Date To
    CLabel labelDateTo = new CLabel(Msg.translate(ctx, DATEORDEREDTO));
    parameterPanel.add(labelDateTo, "growy");
    fieldDateTo = new VDate();
    fieldDateTo.setValue(Env.getContextAsDate(Env.getCtx(), "#Date"));
    labelDateTo.setLabelFor(fieldDateTo);
    parameterPanel.add(fieldDateTo, "h 30, w 200");
    fieldDateTo.addVetoableChangeListener(this);
    fieldProcessed = new CCheckBox(Msg.translate(ctx, PROCESSED));
    fieldProcessed.setSelected(false);
    fieldProcessed.addActionListener(this);
    parameterPanel.add(fieldProcessed, "");
    SwingUtilities.invokeLater(new Runnable() {

        public void run() {
            fieldDocumentNo.requestFocus();
        }
    });
    pack();
    refresh();
}
Also used : CLabel(org.compiere.swing.CLabel) POSTextField(org.adempiere.pos.POSTextField) MigLayout(net.miginfocom.swing.MigLayout) VDate(org.compiere.grid.ed.VDate) CCheckBox(org.compiere.swing.CCheckBox) TitledBorder(javax.swing.border.TitledBorder)

Example 4 with VDate

use of org.compiere.grid.ed.VDate in project adempiere by adempiere.

the class VCRPDetail method jbInit.

private void jbInit() {
    dateFrom = new VDate("DateFrom", true, false, true, DisplayType.Date, "DateFrom");
    dateTo = new VDate("DateTo", true, false, true, DisplayType.Date, "DateTo");
    CPanel northPanel = new CPanel();
    northPanel.setLayout(new java.awt.GridBagLayout());
    northPanel.add(new CLabel(Msg.translate(Env.getCtx(), "S_Resource_ID")), new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    northPanel.add(resource, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
    northPanel.add(new CLabel(Msg.translate(Env.getCtx(), "DateFrom")), new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    northPanel.add(dateFrom, new GridBagConstraints(3, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
    northPanel.add(new CLabel(Msg.translate(Env.getCtx(), "DateTo")), new GridBagConstraints(4, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    northPanel.add(dateTo, new GridBagConstraints(5, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
    ConfirmPanel confirmPanel = new ConfirmPanel(true);
    confirmPanel.addActionListener(new ActionHandler());
    contentPanel = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    contentPanel.setPreferredSize(new Dimension(800, 600));
    m_form.getWindow().getContentPane().add(northPanel, BorderLayout.NORTH);
    m_form.getWindow().getContentPane().add(contentPanel, BorderLayout.CENTER);
    m_form.getWindow().getContentPane().add(confirmPanel, BorderLayout.SOUTH);
}
Also used : CLabel(org.compiere.swing.CLabel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) ConfirmPanel(org.compiere.apps.ConfirmPanel) VDate(org.compiere.grid.ed.VDate) CPanel(org.compiere.swing.CPanel) Dimension(java.awt.Dimension) JSplitPane(javax.swing.JSplitPane)

Aggregations

VDate (org.compiere.grid.ed.VDate)4 Dimension (java.awt.Dimension)2 GridBagConstraints (java.awt.GridBagConstraints)2 Insets (java.awt.Insets)2 CLabel (org.compiere.swing.CLabel)2 CPanel (org.compiere.swing.CPanel)2 Locale (java.util.Locale)1 Properties (java.util.Properties)1 JSplitPane (javax.swing.JSplitPane)1 TitledBorder (javax.swing.border.TitledBorder)1 MigLayout (net.miginfocom.swing.MigLayout)1 POSTextField (org.adempiere.pos.POSTextField)1 ConfirmPanel (org.compiere.apps.ConfirmPanel)1 VLocator (org.compiere.grid.ed.VLocator)1 VLookup (org.compiere.grid.ed.VLookup)1 MLocatorLookup (org.compiere.model.MLocatorLookup)1 MLookup (org.compiere.model.MLookup)1 CCheckBox (org.compiere.swing.CCheckBox)1 Language (org.compiere.util.Language)1