Search in sources :

Example 16 with ReferencesTableSettings

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

the class ViewStateViewStatePropertiesEditionComponent 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 ViewState viewState = (ViewState) elt;
        final ViewStatePropertiesEditionPart viewStatePart = (ViewStatePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(FlowViewsRepository.ViewState.Properties.description))
            viewStatePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, viewState.getDescription()));
        if (isAccessible(FlowViewsRepository.ViewState.Properties.actions)) {
            actionsSettings = new ReferencesTableSettings(viewState, FlowPackage.eINSTANCE.getFlowState_Actions());
            viewStatePart.initActions(actionsSettings);
        }
        if (isAccessible(FlowViewsRepository.ViewState.Properties.name))
            viewStatePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, viewState.getName()));
        if (isAccessible(FlowViewsRepository.ViewState.Properties.newInstance)) {
            viewStatePart.setNewInstance(viewState.isNewInstance());
        }
        if (isAccessible(FlowViewsRepository.ViewState.Properties.refresh)) {
            viewStatePart.setRefresh(viewState.isRefresh());
        }
        if (isAccessible(FlowViewsRepository.ViewState.Properties.viewContainers)) {
            viewContainersSettings = new ReferencesTableSettings(viewState, FlowPackage.eINSTANCE.getViewState_ViewContainers());
            viewStatePart.initViewContainers(viewContainersSettings);
        }
        if (isAccessible(FlowViewsRepository.ViewState.Properties.actions)) {
            viewStatePart.addFilterToActions(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 FlowAction);
                }
            });
        // Start of user code for additional businessfilters for actions
        // End of user code
        }
        if (isAccessible(FlowViewsRepository.ViewState.Properties.viewContainers)) {
            viewStatePart.addFilterToViewContainers(new EObjectFilter(ViewPackage.Literals.VIEW_CONTAINER));
        // Start of user code for additional businessfilters for viewContainers
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : EObjectFilter(org.eclipse.emf.eef.runtime.impl.filters.EObjectFilter) ViewStatePropertiesEditionPart(org.obeonetwork.dsl.cinematic.flow.parts.ViewStatePropertiesEditionPart) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) FlowAction(org.obeonetwork.dsl.cinematic.flow.FlowAction) ViewState(org.obeonetwork.dsl.cinematic.flow.ViewState) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject)

Example 17 with ReferencesTableSettings

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

the class ViewElementViewElementPropertiesEditionComponent 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 ViewElement viewElement = (ViewElement) elt;
        final ViewElementPropertiesEditionPart viewElementPart = (ViewElementPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.description))
            viewElementPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, viewElement.getDescription()));
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.name))
            viewElementPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, viewElement.getName()));
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.widget)) {
            // init part
            widgetSettings = new EObjectFlatComboSettings(viewElement, ViewPackage.eINSTANCE.getAbstractViewElement_Widget());
            viewElementPart.initWidget(widgetSettings);
            // set the button mode
            viewElementPart.setWidgetButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.actions)) {
            actionsSettings = new ReferencesTableSettings(viewElement, ViewPackage.eINSTANCE.getAbstractViewElement_Actions());
            viewElementPart.initActions(actionsSettings);
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.events)) {
            eventsSettings = new ReferencesTableSettings(viewElement, ViewPackage.eINSTANCE.getAbstractViewElement_Events());
            viewElementPart.initEvents(eventsSettings);
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.label))
            viewElementPart.setLabel(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, viewElement.getLabel()));
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.required)) {
            viewElementPart.setRequired(viewElement.isRequired());
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.type)) {
            // init part
            typeSettings = new EObjectFlatComboSettings(viewElement, ViewPackage.eINSTANCE.getViewElement_Type());
            viewElementPart.initType(typeSettings);
            // set the button mode
            viewElementPart.setTypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.widget)) {
            viewElementPart.addFilterToWidget(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 Widget);
                }
            });
        // Start of user code for additional businessfilters for widget
        // End of user code
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.actions)) {
            viewElementPart.addFilterToActions(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 ViewAction);
                }
            });
        // Start of user code for additional businessfilters for actions
        // End of user code
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.events)) {
            viewElementPart.addFilterToEvents(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 ViewEvent);
                }
            });
        // Start of user code for additional businessfilters for events
        // End of user code
        }
        if (isAccessible(ViewViewsRepository.ViewElement.Properties.type)) {
            viewElementPart.addFilterToType(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 Type);
                }
            });
        // Start of user code for additional businessfilters for type
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : Type(org.obeonetwork.dsl.environment.Type) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ViewAction(org.obeonetwork.dsl.cinematic.view.ViewAction) ViewEvent(org.obeonetwork.dsl.cinematic.view.ViewEvent) Widget(org.obeonetwork.dsl.cinematic.toolkits.Widget) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings) ViewElement(org.obeonetwork.dsl.cinematic.view.ViewElement) ViewElementPropertiesEditionPart(org.obeonetwork.dsl.cinematic.view.parts.ViewElementPropertiesEditionPart)

Example 18 with ReferencesTableSettings

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

