Search in sources :

Example 1 with UIActionSpecification

use of org.applause.lang.applauseDsl.UIActionSpecification in project applause by applause.

the class DefaultListScreenActionCompiler method compileActionButton.

private CharSequence compileActionButton(final UIAction it) {
    CharSequence _xifexpression = null;
    UIActionSpecification _action = it.getAction();
    if ((_action instanceof UIActionNavigateAction)) {
        CharSequence _switchResult = null;
        UIActionSpecification _action_1 = it.getAction();
        ActionVerb _actionVerb = ((UIActionNavigateAction) _action_1).getActionVerb();
        final ActionVerb _switchValue = _actionVerb;
        boolean _matched = false;
        if (!_matched) {
            if (Objects.equal(_switchValue, ActionVerb.ADD)) {
                _matched = true;
                Screen _screen = this._defaultListScreenClassExtensions.screen(it);
                CharSequence _compileActionButton_AddItem = this.compileActionButton_AddItem(_screen);
                _switchResult = _compileActionButton_AddItem;
            }
        }
        _xifexpression = _switchResult;
    }
    return _xifexpression;
}
Also used : UIActionNavigateAction(org.applause.lang.applauseDsl.UIActionNavigateAction) ActionVerb(org.applause.lang.applauseDsl.ActionVerb) Screen(org.applause.lang.applauseDsl.Screen) UIActionSpecification(org.applause.lang.applauseDsl.UIActionSpecification)

Example 2 with UIActionSpecification

use of org.applause.lang.applauseDsl.UIActionSpecification in project applause by applause.

the class DefaultListScreenClassExtensions method targetNavigationScreen.

public Screen targetNavigationScreen(final Screen it) {
    ScreenListItemCell _defaultCell = this.defaultCell(it);
    EList<UIAction> _actions = _defaultCell.getActions();
    final Function1<UIAction, UIActionSpecification> _function = new Function1<UIAction, UIActionSpecification>() {

        public UIActionSpecification apply(final UIAction it) {
            UIActionSpecification _action = it.getAction();
            return _action;
        }
    };
    List<UIActionSpecification> _map = ListExtensions.<UIAction, UIActionSpecification>map(_actions, _function);
    Iterable<UIActionNavigateAction> _filter = Iterables.<UIActionNavigateAction>filter(_map, UIActionNavigateAction.class);
    UIActionNavigateAction _head = IterableExtensions.<UIActionNavigateAction>head(_filter);
    Screen _targetScreen = _head.getTargetScreen();
    return _targetScreen;
}
Also used : ScreenListItemCell(org.applause.lang.applauseDsl.ScreenListItemCell) UIActionNavigateAction(org.applause.lang.applauseDsl.UIActionNavigateAction) UIAction(org.applause.lang.applauseDsl.UIAction) Screen(org.applause.lang.applauseDsl.Screen) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1) UIActionSpecification(org.applause.lang.applauseDsl.UIActionSpecification)

Example 3 with UIActionSpecification

use of org.applause.lang.applauseDsl.UIActionSpecification in project applause by applause.

the class UIActionImpl method basicSetAction.

/**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
public NotificationChain basicSetAction(UIActionSpecification newAction, NotificationChain msgs) {
    UIActionSpecification oldAction = action;
    action = newAction;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ApplauseDslPackage.UI_ACTION__ACTION, oldAction, newAction);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) UIActionSpecification(org.applause.lang.applauseDsl.UIActionSpecification)

Example 4 with UIActionSpecification

use of org.applause.lang.applauseDsl.UIActionSpecification in project applause by applause.

the class DefaultListScreenEditActionCompiler method supportsDeleteAction.

public boolean supportsDeleteAction(final Screen it) {
    ScreenListItemCell _defaultCell = this._defaultListScreenClassExtensions.defaultCell(it);
    EList<UIAction> _actions = _defaultCell.getActions();
    final Function1<UIAction, UIActionSpecification> _function = new Function1<UIAction, UIActionSpecification>() {

        public UIActionSpecification apply(final UIAction it) {
            UIActionSpecification _action = it.getAction();
            return _action;
        }
    };
    List<UIActionSpecification> _map = ListExtensions.<UIAction, UIActionSpecification>map(_actions, _function);
    Iterable<UIActionDeleteAction> _filter = Iterables.<UIActionDeleteAction>filter(_map, UIActionDeleteAction.class);
    int _size = IterableExtensions.size(_filter);
    boolean _greaterThan = (_size > 0);
    return _greaterThan;
}
Also used : ScreenListItemCell(org.applause.lang.applauseDsl.ScreenListItemCell) UIAction(org.applause.lang.applauseDsl.UIAction) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1) UIActionDeleteAction(org.applause.lang.applauseDsl.UIActionDeleteAction) UIActionSpecification(org.applause.lang.applauseDsl.UIActionSpecification)

Example 5 with UIActionSpecification

use of org.applause.lang.applauseDsl.UIActionSpecification in project applause by applause.

the class DefaultListScreenEditActionCompiler method deleteAction.

public UIActionDeleteAction deleteAction(final Screen it) {
    ScreenListItemCell _defaultCell = this._defaultListScreenClassExtensions.defaultCell(it);
    EList<UIAction> _actions = _defaultCell.getActions();
    final Function1<UIAction, UIActionSpecification> _function = new Function1<UIAction, UIActionSpecification>() {

        public UIActionSpecification apply(final UIAction it) {
            UIActionSpecification _action = it.getAction();
            return _action;
        }
    };
    List<UIActionSpecification> _map = ListExtensions.<UIAction, UIActionSpecification>map(_actions, _function);
    Iterable<UIActionDeleteAction> _filter = Iterables.<UIActionDeleteAction>filter(_map, UIActionDeleteAction.class);
    UIActionDeleteAction _head = IterableExtensions.<UIActionDeleteAction>head(_filter);
    return _head;
}
Also used : ScreenListItemCell(org.applause.lang.applauseDsl.ScreenListItemCell) UIAction(org.applause.lang.applauseDsl.UIAction) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1) UIActionDeleteAction(org.applause.lang.applauseDsl.UIActionDeleteAction) UIActionSpecification(org.applause.lang.applauseDsl.UIActionSpecification)

Aggregations

UIActionSpecification (org.applause.lang.applauseDsl.UIActionSpecification)6 Screen (org.applause.lang.applauseDsl.Screen)3 ScreenListItemCell (org.applause.lang.applauseDsl.ScreenListItemCell)3 UIAction (org.applause.lang.applauseDsl.UIAction)3 UIActionNavigateAction (org.applause.lang.applauseDsl.UIActionNavigateAction)3 Function1 (org.eclipse.xtext.xbase.lib.Functions.Function1)3 ActionVerb (org.applause.lang.applauseDsl.ActionVerb)2 UIActionDeleteAction (org.applause.lang.applauseDsl.UIActionDeleteAction)2 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1