public IMarker createMarker(IFile file, String severityPreference) { IMarker marker = null; try { marker = _htmlFile.createMarker(Activator.TEMPLATE_PROBLEM_MARKER); marker.setAttribute(IMarker.MESSAGE, getMessage()); int severity; if (isWarning() || PreferenceConstants.WARNING.equals(severityPreference)) { severity = IMarker.SEVERITY_WARNING; } else { severity = IMarker.SEVERITY_ERROR; } marker.setAttribute(IMarker.SEVERITY, new Integer(severity)); marker.setAttribute(IMarker.LINE_NUMBER, _lineNumber); marker.setAttribute(IMarker.CHAR_START, _position.getOffset()); marker.setAttribute(IMarker.CHAR_END, _position.getOffset() + _position.getLength()); marker.setAttribute(IMarker.TRANSIENT, false); } catch (CoreException e) { Activator.getDefault().log(e); } return marker; }
@Override public void initializeDefaultPreferences() { IPreferenceStore prefs = Activator.getDefault().getPreferenceStore(); prefs.setDefault(PreferenceConstants.ELEMENT_NAME, "65,0,197"); prefs.setDefault(PreferenceConstants.ELEMENT_TYPE, "63,127,95"); prefs.setDefault(PreferenceConstants.BINDING_NAME, "138,23,100"); prefs.setDefault(PreferenceConstants.BINDING_NAMESPACE, "138,23,100"); prefs.setDefault(PreferenceConstants.BINDING_VALUE, "0,65,216"); prefs.setDefault(PreferenceConstants.BINDING_VALUE_NAMESPACE, "0,65,216"); prefs.setDefault(PreferenceConstants.OGNL_BINDING_VALUE, "184,93,0"); prefs.setDefault(PreferenceConstants.CONSTANT_BINDING_VALUE, "42,0,255"); prefs.setDefault(PreferenceConstants.OPERATOR, "0,0,0"); prefs.setDefault(PreferenceConstants.COMMENT, "63,127,95"); prefs.setDefault(PreferenceConstants.UNKNOWN, "0,0,0"); prefs.setDefault(PreferenceConstants.SPACES_AROUND_EQUALS, true); prefs.setDefault(PreferenceConstants.INDENT_SIZE, 2); prefs.setDefault(PreferenceConstants.INDENT_TABS, false); prefs.setDefault(PreferenceConstants.LOWERCASE_ATTRIBUTES, true); prefs.setDefault(PreferenceConstants.LOWERCASE_TAGS, true); prefs.setDefault(PreferenceConstants.STICKY_WOTAGS, false); }