Search in sources :

Example 1 with SelectRowDialog

use of com.ramussoft.pb.frames.SelectRowDialog in project ramus by Vitaliy-Yakovchuk.

the class DFDObjectDialog method createFirstTab.

protected Component createFirstTab(JTabbedPane pane) {
    double[][] size = { { 5, TableLayout.MINIMUM, 5, TableLayout.FILL, 5 }, { 5, TableLayout.MINIMUM, 5, TableLayout.MINIMUM } };
    JPanel panel = new JPanel(new BorderLayout());
    JPanel c = new JPanel(new TableLayout(size));
    c.add(new JLabel("row:"), "1,1");
    c.add(qualifier, "3,1");
    c.add(new JLabel("element:"), "1,3");
    c.add(element, "3,3");
    panel.add(c, BorderLayout.NORTH);
    JPanel jPanel = new JPanel(new BorderLayout());
    JPanel jPanel2 = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    JButton button = new JButton("set_dfd_object");
    jPanel2.add(button);
    button.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            SelectRowDialog dialog = new SelectRowDialog(DFDObjectDialog.this) {
            };
            dialog.setSelectType(SelectType.RADIO);
            dialog.init(framework, dataPlugin, framework.getAccessRules());
            List<Row> list = dialog.showModal();
            if ((list != null) && (list.size() > 0)) {
                setLink(list.get(0));
            }
        }
    });
    jPanel.add(jPanel2, BorderLayout.NORTH);
    panel.add(jPanel, BorderLayout.CENTER);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) ArrayList(java.util.ArrayList) List(java.util.List) TableLayout(info.clearthought.layout.TableLayout) SelectRowDialog(com.ramussoft.pb.frames.SelectRowDialog)

Example 2 with SelectRowDialog

use of com.ramussoft.pb.frames.SelectRowDialog in project ramus by Vitaliy-Yakovchuk.

the class SectorRowsEditor method getRowSelectDialog.

private SelectRowDialog getRowSelectDialog() {
    if (rowSelectDialog == null) {
        rowSelectDialog = new SelectRowDialog(dialog) {
        };
        rowSelectDialog.init(framework, dataPlugin, accessRules);
        List<Element> hide = new ArrayList<Element>(1);
        hide.add(((com.ramussoft.database.common.Row) dataPlugin.getBaseFunction()).getElement());
        rowSelectDialog.setQuaifierHideElements(hide);
    }
    return rowSelectDialog;
}
Also used : Element(com.ramussoft.common.Element) ArrayList(java.util.ArrayList) SelectRowDialog(com.ramussoft.pb.frames.SelectRowDialog)

Example 3 with SelectRowDialog

use of com.ramussoft.pb.frames.SelectRowDialog in project ramus by Vitaliy-Yakovchuk.

the class SectorRowsEditor method addRows.

private void addRows() {
    final SelectRowDialog r = getRowSelectDialog();
    List<Row> list = r.showModal();
    if (r.isOk()) {
        addRows(list);
        List<Row> rows = selectRowPanel.getSelected();
        rows.addAll(list);
        selectRowPanel.selectRows((List) rows);
    }
}
Also used : Row(com.ramussoft.pb.Row) SelectRowDialog(com.ramussoft.pb.frames.SelectRowDialog)

Aggregations

SelectRowDialog (com.ramussoft.pb.frames.SelectRowDialog)3 ArrayList (java.util.ArrayList)2 Element (com.ramussoft.common.Element)1 Row (com.ramussoft.pb.Row)1 TableLayout (info.clearthought.layout.TableLayout)1 BorderLayout (java.awt.BorderLayout)1 FlowLayout (java.awt.FlowLayout)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 List (java.util.List)1 JButton (javax.swing.JButton)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1