| /** |
| * 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 javax.inject.Inject; |
| |
| import org.eclipse.core.databinding.observable.list.IObservableList; |
| import org.eclipse.core.databinding.property.list.IListProperty; |
| import org.eclipse.e4.tools.emf.ui.internal.common.VirtualEntry; |
| import org.eclipse.e4.tools.emf.ui.internal.common.component.ApplicationEditor; |
| import org.eclipse.emf.databinding.EMFProperties; |
| |
| import e4modelextension.E4modelextensionPackage; |
| |
| /** |
| * The Class VaaclipseApplicationEditor. |
| */ |
| @SuppressWarnings("restriction") |
| public class VaaclipseApplicationEditor extends ApplicationEditor { |
| |
| /** The Constant EDITOR_DESCRIPTORS_ID. */ |
| private static final String EDITOR_DESCRIPTORS_ID = VaaclipseApplicationEditor.class |
| .getName() + ".EDITOR_DESCRIPTORS"; |
| |
| /** The editor descriptors. */ |
| private IListProperty EDITOR_DESCRIPTORS = EMFProperties |
| .list(E4modelextensionPackage.Literals.VAACLIPSE_APPLICATION__EDITOR_DESCRIPTORS); |
| |
| /** The Constant PREFERENCE_CATEGORIES_ID. */ |
| private static final String PREFERENCE_CATEGORIES_ID = VaaclipseApplicationEditor.class |
| .getName() + ".PREFERENCE_CATEGORIES"; |
| |
| /** The preference categories. */ |
| private IListProperty PREFERENCE_CATEGORIES = EMFProperties |
| .list(E4modelextensionPackage.Literals.VAACLIPSE_APPLICATION__PREFERENCES_CATEGORIES); |
| |
| /** The Constant PREFERENCE_PAGES_ID. */ |
| private static final String PREFERENCE_PAGES_ID = VaaclipseApplicationEditor.class |
| .getName() + ".PREFERENCE_PAGES"; |
| |
| /** The preference pages. */ |
| private IListProperty PREFERENCE_PAGES = EMFProperties |
| .list(E4modelextensionPackage.Literals.VAACLIPSE_APPLICATION__PREFERENCES_PAGES); |
| |
| /** |
| * Instantiates a new vaaclipse application editor. |
| */ |
| @Inject |
| public VaaclipseApplicationEditor() { |
| super(); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.e4.tools.emf.ui.internal.common.component.ApplicationEditor#getLabel(java.lang.Object) |
| */ |
| @Override |
| public String getLabel(Object element) { |
| return "Vaaclipse Application"; |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.e4.tools.emf.ui.internal.common.component.ApplicationEditor#getChildList(java.lang.Object) |
| */ |
| @Override |
| public IObservableList getChildList(Object element) { |
| |
| IObservableList list = super.getChildList(element); |
| |
| VirtualEntry<Object> v = new VirtualEntry<Object>( |
| EDITOR_DESCRIPTORS_ID, EDITOR_DESCRIPTORS, element, |
| "Editor Part Descriptors") { |
| @Override |
| protected boolean accepted(Object o) { |
| return true; |
| } |
| }; |
| list.add(v); |
| |
| VirtualEntry<Object> v2 = new VirtualEntry<Object>( |
| PREFERENCE_CATEGORIES_ID, PREFERENCE_CATEGORIES, element, |
| "Preference Categories") { |
| @Override |
| protected boolean accepted(Object o) { |
| return true; |
| } |
| }; |
| list.add(v2); |
| |
| VirtualEntry<Object> v3 = new VirtualEntry<Object>(PREFERENCE_PAGES_ID, |
| PREFERENCE_PAGES, element, "Preference Pages") { |
| @Override |
| protected boolean accepted(Object o) { |
| return true; |
| } |
| }; |
| list.add(v3); |
| |
| return list; |
| } |
| |
| } |