/*
* 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
* 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
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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-2010 Sun Microsystems, Inc.
*/
/**
* This is the panel that contains the Server Settings: the port, the Directory
* Manager DN, etc.
*
*/
{
private boolean displayServerLocation;
private boolean canUpdateSecurity;
/**
* Constructor of the panel.
* @param application Application this panel represents
* the fields of the panel.
*/
{
super(application);
this.displayServerLocation = isWebStart();
}
/**
* {@inheritDoc}
*/
{
{
{
}
{
{
} else
{
}
}
}
{
}
else
{
{
}
}
return value;
}
/**
* {@inheritDoc}
*/
{
{
if (invalid)
{
} else
{
}
}
}
/**
* {@inheritDoc}
*/
{
FieldName[] fieldNames =
{
};
// ancient style ...
datadirTF.setEditable(false);
// Add the server location widgets
{
}
// Add the other widgets
if (isSecurityField)
{
}
else
{
}
boolean isAdminConnectorPortField =
if (isPortField || isAdminConnectorPortField ||
{
}
else
{
}
if (isSecurityField)
{
if (canUpdateSecurity)
{
}
else
{
}
}
else
{
}
if (isPortField)
{
JLabel l =
}
else if (isAdminConnectorPortField)
{
JLabel l =
}
else if (isSecurityField && canUpdateSecurity)
{
}
}
return panel;
}
/**
* {@inheritDoc}
*/
{
if (Utils.isWebStart())
{
}
else
{
return INFO_SERVER_SETTINGS_PANEL_INSTRUCTIONS.get();
}
}
/**
* {@inheritDoc}
*/
{
return INFO_SERVER_SETTINGS_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 SERVER_LOCATION:
break;
case HOST_NAME:
break;
case SERVER_PORT:
{
}
else
{
value = "";
}
break;
case ADMIN_CONNECTOR_PORT:
{
}
else
{
value = "";
}
break;
case DIRECTORY_MANAGER_DN:
break;
case DIRECTORY_MANAGER_PWD:
break;
break;
case SECURITY_OPTIONS:
true);
break;
default:
throw new IllegalArgumentException("Unknown field name: " +
}
return value;
}
/**
* Creates the components and populates the Maps with them.
*/
private void populateLabelAndFieldMaps()
{
new LabelFieldDescriptor(
{
{
}
else
{
}
}
/* Create the elements for the location */
desc =
if (defaultPath != null)
{
if (index != -1)
{
}
}
}
/**
* Returns the browse button.
* If it does not exist creates the browse button.
* @return the browse button.
*/
{
if (browseButton == null)
{
getMainWindow());
}
return browseButton;
}
/**
* Returns the configure secure access button.
* If it does not exist creates the secure access button.
* @return the secure access button.
*/
{
if (secureAccessButton == null)
{
{
{
if (!getConfigureSecureAccessDialog().isCanceled())
{
}
}
});
}
return secureAccessButton;
}
/**
* 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.
*/
{
}
/**
* Adds the required focus listeners to the fields.
*/
private void addFocusListeners()
{
final FocusListener l = new FocusListener()
{
public void focusGained(FocusEvent e)
{
lastFocusComponent = e.getComponent();
}
public void focusLost(FocusEvent e)
{
}
};
{
tf.addFocusListener(l);
}
if (Utils.isWebStart())
{
}
else
{
}
}
/**
* Returns the port help message that we display when we cannot use the
* default admin connector port (4444).
* @return the port help message that we display when we cannot use the
* default admin connector port (4444).
*/
{
{
}
return s;
}
/**
* Returns the port help message that we display when we cannot use the
* default port (389).
* @return the port help message that we display when we cannot use the
* default port (389).
*/
{
{
s = INFO_CANNOT_USE_DEFAULT_PORT.get();
}
return s;
}
{
{
}
return dlg;
}
}