AbstractIndexPanel.java revision 866cc640d33ce92abbd907d35d4c1b62f2328959
/*
* 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-2010 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* Abstract class used to refactor some code between the classes that are used
*
*/
public abstract class AbstractIndexPanel extends StatusGenericPanel
{
private static final long serialVersionUID = 4465529396749593707L;
/**
* Title panel.
*/
/**
* Attributes combo box.
*/
/**
* Name of the index label.
*/
/**
* Backends label.
*/
/**
* Read-only backend name label.
*/
/**
* Label for attribute.
*/
protected JLabel lAttribute =
/**
* Label for entry limit.
*/
protected JLabel lEntryLimit =
/**
* Entry limit text field.
*/
/**
* Label for type.
*/
/**
* Approximate index type check box.
*/
protected JCheckBox approximate =
/**
* Equality index type check box.
*/
/**
* Ordering index type check box.
*/
/**
* Presence index type check box.
*/
/**
* Substring index type check box.
*/
/**
* Delete index button.
*/
protected JButton deleteIndex =
/**
* Save changes button.
*/
protected JButton saveChanges =
/**
* Label containing some warning information (such as the fact that the index
* cannot be edited).
*/
/**
* Panel containing all the index types.
*/
/**
* LocalizableMessage to be displayed to indicate that an index is not configurable.
*/
protected LocalizableMessage NON_CONFIGURABLE_INDEX =
/**
* LocalizableMessage to be displayed to indicate that an index has been modified.
*/
/**
* Array of checkboxes.
*/
/**
* Array of index types that matches the array of checkboxes (types).
*/
protected IndexTypeDescriptor[] configTypes = {
};
/**
* Custom attributes message.
*/
protected LocalizableMessage CUSTOM_ATTRIBUTES =
/**
* Standard attributes message.
*/
protected LocalizableMessage STANDARD_ATTRIBUTES =
/**
* Minimum value for entry limit.
*/
protected final int MIN_ENTRY_LIMIT =
/**
* Maximum value for entry limit.
*/
protected final int MAX_ENTRY_LIMIT =
/**
* Default value for entry limit.
*/
protected final int DEFAULT_ENTRY_LIMIT = 4000;
/**
* Repopulates the contents of the panel with the provided attribute type. It
* will check the checkboxes for which the attribute has a matching rule.
* @param attr the attribute.
*/
{
{
{
}
{
}
{
}
{
}
}
}
/**
* Creates the basic layout of the panel.
* @param c the container of the layout.
* @param gbc the grid bag constraints to be used.
* @param nameReadOnly whether the panel is read-only or not.
*/
boolean nameReadOnly)
{
addErrorPane(c, gbc);
if (nameReadOnly)
{
p.setOpaque(false);
}
if (!nameReadOnly)
{
}
else
{
}
p.setOpaque(false);
typesPanel.setOpaque(false);
gbc2 = new GridBagConstraints();
{
}
}
/**
* Returns a sorted set of index types (that matches what the user selected
* on the check boxes).
* @return a sorted set of indexes (that matches what the user selected
* on the check boxes).
*/
{
{
if (types[i].isSelected())
{
}
}
return indexTypes;
}
/**
* Returns a list of error message with the problems encountered in the data
* provided by the user.
* @return a list of error message with the problems encountered in the data
* provided by the user.
*/
{
try
{
if ((n < MIN_ENTRY_LIMIT) ||
(n > MAX_ENTRY_LIMIT))
{
}
}
catch (Throwable t)
{
}
{
}
return errors;
}
}