1 | (gbc);↵ | | 1 | (gbc);↵
|
2 | addField(panel, templateField, gbc);↵ | | 2 | addField(panel, refNameField, gbc);↵
|
3 | resetContraints(gbc);↵ | | 3 | resetContraints(gbc);↵
|
4 | addField(panel, matchNumberField, gbc);↵ | | 4 | addField(panel, xpathQueryField, gbc);↵
|
5 | resetContraints(gbc);↵ | | 5 | resetContraints(gbc);↵
|
6 | gbc.weighty = 1;↵ | | 6 | gbc.weighty = 1;↵
|
7 | addField(panel, defaultField, gbc);↵ | | 7 | addField(panel, defaultField, gbc);↵
|
8 | return panel;↵ | | 8 | return panel;↵
|
9 | }↵ | | 9 | }↵
|
|
10 | private void addField(JPanel panel, JLabeledTextField field, GridBagConstraints gbc) {↵ | | 10 | private void addField(JPanel panel, JLabeledTextField field, GridBagConstraints gbc) {↵
|
11 | List item = field.getComponentList();↵ | | 11 | List item = field.getComponentList();↵
|
12 | panel.add((Component) item.get(0), gbc.clone());↵ | | 12 | panel.add((Component) item.get(0), gbc.clone());↵
|
13 | gbc.gridx++;↵ | | 13 | gbc.gridx++;↵
|
14 | gbc.weightx = 1;↵ | | 14 | gbc.weightx = 1;↵
|
15 | gbc.fill=GridBagConstraints.HORIZONTAL;↵ | | 15 | gbc.fill=GridBagConstraints.HORIZONTAL;↵
|
16 | panel.add((Component) item.get(1), gbc.clone());↵ | | 16 | panel.add((Component) item.get(1), gbc.clone());↵
|
17 | }↵ | | 17 | }↵
|
|
18 | // Next line↵ | | |
|
19 | private void resetContraints(GridBagConstraints gbc) {↵ | | 18 | private void resetContraints(GridBagConstraints gbc) {↵
|
20 | gbc.gridx = 0;↵ | | 19 | gbc.gridx = 0;↵
|
21 | gbc.gridy++;↵ | | 20 | gbc.gridy++;↵
|
22 | gbc.weightx = 0;↵ | | 21 | gbc.weightx = 0;↵
|
23 | gbc.fill=GridBagConstraints.NONE;↵ | | 22 | gbc.fill=GridBagConstraints.NONE;↵
|
24 | }↵ | | 23 | }↵
|
|
25 | private void initConstraints(GridBagConstraints gbc) {↵ | | 24 | private void initConstraints(GridBagConstraints gbc) {↵
|
26 | gbc.anchor = GridBagConstraints.NORTHWEST;↵ | | 25 | gbc.anchor = GridBagConstraints.NORTHWEST;↵
|
27 | gbc.fill = GridBagConstraints.NONE;↵ | | 26 | gbc.fill = GridBagConstraints.NONE;↵
|
28 | gbc.gridheight = 1;↵ | | 27 | gbc.gridheight = 1;↵
|
29 | gbc.gridwidth = 1;↵ | | 28 | gbc.gridwidth = 1;↵
|
30 | gbc.gridx = 0;↵ | | 29 | gbc.gridx = 0;↵
|
31 | gbc.gridy = 0;↵ | | 30 | gbc.gridy = 0;↵
|
32 | gbc.weightx = 0;↵ | | 31 | gbc.weightx = 0;↵
|
33 | gbc.weighty = 0;↵ | | 32 | gbc.weighty = 0;↵
|
34 | | | 33 |
|