1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
package org.openslx.dozmod.gui.window.layout;
import org.openslx.dozmod.gui.Gui;
import org.openslx.dozmod.gui.control.QLabel;
import org.openslx.dozmod.gui.helper.GridManager;
import org.openslx.dozmod.gui.helper.StatusHeader;
import javax.swing.*;
import java.awt.*;
public class ContainerBindMountWindowLayout extends JDialog {
private static final String title = "Add Bind Mount";
protected final StatusHeader header;
protected final QLabel lblBmSource;
protected final JTextField txtBmSource;
protected final QLabel lblBmTarget;
protected final JTextField txtBmTarget;
protected final QLabel lblBmOptions;
protected final JTextField txtBmOptions;
protected final JButton btnSave;
protected final JButton btnCancel;
public ContainerBindMountWindowLayout(Window modalParent) {
super(modalParent, title, ModalityType.APPLICATION_MODAL);
setLayout(new BorderLayout());
header = new StatusHeader(getContentPane() , "Source and Target Path Required");
JPanel contentPanel = new JPanel();
add(contentPanel, BorderLayout.CENTER);
GridManager grid = new GridManager(contentPanel, 2, true, new Insets(2, 2, 2, 2));
lblBmSource = new QLabel("Source");
txtBmSource = new JTextField();
grid.add(lblBmSource);
grid.add(txtBmSource).fill(true, false).expand(true, false);
grid.nextRow();
lblBmTarget = new QLabel("Target");
txtBmTarget = new JTextField();
grid.add(lblBmTarget);
grid.add(txtBmTarget).fill(true, false).expand(true, false);
grid.nextRow();
lblBmOptions = new QLabel("Options");
txtBmOptions = new JTextField();
grid.add(lblBmOptions);
grid.add(txtBmOptions).fill(true, false).expand(true, false);
grid.nextRow();
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.LINE_AXIS));
buttonPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
buttonPane.add(Box.createHorizontalGlue());
btnCancel = new JButton("Cancel");
buttonPane.add(btnCancel);
buttonPane.add(Box.createRigidArea(new Dimension(10, 0)));
btnSave = new JButton("Save");
buttonPane.add(btnSave);
grid.add(buttonPane, 2).fill(true, false).expand(true, false);
grid.finish(false);
setSize(350, 200);
setResizable(false);
if (modalParent != null) {
Gui.centerShellOverShell(modalParent, this);
}
}
}
|