@Override
	public void setContentTypeToolAssociations(Set<ToolAssociationInfo> infos) {
		for (ToolAssociationInfo info : infos) {

			ContentHandler<?> handler = info.getContentHandler();
			String contentType = handler.getContentType();
			String preferenceKey = getToolAssociationPreferenceKey(contentType);
			if (!info.isDefault()) {
				ToolTemplate template = info.getCurrentTemplate();
				String toolName = template.getName();
				Preferences.setProperty(preferenceKey, toolName);
			}
			else {
				// remove the preference
				Preferences.setProperty(preferenceKey, null);
			}

			ensureToolIsInToolChest(info.getCurrentTemplate());
		}
		Preferences.store();
	}
Implementation of service used to manipulate tools.
Ghidra/Framework/Project/src/main/java/ghidra/framework/project/tool/ToolServicesImpl.java