From 4cd4ffb2771ea2d133b30273b1ffea0fef6b4552 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Tue, 17 Apr 2007 20:23:12 +0000
Subject: [PATCH] This commit introduces preliminary versions of the upgrader tool's GUI wizard panels. Effort has been made to make the panels conform to the design at
---
opends/src/quicksetup/org/opends/quicksetup/ui/DataOptionsPanel.java | 41 ++++++++++-------------------------------
1 files changed, 10 insertions(+), 31 deletions(-)
diff --git a/opends/src/quicksetup/org/opends/quicksetup/ui/DataOptionsPanel.java b/opends/src/quicksetup/org/opends/quicksetup/ui/DataOptionsPanel.java
index 7134845..86143a0 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/ui/DataOptionsPanel.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/ui/DataOptionsPanel.java
@@ -46,7 +46,6 @@
import org.opends.quicksetup.event.BrowseActionListener;
import org.opends.quicksetup.DataOptions;
-import org.opends.quicksetup.installer.FieldName;
import org.opends.quicksetup.UserData;
/**
@@ -75,16 +74,16 @@
/**
* Constructor of the panel.
- * @param defaultUserData the default values that must be used to initialize
+ * @param application Application represented by this panel
* the fields of the panel.
*/
- public DataOptionsPanel(UserData defaultUserData)
+ public DataOptionsPanel(GuiApplication application)
{
- this.defaultUserData = defaultUserData;
+ super(application);
+ this.defaultUserData = application.getUserData();
populateComponentMaps();
addDocumentListeners();
addFocusListeners();
- createLayout();
}
/**
@@ -288,30 +287,10 @@
private JPanel createBrowseButtonPanel(FieldName fieldName,
JButton browseButton)
{
- GridBagConstraints gbc = new GridBagConstraints();
-
- JPanel panel = new JPanel(new GridBagLayout());
- panel.setOpaque(false);
- gbc.insets = UIFactory.getEmptyInsets();
- gbc.gridwidth = 4;
- gbc.weightx = 0.0;
- gbc.fill = GridBagConstraints.HORIZONTAL;
- panel.add(getLabel(fieldName), gbc);
-
- gbc.insets.left = UIFactory.LEFT_INSET_SECONDARY_FIELD;
- gbc.gridwidth--;
- gbc.weightx = 0.1;
- panel.add(getField(fieldName), gbc);
-
- gbc.insets.left = UIFactory.LEFT_INSET_BROWSE;
- gbc.gridwidth = GridBagConstraints.RELATIVE;
- panel.add(browseButton, gbc);
-
- gbc.weightx = 1.0;
- gbc.gridwidth = GridBagConstraints.REMAINDER;
- panel.add(Box.createHorizontalGlue(), gbc);
-
- return panel;
+ return Utilities.createBrowseButtonPanel(
+ getLabel(fieldName),
+ getField(fieldName),
+ browseButton);
}
/**
@@ -430,11 +409,11 @@
LabelFieldDescriptor desc = hm.get(fieldName);
String defaultValue = getDefaultStringValue(fieldName);
- field = makeJTextComponent(desc, defaultValue);
+ field = UIFactory.makeJTextComponent(desc, defaultValue);
hmFields.put(fieldName, field);
- JLabel l = makeJLabel(desc);
+ JLabel l = UIFactory.makeJLabel(desc);
l.setLabelFor(field);
--
Gitblit v1.10.0