summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ContainerBindMountWindowLayout.java
blob: 2e5432b8e00780acd02bc188bf8400a88b247da3 (plain) (blame)
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
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 javax.swing.*;
import java.awt.*;

public class ContainerBindMountWindowLayout extends JDialog {

	private static final String title = "Add Bind Mount";

	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,
				modalParent != null ? ModalityType.APPLICATION_MODAL : ModalityType.MODELESS);

		GridManager grid = new GridManager(this, 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);

		//setPreferredSize(Gui.getScaledDimension(650, 350));

		setSize(350, 150);
		setResizable(false);
		//setMinimumSize(Gui.getScaledDimension(550, 650));
		if (modalParent != null) {
			Gui.centerShellOverShell(modalParent, this);
		}
	}
}