blob: ba7f732f8e81728d314224c2da085a9265835d5f [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency
* 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:
* Pierre Allard - initial API and implementation
*
* SPDX-License-Identifier: EPL-1.0
*
*******************************************************************************/
package org.eclipse.apogy.common.topology.bindings.ui.impl;
import java.util.Set;
import java.util.TreeSet;
import org.eclipse.apogy.common.topology.bindings.EnumerationCase;
import org.eclipse.apogy.common.topology.bindings.EnumerationSwitchBinding;
import org.eclipse.emf.ecore.EEnumLiteral;
public class ApogyCommonTopologyBindingsUIFacadeCustomImpl extends ApogyCommonTopologyBindingsUIFacadeImpl {
public boolean isEEnumLiteralInUse(EnumerationSwitchBinding enumerationSwitchBinding, EEnumLiteral eEnumLiteral) {
Set<Integer> used = new TreeSet<Integer>();
for (EnumerationCase enumCase : enumerationSwitchBinding.getCases()) {
for (EEnumLiteral literal : enumCase.getEnumerationLiterals()) {
used.add(literal.getValue());
}
}
return used.contains(eEnumLiteral.getValue());
}
} // ApogyCommonTopologyBindingsUIFacadeImpl