1 package cz
.cvut
.promod
.services
.projectService
.dialogs
;
3 import cz
.cvut
.promod
.services
.ModelerSession
;
4 import cz
.cvut
.promod
.services
.componentFactoryService
.ComponentFactoryService
;
9 import com
.jgoodies
.forms
.layout
.FormLayout
;
10 import com
.jgoodies
.forms
.layout
.CellConstraints
;
11 import com
.jgoodies
.forms
.factories
.Borders
;
14 * ProMod, master thesis project
15 * User: Petr Zverina, petr.zverina@gmail.com
16 * Date: 22:06:00, 13.11.2009
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());
47 errorsTextArea
.setEditable(false);
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"
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(
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
);