DataOptionsPanel.java revision e7cac727a9231ff3602e61a4ea678e0463eb0e39
/*
* 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 2006-2009 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* This is the panel that contains the Data Options: the suffix dn, whether
* to import data to the suffix or not, etc.
*
*/
public class DataOptionsPanel extends QuickSetupStepPanel
{
private Component lastFocusComponent;
private static final long serialVersionUID = 1815782841921928118L;
private UserData defaultUserData;
private JButton ldifBrowseButton;
/**
* Constructor of the panel.
* @param application Application represented by this panel
* the fields of the panel.
*/
{
super(application);
}
/** {@inheritDoc} */
{
{
{
{
break;
}
}
} else
{
{
}
}
return value;
}
/** {@inheritDoc} */
{
{
{
if (invalid)
{
} else
{
}
} else
{
if (invalid)
{
} else
{
}
}
}
}
/** {@inheritDoc} */
protected Component createInputPanel()
{
// Add the server location widgets
return panel;
}
/**
* Returns and creates the radio buttons panel.
* @return the radio buttons panel.
*/
private JPanel createRadioButtonPanel()
{
gbc);
return panel;
}
/**
* Returns the number entries panel.
* @return the number entries panel.
*/
private JPanel createNumberEntriesPanel()
{
return panel;
}
/**
* Creates a panel with a field and a browse button.
* @param fieldName the field name of the field.
* @param browseButton the browse button.
* @return the created panel.
*/
{
return Utilities.createBrowseButtonPanel(
}
/** {@inheritDoc} */
protected LocalizableMessage getInstructions()
{
return INFO_DATA_OPTIONS_PANEL_INSTRUCTIONS.get();
}
/** {@inheritDoc} */
protected LocalizableMessage getTitle()
{
return INFO_DATA_OPTIONS_PANEL_TITLE.get();
}
/** {@inheritDoc} */
public void endDisplay()
{
if (lastFocusComponent != null)
{
}
}
/**
* Returns the default value for the provided field Name.
* @param fieldName the field name for which we want to get the default
* value.
* @return the default value for the provided field Name.
*/
{
switch (fieldName)
{
case DIRECTORY_BASE_DN:
{
}
else
{
}
break;
case DATA_OPTIONS:
break;
case LDIF_PATH:
defaults =
{
}
else
{
}
break;
case NUMBER_ENTRIES:
break;
default:
throw new IllegalArgumentException("Unknown field name: " +
}
return value;
}
/**
* Returns the default string value for the provided field Name.
* @param fieldName the field name for which we want to get the default
* string value.
* @return the default value for the provided field Name.
*/
{
if (v != null)
{
if (v instanceof String)
{
} else
{
}
}
return value;
}
/**
* Creates the components and populates the Maps with them.
*/
private void populateComponentMaps()
{
{
l.setLabelFor(field);
}
rb =
rb =
rb =
{
}
}
/**
* Returns the browse button to browse LDIF files.
* If it does not exist creates the browse button to browse LDIF files.
* @return the browse button to browse LDIF files.
*/
private JButton getLDIFBrowseButton()
{
if (ldifBrowseButton == null)
{
}
return ldifBrowseButton;
}
/**
* Adds all the required document listeners to the fields.
*/
private void addDocumentListeners()
{
{
{
}
{
}
{
}
});
}
/**
* Adds the required focus listeners to the fields.
*/
private void addFocusListeners()
{
final FocusListener l = new FocusListener()
{
public void focusGained(FocusEvent e)
{
lastFocusComponent = e.getComponent();
{
setSelected(true);
}
{
.setSelected(true);
}
}
public void focusLost(FocusEvent e)
{
}
};
{
tf.addFocusListener(l);
}
{
rb.addFocusListener(l);
}
}
/**
* Adds the required focus listeners to the fields.
*/
private void addActionListeners()
{
final ActionListener l = new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
}
};
{
rb.addActionListener(l);
}
}
/**
*/
private void checkEnablingState()
{
boolean importLDIF = getRadioButton(
boolean automaticData = getRadioButton(
isSelected();
}
/**
* Returns the label associated with the given field name.
* @param fieldName the field name for which we want to retrieve the JLabel.
* @return the label associated with the given field name.
*/
{
}
/**
* Returns the JTextComponent associated with the given field name.
* @param fieldName the field name for which we want to retrieve the
* JTextComponent.
* @return the JTextComponent associated with the given field name.
*/
{
}
/**
* Returns the JRadioButton associated with the given DataOptions.Type.
* @param type the DataOptions.Type object for which we want to retrieve the
* JRadioButton.
* @return the JRadioButton associated with the given DataOptions.Type object.
*/
{
}
}