IStatus status = null;
if (pos >= 0) {
IResource res = getResourceFromInput(input);
if (res != null) {
String path = null;
IBreakpoint point = JDIDebugModel.createStratumBreakpoint(res, "JSP", res.getName(), path, getClassPattern(res), editorLineNumber, pos, pos, 0, true, null); //$NON-NLS-1$
if (point == null) {
status = new Status(IStatus.ERROR, JSPUIPlugin.ID, IStatus.ERROR, "unsupported input type", null); //$NON-NLS-1$
}
}
else if (input instanceof IStorageEditorInput) {
// For non-resources, use the workspace root and a coordinated
// attribute that is used to
// prevent unwanted (breakpoint) markers from being loaded
// into the editors.
res = ResourcesPlugin.getWorkspace().getRoot();
String id = input.getName();
if (input instanceof IStorageEditorInput && ((IStorageEditorInput) input).getStorage() != null && ((IStorageEditorInput) input).getStorage().getFullPath() != null) {
id = ((IStorageEditorInput) input).getStorage().getFullPath().toString();
}
Map attributes = new HashMap();
attributes.put(StructuredResourceMarkerAnnotationModel.SECONDARY_ID_KEY, id);
String path = null;
IBreakpoint point = JDIDebugModel.createStratumBreakpoint(res, "JSP", input.getName(), path, getClassPattern(res), editorLineNumber, pos, pos, 0, true, attributes); //$NON-NLS-1$
if (point == null) {
status = new Status(IStatus.ERROR, JSPUIPlugin.ID, IStatus.ERROR, "unsupported input type", null); //$NON-NLS-1$
}
}
}