20 package net.sf.gridarta.gui.dialog.shortcuts;
22 import java.awt.Component;
23 import java.awt.GridBagConstraints;
24 import java.awt.GridBagLayout;
25 import javax.swing.Action;
26 import javax.swing.JButton;
27 import javax.swing.JComponent;
28 import javax.swing.JDialog;
29 import javax.swing.JOptionPane;
30 import javax.swing.JPanel;
31 import javax.swing.JTextArea;
32 import javax.swing.KeyStroke;
33 import javax.swing.WindowConstants;
34 import javax.swing.border.TitledBorder;
38 import net.
sf.japi.swing.action.ActionBuilder;
39 import net.
sf.japi.swing.action.ActionBuilderFactory;
40 import net.
sf.japi.swing.action.ActionMethod;
41 import org.jetbrains.annotations.NotNull;
42 import org.jetbrains.annotations.Nullable;
59 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
127 public void keyStrokeChanged(@NotNull
final KeyStroke
keyStroke) {
143 dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
154 public boolean showDialog(@NotNull
final Component parentComponent) {
155 dialog.setLocationRelativeTo(parentComponent);
169 final GridBagConstraints gbc =
new GridBagConstraints();
171 final JComponent keyStrokePanel =
new JPanel(
new GridBagLayout());
175 gbc.fill = GridBagConstraints.HORIZONTAL;
179 final JComponent conflictsPanel =
new JPanel(
new GridBagLayout());
183 gbc.fill = GridBagConstraints.BOTH;
188 final JPanel panel =
new JPanel(
new GridBagLayout());
191 gbc.fill = GridBagConstraints.HORIZONTAL;
194 panel.add(keyStrokePanel, gbc);
196 gbc.fill = GridBagConstraints.BOTH;
198 panel.add(conflictsPanel, gbc);
221 public void setValue(@Nullable
final Object newValue) {
222 super.setValue(newValue);
223 if (newValue != UNINITIALIZED_VALUE) {
233 Action conflictAction =
null;
234 if (newKeyStroke !=
null) {
238 if (newKeyStroke.equals(tmpKeyStroke)) {
239 conflictAction = tmp;
245 if (conflictAction ==
null) {