Search in sources :

Example 1 with AppsAction

use of org.compiere.apps.AppsAction in project adempiere by adempiere.

the class VCreateFromDialog method jbInit.

protected void jbInit() throws Exception {
    getContentPane().add(parameterPanel, BorderLayout.NORTH);
    JScrollPane dataPane = new JScrollPane();
    getContentPane().add(dataPane, BorderLayout.CENTER);
    dataPane.getViewport().add(dataTable, null);
    AppsAction selectAllAction = new AppsAction(SELECT_ALL, KeyStroke.getKeyStroke(KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK), null);
    CButton selectAllButton = (CButton) selectAllAction.getButton();
    selectAllButton.setMargin(new Insets(0, 10, 0, 10));
    selectAllButton.setDefaultCapable(true);
    selectAllButton.addActionListener(this);
    confirmPanel.addButton(selectAllButton);
    CPanel southPanel = new CPanel();
    getContentPane().add(southPanel, BorderLayout.SOUTH);
    BorderLayout southLayout = new BorderLayout();
    southPanel.setLayout(southLayout);
    southPanel.add(confirmPanel, BorderLayout.CENTER);
    southPanel.add(statusBar, BorderLayout.SOUTH);
    dataTable.setMultiSelection(true);
}
Also used : JScrollPane(javax.swing.JScrollPane) AppsAction(org.compiere.apps.AppsAction) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) CPanel(org.compiere.swing.CPanel) CButton(org.compiere.swing.CButton)

Example 2 with AppsAction

use of org.compiere.apps.AppsAction in project adempiere by adempiere.

the class POSSubPanel method createButtonAction.

//	dispose
/**
	 * 	Create Action Button
	 *	@param action action 
	 *	@return button
	 */
protected CButton createButtonAction(String action, KeyStroke accelerator) {
    String acceleratorText = "";
    if (action != null && accelerator != null) {
        if (accelerator != null) {
            int modifiers = accelerator.getModifiers();
            if (modifiers >= 0) {
                acceleratorText = "(" + KeyEvent.getKeyModifiersText(modifiers);
            //acceleratorText += "+";
            }
            acceleratorText += KeyEvent.getKeyText(accelerator.getKeyCode());
        }
        posPanel.addStatusBarInfo(action + acceleratorText + ")");
    }
    //AppsAction(action, accelerator, false);
    AppsAction act = new AppsAction(action, accelerator, acceleratorText, false);
    act.setDelegate(this);
    CButton button = (CButton) act.getButton();
    button.setPreferredSize(new Dimension(WIDTH, HEIGHT));
    button.setMinimumSize(new Dimension(WIDTH, HEIGHT));
    button.setMaximumSize(new Dimension(WIDTH, HEIGHT));
    return button;
}
Also used : AppsAction(org.compiere.apps.AppsAction) Dimension(java.awt.Dimension) CButton(org.compiere.swing.CButton)

Example 3 with AppsAction

use of org.compiere.apps.AppsAction in project adempiere by adempiere.

the class VBrowser method setupToolBar.

//cmd_deleteSelection
/**
	 * Instance tool bar
	 */
private void setupToolBar() {
    bOk = ConfirmPanel.createOKButton(false);
    bOk.addActionListener(this);
    bSearch = ConfirmPanel.createRefreshButton(true);
    bSearch.addActionListener(this);
    bCancel = ConfirmPanel.createCancelButton(false);
    bCancel.addActionListener(this);
    bZoom = ConfirmPanel.createZoomButton(true);
    bZoom.addActionListener(this);
    bExport = ConfirmPanel.createExportButton(true);
    bExport.addActionListener(this);
    bDelete = ConfirmPanel.createDeleteButton(true);
    bDelete.addActionListener(this);
    AppsAction selectAllAction = new AppsAction("SelectAll", null, Msg.getMsg(Env.getCtx(), "SelectAll"));
    selectAllAction.setDelegate(this);
    bSelectAll = (CButton) selectAllAction.getButton();
    toolsBar = new javax.swing.JToolBar();
}
Also used : AppsAction(org.compiere.apps.AppsAction)

