Search in sources :

Example 21 with ReferencesTableListener

use of org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener in project InformationSystem by ObeoNetwork.

the class InitialNodePropertiesEditionPartImpl method createIncomingTransitionsAdvancedReferencesTable.

/**
 */
protected Composite createIncomingTransitionsAdvancedReferencesTable(Composite parent) {
    String label = getDescription(GraalViewsRepository.InitialNode.Properties.incomingTransitions, GraalMessages.InitialNodePropertiesEditionPart_IncomingTransitionsLabel);
    this.incomingTransitions = new ReferencesTable(label, new ReferencesTableListener() {

        public void handleAdd() {
            addIncomingTransitions();
        }

        public void handleEdit(EObject element) {
            editIncomingTransitions(element);
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            moveIncomingTransitions(element, oldIndex, newIndex);
        }

        public void handleRemove(EObject element) {
            removeFromIncomingTransitions(element);
        }

        public void navigateTo(EObject element) {
        }
    });
    this.incomingTransitions.setHelpText(propertiesEditionComponent.getHelpContent(GraalViewsRepository.InitialNode.Properties.incomingTransitions, GraalViewsRepository.SWT_KIND));
    this.incomingTransitions.createControls(parent);
    this.incomingTransitions.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(InitialNodePropertiesEditionPartImpl.this, GraalViewsRepository.InitialNode.Properties.incomingTransitions, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData incomingTransitionsData = new GridData(GridData.FILL_HORIZONTAL);
    incomingTransitionsData.horizontalSpan = 3;
    this.incomingTransitions.setLayoutData(incomingTransitionsData);
    this.incomingTransitions.disableMove();
    incomingTransitions.setID(GraalViewsRepository.InitialNode.Properties.incomingTransitions);
    // $NON-NLS-1$
    incomingTransitions.setEEFType("eef::AdvancedReferencesTable");
    return parent;
}
Also used : 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 22 with ReferencesTableListener

use of org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener in project InformationSystem by ObeoNetwork.

the class LoopPropertiesEditionPartImpl method createSubActivitiesAdvancedTableComposition.

/**
 * @param container
 */
protected Composite createSubActivitiesAdvancedTableComposition(Composite parent) {
    this.subActivities = new ReferencesTable(getDescription(GraalViewsRepository.Loop.Properties.subActivities, GraalMessages.LoopPropertiesEditionPart_SubActivitiesLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(LoopPropertiesEditionPartImpl.this, GraalViewsRepository.Loop.Properties.subActivities, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            subActivities.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(LoopPropertiesEditionPartImpl.this, GraalViewsRepository.Loop.Properties.subActivities, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            subActivities.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(LoopPropertiesEditionPartImpl.this, GraalViewsRepository.Loop.Properties.subActivities, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            subActivities.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(LoopPropertiesEditionPartImpl.this, GraalViewsRepository.Loop.Properties.subActivities, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            subActivities.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.subActivitiesFilters) {
        this.subActivities.addFilter(filter);
    }
    this.subActivities.setHelpText(propertiesEditionComponent.getHelpContent(GraalViewsRepository.Loop.Properties.subActivities, GraalViewsRepository.SWT_KIND));
    this.subActivities.createControls(parent);
    this.subActivities.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(LoopPropertiesEditionPartImpl.this, GraalViewsRepository.Loop.Properties.subActivities, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData subActivitiesData = new GridData(GridData.FILL_HORIZONTAL);
    subActivitiesData.horizontalSpan = 3;
    this.subActivities.setLayoutData(subActivitiesData);
    this.subActivities.setLowerBound(0);
    this.subActivities.setUpperBound(-1);
    subActivities.setID(GraalViewsRepository.Loop.Properties.subActivities);
    // $NON-NLS-1$
    subActivities.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 23 with ReferencesTableListener

use of org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener in project InformationSystem by ObeoNetwork.

the class OperatorPropertiesEditionPartImpl method createOutgoingTransitionsAdvancedReferencesTable.

/**
 */
protected Composite createOutgoingTransitionsAdvancedReferencesTable(Composite parent) {
    String label = getDescription(GraalViewsRepository.Operator.Properties.outgoingTransitions, GraalMessages.OperatorPropertiesEditionPart_OutgoingTransitionsLabel);
    this.outgoingTransitions = new ReferencesTable(label, new ReferencesTableListener() {

        public void handleAdd() {
            addOutgoingTransitions();
        }

        public void handleEdit(EObject element) {
            editOutgoingTransitions(element);
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            moveOutgoingTransitions(element, oldIndex, newIndex);
        }

        public void handleRemove(EObject element) {
            removeFromOutgoingTransitions(element);
        }

        public void navigateTo(EObject element) {
        }
    });
    this.outgoingTransitions.setHelpText(propertiesEditionComponent.getHelpContent(GraalViewsRepository.Operator.Properties.outgoingTransitions, GraalViewsRepository.SWT_KIND));
    this.outgoingTransitions.createControls(parent);
    this.outgoingTransitions.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(OperatorPropertiesEditionPartImpl.this, GraalViewsRepository.Operator.Properties.outgoingTransitions, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData outgoingTransitionsData = new GridData(GridData.FILL_HORIZONTAL);
    outgoingTransitionsData.horizontalSpan = 3;
    this.outgoingTransitions.setLayoutData(outgoingTransitionsData);
    this.outgoingTransitions.disableMove();
    outgoingTransitions.setID(GraalViewsRepository.Operator.Properties.outgoingTransitions);
    // $NON-NLS-1$
    outgoingTransitions.setEEFType("eef::AdvancedReferencesTable");
    return parent;
}
Also used : 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 24 with ReferencesTableListener

use of org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener in project InformationSystem by ObeoNetwork.

the class UserViewPropertiesEditionPartImpl method createOutgoingTransitionsAdvancedReferencesTable.

/**
 */
protected Composite createOutgoingTransitionsAdvancedReferencesTable(Composite parent) {
    String label = getDescription(GraalViewsRepository.UserView.Properties.outgoingTransitions, GraalMessages.UserViewPropertiesEditionPart_OutgoingTransitionsLabel);
    this.outgoingTransitions = new ReferencesTable(label, new ReferencesTableListener() {

        public void handleAdd() {
            addOutgoingTransitions();
        }

        public void handleEdit(EObject element) {
            editOutgoingTransitions(element);
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            moveOutgoingTransitions(element, oldIndex, newIndex);
        }

        public void handleRemove(EObject element) {
            removeFromOutgoingTransitions(element);
        }

        public void navigateTo(EObject element) {
        }
    });
    this.outgoingTransitions.setHelpText(propertiesEditionComponent.getHelpContent(GraalViewsRepository.UserView.Properties.outgoingTransitions, GraalViewsRepository.SWT_KIND));
    this.outgoingTransitions.createControls(parent);
    this.outgoingTransitions.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(UserViewPropertiesEditionPartImpl.this, GraalViewsRepository.UserView.Properties.outgoingTransitions, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData outgoingTransitionsData = new GridData(GridData.FILL_HORIZONTAL);
    outgoingTransitionsData.horizontalSpan = 3;
    this.outgoingTransitions.setLayoutData(outgoingTransitionsData);
    this.outgoingTransitions.disableMove();
    outgoingTransitions.setID(GraalViewsRepository.UserView.Properties.outgoingTransitions);
    // $NON-NLS-1$
    outgoingTransitions.setEEFType("eef::AdvancedReferencesTable");
    return parent;
}
Also used : 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 25 with ReferencesTableListener

use of org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener in project InformationSystem by ObeoNetwork.

the class UserViewPropertiesEditionPartImpl method createIncomingTransitionsAdvancedReferencesTable.

/**
 */
protected Composite createIncomingTransitionsAdvancedReferencesTable(Composite parent) {
    String label = getDescription(GraalViewsRepository.UserView.Properties.incomingTransitions, GraalMessages.UserViewPropertiesEditionPart_IncomingTransitionsLabel);
    this.incomingTransitions = new ReferencesTable(label, new ReferencesTableListener() {

        public void handleAdd() {
            addIncomingTransitions();
        }

        public void handleEdit(EObject element) {
            editIncomingTransitions(element);
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            moveIncomingTransitions(element, oldIndex, newIndex);
        }

        public void handleRemove(EObject element) {
            removeFromIncomingTransitions(element);
        }

        public void navigateTo(EObject element) {
        }
    });
    this.incomingTransitions.setHelpText(propertiesEditionComponent.getHelpContent(GraalViewsRepository.UserView.Properties.incomingTransitions, GraalViewsRepository.SWT_KIND));
    this.incomingTransitions.createControls(parent);
    this.incomingTransitions.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(UserViewPropertiesEditionPartImpl.this, GraalViewsRepository.UserView.Properties.incomingTransitions, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData incomingTransitionsData = new GridData(GridData.FILL_HORIZONTAL);
    incomingTransitionsData.horizontalSpan = 3;
    this.incomingTransitions.setLayoutData(incomingTransitionsData);
    this.incomingTransitions.disableMove();
    incomingTransitions.setID(GraalViewsRepository.UserView.Properties.incomingTransitions);
    // $NON-NLS-1$
    incomingTransitions.setEEFType("eef::AdvancedReferencesTable");
    return parent;
}
Also used : 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

EObject (org.eclipse.emf.ecore.EObject)162 IPropertiesEditionEvent (org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)162 PropertiesEditionEvent (org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)162 ReferencesTable (org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable)162 ReferencesTableListener (org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)162 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)162 SelectionEvent (org.eclipse.swt.events.SelectionEvent)162 GridData (org.eclipse.swt.layout.GridData)162 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)84 FlatReferencesTable (org.eclipse.emf.eef.runtime.ui.widgets.FlatReferencesTable)6