/*
* 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.
*/
/**
* The panel that displays a custom object class definition.
*
*/
{
new HashSet<AttributeType>();
new HashSet<AttributeType>();
};
new SuperiorObjectClassesEditor();
private boolean ignoreChangeEvents;
/**
* Default constructor of the panel.
*
*/
public CustomObjectClassPanel()
{
super();
createLayout();
}
/**
* {@inheritDoc}
*/
{
return INFO_CTRL_PANEL_CUSTOM_OBJECTCLASS_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.
*/
{
{
/**
* {@inheritDoc}
*/
public void parentObjectClassesChanged(
{
if (ignoreChangeEvents) return;
updateAttributesWithParent(true);
{
}
else
{
}
}
};
{
model.addElement(t);
}
{
/**
* {@inheritDoc}
*/
{
}
};
addErrorPane(c, gbc);
JLabel[] inlineHelps = {
p.setOpaque(false);
{
/**
* {@inheritDoc}
*/
public void stateChanged(ChangeEvent e)
{
}
};
expander.setSelected(false);
{
/**
* {@inheritDoc}
*/
{
}
/**
* {@inheritDoc}
*/
{
}
/**
* {@inheritDoc}
*/
{
}
};
{
}
{
{
}
};
{
/**
* {@inheritDoc}
*/
public void contentsChanged(ListDataEvent e)
{
}
/**
* {@inheritDoc}
*/
public void intervalAdded(ListDataEvent e)
{
}
/**
* {@inheritDoc}
*/
public void intervalRemoved(ListDataEvent e)
{
}
};
}
/**
* Updates the contents of the panel with the provided object class.
* @param oc the object class.
* @param schema the schema.
*/
{
ignoreChangeEvents = true;
objectClass = oc;
{
// Ignore: this is called to get an initial panel size.
return;
}
if (n == null)
{
n = NOT_APPLICABLE.toString();
}
{
}
else
{
}
updateAttributesWithParent(false);
{
}
{
}
n = oc.getDescription();
if (n == null)
{
n = "";
}
description.setText(n);
lastAliases.clear();
{
sOrigin = "";
}
{
sFile = "";
}
{
}
saveChanges.setEnabled(false);
ignoreChangeEvents = false;
}
/**
* {@inheritDoc}
*/
{
final boolean schemaChanged;
{
}
{
schemaChanged = true;
}
{
schemaChanged = false;
}
else
{
schemaChanged = false;
}
if (schemaChanged)
{
schema = s;
isLocal() ?
}
{
}
{
/**
* {@inheritDoc}
*/
public void run()
{
{
}
}
});
}
/**
* {@inheritDoc}
*/
public boolean mustCheckUnsavedChanges()
{
return saveChanges.isEnabled();
}
/**
* {@inheritDoc}
*/
{
objectClass.getNameOrOID()));
Utilities.getParentDialog(this));
unsavedChangesDlg.setVisible(true);
{
saveChanges(true, errors);
{
}
}
return result;
}
/**
* {@inheritDoc}
*/
{
return name;
}
/**
* {@inheritDoc}
*/
public void okClicked()
{
}
private void deleteObjectclass()
{
Utilities.getParentDialog(this),
{
}
{
{
{
{
}
}
}
}
else
{
}
{
if (!childClasses.isEmpty())
{
}
ocName);
{
null,
dlg);
dlg.setVisible(true);
}
}
else
{
}
}
{
{
}
String n = getObjectClassName();
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()));
}
}
}
}
}
//validate the superiority.
{
}
errors);
{
Utilities.getParentDialog(this),
{
}
{
}
{
null,
dlg);
dlg.setVisible(true);
}
}
{
}
}
{
{
return;
}
{
{
obj.getNameOrOID()));
return;
}
}
}
private void checkEnableSaveChanges()
{
if (ignoreChangeEvents) return;
boolean changed;
if (objectClass != null)
{
try
{
getNewObjectClass().toString());
}
catch (Throwable t)
{
changed = true;
}
}
else
{
changed = false;
}
}
{
if (s.length() > 0)
{
{
}
}
return al;
}
{
}
{
if (o.length() == 0)
{
o = getObjectClassName()+"-oid";
}
return o;
}
{
if (f.length() > 0)
{
}
{
}
return map;
}
{
return al;
}
{
}
{
return superiors.getSelectedSuperiors();
}
{
}
{
return attrs;
}
{
return attrs;
}
{
getAllNames(),
getOID(),
return newObjectClass;
}
private void updateAttributes()
{
int[][] selected =
{
};
{
};
{
{
}
else
{
}
}
{
}
{
{
}
else
{
}
}
{
}
int i = 0;
{
{
{
{
}
}
{
}
}
i++;
}
}
{
// Remove the previous inherited attributes.
{
}
{
}
for (ObjectClass p : getObjectClassSuperiors())
{
{
}
{
}
}
{
}
{
}
if (notify)
{
}
}
private void notifyAttributesChanged()
{
}
/**
* A renderer for the attribute lists. The renderer basically marks the
* inherited attributes with an asterisk.
*
*/
{
/**
* Renderer constructor.
*
*/
public AttributeTypeCellRenderer()
{
}
/**
* {@inheritDoc}
*/
{
if (value instanceof AttributeType)
{
{
}
else
{
}
}
}
}
}