Search in sources :

Example 1 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

the class DataBasePropertiesEditionComponent method initPart.

/**
 * {@inheritDoc}
 *
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
 *      org.eclipse.emf.ecore.resource.ResourceSet)
 */
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
    setInitializing(true);
    if (editingPart != null && key == partKey) {
        editingPart.setContext(elt, allResource);
        final DataBase dataBase = (DataBase) elt;
        final DataBasePropertiesEditionPart dataBasePart = (DataBasePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(DatabaseViewsRepository.DataBase_.Properties.name))
            dataBasePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, dataBase.getName()));
        if (isAccessible(DatabaseViewsRepository.DataBase_.Properties.url))
            dataBasePart.setUrl(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, dataBase.getUrl()));
        if (isAccessible(DatabaseViewsRepository.DataBase_.Properties.comments))
            dataBasePart.setComments(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, dataBase.getComments()));
        if (isAccessible(DatabaseViewsRepository.DataBase_.Properties.usedLibraries)) {
            usedLibrariesSettings = new ReferencesTableSettings(dataBase, TypesLibraryPackage.eINSTANCE.getTypesLibraryUser_UsedLibraries());
            dataBasePart.initUsedLibraries(usedLibrariesSettings);
        }
        if (isAccessible(DatabaseViewsRepository.DataBase_.Properties.usedLibraries)) {
            dataBasePart.addFilterToUsedLibraries(new ViewerFilter() {

                /**
                 * {@inheritDoc}
                 *
                 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
                 */
                public boolean select(Viewer viewer, Object parentElement, Object element) {
                    if (element instanceof EObject)
                        return (!dataBasePart.isContainedInUsedLibrariesTable((EObject) element));
                    return element instanceof String && element.equals("");
                }
            });
            dataBasePart.addFilterToUsedLibraries(new EObjectStrictFilter(TypesLibraryPackage.Literals.TYPES_LIBRARY));
        // Start of user code for additional businessfilters for usedLibraries
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : EObjectStrictFilter(org.eclipse.emf.eef.runtime.impl.filters.EObjectStrictFilter) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) EObject(org.eclipse.emf.ecore.EObject) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) DataBasePropertiesEditionPart(org.obeonetwork.dsl.database.parts.DataBasePropertiesEditionPart) DataBase(org.obeonetwork.dsl.database.DataBase)

Example 2 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

the class IndexPropertiesEditionComponent method initPart.

/**
 * {@inheritDoc}
 *
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
 *      org.eclipse.emf.ecore.resource.ResourceSet)
 */
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
    setInitializing(true);
    if (editingPart != null && key == partKey) {
        editingPart.setContext(elt, allResource);
        final Index index = (Index) elt;
        final IndexPropertiesEditionPart indexPart = (IndexPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(DatabaseViewsRepository.Index.Properties.name))
            indexPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, index.getName()));
        if (isAccessible(DatabaseViewsRepository.Index.Properties.qualifier))
            indexPart.setQualifier(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, index.getQualifier()));
        if (isAccessible(DatabaseViewsRepository.Index.Properties.unique)) {
            indexPart.setUnique(index.isUnique());
        }
        if (isAccessible(DatabaseViewsRepository.Index.Properties.cardinality)) {
            indexPart.setCardinality(EEFConverterUtil.convertToString(EcorePackage.Literals.EINT, index.getCardinality()));
        }
        if (isAccessible(DatabaseViewsRepository.Index.Properties.indexType))
            indexPart.setIndexType(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, index.getIndexType()));
        if (isAccessible(DatabaseViewsRepository.Index.Properties.comments))
            indexPart.setComments(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, index.getComments()));
        if (isAccessible(DatabaseViewsRepository.Index.Properties.elements)) {
            elementsSettings = new ReferencesTableSettings(index, DatabasePackage.eINSTANCE.getIndex_Elements());
            indexPart.initElements(elementsSettings);
        }
        if (isAccessible(DatabaseViewsRepository.Index.Properties.elements)) {
            indexPart.addFilterToElements(new ViewerFilter() {

                /**
                 * {@inheritDoc}
                 *
                 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
                 */
                public boolean select(Viewer viewer, Object parentElement, Object element) {
                    // $NON-NLS-1$
                    return (element instanceof String && element.equals("")) || (element instanceof IndexElement);
                }
            });
        // Start of user code for additional businessfilters for elements
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : IndexPropertiesEditionPart(org.obeonetwork.dsl.database.parts.IndexPropertiesEditionPart) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Index(org.obeonetwork.dsl.database.Index) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) IndexElement(org.obeonetwork.dsl.database.IndexElement)

Example 3 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

the class PrimaryKeyPropertiesEditionComponent method initPart.

