RebuildIndexPanel.java revision ca669ae54f86dbeea277280690584d9f591c7571
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008-2009 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* The panel that appears when the user wants to rebuild indexes.
*
*/
public class RebuildIndexPanel extends StatusGenericPanel
implements IndexModifiedListener
{
private static final long serialVersionUID = -4805445967165643375L;
private JLabel lNoBaseDNsFound;
/**
* Constructor of the panel.
*
*/
public RebuildIndexPanel()
{
super();
createLayout();
}
/**
* {@inheritDoc}
*/
{
}
/**
* {@inheritDoc}
*/
{
}
/**
* Creates the layout of the panel (but the contents are not populated here).
*/
private void createLayout()
{
{
/**
* {@inheritDoc}
*/
{
}
});
lNoBaseDNsFound.setVisible(false);
lIndexes =
AbstractIndexDescriptor.class);
}
/**
* {@inheritDoc}
*/
{
info.addIndexModifiedListener(this);
}
/**
* {@inheritDoc}
*/
public LocalizableMessage getTitle()
{
return INFO_CTRL_PANEL_REBUILD_INDEXES_TITLE.get();
}
/**
* {@inheritDoc}
*/
public Component getPreferredFocusComponent()
{
return baseDNs;
}
/**
* {@inheritDoc}
*/
{
}
/**
* Refresh the contents of the panel with the provided server descriptor.
* @param desc the server descriptor.
*/
{
// Check that all backends
boolean allDisabled = false;
{
{
allDisabled = false;
break;
}
}
if (!allDisabled)
{
isLocal() ?
}
{
/**
* {@inheritDoc}
*/
public void run()
{
{
}
else
{
}
{
setEnabledOK(false);
}
else
{
setEnabledOK(true);
}
}
});
}
/**
* {@inheritDoc}
*/
public void cancelClicked()
{
super.cancelClicked();
}
/**
* {@inheritDoc}
*/
public void okClicked()
{
{
{
}
else
{
}
}
{
}
{
getInfo());
{
}
boolean confirmed = true;
{
}
{
null,
progressDialog.setVisible(true);
}
}
{
}
}
/**
* {@inheritDoc}
*/
{
return !backend.isConfigBackend() &&
}
private String getSelectedBaseDN()
{
if (o != null)
{
}
return dn;
}
private void filterIndexes(
{
// Remove the indexes that are not to be added.
{
new ArrayList<AbstractIndexDescriptor>();
{
if (!mustBeDisplayed(index))
{
}
}
}
}
{
boolean mustBeDisplayed = true;
if (index instanceof IndexDescriptor)
{
{
{
mustBeDisplayed = false;
break;
}
}
}
return mustBeDisplayed;
}
}