/** Creates the layout of the panel (but the contents are not populated here). */ private void createLayout() { GridBagConstraints gbc = new GridBagConstraints(); CardLayout cardLayout = new CardLayout(); mainPanel = new JPanel(cardLayout); mainPanel.setOpaque(false); noEntryPanel.setMessage(INFO_CTRL_PANEL_NO_SCHEMA_ITEM_SELECTED_LABEL.get()); mainPanel.add(noEntryPanel, NOTHING_SELECTED); StatusGenericPanel[] panelsWithScroll = { standardObjectClassPanel, configurationObjectClassPanel, standardAttributePanel, configurationAttributePanel, matchingRulePanel, attributeSyntaxPanel }; StatusGenericPanel[] panelsWithNoScroll = {customObjectClassPanel, customAttributePanel}; for (StatusGenericPanel panel : panelsWithScroll) { mainPanel.add(Utilities.createBorderLessScrollBar(panel), panel.getTitle().toString()); } for (StatusGenericPanel panel : panelsWithNoScroll) { mainPanel.add(panel, panel.getTitle().toString()); } cardLayout.show(mainPanel, NOTHING_SELECTED); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 1.0; gbc.weighty = 1.0; gbc.fill = GridBagConstraints.BOTH; add(mainPanel, gbc); }
/** {@inheritDoc} */ public void setInfo(ControlPanelInfo info) { super.setInfo(info); ListCellRenderer indexCellRenderer = new IndexCellRenderer(addRemove.getAvailableList(), info); addRemove.getAvailableList().setCellRenderer(indexCellRenderer); addRemove.getSelectedList().setCellRenderer(indexCellRenderer); info.addIndexModifiedListener(this); }
/** * Removes a configuration element created listener. * * @param listener the listener. */ public void removeConfigurationElementCreatedListener( ConfigurationElementCreatedListener listener) { super.removeConfigurationElementCreatedListener(listener); for (SchemaElementPanel panel : panels) { panel.removeConfigurationElementCreatedListener(listener); } }
/** {@inheritDoc} */ public void okClicked() { // Check that at least one checkbox is selected. selectedAttributes.clear(); int i = 0; for (T attribute : monitoringAttributes) { if (checkboxes[i].isSelected()) { selectedAttributes.add(attribute); } i++; } if (selectedAttributes.isEmpty()) { super.displayErrorDialog(newArrayList(INFO_CTRL_PANEL_NO_OPERATION_SELECTED.get())); } else { isCanceled = false; super.closeClicked(); } }
/** {@inheritDoc} */ public void toBeDisplayed(boolean visible) { super.toBeDisplayed(visible); Window w = Utilities.getParentDialog(this); if (w instanceof GenericDialog) { ((GenericDialog) w).getRootPane().setDefaultButton(null); } else if (w instanceof GenericFrame) { ((GenericFrame) w).getRootPane().setDefaultButton(null); } }
/** * Refresh the contents of the panel with the provided server descriptor. * * @param desc the server descriptor. */ private void refreshContents(final ServerDescriptor desc) { super.updateIndexMap(desc, hmIndexes); filterIndexes(hmIndexes); updateBaseDNComboBoxModel((DefaultComboBoxModel) baseDNs.getModel(), desc); // Check that all backends boolean allDisabled = false; for (BackendDescriptor backend : desc.getBackends()) { if (displayBackend(backend)) { if (backend.isEnabled()) { allDisabled = false; break; } } } if (!allDisabled) { updateErrorPaneAndOKButtonIfAuthRequired( desc, isLocal() ? INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_FOR_DISABLE_BACKEND.get() : INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_DETAILS.get(desc.getHostname())); } SwingUtilities.invokeLater( new Runnable() { /** {@inheritDoc} */ public void run() { ViewPositions pos; JScrollPane scroll = Utilities.getContainingScroll(RebuildIndexPanel.this); if (scroll != null) { pos = Utilities.getViewPositions(scroll); } else { pos = Utilities.getViewPositions(RebuildIndexPanel.this); } boolean comboVisible = baseDNs.getModel().getSize() > 0; baseDNs.setVisible(comboVisible); lNoBaseDNsFound.setVisible(!comboVisible); addRemove.getAvailableList().repaint(); addRemove.getSelectedList().repaint(); Utilities.updateViewPositions(pos); if (!desc.isLocal()) { displayErrorMessage( INFO_CTRL_PANEL_SERVER_REMOTE_SUMMARY.get(), INFO_CTRL_PANEL_SERVER_MUST_BE_LOCAL_REBUILD_INDEX_SUMMARY.get()); setEnabledOK(false); } else { displayMainPanel(); setEnabledOK(true); } } }); }
/** {@inheritDoc} */ public void setInfo(ControlPanelInfo info) { super.setInfo(info); treePane.setInfo(info); entryPane.setInfo(info); info.addIndexModifiedListener(this); }
/** {@inheritDoc} */ public void closeClicked() { super.closeClicked(); }
/** {@inheritDoc} */ public void cancelClicked() { setPrimaryValid(lBaseDN); setSecondaryValid(addRemove.getSelectedLabel()); super.cancelClicked(); }
/** {@inheritDoc} */ public void setInfo(ControlPanelInfo info) { super.setInfo(info); for (StatusGenericPanel panel : panels) { panel.setInfo(info); } }