}
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();
}