| | |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | |
| | | private JPanel detailsPanel; |
| | | private JLabel noDetailsLabel; |
| | | // The panel containing all the labels and values of the details. |
| | | /** The panel containing all the labels and values of the details. */ |
| | | private JPanel detailsSubpanel; |
| | | private JLabel logsLabel; |
| | | private JScrollPane logsScroll; |
| | |
| | | |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | /** |
| | | * Default constructor. |
| | | * |
| | | */ |
| | | /** Default constructor. */ |
| | | public ManageTasksPanel() |
| | | { |
| | | super(); |
| | | createLayout(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public LocalizableMessage getTitle() |
| | | { |
| | | return INFO_CTRL_PANEL_TASK_TO_SCHEDULE_LIST_TITLE.get(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public boolean requiresScroll() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public GenericDialog.ButtonType getButtonType() |
| | | { |
| | | return GenericDialog.ButtonType.CLOSE; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void okClicked() |
| | | { |
| | | // Nothing to do, it only contains a close button. |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public JMenuBar getMenuBar() |
| | | { |
| | |
| | | return menuBar; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Component getPreferredFocusComponent() |
| | | { |
| | | return taskTable; |
| | |
| | | add(Box.createVerticalGlue(), gbc); |
| | | cancelTask.addActionListener(new ActionListener() |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | cancelTaskClicked(); |
| | |
| | | |
| | | ListSelectionListener listener = new ListSelectionListener() |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void valueChanged(ListSelectionEvent ev) |
| | | { |
| | | tableSelected(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void configurationChanged(ConfigurationChangeEvent ev) |
| | | { |
| | | updateErrorPaneIfServerRunningAndAuthRequired(ev.getNewDescriptor(), |
| | |
| | | INFO_CTRL_PANEL_SCHEDULED_TASK_LIST_AUTHENTICATION.get()); |
| | | ServerDescriptor server = ev.getNewDescriptor(); |
| | | final Set<TaskEntry> tasks = server.getTaskEntries(); |
| | | boolean changed = tableModel.getRowCount() != tasks.size(); |
| | | if (!changed) |
| | | { |
| | | for (int i=0; i<tableModel.getRowCount(); i++) |
| | | { |
| | | if (!tasks.contains(tableModel.get(i))) |
| | | { |
| | | changed = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if (changed) |
| | | if (haveChanged(tasks)) |
| | | { |
| | | SwingUtilities.invokeLater(new Runnable() |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void run() |
| | | { |
| | | Set<String> selectedIds = getSelectedIds(); |
| | |
| | | } |
| | | } |
| | | |
| | | private boolean haveChanged(final Set<TaskEntry> tasks) |
| | | { |
| | | if (tableModel.getRowCount() != tasks.size()) |
| | | { |
| | | return true; |
| | | } |
| | | for (int i=0; i<tableModel.getRowCount(); i++) |
| | | { |
| | | if (!tasks.contains(tableModel.get(i))) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private void updateTableSizes() |
| | | { |
| | | Utilities.updateTableSizes(taskTable, 5); |
| | |
| | | super(info); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected void addMenus() |
| | | { |