| | |
| | | import org.opends.quicksetup.ProgressStep; |
| | | import org.opends.quicksetup.event.ButtonEvent; |
| | | import org.opends.quicksetup.ProgressDescriptor; |
| | | import org.opends.messages.Message; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | |
| | | /** |
| | | * This panel is used to show the progress of the application. |
| | |
| | | |
| | | private JEditorPane detailsTextArea; |
| | | |
| | | private String lastText; |
| | | private Message lastText; |
| | | |
| | | private Component lastFocusComponent; |
| | | |
| | |
| | | gbc.fill = GridBagConstraints.HORIZONTAL; |
| | | |
| | | progressBarLabel = UIFactory.makeHtmlPane( |
| | | getMsg("progressbar-initial-label"), UIFactory.PROGRESS_FONT); |
| | | INFO_PROGRESSBAR_INITIAL_LABEL.get(), |
| | | UIFactory.PROGRESS_FONT); |
| | | progressBarLabel.setOpaque(false); |
| | | progressBarLabel.setEditable(false); |
| | | progressBarLabel.setFocusable(false); |
| | |
| | | gbc.insets.top = UIFactory.TOP_INSET_PROGRESS_BAR; |
| | | gbc.insets.bottom = UIFactory.BOTTOM_INSET_PROGRESS_BAR; |
| | | panel.add(createProgressBarPanel(), gbc); |
| | | progressBar.setToolTipText(getMsg("progressbar-tooltip")); |
| | | progressBar.setToolTipText(INFO_PROGRESSBAR_TOOLTIP.get().toString()); |
| | | |
| | | JLabel l = |
| | | UIFactory.makeJLabel(UIFactory.IconType.NO_ICON, |
| | | getMsg("progress-details-label"), |
| | | INFO_PROGRESS_DETAILS_LABEL.get(), |
| | | UIFactory.TextStyle.SECONDARY_FIELD_VALID); |
| | | |
| | | gbc.insets = UIFactory.getEmptyInsets(); |
| | |
| | | String url = e.getURL().toString(); |
| | | lastText = getFormatter().getFormattedAfterUrlClick(url, |
| | | lastText); |
| | | detailsTextArea.setText(lastText); |
| | | detailsTextArea.setText(lastText.toString()); |
| | | } |
| | | } |
| | | }); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | protected String getInstructions() |
| | | protected Message getInstructions() |
| | | { |
| | | return null; |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | protected String getTitle() |
| | | protected Message getTitle() |
| | | { |
| | | return getMsg("progress-panel-title"); |
| | | return INFO_PROGRESS_PANEL_TITLE.get(); |
| | | } |
| | | |
| | | /** |
| | |
| | | public void displayProgress(ProgressDescriptor descriptor) |
| | | { |
| | | ProgressStep status = descriptor.getProgressStep(); |
| | | String summaryText = UIFactory.applyFontToHtml(descriptor |
| | | .getProgressBarMsg(), UIFactory.PROGRESS_FONT); |
| | | String summaryText = UIFactory.applyFontToHtml( |
| | | String.valueOf(descriptor.getProgressBarMsg()), |
| | | UIFactory.PROGRESS_FONT); |
| | | |
| | | if (status.isLast()) { |
| | | progressBar.setVisible(false); |
| | |
| | | progressBar.setValue(v); |
| | | } |
| | | lastText = descriptor.getDetailsMsg(); |
| | | detailsTextArea.setText(lastText); |
| | | detailsTextArea.setText(lastText.toString()); |
| | | } |
| | | |
| | | /** |
| | |
| | | gbc.fill = GridBagConstraints.HORIZONTAL; |
| | | |
| | | btnCancel = UIFactory.makeJButton( |
| | | getMsg("cancel-button-label"), |
| | | getMsg("cancel-button-tooltip")); |
| | | INFO_CANCEL_BUTTON_LABEL.get(), |
| | | INFO_CANCEL_BUTTON_TOOLTIP.get()); |
| | | btnCancel.addActionListener(new ActionListener() { |
| | | public void actionPerformed(ActionEvent e) { |
| | | GuiApplication app = getApplication(); |