<commit_before>/**
 * Copyright (c) 2011 committers of YAKINDU and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * Contributors:
 * 	committers of YAKINDU - initial API and implementation
 * 
 */
package org.yakindu.sct.ui.navigator;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.yakindu.sct.model.sgraph.Scope;
import org.yakindu.sct.model.sgraph.Trigger;
import org.yakindu.sct.model.stext.stext.InterfaceScope;
import org.yakindu.sct.model.stext.stext.InternalScope;

/**
 * 
 * @author m.muehlbrandt
 *
 */
public class StatechartObjectViewerFilter extends ViewerFilter {

	@Override
	public boolean select(Viewer viewer, Object parentElement, Object element) {
		if (element instanceof DomainNavigatorItem) {
			DomainNavigatorItem navigatorItem = (DomainNavigatorItem) element;
			EObject modelElement = navigatorItem.getEObject();
			if (modelElement instanceof Diagram) {
				return false;
			}
			if (modelElement instanceof Trigger) {
				return false;
			}
			if (modelElement instanceof InternalScope
					|| modelElement instanceof InterfaceScope) {
				return true;
			}
			if (modelElement instanceof Scope) {
				return false;
			}
		}
		return true;
	}
}<commit_msg>Navigator filters Expressions and LocalReactions.<commit_after>/**
 * Copyright (c) 2011 committers of YAKINDU and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * Contributors:
 * 	committers of YAKINDU - initial API and implementation
 * 
 */
package org.yakindu.sct.ui.navigator;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.yakindu.sct.model.sgraph.Scope;
import org.yakindu.sct.model.sgraph.Trigger;
import org.yakindu.sct.model.stext.stext.Expression;
import org.yakindu.sct.model.stext.stext.InterfaceScope;
import org.yakindu.sct.model.stext.stext.InternalScope;
import org.yakindu.sct.model.stext.stext.LocalReaction;
import org.yakindu.sct.model.stext.stext.ReactionEffect;

/**
 * 
 * @author m.muehlbrandt
 *
 */
public class StatechartObjectViewerFilter extends ViewerFilter {

	@Override
	public boolean select(Viewer viewer, Object parentElement, Object element) {
		if (element instanceof DomainNavigatorItem) {
			DomainNavigatorItem navigatorItem = (DomainNavigatorItem) element;
			EObject modelElement = navigatorItem.getEObject();
			if (modelElement instanceof Diagram) {
				return false;
			}
			if (modelElement instanceof Trigger) {
				return false;
			}
			if (modelElement instanceof InternalScope
					|| modelElement instanceof InterfaceScope) {
				return true;
			}
			if (modelElement instanceof Scope) {
				return false;
			}
			if (modelElement instanceof LocalReaction) {
				return false;
			}
			if (modelElement instanceof ReactionEffect) {
				return false;
			}
			if (modelElement instanceof Expression) {
				return false;
			}
		}
		return true;
	}
}
{'fraction_non_alphanumeric': 0.09111813739580339, 'fraction_numerical': 0.004599022707674619, 'mean_word_length': 4.209580838323354, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '685605', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1078, 'n_words': 270}