Search in sources :

Example 1 with Enumerator

use of org.yakindu.base.types.Enumerator in project statecharts by Yakindu.

the class EnumerationEditingSupport method getCellEditor.

@Override
public CellEditor getCellEditor(Object element) {
    if (element instanceof ExecutionSlot) {
        EnumerationType e = getEnumerationType((ExecutionSlot) element);
        List<String> enumeratorNames = new ArrayList<String>();
        for (Enumerator enumerator : e.getEnumerator()) {
            enumeratorNames.add(enumerator.getName());
        }
        return new ComboBoxCellEditor((Composite) getViewer().getControl(), enumeratorNames.toArray(new String[] {}), SWT.READ_ONLY);
    }
    return null;
}
Also used : ExecutionSlot(org.yakindu.sct.model.sruntime.ExecutionSlot) Enumerator(org.yakindu.base.types.Enumerator) EnumerationType(org.yakindu.base.types.EnumerationType) ArrayList(java.util.ArrayList) ComboBoxCellEditor(org.eclipse.jface.viewers.ComboBoxCellEditor)

Aggregations

ArrayList (java.util.ArrayList)1 ComboBoxCellEditor (org.eclipse.jface.viewers.ComboBoxCellEditor)1 EnumerationType (org.yakindu.base.types.EnumerationType)1 Enumerator (org.yakindu.base.types.Enumerator)1 ExecutionSlot (org.yakindu.sct.model.sruntime.ExecutionSlot)1