the class PackagePackage_PropertiesEditionComponent 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 Package package_ = (Package) elt;
        final Package_PropertiesEditionPart package_Part = (Package_PropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(CinematicViewsRepository.Package_.Properties.description))
            package_Part.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, package_.getDescription()));
        if (isAccessible(CinematicViewsRepository.Package_.Properties.name))
            package_Part.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, package_.getName()));
        if (isAccessible(CinematicViewsRepository.Package_.Properties.flows)) {
            flowsSettings = new ReferencesTableSettings(package_, CinematicPackage.eINSTANCE.getAbstractPackage_Flows());
            package_Part.initFlows(flowsSettings);
        }
        if (isAccessible(CinematicViewsRepository.Package_.Properties.viewContainers)) {
            viewContainersSettings = new ReferencesTableSettings(package_, CinematicPackage.eINSTANCE.getAbstractPackage_ViewContainers());
            package_Part.initViewContainers(viewContainersSettings);
        }
        if (isAccessible(CinematicViewsRepository.Package_.Properties.subPackages)) {
            subPackagesSettings = new ReferencesTableSettings(package_, CinematicPackage.eINSTANCE.getAbstractPackage_SubPackages());
            package_Part.initSubPackages(subPackagesSettings);
        }
        if (isAccessible(CinematicViewsRepository.Package_.Properties.flows)) {
            package_Part.addFilterToFlows(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 Flow);
                }
            });
        // Start of user code for additional businessfilters for flows
        // End of user code
        }
        if (isAccessible(CinematicViewsRepository.Package_.Properties.viewContainers)) {
            package_Part.addFilterToViewContainers(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 ViewContainer);
                }
            });
        // Start of user code for additional businessfilters for viewContainers
        // End of user code
        }
        if (isAccessible(CinematicViewsRepository.Package_.Properties.subPackages)) {
            package_Part.addFilterToSubPackages(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 Package);
                }
            });
        // Start of user code for additional businessfilters for subPackages
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) Package_PropertiesEditionPart(org.obeonetwork.dsl.cinematic.parts.Package_PropertiesEditionPart) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) EcorePackage(org.eclipse.emf.ecore.EcorePackage) Package(org.obeonetwork.dsl.cinematic.Package) EnvironmentPackage(org.obeonetwork.dsl.environment.EnvironmentPackage) CinematicPackage(org.obeonetwork.dsl.cinematic.CinematicPackage) ViewContainer(org.obeonetwork.dsl.cinematic.view.ViewContainer) Flow(org.obeonetwork.dsl.cinematic.flow.Flow)

Example 19 with ReferencesTableSettings

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

the class ActionStateActionStatePropertiesEditionComponent 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 ActionState actionState = (ActionState) elt;
        final ActionStatePropertiesEditionPart actionStatePart = (ActionStatePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(FlowViewsRepository.ActionState.Properties.description))
            actionStatePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, actionState.getDescription()));
        if (isAccessible(FlowViewsRepository.ActionState.Properties.actions)) {
            actionsSettings = new ReferencesTableSettings(actionState, FlowPackage.eINSTANCE.getFlowState_Actions());
            actionStatePart.initActions(actionsSettings);
        }
        if (isAccessible(FlowViewsRepository.ActionState.Properties.name))
            actionStatePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, actionState.getName()));
        if (isAccessible(FlowViewsRepository.ActionState.Properties.actions)) {
            actionStatePart.addFilterToActions(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 FlowAction);
                }
            });
        // Start of user code for additional businessfilters for actions
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : ActionStatePropertiesEditionPart(org.obeonetwork.dsl.cinematic.flow.parts.ActionStatePropertiesEditionPart) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) FlowAction(org.obeonetwork.dsl.cinematic.flow.FlowAction) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) ActionState(org.obeonetwork.dsl.cinematic.flow.ActionState)

Example 20 with ReferencesTableSettings

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

the class AsyncEventStateAsyncEventStatePropertiesEditionComponent 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 AsyncEventState asyncEventState = (AsyncEventState) elt;
        final AsyncEventStatePropertiesEditionPart asyncEventStatePart = (AsyncEventStatePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(FlowViewsRepository.AsyncEventState.Properties.description))
            asyncEventStatePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, asyncEventState.getDescription()));
        if (isAccessible(FlowViewsRepository.AsyncEventState.Properties.actions)) {
            actionsSettings = new ReferencesTableSettings(asyncEventState, FlowPackage.eINSTANCE.getFlowState_Actions());
            asyncEventStatePart.initActions(actionsSettings);
        }
        if (isAccessible(FlowViewsRepository.AsyncEventState.Properties.name))
            asyncEventStatePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, asyncEventState.getName()));
        if (isAccessible(FlowViewsRepository.AsyncEventState.Properties.actions)) {
            asyncEventStatePart.addFilterToActions(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 FlowAction);
                }
            });
        // Start of user code for additional businessfilters for actions
        // End of user code
        }
    // init values for referenced views
    // init filters for referenced views
    }
    setInitializing(false);
}
Also used : AsyncEventState(org.obeonetwork.dsl.cinematic.flow.AsyncEventState) ReferencesTableSettings(org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) FlowAction(org.obeonetwork.dsl.cinematic.flow.FlowAction) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) AsyncEventStatePropertiesEditionPart(org.obeonetwork.dsl.cinematic.flow.parts.AsyncEventStatePropertiesEditionPart)

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