1 package com.bonevich.erj.ui;
2
3 import com.bonevich.erj.model.Relation;
4 import com.bonevich.erj.model.KeyConstraint;
5 import com.bonevich.erj.ui.editor.KeyEditor;
6 import com.bonevich.erj.ui.editor.ModelEditor;
7
8 import org.tigris.gef.base.Globals;
9
10 import java.util.Hashtable;
11 import java.awt.Component;
12 import java.awt.Window;
13 import javax.swing.JTabbedPane;
14
15 /*** Cmd to edit the properties of a <code>KeyConstraint</code>. The loaded
16 * editor is displayed in a tabbed dialog.
17 *
18 * @see CmdProperties */
19 public class CmdEditKey extends CmdProperties
20 {
21 ////////////////////////////////////////////////////////////////
22 // Constructors
23 public CmdEditKey(KeyConstraint key)
24 {
25 this(key, Globals.curEditor().findFrame());
26 }
27
28 public CmdEditKey(KeyConstraint key, String name)
29 {
30 this(key, Globals.curEditor().findFrame(), name);
31 }
32
33 public CmdEditKey(KeyConstraint key, Window window)
34 {
35 this(key, window, "Edit Key");
36 }
37
38 public CmdEditKey(KeyConstraint key, Window window, String name)
39 {
40 super(name);
41 putValue("relation", key.getRelation());
42 putValue("key", key);
43 putValue(EDITOR_NAME, "Edit Key");
44 putValue(PARENT_WINDOW, window);
45 }
46
47 protected ModelEditor createModelEditor(Component cmp)
48 {
49 return new KeyEditor((JTabbedPane) cmp, (Relation) getValue("relation"), (KeyConstraint) getValue("key"));
50 }
51
52 } /* end class CmdEditKey */
This page was automatically generated by Maven