/*
* 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 2011 ForgeRock AS
*/
/**
* The panel that displays a custom attribute definition.
*
*/
{
};
private boolean ignoreChangeEvents;
/**
* Default constructor of the panel.
*
*/
public CustomAttributePanel()
{
super();
createLayout();
}
/**
* {@inheritDoc}
*/
{
return INFO_CTRL_PANEL_CUSTOM_ATTRIBUTE_TITLE.get();
}
/**
* Creates the layout of the panel (but the contents are not populated here).
*/
protected void createLayout()
{
p.setOpaque(false);
createBasicLayout(p, gbc);
gbc = new GridBagConstraints();
{
/**
* {@inheritDoc}
*/
{
}
});
saveChanges.setOpaque(false);
{
/**
* {@inheritDoc}
*/
{
saveChanges(false, errors);
}
});
}
/**
* Creates the basic layout of the panel.
* @param c the container where all the components will be layed out.
* @param gbc the grid bag constraints.
*/
{
addErrorPane(c, gbc);
};
{
new Object[]{defaultValues[i]});
}
{
}
syntax};
new BasicExpander(
};
}
};
{
p.setOpaque(false);
{
/**
* {@inheritDoc}
*/
public void stateChanged(ChangeEvent e)
{
}
};
expander.setSelected(false);
}
{
/**
* {@inheritDoc}
*/
{
{
}
}
};
};
{
if (i == 0)
{
}
else
{
}
if (i == 0)
{
}
else
{
}
{
/**
* {@inheritDoc}
*/
{
{
}
}
};
{
/**
* {@inheritDoc}
*/
{
{
}
}
};
}
{
/**
* {@inheritDoc}
*/
{
}
/**
* {@inheritDoc}
*/
{
}
/**
* {@inheritDoc}
*/
{
}
};
{
}
{
{
}
};
{
}
obsolete};
{
}
}
/**
* {@inheritDoc}
*/
public boolean mustCheckUnsavedChanges()
{
return saveChanges.isEnabled();
}
/**
* {@inheritDoc}
*/
{
attribute.getNameOrOID()));
Utilities.getParentDialog(this));
unsavedChangesDlg.setVisible(true);
{
saveChanges(true, errors);
{
}
}
return result;
}
/**
* {@inheritDoc}
*/
public boolean requiresScroll()
{
return false;
}
/**
* {@inheritDoc}
*/
{
ignoreChangeEvents = true;
if (n == null)
{
n = "";
}
n = attr.getDescription();
if (n == null)
{
n = "";
}
description.setText(n);
{
}
else
{
}
lastAliases.clear();
{
sOrigin = "";
}
{
sFile = "";
}
};
{
{
}
else
{
}
}
{
{
}
}
{
}
{
{
}
}
{
}
{
}
saveChanges.setEnabled(false);
ignoreChangeEvents = false;
}
/**
* {@inheritDoc}
*/
{
new ArrayList<AttributeSyntax<?>>();
boolean schemaChanged;
{
}
{
schemaChanged = true;
}
{
schemaChanged = false;
}
else
{
schemaChanged = false;
}
if (schemaChanged)
{
schema = s;
AttributeSyntax<?>>();
{
{
}
}
{
}
AttributeType>();
{
}
orderedKeys.clear();
{
}
new ArrayList<MatchingRule>();
MatchingRule>();
{
}
orderedKeys.clear();
{
if (matchingRule instanceof ApproximateMatchingRule)
{
}
else if (matchingRule instanceof EqualityMatchingRule)
{
}
else if (matchingRule instanceof OrderingMatchingRule)
{
}
else if (matchingRule instanceof SubstringMatchingRule)
{
}
}
{
{
}
else
{
}
}
}
{
}
{
isLocal() ?
}
{
/**
* {@inheritDoc}
*/
public void run()
{
}
});
}
/**
* {@inheritDoc}
*/
{
return name;
}
/**
* {@inheritDoc}
*/
public void okClicked()
{
}
private void deleteAttribute()
{
Utilities.getParentDialog(this),
{
}
{
{
{
}
}
{
{
}
{
}
}
}
else
{
}
{
if (!childAttributes.isEmpty())
{
}
if (!dependentClasses.isEmpty())
{
}
{
null,
dlg);
dlg.setVisible(true);
}
}
else
{
}
}
{
// Check if the aliases or the name have changed
{
}
String n = getAttributeName();
if (n.length() == 0)
{
}
{
{
err = new MessageBuilder();
}
else
{
if (elementType != null)
{
elementType.toString()));
}
}
}
{
{
err = new MessageBuilder();
}
else
{
if (elementType != null)
{
elementType.toString()));
}
}
}
{
{
{
}
else
{
boolean notPreviouslyDefined = true;
{
{
notPreviouslyDefined = false;
break;
}
}
if (notPreviouslyDefined)
{
if (elementType != null)
{
elementType.toString()));
}
}
}
}
}
{
{
}
else
{
// Check whether this object class is defined as parent as the superior.
{
{
getSuperior().getNameOrOID()));
break;
}
}
}
}
if (nonModifiable.isSelected())
{
{
}
}
{
Utilities.getParentDialog(this),
{
}
{
}
{
null,
dlg);
dlg.setVisible(true);
}
}
{
}
}
private void checkEnableSaveChanges()
{
if (ignoreChangeEvents) return;
boolean changed;
{
try
{
}
catch (Throwable t)
{
changed = true;
}
}
else
{
changed = false;
}
}
{
}
{
if (o.length() == 0)
{
o = getAttributeName()+"-oid";
}
return o;
}
{
if (s.length() > 0)
{
{
}
}
return al;
}
{
return al;
}
{
{
return null;
}
else
{
return (AttributeType)o;
}
}
{
{
return null;
}
else
{
}
}
{
{
return null;
}
else
{
}
}
{
{
return null;
}
else
{
}
}
{
{
return null;
}
else
{
}
}
{
if (f.length() > 0)
{
}
{
}
return map;
}
{
}
{
getAllNames(),
getOID(),
getSuperior(),
return attr;
}
private void updateDefaultMatchingRuleNames()
{
{
{
{
{
}
}
else
{
{
}
}
}
}
}
}