public static String getUniqueId(IValidator validator) { if (validator == null) { return ""; //$NON-NLS-1$ } return getUniqueId(validator.getClass()); }
/** * Add a class to the list of owners of validation messages. ONLY by the validation framework * should use this method (it is used for messages owned by framework classes or classes used by * the TVT plugin.) */ public void addInternalOwner(Class clazz) { if (clazz == null) { return; } String[] tempInternalOwners = new String[_internalOwners.length + 1]; if (_internalOwners.length > 0) { System.arraycopy(_internalOwners, 0, tempInternalOwners, 0, _internalOwners.length); } tempInternalOwners[_internalOwners.length] = WorkbenchReporter.getUniqueId(clazz); _internalOwners = tempInternalOwners; }
public static void removeMessageSubset(IResource resource, Class messageOwner, String groupName) { // Since the addMessage(Class, IMessage) is defaulted to the IProject, // remove the message subsets from the IProject removeMessageSubset(resource, new String[]{getUniqueId(messageOwner)}, null, groupName); }
public static void addMessage(IResource resource, Class clazz, ClassLoader cl, IMessage message, String targetObjectName, String location) { if ((clazz == null) || (message == null) || (resource == null)) { return; } if (cl == null) { cl = clazz.getClassLoader(); } addMessage(resource, getUniqueId(clazz), cl, message, targetObjectName, location); }
public static void addMessage(IResource resource, Class clazz, ClassLoader cl, IMessage message, String targetObjectName, String location, String markerId) { if ((clazz == null) || (message == null) || (resource == null)) { return; } if (cl == null) { cl = clazz.getClassLoader(); } addMessage(resource, getUniqueId(clazz), cl, message, targetObjectName, location, markerId); }
/** * This message is for use only by the validation framework. If the "max messages were reported" * IMarker exists, return it. Otherwise return null. */ private IMarker[] getLimitMessage(IProject project) { IMarker[] exceededMessage = TaskListUtility.getValidationTasks(project, WorkbenchReporter.getUniqueId(getMessageLimitOwner())); if ((exceededMessage != null) && (exceededMessage.length != 0)) { return exceededMessage; } return null; }
private static void cacheMessage( IValidatorJob validator, IResource resource, Class clazz, IMessage message, String targetObjectName, String location, String markerId ){ if ((clazz == null) || (message == null) || (resource == null)) { return; } ClassLoader cl = null; if (cl == null) { cl = clazz.getClassLoader(); } String text = message.getText(cl); MessageInfo msgInfo = new MessageInfo(getUniqueId(clazz), resource, location, text, targetObjectName, markerId, message ); ValidatorManager mgr = ValidatorManager.getManager(); mgr.cacheMessage( validator, msgInfo ); } }