/** * create portable task markers according to the parse exceptions * * @param exceptions Collections of ParseException * @throws CoreException */ private void updatePortableAnnotation(ArrayList exceptions) { try { for (Iterator iter = exceptions.iterator(); iter.hasNext();) { //create markers according to the parse exceptions ParseException ex = (ParseException) iter.next(); HashMap attrs = new HashMap(); attrs.put(IMarker.USER_EDITABLE, Boolean.FALSE); String storageName = "";//$NON-NLS-1$ if (!(_input instanceof IFileEditorInput)) { storageName = _input.getName() + ": ";//$NON-NLS-1$ } attrs.put(IMarker.MESSAGE, storageName + NLS.bind(SQLEditorResources.SQLUpdater_nonportable, (new String[]{_portableTarget})) + ex.getMessage()); updateAnnotation(ex, EditorConstants.PORTABILITY_MARKER_TYPE, attrs); } } catch (CoreException e) { SQLEditorPlugin.getDefault().log(SQLEditorResources.SQLUpdater_error_annotation, e); } }
/** * create markers according to the parse exceptions * * @param exceptions Collections of ParseException * @throws CoreException */ private void updateErrorAnnotation(ArrayList exceptions) { try { for (Iterator iter = exceptions.iterator(); iter.hasNext();) { //create markers according to the parse exceptions ParseException ex = (ParseException) iter.next(); HashMap attrs = new HashMap(); attrs.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR)); String storageName = "";//$NON-NLS-1$ if (!(_input instanceof IFileEditorInput)) { storageName = _input.getName() + ": ";//$NON-NLS-1$ } attrs.put(IMarker.MESSAGE, storageName + ex.getMessage()); attrs.put(ISQLEditorMarker.SHORT_MESSAGE, storageName + ex.getShortMessage()); updateAnnotation(ex, EditorConstants.SYNTAX_MARKER_TYPE, attrs); } } catch (CoreException e) { SQLEditorPlugin.getDefault().log(SQLEditorResources.SQLUpdater_error_annotation, e); } }