Example 4 with AppsAction

use of org.compiere.apps.AppsAction in project adempiere by adempiere.

the class VCreateFromPanel method jbInit.

/**
	 * Create UI
	 */
protected void jbInit() {
    //	Set Layout
    setLayout(new BorderLayout());
    //	Add Parameter
    JScrollPane dataPane = new JScrollPane();
    dataPane.getViewport().add(dataTable, null);
    AppsAction selectAllAction = new AppsAction(SELECT_ALL, KeyStroke.getKeyStroke(KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK), null);
    CButton selectAllButton = (CButton) selectAllAction.getButton();
    selectAllButton.setMargin(new Insets(0, 10, 0, 10));
    selectAllButton.setDefaultCapable(true);
    selectAllButton.addActionListener(this);
    confirmPanel.addButton(selectAllButton);
    CPanel southPanel = new CPanel();
    BorderLayout southLayout = new BorderLayout();
    southPanel.setLayout(southLayout);
    southPanel.add(confirmPanel, BorderLayout.CENTER);
    southPanel.add(statusBar, BorderLayout.SOUTH);
    dataTable.setMultiSelection(true);
    //	Add to Main
    add(parameterPanel, BorderLayout.NORTH);
    add(dataPane, BorderLayout.CENTER);
    add(southPanel, BorderLayout.SOUTH);
}
Also used : JScrollPane(javax.swing.JScrollPane) AppsAction(org.compiere.apps.AppsAction) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) CPanel(org.compiere.swing.CPanel) CButton(org.compiere.swing.CButton)

Example 5 with AppsAction

use of org.compiere.apps.AppsAction in project adempiere by adempiere.

the class POSQuery method createButtonAction.

/**
	 * 	Create Action Button
	 *	@param action action 
	 *	@return button
	 */
protected CButton createButtonAction(String action, KeyStroke accelerator) {
    String acceleratorText = "";
    if (action != null && accelerator != null) {
        int modifiers = accelerator.getModifiers();
        if (modifiers >= 0) {
            acceleratorText = "(" + KeyEvent.getKeyModifiersText(modifiers);
        //acceleratorText += "+";
        }
        acceleratorText += KeyEvent.getKeyText(accelerator.getKeyCode());
        addStatusBarInfo(action + acceleratorText + ")");
    }
    AppsAction act = new AppsAction(action, accelerator, false);
    act.setDelegate(this);
    CButton button = (CButton) act.getButton();
    button.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT));
    button.setMinimumSize(getPreferredSize());
    button.setMaximumSize(getPreferredSize());
    button.setFocusable(false);
    return button;
}
Also used : AppsAction(org.compiere.apps.AppsAction) Dimension(java.awt.Dimension) CButton(org.compiere.swing.CButton)

Aggregations

AppsAction (org.compiere.apps.AppsAction)10 Dimension (java.awt.Dimension)6 CPanel (org.compiere.swing.CPanel)6 Insets (java.awt.Insets)5 BorderLayout (java.awt.BorderLayout)4 CButton (org.compiere.swing.CButton)4 GridBagConstraints (java.awt.GridBagConstraints)3 JScrollPane (javax.swing.JScrollPane)3 CLabel (org.compiere.swing.CLabel)3 FlowLayout (java.awt.FlowLayout)1 Font (java.awt.Font)1 GridBagLayout (java.awt.GridBagLayout)1 ImageIcon (javax.swing.ImageIcon)1 JButton (javax.swing.JButton)1 ListSelectionModel (javax.swing.ListSelectionModel)1 ColorUIResource (javax.swing.plaf.ColorUIResource)1 MigLayout (net.miginfocom.swing.MigLayout)1 AdempiereTaskPaneUI (org.adempiere.plaf.AdempiereTaskPaneUI)1 ALayout (org.compiere.apps.ALayout)1 VComboBox (org.compiere.grid.ed.VComboBox)1