blob: 6e5f0e73b55a6f3f287b9bec3b50f1a6945a32a6 [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
// Regent L'Archeveque
// Olivier L. Larouche
//
// SPDX-License-Identifier: EPL-1.0
// *****************************************************************************
@GenModel(prefix="ApogyCommonEMFUiEMFForms",
childCreationExtenders="true",
extensibleProviderFactory="true",
copyrightText="*******************************************************************************
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
Regent L'Archeveque,
Olivier L. Larouche
SPDX-License-Identifier: EPL-1.0
*******************************************************************************",
modelName="ApogyCommonEMFUiEMFForms")
@GenModel(dynamicTemplates="true", templateDirectory="platform:/plugin/org.eclipse.apogy.common.emf.codegen/templates")
@GenModel(modelDirectory="/org.eclipse.apogy.common.emf.ui.emfforms/src-gen")
@GenModel(editDirectory="/org.eclipse.apogy.common.emf.ui.emfforms/src-gen")
package org.eclipse.apogy.common.emf.ui.emfforms
import org.eclipse.apogy.common.emf.ui.WizardPagesProvider
import org.eclipse.emf.ecore.EAttribute
import org.eclipse.emf.ecore.EObject
import org.eclipse.emf.ecore.EReference
import org.eclipse.emf.ecp.ui.view.swt.ECPSWTView
import org.eclipse.emf.ecp.view.spi.model.VContainedElement
import org.eclipse.emf.ecp.view.spi.model.VControl
import org.eclipse.emf.ecp.view.spi.model.VView
import org.eclipse.swt.widgets.Composite
import org.eclipse.apogy.common.Apogy
// Types
type Composite wraps Composite
type VView wraps VView
type VControl wraps VControl
type VContainedElement wraps VContainedElement
type ECPSWTView wraps ECPSWTView
type List<T> wraps java.util.List
type SortedSet<T> wraps java.util.SortedSet
/**
* Apogy Common EMF Ui EMFForms Facade.
*/
@Apogy(isSingleton="true", hasCustomClass="true")
class ApogyCommonEMFUiEMFFormsFacade
{
/**
* Creates a {@link Composite} containing the EMF forms
* corresponding to a specified {@link EObject} in the parent {@link Composite}.
* This method is the same as calling createEMFForms(parent, eObject, false).
* @param parent The parent {@link Composite} containing the EMF forms.
* @param eObject The {@link EObject} to display.
*/
op void createEMFForms(Composite parent, EObject eObject)
/**
* Creates a {@link Composite} containing the EMF forms
* corresponding to a specified {@link EObject} in the parent {@link Composite}.
* @param parent The parent {@link Composite} containing the EMF forms.
* @param eObject The {@link EObject} to display.
* @param message Message to display if the object is null.
*/
op void createEMFForms(Composite parent, EObject eObject, String message)
/**
* Creates a {@link Composite} containing the EMF forms
* corresponding to a specified {@link EObject} in the parent {@link Composite}.
* @param parent The parent {@link Composite} containing the EMF forms.
* @param eObject The {@link EObject} to display.
* @param readOlny Used to specify if the EMF forms is in read only mode.
*/
op void createEMFForms(Composite parent, EObject eObject, boolean readOnly)
/**
* Creates a {@link Composite} containing the EMF forms
* corresponding to a specified {@link EObject} in the parent {@link Composite}.
* @param parent The parent {@link Composite} containing the EMF forms.
* @param eObject The {@link EObject} to display.
* @param viewModel View model used to render the EObject.
*/
op void createEMFForms(Composite parent, EObject eObject, VView viewModel)
/**
* Creates a {@link Composite} containing the EMF forms
* corresponding to a specified {@link EObject} in the parent {@link Composite}.
* @param parent The parent {@link Composite} containing the EMF forms.
* @param eObject The {@link EObject} to display.
* @param viewModel View model used to render the EObject.
* @param message Message to display if the object is null.
*/
op void createEMFForms(Composite parent, EObject eObject, VView viewModel, String message)
/**
* Creates a default view model. This models includes all attributes and features.
* @param eObject The EObject for which to create the View Model.
* @return A view model for the specified EObject.
*/
op VView createDefaultViewModel(EObject eObject)
/**
* Sorts a list of VControl Alphabetically.
* @param vcontrols The list of VControl to sort.
* @return The sorted set of VVControl.
*/
op SortedSet<VControl> sortVControlAlphabetically(List<VControl> vcontrols)
/**
* Sorts a list of VContainedElement Alphabetically.
* @param vContainedElements The list of VContainedElement to sort.
* @return The sorted set of VContainedElement.
*/
op SortedSet<VContainedElement> sortVElementAlphabetically(List<VContainedElement> vContainedElements)
/**
* Creates a VControl for a given attribute.
* @param attribute The attribute
* @return The VControl, null if none could be created.
*/
op VControl createVControl(EAttribute attribute)
/**
* Creates a VControl for a given reference.
* @param eReference The reference.
* @return The VControl, null if none could be created.
*/
op VControl createVControl(EReference eReference)
/**
* Returns the property type associated with a given EAttribute.
* @param attribute The attribute.
* @return The PropertyType.
*/
op PropertyType getPropertyType(EAttribute attribute)
/**
* Returns the property type associated with a given EReference.
* @param eReference The eReference.
* @return The PropertyType.
*/
op PropertyType getPropertyType(EReference eReference)
}
/**
* Defines property types.
*/
enum PropertyType
{
NONE as "NONE" = 0,
READONLY as "READONLY" = 1,
EDITABLE as "EDITABLE" = 2
}
/**
* Page provider for EObjectEMFForms.
*/
@Apogy(hasCustomClass="true")
class EObjectEMFFormsWizardPageProvider extends WizardPagesProvider
{
}