Search in sources :

Example 41 with Container

use of java.awt.Container in project adempiere by adempiere.

the class Viewer method launchProcessPara.

//	cmd_find
/**
	 * FR [ 295 ]
	 * Launch Parameters for re-query
	 * @return isOk
	 */
private boolean launchProcessPara() {
    if (m_reportEngine.getProcessInfo() == null)
        return false;
    //	Create new Instance
    ProcessInfo pi = new ProcessInfo(m_reportEngine.getProcessInfo().getTitle(), m_reportEngine.getProcessInfo().getAD_Process_ID(), m_reportEngine.getProcessInfo().getTable_ID(), m_reportEngine.getProcessInfo().getRecord_ID());
    //	Launch dialog
    ProcessModalDialog para = new ProcessModalDialog(Env.getFrame((Container) this), m_WindowNo, pi);
    if (para.isValidDialog()) {
        para.validate();
        para.pack();
        AEnv.showCenterWindow(Env.getWindow(m_WindowNo), para);
        if (para.isOK()) {
            //	execute
            ProcessCtl worker = new ProcessCtl(null, m_WindowNo, pi, true, null);
            //synchrous
            worker.run();
            //	
            ReportEngine re = ReportEngine.get(Env.getCtx(), pi);
            //	
            m_reportEngine.setQuery(re.getQuery());
            //	
            return true;
        }
    }
    //	Default
    return false;
}
Also used : Container(java.awt.Container) ProcessCtl(org.compiere.apps.ProcessCtl) ProcessInfo(org.compiere.process.ProcessInfo) ProcessModalDialog(org.compiere.apps.ProcessModalDialog)

Example 42 with Container

use of java.awt.Container in project adempiere by adempiere.

the class POSTable method growScrollbars.

/**
	 * 
	 * @return void
	 */
public void growScrollbars() {
    // fatter scroll bars
    Container p = getParent();
    if (p instanceof JViewport) {
        Container gp = p.getParent();
        if (gp instanceof JScrollPane) {
            JScrollPane scrollPane = (JScrollPane) gp;
            scrollPane.getVerticalScrollBar().setPreferredSize(new Dimension(SCROLLBAR_WIDTH, SCROLLBAR_HEIGHT));
            scrollPane.getHorizontalScrollBar().setPreferredSize(new Dimension(SCROLLBAR_WIDTH, SCROLLBAR_HEIGHT));
        }
    }
}
Also used : JScrollPane(javax.swing.JScrollPane) Container(java.awt.Container) JViewport(javax.swing.JViewport) Dimension(java.awt.Dimension)

Example 43 with Container

use of java.awt.Container in project adempiere by adempiere.

the class CompiereUtils method printParents.

/**
	 *  Print Oarent of Component
	 *  @param c component
	 */
static void printParents(JComponent c) {
    if (c.getName() == null)
        c.setName("C" + String.valueOf(s_no++));
    System.out.print(c.getName());
    System.out.print(" - " + c.getClass().getName());
    System.out.println(" ** " + c.isOpaque() + " bg=" + (c.getClientProperty(CompiereLookAndFeel.BACKGROUND) != null));
    //
    Container container = c.getParent();
    while (container != null) {
        System.out.print(" - " + container.getName() + " " + container.getClass().getName() + " ** " + container.isOpaque());
        if (container instanceof JComponent)
            System.out.print(" bg=" + (((JComponent) container).getClientProperty(CompiereLookAndFeel.BACKGROUND) != null));
        System.out.println();
        container = container.getParent();
    }
}
Also used : Container(java.awt.Container) JComponent(javax.swing.JComponent)

Example 44 with Container

use of java.awt.Container in project adempiere by adempiere.

the class CDialog method dialogInit.

/**
	 * 	Initialize.
	 * 	Install ALT-Pause
	 */
protected void dialogInit() {
    super.dialogInit();
    setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
    //	remove Mn
    setTitle(getTitle());
    //
    Container c = getContentPane();
    if (c instanceof JPanel) {
        JPanel panel = (JPanel) c;
        panel.getActionMap().put(ACTION_DISPOSE, s_dialogAction);
        panel.getInputMap(JPanel.WHEN_IN_FOCUSED_WINDOW).put(s_disposeKeyStroke, ACTION_DISPOSE);
    }
}
Also used : JPanel(javax.swing.JPanel) Container(java.awt.Container)

Example 45 with Container

use of java.awt.Container in project adempiere by adempiere.

the class CFrame method frameInit.

/**
	 * 	Frame Init.
	 * 	Install ALT-Pause
	 */
protected void frameInit() {
    super.frameInit();
    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    //
    Container c = getContentPane();
    if (c instanceof JPanel) {
        JPanel panel = (JPanel) c;
        panel.getActionMap().put(CDialog.ACTION_DISPOSE, CDialog.s_dialogAction);
        panel.getInputMap(JPanel.WHEN_IN_FOCUSED_WINDOW).put(CDialog.s_disposeKeyStroke, CDialog.ACTION_DISPOSE);
    }
}
Also used : JPanel(javax.swing.JPanel) Container(java.awt.Container)

Aggregations

Container (java.awt.Container)250 JPanel (javax.swing.JPanel)70 JLabel (javax.swing.JLabel)65 JButton (javax.swing.JButton)56 JScrollPane (javax.swing.JScrollPane)55 BoxLayout (javax.swing.BoxLayout)50 FlowLayout (java.awt.FlowLayout)49 Component (java.awt.Component)46 BorderLayout (java.awt.BorderLayout)44 Dimension (java.awt.Dimension)39 ActionEvent (java.awt.event.ActionEvent)38 ActionListener (java.awt.event.ActionListener)26 JComponent (javax.swing.JComponent)22 JFrame (javax.swing.JFrame)22 JmriJFrame (jmri.util.JmriJFrame)20 Border (javax.swing.border.Border)18 JTable (javax.swing.JTable)17 JTextArea (javax.swing.JTextArea)17 Frame (java.awt.Frame)16 JTextField (javax.swing.JTextField)16