| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.Comparator; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.HashSet; |
| | |
| | | import java.util.Set; |
| | | import java.util.SortedSet; |
| | | import java.util.TreeSet; |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | |
| | | import javax.naming.NamingEnumeration; |
| | | import javax.naming.directory.SearchControls; |
| | |
| | | private static final String MAIN_PANEL = "mainPanel"; |
| | | private static final String MESSAGE_PANEL = "messagePanel"; |
| | | |
| | | private static final Logger LOG = |
| | | Logger.getLogger(StatusGenericPanel.class.getName()); |
| | | |
| | | /** |
| | | * The error pane. |
| | | */ |
| | |
| | | public void addConfigurationElementCreatedListener( |
| | | ConfigurationElementCreatedListener listener) |
| | | { |
| | | confListeners.add(listener); |
| | | getConfigurationElementCreatedListeners().add(listener); |
| | | } |
| | | |
| | | /** |
| | |
| | | public void removeConfigurationElementCreatedListener( |
| | | ConfigurationElementCreatedListener listener) |
| | | { |
| | | confListeners.remove(listener); |
| | | getConfigurationElementCreatedListeners().remove(listener); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | protected void notifyConfigurationElementCreated(Object configObject) |
| | | { |
| | | for (ConfigurationElementCreatedListener listener : confListeners) |
| | | for (ConfigurationElementCreatedListener listener : |
| | | getConfigurationElementCreatedListeners()) |
| | | { |
| | | listener.elementCreated( |
| | | new ConfigurationElementCreatedEvent(this, configObject)); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns the list of configuration listeners. |
| | | * @return the list of configuration listeners. |
| | | */ |
| | | protected List<ConfigurationElementCreatedListener> |
| | | getConfigurationElementCreatedListeners() |
| | | { |
| | | return confListeners; |
| | | } |
| | | |
| | | /** |
| | | * Notification that cancel was clicked, the panel is in charge |
| | | * of doing whatever is required (close the dialog, etc.). |
| | | * |
| | |
| | | protected void updateComboBoxModel(final Collection<?> newElements, |
| | | final DefaultComboBoxModel model) |
| | | { |
| | | updateComboBoxModel(newElements, model, null); |
| | | } |
| | | |
| | | /** |
| | | * Updates a combo box model with a number of items. |
| | | * @param newElements the new items for the combo box model. |
| | | * @param model the combo box model to be updated. |
| | | * @param comparator the object that will be used to compare the objects in |
| | | * the model. If <CODE>null</CODE>, the equals method will be used. |
| | | */ |
| | | protected void updateComboBoxModel(final Collection<?> newElements, |
| | | final DefaultComboBoxModel model, |
| | | final Comparator<Object> comparator) |
| | | { |
| | | SwingUtilities.invokeLater(new Runnable() |
| | | { |
| | | public void run() |
| | |
| | | int i = 0; |
| | | for (Object newElement : newElements) |
| | | { |
| | | changed = !newElement.equals(model.getElementAt(i)); |
| | | if (comparator == null) |
| | | { |
| | | changed = !newElement.equals(model.getElementAt(i)); |
| | | } |
| | | else |
| | | { |
| | | changed = |
| | | comparator.compare(newElement, model.getElementAt(i)) != 0; |
| | | } |
| | | if (changed) |
| | | { |
| | | break; |
| | |
| | | |
| | | if (t != null) |
| | | { |
| | | LOG.log(Level.WARNING, "Error occurred running task: "+t, t); |
| | | if ((task.getReturnCode() != null) && |
| | | (errorDetailCode != null)) |
| | | { |