<commit_before>/**
 * 
 */
package org.csstudio.beast.ui.adapters;

import java.util.ArrayList;
import java.util.List;

import org.csstudio.alarm.beast.client.AlarmTreeItem;
import org.csstudio.alarm.beast.client.AlarmTreeLeaf;
import org.csstudio.alarm.beast.ui.actions.AlarmTextHelper;
import org.csstudio.logbook.LogEntry;
import org.csstudio.logbook.LogEntryBuilder;
import org.eclipse.core.runtime.IAdapterFactory;

/**
 * @author shroffk
 * 
 */
public class LogbookBuilderFactory implements IAdapterFactory {

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object,
	 * java.lang.Class)
	 */
	@Override
	public Object getAdapter(Object adaptableObject, Class adapterType) {
		if (adapterType == LogEntryBuilder.class) {
			if (adaptableObject instanceof AlarmTreeItem) {
				AlarmTreeItem alarmTreeItem = ((AlarmTreeItem) adaptableObject);
				return LogEntryBuilder.withText("alarmTreeItem");
			} else if (adaptableObject instanceof AlarmTreeLeaf) {
				AlarmTreeLeaf alarmTreeLeaf = ((AlarmTreeLeaf) adaptableObject);
				List<AlarmTreeLeaf> alarms = new ArrayList<AlarmTreeLeaf>();
				alarms.add(alarmTreeLeaf);
				return LogEntryBuilder.withText(AlarmTextHelper.createAlarmInfoText(alarms));
			}
		}
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
	 */
	@Override
	public Class[] getAdapterList() {
		return new Class[] { LogEntryBuilder.class };
	}

}<commit_msg>..LogbookBuilderFactory: adding adapter for AlarmTreeItem<commit_after>/**
 * 
 */
package org.csstudio.beast.ui.adapters;

import java.util.ArrayList;
import java.util.List;

import org.csstudio.alarm.beast.client.AlarmTreeItem;
import org.csstudio.alarm.beast.client.AlarmTreeLeaf;
import org.csstudio.alarm.beast.ui.actions.AlarmTextHelper;
import org.csstudio.logbook.LogEntry;
import org.csstudio.logbook.LogEntryBuilder;
import org.eclipse.core.runtime.IAdapterFactory;

/**
 * @author shroffk
 * 
 */
public class LogbookBuilderFactory implements IAdapterFactory {

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object,
	 * java.lang.Class)
	 */
	@Override
	public Object getAdapter(Object adaptableObject, Class adapterType) {
		if (adapterType == LogEntryBuilder.class) {
			if (adaptableObject instanceof AlarmTreeLeaf) {
				AlarmTreeLeaf alarmTreeLeaf = ((AlarmTreeLeaf) adaptableObject);
				List<AlarmTreeLeaf> alarms = new ArrayList<AlarmTreeLeaf>();
				alarms.add(alarmTreeLeaf);
				return LogEntryBuilder.withText(AlarmTextHelper
						.createAlarmInfoText(alarms));
			} else if (adaptableObject instanceof AlarmTreeItem) {
				AlarmTreeItem alarmTreeItem = ((AlarmTreeItem) adaptableObject);
				return LogEntryBuilder.withText("alarmTreeItem");
			}
		}
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
	 */
	@Override
	public Class[] getAdapterList() {
		return new Class[] { LogEntryBuilder.class };
	}

}
{'fraction_non_alphanumeric': 0.1171644240236298, 'fraction_numerical': 0.0, 'mean_word_length': 4.707865168539326, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4946413', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1011, 'n_words': 163}