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");
136 dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
147 public boolean showDialog(@NotNull
final Component parentComponent) {
148 dialog.setLocationRelativeTo(parentComponent);
162 final GridBagConstraints gbc =
new GridBagConstraints();
164 final JComponent keyStrokePanel =
new JPanel(
new GridBagLayout());
168 gbc.fill = GridBagConstraints.HORIZONTAL;
172 final JComponent conflictsPanel =
new JPanel(
new GridBagLayout());
176 gbc.fill = GridBagConstraints.BOTH;
181 final JPanel panel =
new JPanel(
new GridBagLayout());
184 gbc.fill = GridBagConstraints.HORIZONTAL;
187 panel.add(keyStrokePanel, gbc);
189 gbc.fill = GridBagConstraints.BOTH;
191 panel.add(conflictsPanel, gbc);
214 public void setValue(@Nullable
final Object newValue) {
215 super.setValue(newValue);
216 if (newValue != UNINITIALIZED_VALUE) {
226 Action conflictAction =
null;
227 if (newKeyStroke !=
null) {
231 if (newKeyStroke.equals(tmpKeyStroke)) {
232 conflictAction = tmp;
238 if (conflictAction ==
null) {