/**
 * {@inheritDoc}
 *
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
 *      org.eclipse.emf.ecore.resource.ResourceSet)
 */
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
    setInitializing(true);
    if (editingPart != null && key == partKey) {
        editingPart.setContext(elt, allResource);
        final PrimaryKey primaryKey = (PrimaryKey) elt;
        final PrimaryKeyPropertiesEditionPart primaryKeyPart = (PrimaryKeyPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(DatabaseViewsRepository.PrimaryKey.Properties.name))
            primaryKeyPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, primaryKey.getName()));
        if (isAccessible(DatabaseViewsRepository.PrimaryKey.Properties.columns)) {
            columnsSettings = new ReferencesTableSettings(primaryKey, DatabasePackage.eINSTANCE.getPrimaryKey_Columns());
            primaryKeyPart.initColumns(columnsSettings);
        }
        if (isAccessible(DatabaseViewsRepository.PrimaryKey.Properties.comments))
            primaryKeyPart.setComments(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, primaryKey.getComments()));
        if (isAccessible(DatabaseViewsRepository.PrimaryKey.Properties.columns)) {
            primaryKeyPart.addFilterToColumns(new ViewerFilter() {

                /**
                 * {@inheritDoc}
                 *
                 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
                 */
                public boolean select(Viewer viewer, Object parentElement, Object element) {
                    if (element instanceof EObject)
                        return (!primaryKeyPart.isContainedInColumnsTable((EObject) element));
                    return element instanceof String && element.equals("");
                }
            });
            primaryKeyPart.addFilterToColumns(new EObjectStrictFilter(DatabasePackage.Literals.COLUMN));
        // Start of user code for additional businessfilters for columns
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : EObjectStrictFilter(org.eclipse.emf.eef.runtime.impl.filters.EObjectStrictFilter) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) EObject(org.eclipse.emf.ecore.EObject) PrimaryKey(org.obeonetwork.dsl.database.PrimaryKey) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) PrimaryKeyPropertiesEditionPart(org.obeonetwork.dsl.database.parts.PrimaryKeyPropertiesEditionPart)

Example 4 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

the class TableConstraintsPropertiesEditionComponent method initPart.

/**
 * {@inheritDoc}
 *
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
 *      org.eclipse.emf.ecore.resource.ResourceSet)
 */
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
    setInitializing(true);
    if (editingPart != null && key == partKey) {
        editingPart.setContext(elt, allResource);
        final Table table = (Table) elt;
        final ConstraintsPropertiesEditionPart constraintsPart = (ConstraintsPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(DatabaseViewsRepository.Constraints.Properties.constraints_)) {
            constraintsSettings = new ReferencesTableSettings(table, DatabasePackage.eINSTANCE.getTable_Constraints());
            constraintsPart.initConstraints(constraintsSettings);
        }
        // init filters
        if (isAccessible(DatabaseViewsRepository.Constraints.Properties.constraints_)) {
            constraintsPart.addFilterToConstraints(new ViewerFilter() {

                /**
                 * {@inheritDoc}
                 *
                 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
                 */
                public boolean select(Viewer viewer, Object parentElement, Object element) {
                    // $NON-NLS-1$
                    return (element instanceof String && element.equals("")) || (element instanceof Constraint);
                }
            });
        // Start of user code for additional businessfilters for constraints
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : Table(org.obeonetwork.dsl.database.Table) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ConstraintsPropertiesEditionPart(org.obeonetwork.dsl.database.parts.ConstraintsPropertiesEditionPart) Constraint(org.obeonetwork.dsl.database.Constraint) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject)

Example 5 with ReferencesTableSettings

use of org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings in project InformationSystem by ObeoNetwork.

the class TableTablePropertiesEditionComponent method initPart.

/**
 * {@inheritDoc}
 *
 * @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
 *      org.eclipse.emf.ecore.resource.ResourceSet)
 */
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
    setInitializing(true);
    if (editingPart != null && key == partKey) {
        editingPart.setContext(elt, allResource);
        final Table table = (Table) elt;
        final TablePropertiesEditionPart tablePart = (TablePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(DatabaseViewsRepository.Table.Properties.name))
            tablePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, table.getName()));
        if (isAccessible(DatabaseViewsRepository.Table.Properties.columns)) {
            columnsSettings = new ReferencesTableSettings(table, DatabasePackage.eINSTANCE.getTable_Columns());
            tablePart.initColumns(columnsSettings);
        }
        if (isAccessible(DatabaseViewsRepository.Table.Properties.comments))
            tablePart.setComments(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, table.getComments()));
        if (isAccessible(DatabaseViewsRepository.Table.Properties.columns)) {
            tablePart.addFilterToColumns(new ViewerFilter() {

                /**
                 * {@inheritDoc}
                 *
                 * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
                 */
                public boolean select(Viewer viewer, Object parentElement, Object element) {
                    // $NON-NLS-1$
                    return (element instanceof String && element.equals("")) || (element instanceof Column);
                }
            });
        // Start of user code for additional businessfilters for columns
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : Table(org.obeonetwork.dsl.database.Table) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Column(org.obeonetwork.dsl.database.Column) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) TablePropertiesEditionPart(org.obeonetwork.dsl.database.parts.TablePropertiesEditionPart)

Aggregations

ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)56 EObject (org.eclipse.emf.ecore.EObject)38 Viewer (org.eclipse.jface.viewers.Viewer)38 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)38 EObjectFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter)23 EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)11 FlowAction (org.obeonetwork.dsl.cinematic.flow.FlowAction)9 Table (org.obeonetwork.dsl.database.Table)6 EObjectStrictFilter (org.eclipse.emf.eef.runtime.impl.filters.EObjectStrictFilter)5 Flow (org.obeonetwork.dsl.cinematic.flow.Flow)4 ViewContainer (org.obeonetwork.dsl.cinematic.view.ViewContainer)4 Widget (org.obeonetwork.dsl.cinematic.toolkits.Widget)3 ViewAction (org.obeonetwork.dsl.cinematic.view.ViewAction)3 ViewEvent (org.obeonetwork.dsl.cinematic.view.ViewEvent)3 EcorePackage (org.eclipse.emf.ecore.EcorePackage)2 CompositePropertiesEditionPart (org.eclipse.emf.eef.runtime.impl.parts.CompositePropertiesEditionPart)2 CinematicPackage (org.obeonetwork.dsl.cinematic.CinematicPackage)2 CinematicRoot (org.obeonetwork.dsl.cinematic.CinematicRoot)2 Package (org.obeonetwork.dsl.cinematic.Package)2 FlowEvent (org.obeonetwork.dsl.cinematic.flow.FlowEvent)2