|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
| package org.ericmignot.modeler.gui.palette; |
|
19 |
| |
|
20 |
| import java.awt.BorderLayout; |
|
21 |
| import java.util.HashMap; |
|
22 |
| import java.util.Map; |
|
23 |
| |
|
24 |
| import javax.swing.JLabel; |
|
25 |
| import javax.swing.JPanel; |
|
26 |
| import javax.swing.JTextField; |
|
27 |
| |
|
28 |
| import org.ericmignot.modeler.data.Link; |
|
29 |
| import org.ericmignot.modeler.gui.StaticValues; |
|
30 |
| |
|
31 |
| public class LinkUpdatePanel extends UpdatePanel |
|
32 |
| { |
|
33 |
| private JTextField linkLabelField; |
|
34 |
| |
|
35 |
0
| private Link getLink()
|
|
36 |
| { |
|
37 |
0
| return (Link) this.getBusinessObject();
|
|
38 |
| } |
|
39 |
| |
|
40 |
0
| public JTextField getLinkLabelField()
|
|
41 |
| { |
|
42 |
0
| return linkLabelField;
|
|
43 |
| } |
|
44 |
| |
|
45 |
0
| protected JPanel getSpecificPanel()
|
|
46 |
| { |
|
47 |
0
| JLabel linkLabel = new JLabel(StaticValues.getInstance().get("Design.Link.LabelFieldName", "Label") + " : ");
|
|
48 |
0
| this.linkLabelField = new JTextField(this.getLink().getLabel(), 20);
|
|
49 |
| |
|
50 |
0
| JPanel toReturn = new JPanel(new BorderLayout());
|
|
51 |
| |
|
52 |
0
| JPanel fieldsLabelPanel = new JPanel(new BorderLayout());
|
|
53 |
0
| fieldsLabelPanel.add(linkLabel, BorderLayout.NORTH);
|
|
54 |
| |
|
55 |
0
| JPanel fieldsValuePanel = new JPanel(new BorderLayout());
|
|
56 |
0
| fieldsValuePanel.add(linkLabelField, BorderLayout.NORTH);
|
|
57 |
| |
|
58 |
0
| toReturn.add(fieldsLabelPanel, BorderLayout.WEST);
|
|
59 |
0
| toReturn.add(fieldsValuePanel, BorderLayout.CENTER);
|
|
60 |
0
| return toReturn;
|
|
61 |
| } |
|
62 |
| |
|
63 |
0
| protected Map getNewValues()
|
|
64 |
| { |
|
65 |
0
| Map toReturn = new HashMap();
|
|
66 |
0
| toReturn.put (Link.FIELD_LABEL, this.linkLabelField.getText());
|
|
67 |
0
| return toReturn;
|
|
68 |
| } |
|
69 |
| |
|
70 |
| |
|
71 |
| } |