Search in sources :

Example 11 with ReferencesTable

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

the class FinalStatePropertiesEditionPartImpl method createOutcomingTransitionsAdvancedReferencesTable.

/**
 */
protected Composite createOutcomingTransitionsAdvancedReferencesTable(Composite parent) {
    String label = getDescription(StatemachineViewsRepository.FinalState.Properties.outcomingTransitions, StatemachineMessages.FinalStatePropertiesEditionPart_OutcomingTransitionsLabel);
    this.outcomingTransitions = new ReferencesTable(label, new ReferencesTableListener() {

        public void handleAdd() {
            addOutcomingTransitions();
        }

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

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

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

        public void navigateTo(EObject element) {
        }
    });
    this.outcomingTransitions.setHelpText(propertiesEditionComponent.getHelpContent(StatemachineViewsRepository.FinalState.Properties.outcomingTransitions, StatemachineViewsRepository.SWT_KIND));
    this.outcomingTransitions.createControls(parent);
    this.outcomingTransitions.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(FinalStatePropertiesEditionPartImpl.this, StatemachineViewsRepository.FinalState.Properties.outcomingTransitions, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData outcomingTransitionsData = new GridData(GridData.FILL_HORIZONTAL);
    outcomingTransitionsData.horizontalSpan = 3;
    this.outcomingTransitions.setLayoutData(outcomingTransitionsData);
    this.outcomingTransitions.disableMove();
    outcomingTransitions.setID(StatemachineViewsRepository.FinalState.Properties.outcomingTransitions);
    // $NON-NLS-1$
    outcomingTransitions.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 12 with ReferencesTable

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

the class InitialStatePropertiesEditionPartImpl method createIncomingTransitionsAdvancedReferencesTable.

/**
 */
protected Composite createIncomingTransitionsAdvancedReferencesTable(Composite parent) {
    String label = getDescription(StatemachineViewsRepository.InitialState.Properties.incomingTransitions, StatemachineMessages.InitialStatePropertiesEditionPart_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(StatemachineViewsRepository.InitialState.Properties.incomingTransitions, StatemachineViewsRepository.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(InitialStatePropertiesEditionPartImpl.this, StatemachineViewsRepository.InitialState.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(StatemachineViewsRepository.InitialState.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 13 with ReferencesTable

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

the class StateMachinePropertiesEditionPartImpl method createRegionsAdvancedTableComposition.

/**
 * @param container
 */
protected Composite createRegionsAdvancedTableComposition(Composite parent) {
    this.regions = new ReferencesTable(getDescription(StatemachineViewsRepository.StateMachine_.Properties.regions, StatemachineMessages.StateMachinePropertiesEditionPart_RegionsLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StateMachinePropertiesEditionPartImpl.this, StatemachineViewsRepository.StateMachine_.Properties.regions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            regions.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StateMachinePropertiesEditionPartImpl.this, StatemachineViewsRepository.StateMachine_.Properties.regions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            regions.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StateMachinePropertiesEditionPartImpl.this, StatemachineViewsRepository.StateMachine_.Properties.regions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            regions.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StateMachinePropertiesEditionPartImpl.this, StatemachineViewsRepository.StateMachine_.Properties.regions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            regions.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.regionsFilters) {
        this.regions.addFilter(filter);
    }
    this.regions.setHelpText(propertiesEditionComponent.getHelpContent(StatemachineViewsRepository.StateMachine_.Properties.regions, StatemachineViewsRepository.SWT_KIND));
    this.regions.createControls(parent);
    this.regions.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StateMachinePropertiesEditionPartImpl.this, StatemachineViewsRepository.StateMachine_.Properties.regions, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData regionsData = new GridData(GridData.FILL_HORIZONTAL);
    regionsData.horizontalSpan = 3;
    this.regions.setLayoutData(regionsData);
    this.regions.setLowerBound(0);
    this.regions.setUpperBound(-1);
    regions.setID(StatemachineViewsRepository.StateMachine_.Properties.regions);
    // $NON-NLS-1$
    regions.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 14 with ReferencesTable

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

the class ComplexNamedTypePropertiesEditionPartImpl method createTypesAdvancedTableComposition.

/**
 * @param container
 */
protected Composite createTypesAdvancedTableComposition(Composite parent) {
    this.types = new ReferencesTable(getDescription(TypeslibraryViewsRepository.ComplexNamedType.Properties.types, TypeslibraryMessages.ComplexNamedTypePropertiesEditionPart_TypesLabel), new ReferencesTableListener() {

        public void handleAdd() {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ComplexNamedTypePropertiesEditionPartImpl.this, TypeslibraryViewsRepository.ComplexNamedType.Properties.types, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
            types.refresh();
        }

        public void handleEdit(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ComplexNamedTypePropertiesEditionPartImpl.this, TypeslibraryViewsRepository.ComplexNamedType.Properties.types, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
            types.refresh();
        }

        public void handleMove(EObject element, int oldIndex, int newIndex) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ComplexNamedTypePropertiesEditionPartImpl.this, TypeslibraryViewsRepository.ComplexNamedType.Properties.types, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
            types.refresh();
        }

        public void handleRemove(EObject element) {
            propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ComplexNamedTypePropertiesEditionPartImpl.this, TypeslibraryViewsRepository.ComplexNamedType.Properties.types, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
            types.refresh();
        }

        public void navigateTo(EObject element) {
        }
    });
    for (ViewerFilter filter : this.typesFilters) {
        this.types.addFilter(filter);
    }
    this.types.setHelpText(propertiesEditionComponent.getHelpContent(TypeslibraryViewsRepository.ComplexNamedType.Properties.types, TypeslibraryViewsRepository.SWT_KIND));
    this.types.createControls(parent);
    this.types.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ComplexNamedTypePropertiesEditionPartImpl.this, TypeslibraryViewsRepository.ComplexNamedType.Properties.types, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData typesData = new GridData(GridData.FILL_HORIZONTAL);
    typesData.horizontalSpan = 3;
    this.types.setLayoutData(typesData);
    this.types.setLowerBound(0);
    this.types.setUpperBound(-1);
    types.setID(TypeslibraryViewsRepository.ComplexNamedType.Properties.types);
    // $NON-NLS-1$
    types.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 15 with ReferencesTable

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

the class TaskPropertiesEditionPartImpl method createUsesAdvancedReferencesTable.

/**
 */
protected Composite createUsesAdvancedReferencesTable(Composite parent) {
    String label = getDescription(GraalViewsRepository.Task.Properties.uses, GraalMessages.TaskPropertiesEditionPart_UsesLabel);
    this.uses = new ReferencesTable(label, new ReferencesTableListener() {

        public void handleAdd() {
            addUses();
        }

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

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

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

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

        public void widgetSelected(SelectionEvent e) {
            if (e.item != null && e.item.getData() instanceof EObject) {
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(TaskPropertiesEditionPartImpl.this, GraalViewsRepository.Task.Properties.uses, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
            }
        }
    });
    GridData usesData = new GridData(GridData.FILL_HORIZONTAL);
    usesData.horizontalSpan = 3;
    this.uses.setLayoutData(usesData);
    this.uses.disableMove();
    uses.setID(GraalViewsRepository.Task.Properties.uses);
    // $NON-NLS-1$
    uses.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