Search in sources :

Example 86 with PropertiesEditionEvent

use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent 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 87 with PropertiesEditionEvent

use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.

the class FinalStatePropertiesEditionPartImpl method addOutcomingTransitions.

/**
 */
protected void addOutcomingTransitions() {
    TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(outcomingTransitions.getInput(), outcomingTransitionsFilters, outcomingTransitionsBusinessFilters, "outcomingTransitions", propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {

        @Override
        public void process(IStructuredSelection selection) {
            for (Iterator<?> iter = selection.iterator(); iter.hasNext(); ) {
                EObject elem = (EObject) iter.next();
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(FinalStatePropertiesEditionPartImpl.this, StatemachineViewsRepository.FinalState.Properties.outcomingTransitions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
            }
            outcomingTransitions.refresh();
        }
    };
    dialog.open();
}
Also used : TabElementTreeSelectionDialog(org.eclipse.emf.eef.runtime.ui.widgets.TabElementTreeSelectionDialog) EObject(org.eclipse.emf.ecore.EObject) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 88 with PropertiesEditionEvent

use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.

the class InitialStatePropertiesEditionPartImpl method addOutcomingTransitions.

/**
 */
protected void addOutcomingTransitions() {
    TabElementTreeSelectionDialog dialog = new TabElementTreeSelectionDialog(outcomingTransitions.getInput(), outcomingTransitionsFilters, outcomingTransitionsBusinessFilters, "outcomingTransitions", propertiesEditionComponent.getEditingContext().getAdapterFactory(), current.eResource()) {

        @Override
        public void process(IStructuredSelection selection) {
            for (Iterator<?> iter = selection.iterator(); iter.hasNext(); ) {
                EObject elem = (EObject) iter.next();
                propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(InitialStatePropertiesEditionPartImpl.this, StatemachineViewsRepository.InitialState.Properties.outcomingTransitions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, elem));
            }
            outcomingTransitions.refresh();
        }
    };
    dialog.open();
}
Also used : TabElementTreeSelectionDialog(org.eclipse.emf.eef.runtime.ui.widgets.TabElementTreeSelectionDialog) EObject(org.eclipse.emf.ecore.EObject) IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection)

Example 89 with PropertiesEditionEvent

use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.

the class InitialStatePropertiesEditionPartImpl method moveOutcomingTransitions.

/**
 */
protected void moveOutcomingTransitions(EObject element, int oldIndex, int newIndex) {
    propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(InitialStatePropertiesEditionPartImpl.this, StatemachineViewsRepository.InitialState.Properties.outcomingTransitions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
    outcomingTransitions.refresh();
}
Also used : IPropertiesEditionEvent(org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent) PropertiesEditionEvent(org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)

Example 90 with PropertiesEditionEvent

use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent 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)

Aggregations

PropertiesEditionEvent (org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)1056 IPropertiesEditionEvent (org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)1052 GridData (org.eclipse.swt.layout.GridData)818 FocusAdapter (org.eclipse.swt.events.FocusAdapter)458 FocusEvent (org.eclipse.swt.events.FocusEvent)458 KeyAdapter (org.eclipse.swt.events.KeyAdapter)283 KeyEvent (org.eclipse.swt.events.KeyEvent)283 EObject (org.eclipse.emf.ecore.EObject)262 SelectionEvent (org.eclipse.swt.events.SelectionEvent)230 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)228 Label (org.eclipse.swt.widgets.Label)174 ReferencesTable (org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable)162 ReferencesTableListener (org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)162 AdapterFactoryLabelProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider)134 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)116 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)116 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)86 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)84 TabElementTreeSelectionDialog (org.eclipse.emf.eef.runtime.ui.widgets.TabElementTreeSelectionDialog)78 EObjectFlatComboViewer (org.eclipse.emf.eef.runtime.ui.widgets.EObjectFlatComboViewer)60