.getStart().getParent() : context.getPictogramElements()[0];
final Object bo = getBusinessObjectForPictogramElement(_pe);
final IResource resource = getResource();
if (bo instanceof AbstractNode) {
AbstractNode _ep = (AbstractNode) bo;
try {
Boolean userWantsUpdate = null;
IFile contextFile = getContextFile();
String fileName = contextFile.getName();
String projectName = contextFile.getProject().getName();
ConditionalBreakpointEditorDialog dlg = new ConditionalBreakpointEditorDialog(Display.getDefault().getActiveShell(), _ep);
dlg.setBlockOnOpen(true);
if (Window.OK == dlg.open()) {
String language = dlg.getLanguage();
String condition = dlg.getCondition();
if (Strings.isBlank(_ep.getCamelContextId()) ||
Strings.isBlank(_ep.getId()) ) {
// important ID fields are not yet set - ask the user if we
// can update those fields for him
userWantsUpdate = askForIDUpdate(_ep);
if (userWantsUpdate) {
// update the context id if needed
if (Strings.isBlank(_ep.getCamelContextId())) {
String newContextId = ICamelDebugConstants.PREFIX_CONTEXT_ID + UUID.randomUUID().toString();
((RouteContainer)_ep.getParent().getParent()).setContextId(newContextId);
}
// update the node id if blank
boolean foundUniqueId = false;
if (Strings.isBlank(_ep.getId())) {
String newNodeId = null;
while (!foundUniqueId) {
newNodeId = ICamelDebugConstants.PREFIX_NODE_ID + _ep.getNewID();
// we need to check if the id is really unique in our context
if (((RiderDesignEditor)getDiagramBehavior().getDiagramContainer()).getModel().getNode(newNodeId) == null) {
foundUniqueId = true;
}
}
if (Strings.isBlank(newNodeId) == false) {
_ep.setId(newNodeId);
} else {
throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Unable to determine a unique ID for node " + _ep));
}
}