| | |
| | | import javax.swing.JPanel; |
| | | import javax.swing.event.HyperlinkEvent; |
| | | import javax.swing.event.HyperlinkListener; |
| | | import javax.swing.text.JTextComponent; |
| | | |
| | | import org.opends.quicksetup.event.ButtonActionListener; |
| | | import org.opends.quicksetup.event.ButtonEvent; |
| | | import org.opends.quicksetup.installer.FieldName; |
| | | import org.opends.quicksetup.ProgressDescriptor; |
| | | import org.opends.quicksetup.UserData; |
| | | import org.opends.quicksetup.util.HtmlProgressMessageFormatter; |
| | |
| | | new HashMap<String, URLWorker>(); |
| | | |
| | | /** |
| | | * Creates a default instance. |
| | | * @param application Application this panel represents |
| | | */ |
| | | public QuickSetupStepPanel(GuiApplication application) { |
| | | super(application); |
| | | } |
| | | |
| | | /** |
| | | * Initializes this panel. Called soon after creation. In general this |
| | | * is where maps should be populated etc. |
| | | */ |
| | | public void initialize() { |
| | | createLayout(); |
| | | } |
| | | |
| | | /** |
| | | * Called just before the panel is shown: used to update the contents of the |
| | | * panel with new UserData (used in particular in the review panel). |
| | | * |
| | |
| | | * Creates the layout of the panel. |
| | | * |
| | | */ |
| | | protected void createLayout() |
| | | private void createLayout() |
| | | { |
| | | setLayout(new GridBagLayout()); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Commodity method that returns a JTextComponent based on a |
| | | * LabelFieldDescriptor. |
| | | * @param desc the LabelFieldDescriptor describing the JTextField. |
| | | * @param defaultValue the default value used to initialize the |
| | | * JTextComponent. |
| | | * @return a JTextComponent based on a |
| | | * LabelFieldDescriptor. |
| | | */ |
| | | protected JTextComponent makeJTextComponent(LabelFieldDescriptor desc, |
| | | String defaultValue) |
| | | { |
| | | JTextComponent field; |
| | | switch (desc.getType()) |
| | | { |
| | | case TEXTFIELD: |
| | | |
| | | field = |
| | | UIFactory.makeJTextField(defaultValue, desc.getTooltip(), desc |
| | | .getSize(), UIFactory.TextStyle.TEXTFIELD); |
| | | break; |
| | | |
| | | case PASSWORD: |
| | | |
| | | field = |
| | | UIFactory.makeJPasswordField(defaultValue, desc.getTooltip(), desc |
| | | .getSize(), UIFactory.TextStyle.PASSWORD_FIELD); |
| | | break; |
| | | |
| | | case READ_ONLY: |
| | | |
| | | field = |
| | | UIFactory.makeTextPane(defaultValue, UIFactory.TextStyle.READ_ONLY); |
| | | break; |
| | | |
| | | default: |
| | | throw new IllegalArgumentException("Unknown type: " + desc.getType()); |
| | | } |
| | | return field; |
| | | } |
| | | |
| | | /** |
| | | * Commodity method that returns a JLabel based on a LabelFieldDescriptor. |
| | | * @param desc the LabelFieldDescriptor describing the JLabel. |
| | | * @return a JLabel based on a LabelFieldDescriptor. |