Converted all CRLF to LF.
[indepmod/experimental.git] / IndependentModeler / src / cz / cvut / promod / gui / dialogs / pluginsOverview / extensions / ExtensionOverviewTabView.java
blob857d933282c046657d9ecdb5f81603973357df6f
1 package cz.cvut.promod.gui.dialogs.pluginsOverview.extensions;
3 import com.jgoodies.forms.factories.Borders;
4 import com.jgoodies.forms.layout.FormLayout;
5 import com.jgoodies.forms.layout.CellConstraints;
7 import javax.swing.*;
9 import cz.cvut.promod.services.componentFactoryService.ComponentFactoryService;
10 import cz.cvut.promod.services.ModelerSession;
11 import cz.cvut.promod.gui.dialogs.pluginsOverview.PluginsOverviewDialogView;
12 import cz.cvut.promod.gui.dialogs.pluginsOverview.PluginsOverviewDialogDialog;
14 import java.awt.*;
16 /**
17 * ProMod, master thesis project
18 * User: Petr Zverina, petr.zverina@gmail.com
19 * Date: 16:50:08, 11.2.2010
21 * Tab for basic information demonstration about the extensions.
23 public class ExtensionOverviewTabView extends JPanel {
25 protected final JList extensionList = ModelerSession.getComponentFactoryService().createList();
27 private final JLabel identifierLabel =
28 ModelerSession.getComponentFactoryService().createLabel(PluginsOverviewDialogDialog.IDENTIFIER_LABEL);
29 private final JLabel nameLabel =
30 ModelerSession.getComponentFactoryService().createLabel(PluginsOverviewDialogDialog.NAME_LABEL);
31 private final JLabel descriptionLabel =
32 ModelerSession.getComponentFactoryService().createLabel(PluginsOverviewDialogDialog.DESCRIPTION_LABEL);
33 private final JLabel extensionLabel =
34 ModelerSession.getComponentFactoryService().createLabel(PluginsOverviewDialogDialog.EXTENSION_LABEL);
36 protected final JTextField identifierTextArea =
37 ModelerSession.getComponentFactoryService().createTextField();
38 protected final JTextField nameTextArea =
39 ModelerSession.getComponentFactoryService().createTextField();
40 protected final JTextArea descriptionTextArea =
41 ModelerSession.getComponentFactoryService().createTextArea();
43 public ExtensionOverviewTabView(){
44 identifierTextArea.setEditable(false);
45 nameTextArea.setEditable(false);
46 descriptionTextArea.setEditable(false);
48 descriptionTextArea.setLineWrap(true);
49 descriptionTextArea.setWrapStyleWord(true);
51 extensionList.setFixedCellWidth(PluginsOverviewDialogView.LIST_WIDTH);
53 initLayout();
56 private void initLayout() {
57 setBorder(Borders.createEmptyBorder(ComponentFactoryService.DEFAULT_FORM_BORDER));
59 final JPanel centerPanel = ModelerSession.getComponentFactoryService().createPanel();
60 centerPanel.setBorder(Borders.createEmptyBorder(ComponentFactoryService.DEFAULT_FORM_BORDER));
62 centerPanel.setLayout(new FormLayout(
63 "pref:grow",
64 "pref, 3dlu, pref, 7dlu, pref, 3dlu, pref, 7dlu, pref, 3dlu, fill:pref:grow"
65 ));
66 final CellConstraints cellConstraints = new CellConstraints();
68 centerPanel.add(identifierLabel, cellConstraints.xy(1,1));
69 centerPanel.add(identifierTextArea, cellConstraints.xy(1,3));
70 centerPanel.add(nameLabel, cellConstraints.xy(1,5));
71 centerPanel.add(nameTextArea, cellConstraints.xy(1,7));
72 centerPanel.add(descriptionLabel, cellConstraints.xy(1,9));
73 centerPanel.add(ModelerSession.getComponentFactoryService().createScrollPane(descriptionTextArea), cellConstraints.xy(1,11));
75 JPanel listPanel = ModelerSession.getComponentFactoryService().createPanel();
76 listPanel.setLayout(new BorderLayout());
77 listPanel.add(extensionLabel, BorderLayout.NORTH);
78 listPanel.add(ModelerSession.getComponentFactoryService().createScrollPane(extensionList), BorderLayout.CENTER);
80 setLayout(new BorderLayout(PluginsOverviewDialogView.HGAP, PluginsOverviewDialogView.HGAP));
81 add(centerPanel, BorderLayout.CENTER);
82 add(listPanel, BorderLayout.WEST);