Package open.dolphin.ui

Examples of open.dolphin.ui.MyJSheet


            }
            cc = stack;
        }
        final JButton forceEditBtn = tmpForce;
       
        MyJSheet dialog = MyJSheet.createDialog(pane, getContext().getFrame());
        dialog.addSheetListener(new SheetListener(){
            @Override
            public void optionSelected(SheetEvent se) {
                int result = se.getOption();
                if (result == 0) { // 閲覧
                    pvtModel.setState(KarteState.READ_ONLY);
                    getContext().openKarte(pvtModel);
                } else if (result == 1) { // 強制編集
                    pvtModel.setState(KarteState.toClosedState(state));
                    getContext().openKarte(pvtModel);
                }
                // それ以外はキャンセル
            }           
        });
       
        // 強制編集ボタンにショートカット登録
        ActionMap am = dialog.getRootPane().getActionMap();
        InputMap im = dialog.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
        im.put(KeyStroke.getKeyStroke(KeyEvent.VK_E, 0), "force-edit");
        am.put("force-edit", new AbstractAction() {
            @Override
            public void actionPerformed(ActionEvent e) {
                forceEditBtn.doClick();
            }
        });
       
        dialog.show();
    }
View Full Code Here

TOP

Related Classes of open.dolphin.ui.MyJSheet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.