blob: 44f749fb24e3f299a16b048b9ccd1c9fba206b39 [file] [log] [blame]
/**
* Copyright (c) 2013 Rushan Gilmullin, Florian Pirchner, Sopot Scela 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:
* Rushan Gilmullin - Initial implementation
*/
package org.eclipse.osbp.e4tools.extension;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.eclipse.e4.tools.emf.ui.common.IEditorFeature;
import org.eclipse.e4.ui.model.fragment.impl.FragmentPackageImpl;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.osbp.vaaclipse.ui.preferences.model.metadata.PreferencesPackage;
import e4modelextension.E4modelextensionPackage;
/**
* The Class EditorFeature.
*/
@SuppressWarnings("restriction")
public class EditorFeature implements IEditorFeature {
/* (non-Javadoc)
* @see org.eclipse.e4.tools.emf.ui.common.IEditorFeature#getFeatureClasses(org.eclipse.emf.ecore.EClass, org.eclipse.emf.ecore.EStructuralFeature)
*/
@Override
public List<FeatureClass> getFeatureClasses(EClass eClass,
EStructuralFeature feature) {
if (eClass == FragmentPackageImpl.Literals.MODEL_FRAGMENT) {
if (feature == FragmentPackageImpl.Literals.MODEL_FRAGMENT__ELEMENTS) {
List<FeatureClass> features = new ArrayList<FeatureClass>(3);
features.add(new FeatureClass(
E4modelextensionPackage.Literals.EDITOR_PART_DESCRIPTOR
.getName(),
E4modelextensionPackage.Literals.EDITOR_PART_DESCRIPTOR));
features.add(new FeatureClass(
PreferencesPackage.Literals.PREFERENCES_CATEGORY
.getName(),
PreferencesPackage.Literals.PREFERENCES_CATEGORY));
features.add(new FeatureClass(
PreferencesPackage.Literals.PREFERENCES_PAGE.getName(),
PreferencesPackage.Literals.PREFERENCES_PAGE));
return features;
}
}
return Collections.emptyList();
}
}