Search in sources :

Example 91 with ViewerFilter

use of org.eclipse.jface.viewers.ViewerFilter in project InformationSystem by ObeoNetwork.

the class ParticipantParticipantPropertiesEditionComponent 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 Participant participant = (Participant) elt;
        final ParticipantPropertiesEditionPart participantPart = (ParticipantPropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(InteractionViewsRepository.Participant.Properties.name))
            participantPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, participant.getName()));
        if (isAccessible(InteractionViewsRepository.Participant.Properties.type)) {
            // init part
            typeSettings = new EObjectFlatComboSettings(participant, InteractionPackage.eINSTANCE.getParticipant_Type());
            participantPart.initType(typeSettings);
            // set the button mode
            participantPart.setTypeButtonMode(ButtonsModeEnum.BROWSE);
        }
        if (isAccessible(InteractionViewsRepository.Participant.Properties.description))
            participantPart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, participant.getDescription()));
        if (isAccessible(InteractionViewsRepository.Participant.Properties.type)) {
            participantPart.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 ObeoDSMObject);
                }
            });
        // 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 : Participant(org.obeonetwork.dsl.interaction.Participant) ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ObeoDSMObject(org.obeonetwork.dsl.environment.ObeoDSMObject) ParticipantPropertiesEditionPart(org.obeonetwork.dsl.interaction.parts.ParticipantPropertiesEditionPart) Viewer(org.eclipse.jface.viewers.Viewer) EObject(org.eclipse.emf.ecore.EObject) ObeoDSMObject(org.obeonetwork.dsl.environment.ObeoDSMObject) EObjectFlatComboSettings(org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)

Example 92 with ViewerFilter

use of org.eclipse.jface.viewers.ViewerFilter 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 93 with ViewerFilter

use of org.eclipse.jface.viewers.ViewerFilter 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 94 with ViewerFilter

use of org.eclipse.jface.viewers.ViewerFilter 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)

Example 95 with ViewerFilter

use of org.eclipse.jface.viewers.ViewerFilter in project InformationSystem by ObeoNetwork.

the class FinalStateFinalStatePropertiesEditionComponent 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 FinalState finalState = (FinalState) elt;
        final FinalStatePropertiesEditionPart finalStatePart = (FinalStatePropertiesEditionPart) editingPart;
        // init values
        if (isAccessible(FlowViewsRepository.FinalState.Properties.description))
            finalStatePart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, finalState.getDescription()));
        if (isAccessible(FlowViewsRepository.FinalState.Properties.actions)) {
            actionsSettings = new ReferencesTableSettings(finalState, FlowPackage.eINSTANCE.getFlowState_Actions());
            finalStatePart.initActions(actionsSettings);
        }
        if (isAccessible(FlowViewsRepository.FinalState.Properties.name))
            finalStatePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, finalState.getName()));
        if (isAccessible(FlowViewsRepository.FinalState.Properties.actions)) {
            finalStatePart.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 : 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) FinalStatePropertiesEditionPart(org.obeonetwork.dsl.cinematic.flow.parts.FinalStatePropertiesEditionPart) FinalState(org.obeonetwork.dsl.cinematic.flow.FinalState)

Aggregations

ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)266 EObject (org.eclipse.emf.ecore.EObject)144 Viewer (org.eclipse.jface.viewers.Viewer)130 GridData (org.eclipse.swt.layout.GridData)124 SelectionEvent (org.eclipse.swt.events.SelectionEvent)107 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)101 IPropertiesEditionEvent (org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)86 PropertiesEditionEvent (org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)86 ReferencesTable (org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable)84 ReferencesTableListener (org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)84 ReferencesTableSettings (org.eclipse.emf.eef.runtime.ui.widgets.referencestable.ReferencesTableSettings)38 Composite (org.eclipse.swt.widgets.Composite)38 GridLayout (org.eclipse.swt.layout.GridLayout)33 TreeViewer (org.eclipse.jface.viewers.TreeViewer)28 IFile (org.eclipse.core.resources.IFile)24 EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)22 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)21 Label (org.eclipse.swt.widgets.Label)21 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)20 TableViewer (org.eclipse.jface.viewers.TableViewer)20