activityHandlerDefinition.setOwner(this);
}
public void copyFromItem(Item item, int syncFlags)
{
ActivityItem ai = (ActivityItem) item;
// Make node name unique
String newName = ai.getName();
if (getProcess() != null)
{
newName = NamedObjectCollectionUtil.createUniqueId(getProcess().getNodeList(), newName);
}
setName(newName);
if (ai instanceof JavaActivityItem)
{
setActivityHandlerDefinition(new HandlerDefinition());
try
{
activityHandlerDefinition.copyFrom(((JavaActivityItem) ai).getHandlerDefinition(), Copyable.COPY_DEEP);
}
catch (CloneNotSupportedException e)
{
// Doesn't happen
}
activityHandlerDefinition.setOwner(this);
}
// Copy the sockets
clearSockets();
for (Iterator it = ai.getSockets(); it.hasNext();)
{
ActivitySocket activitySocket = (ActivitySocket) it.next();
NodeSocket nodeSocket = new NodeSocketImpl();
nodeSocket.copyFromActivitySocket(activitySocket, syncFlags);
addSocket(nodeSocket);
}
// Copy description and display name
ItemSynchronization.syncDisplayObjects(this, ai, syncFlags);
setGeometry(ai.getGeometry());
}