Converted all CRLF to LF.
[indepmod/experimental.git] / IndependentModeler / src / cz / cvut / promod / services / projectService / dialogs / SyncDialogView.java
blob621a90e07583a5ecfc051ce863f78869f32c1ba0
1 package cz.cvut.promod.services.projectService.dialogs;
3 import cz.cvut.promod.services.ModelerSession;
4 import cz.cvut.promod.services.componentFactoryService.ComponentFactoryService;
6 import javax.swing.*;
7 import java.awt.*;
9 import com.jgoodies.forms.layout.FormLayout;
10 import com.jgoodies.forms.layout.CellConstraints;
11 import com.jgoodies.forms.factories.Borders;
13 /**
14 * ProMod, master thesis project
15 * User: Petr Zverina, petr.zverina@gmail.com
16 * Date: 22:06:00, 13.11.2009
19 /**
20 * SyncDialog view.
22 public class SyncDialogView extends JDialog {
24 private final JLabel errorsLabel = ModelerSession.getComponentFactoryService().createLabel(
25 ModelerSession.getCommonResourceBundle().getString("project.service.sync.dialog.errorlist"));
27 private final JLabel searchLocationLabel = ModelerSession.getComponentFactoryService().createLabel(
28 ModelerSession.getCommonResourceBundle().getString("project.service.sync.dialog.searching"));
30 protected final JLabel currentSearchLocationLabel = ModelerSession.getComponentFactoryService().createLabel("");
32 protected final JTextArea errorsTextArea = ModelerSession.getComponentFactoryService().createTextArea();
34 protected final JButton cancelButton = ModelerSession.getComponentFactoryService().createButton(
35 ModelerSession.getCommonResourceBundle().getString("project.service.sync.dialog.cancel"), null);
37 protected final JButton okButton = ModelerSession.getComponentFactoryService().createButton(
38 ModelerSession.getCommonResourceBundle().getString("modeler.ok"), null);
40 public SyncDialogView(final String title){
41 super(ModelerSession.getFrame(), title);
43 setLocationRelativeTo(ModelerSession.getFrame());
45 setSize(600, 350);
47 errorsTextArea.setEditable(false);
49 initLayout();
52 private void initLayout() {
53 final JPanel panel = ModelerSession.getComponentFactoryService().createPanel();
54 panel.setLayout(new BorderLayout());
55 panel.setBorder(Borders.createEmptyBorder(ComponentFactoryService.DEFAULT_FORM_BORDER));
57 final CellConstraints cellConstraints = new CellConstraints();
59 final JPanel northPanel = ModelerSession.getComponentFactoryService().createPanel();
60 northPanel.setLayout(new FormLayout(
61 "pref:grow, 10dlu, pref",
62 "pref, 3dlu, pref, 7dlu"
63 ));
65 northPanel.add(searchLocationLabel, cellConstraints.xy(1,1));
66 northPanel.add(cancelButton, cellConstraints.xy(3,1));
68 northPanel.add(currentSearchLocationLabel, cellConstraints.xyw(1, 3, 3));
70 final JPanel centerPanel = ModelerSession.getComponentFactoryService().createPanel();
71 centerPanel.setLayout(new BorderLayout());
73 centerPanel.add(errorsLabel, BorderLayout.NORTH);
74 centerPanel.add(ModelerSession.getComponentFactoryService().createScrollPane(errorsTextArea), BorderLayout.CENTER);
76 final JPanel southPanel = ModelerSession.getComponentFactoryService().createPanel();
77 southPanel.setLayout(new FormLayout(
78 "right:pref:grow",
79 "7dlu, pref"
80 ));
81 southPanel.add(okButton, cellConstraints.xy(1,2));
83 panel.add(northPanel, BorderLayout.NORTH);
84 panel.add(centerPanel, BorderLayout.CENTER);
85 panel.add(southPanel, BorderLayout.SOUTH);
86 add(panel);