Search in sources :

Example 56 with ViewerFilter

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

the class ViewElementPropertiesEditionPartImpl method createEventsAdvancedTableComposition.

/**
 * @param container
 */
protected Composite createEventsAdvancedTableComposition(Composite parent) {
    this.events = new ReferencesTable(getDescription(ViewViewsRepository.ViewElement.Properties.events, ViewMessages.ViewElementPropertiesEditionPart_EventsLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewElementPropertiesEditionPartImpl.this, ViewViewsRepository.ViewElement.Properties.events, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            events.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewElementPropertiesEditionPartImpl.this, ViewViewsRepository.ViewElement.Properties.events, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            events.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewElementPropertiesEditionPartImpl.this, ViewViewsRepository.ViewElement.Properties.events, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            events.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewElementPropertiesEditionPartImpl.this, ViewViewsRepository.ViewElement.Properties.events, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            events.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.eventsFilters) {
        this.events.addFilter(filter);
    }
    this.events.setHelpText(propertiesEditionComponent.getHelpContent(ViewViewsRepository.ViewElement.Properties.events, ViewViewsRepository.SWT_KIND));
    this.events.createControls(parent);
    this.events.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewElementPropertiesEditionPartImpl.this, ViewViewsRepository.ViewElement.Properties.events, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData eventsData = new GridData(GridData.FILL_HORIZONTAL);
    eventsData.horizontalSpan = 3;
    this.events.setLayoutData(eventsData);
    this.events.setLowerBound(0);
    this.events.setUpperBound(-1);
    events.setID(ViewViewsRepository.ViewElement.Properties.events);
    // $NON-NLS-1$
    events.setEEFType("eef::AdvancedTableComposition");
    // End of user code
    return parent;
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ReferencesTable(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable) EObject(org.eclipse.emf.ecore.EObject) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) ReferencesTableListener(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)

Example 57 with ViewerFilter

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

the class ViewElementPropertiesEditionPartImpl method createActionsAdvancedTableComposition.

/**
 * @param container
 */
protected Composite createActionsAdvancedTableComposition(Composite parent) {
    this.actions = new ReferencesTable(getDescription(ViewViewsRepository.ViewElement.Properties.actions, ViewMessages.ViewElementPropertiesEditionPart_ActionsLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewElementPropertiesEditionPartImpl.this, ViewViewsRepository.ViewElement.Properties.actions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            actions.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewElementPropertiesEditionPartImpl.this, ViewViewsRepository.ViewElement.Properties.actions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            actions.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewElementPropertiesEditionPartImpl.this, ViewViewsRepository.ViewElement.Properties.actions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            actions.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewElementPropertiesEditionPartImpl.this, ViewViewsRepository.ViewElement.Properties.actions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            actions.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.actionsFilters) {
        this.actions.addFilter(filter);
    }
    this.actions.setHelpText(propertiesEditionComponent.getHelpContent(ViewViewsRepository.ViewElement.Properties.actions, ViewViewsRepository.SWT_KIND));
    this.actions.createControls(parent);
    this.actions.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewElementPropertiesEditionPartImpl.this, ViewViewsRepository.ViewElement.Properties.actions, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData actionsData = new GridData(GridData.FILL_HORIZONTAL);
    actionsData.horizontalSpan = 3;
    this.actions.setLayoutData(actionsData);
    this.actions.setLowerBound(0);
    this.actions.setUpperBound(-1);
    actions.setID(ViewViewsRepository.ViewElement.Properties.actions);
    // $NON-NLS-1$
    actions.setEEFType("eef::AdvancedTableComposition");
    // End of user code
    return parent;
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ReferencesTable(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable) EObject(org.eclipse.emf.ecore.EObject) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) ReferencesTableListener(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)

Example 58 with ViewerFilter

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

the class ViewContainerPropertiesEditionPartForm method createActionsTableComposition.

/**
 * @param container
 */
protected Composite createActionsTableComposition(FormToolkit widgetFactory, Composite parent) {
    this.actions = new ReferencesTable(getDescription(ViewViewsRepository.ViewContainer.Properties.actions, ViewMessages.ViewContainerPropertiesEditionPart_ActionsLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.actions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            actions.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.actions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            actions.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.actions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            actions.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.actions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            actions.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.actionsFilters) {
        this.actions.addFilter(filter);
    }
    this.actions.setHelpText(propertiesEditionComponent.getHelpContent(ViewViewsRepository.ViewContainer.Properties.actions, ViewViewsRepository.FORM_KIND));
    this.actions.createControls(parent, widgetFactory);
    this.actions.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.actions, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData actionsData = new GridData(GridData.FILL_HORIZONTAL);
    actionsData.horizontalSpan = 3;
    this.actions.setLayoutData(actionsData);
    this.actions.setLowerBound(0);
    this.actions.setUpperBound(-1);
    actions.setID(ViewViewsRepository.ViewContainer.Properties.actions);
    // $NON-NLS-1$
    actions.setEEFType("eef::AdvancedTableComposition");
    // End of user code
    return parent;
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ReferencesTable(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable) EObject(org.eclipse.emf.ecore.EObject) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) ReferencesTableListener(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)

Example 59 with ViewerFilter

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

the class ViewContainerPropertiesEditionPartForm method createEventsTableComposition.

/**
 * @param container
 */
protected Composite createEventsTableComposition(FormToolkit widgetFactory, Composite parent) {
    this.events = new ReferencesTable(getDescription(ViewViewsRepository.ViewContainer.Properties.events, ViewMessages.ViewContainerPropertiesEditionPart_EventsLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.events, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            events.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.events, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            events.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.events, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            events.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.events, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            events.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.eventsFilters) {
        this.events.addFilter(filter);
    }
    this.events.setHelpText(propertiesEditionComponent.getHelpContent(ViewViewsRepository.ViewContainer.Properties.events, ViewViewsRepository.FORM_KIND));
    this.events.createControls(parent, widgetFactory);
    this.events.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.events, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData eventsData = new GridData(GridData.FILL_HORIZONTAL);
    eventsData.horizontalSpan = 3;
    this.events.setLayoutData(eventsData);
    this.events.setLowerBound(0);
    this.events.setUpperBound(-1);
    events.setID(ViewViewsRepository.ViewContainer.Properties.events);
    // $NON-NLS-1$
    events.setEEFType("eef::AdvancedTableComposition");
    // End of user code
    return parent;
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ReferencesTable(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable) EObject(org.eclipse.emf.ecore.EObject) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) ReferencesTableListener(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)

Example 60 with ViewerFilter

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

the class ViewContainerPropertiesEditionPartForm method createOwnedElementsTableComposition.

/**
 * @param container
 */
protected Composite createOwnedElementsTableComposition(FormToolkit widgetFactory, Composite parent) {
    this.ownedElements = new ReferencesTable(getDescription(ViewViewsRepository.ViewContainer.Properties.ownedElements, ViewMessages.ViewContainerPropertiesEditionPart_OwnedElementsLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.ownedElements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            ownedElements.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.ownedElements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            ownedElements.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.ownedElements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            ownedElements.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.ownedElements, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            ownedElements.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.ownedElementsFilters) {
        this.ownedElements.addFilter(filter);
    }
    this.ownedElements.setHelpText(propertiesEditionComponent.getHelpContent(ViewViewsRepository.ViewContainer.Properties.ownedElements, ViewViewsRepository.FORM_KIND));
    this.ownedElements.createControls(parent, widgetFactory);
    this.ownedElements.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ViewContainerPropertiesEditionPartForm.this, ViewViewsRepository.ViewContainer.Properties.ownedElements, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData ownedElementsData = new GridData(GridData.FILL_HORIZONTAL);
    ownedElementsData.horizontalSpan = 3;
    this.ownedElements.setLayoutData(ownedElementsData);
    this.ownedElements.setLowerBound(0);
    this.ownedElements.setUpperBound(-1);
    ownedElements.setID(ViewViewsRepository.ViewContainer.Properties.ownedElements);
    // $NON-NLS-1$
    ownedElements.setEEFType("eef::AdvancedTableComposition");
    // End of user code
    return parent;
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) ReferencesTable(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable) EObject(org.eclipse.emf.ecore.EObject) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) ReferencesTableListener(org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)

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