Search in sources :

Example 6 with ScreenListItemCell

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

the class DefaultDetailsScreenModuleFileCompiler method cells.

public Iterable<ScreenListItemCell> cells(final Screen it) {
    EList<ScreenSection> _sections = it.getSections();
    final Function1<ScreenSection, ScreenSectionItems> _function = new Function1<ScreenSection, ScreenSectionItems>() {

        public ScreenSectionItems apply(final ScreenSection it) {
            ScreenSectionItems _items = it.getItems();
            return _items;
        }
    };
    List<ScreenSectionItems> _map = ListExtensions.<ScreenSection, ScreenSectionItems>map(_sections, _function);
    final Function1<ScreenSectionItems, EList<ScreenListItemCell>> _function_1 = new Function1<ScreenSectionItems, EList<ScreenListItemCell>>() {

        public EList<ScreenListItemCell> apply(final ScreenSectionItems it) {
            EList<ScreenListItemCell> _items = it.getItems();
            return _items;
        }
    };
    List<EList<ScreenListItemCell>> _map_1 = ListExtensions.<ScreenSectionItems, EList<ScreenListItemCell>>map(_map, _function_1);
    Iterable<ScreenListItemCell> _flatten = Iterables.<ScreenListItemCell>concat(_map_1);
    return _flatten;
}
Also used : ScreenSection(org.applause.lang.applauseDsl.ScreenSection) ScreenListItemCell(org.applause.lang.applauseDsl.ScreenListItemCell) EList(org.eclipse.emf.common.util.EList) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1) ScreenSectionItems(org.applause.lang.applauseDsl.ScreenSectionItems)

Example 7 with ScreenListItemCell

use of org.applause.lang.applauseDsl.ScreenListItemCell 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 8 with ScreenListItemCell

use of org.applause.lang.applauseDsl.ScreenListItemCell 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)

Example 9 with ScreenListItemCell

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

the class DefaultDetailsScreenModuleFileCompiler method compileForm.

public CharSequence compileForm(final Screen it) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("- (QRootElement *)createForm");
    _builder.newLine();
    _builder.append("{");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("QRootElement *root = [[QRootElement alloc] init];");
    _builder.newLine();
    _builder.append("\t");
    _builder.append("root.controllerName = @\"");
    String _controllerClassName = this._defaultDetailsScreenClassExtensions.controllerClassName(it);
    _builder.append(_controllerClassName, "	");
    _builder.append("\";");
    _builder.newLineIfNotEmpty();
    _builder.append("\t");
    _builder.append("root.grouped = YES;");
    _builder.newLine();
    {
        String _title = it.getTitle();
        boolean _notEquals = (!Objects.equal(_title, null));
        if (_notEquals) {
            _builder.append("\t");
            _builder.append("root.title = @\"");
            String _title_1 = it.getTitle();
            _builder.append(_title_1, "	");
            _builder.append("\";");
            _builder.newLineIfNotEmpty();
        }
    }
    _builder.newLine();
    _builder.append("\t");
    _builder.append("QSection *sectionMain = [[QSection alloc] init];");
    _builder.newLine();
    _builder.newLine();
    {
        Iterable<ScreenListItemCell> _cells = this.cells(it);
        for (final ScreenListItemCell it_1 : _cells) {
            _builder.append("\t");
            CharSequence _compileCell = this.compileCell(it_1);
            _builder.append(_compileCell, "	");
            _builder.newLineIfNotEmpty();
            _builder.append("\t");
            _builder.newLine();
        }
    }
    _builder.append("\t");
    _builder.append("[root addSection:sectionMain];");
    _builder.newLine();
    _builder.newLine();
    _builder.append("\t");
    _builder.append("return root;");
    _builder.newLine();
    _builder.append("}");
    _builder.newLine();
    return _builder;
}
Also used : ScreenListItemCell(org.applause.lang.applauseDsl.ScreenListItemCell) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation)

Example 10 with ScreenListItemCell

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

the class DefaultDetailsScreenModuleFileCompiler method configurations.

public Iterable<UIComponentMemberConfiguration> configurations(final Screen it) {
    EList<ScreenSection> _sections = it.getSections();
    final Function1<ScreenSection, ScreenSectionItems> _function = new Function1<ScreenSection, ScreenSectionItems>() {

        public ScreenSectionItems apply(final ScreenSection it) {
            ScreenSectionItems _items = it.getItems();
            return _items;
        }
    };
    List<ScreenSectionItems> _map = ListExtensions.<ScreenSection, ScreenSectionItems>map(_sections, _function);
    final Function1<ScreenSectionItems, EList<ScreenListItemCell>> _function_1 = new Function1<ScreenSectionItems, EList<ScreenListItemCell>>() {

        public EList<ScreenListItemCell> apply(final ScreenSectionItems it) {
            EList<ScreenListItemCell> _items = it.getItems();
            return _items;
        }
    };
    List<EList<ScreenListItemCell>> _map_1 = ListExtensions.<ScreenSectionItems, EList<ScreenListItemCell>>map(_map, _function_1);
    Iterable<ScreenListItemCell> _flatten = Iterables.<ScreenListItemCell>concat(_map_1);
    final Function1<ScreenListItemCell, EList<UIComponentMemberConfiguration>> _function_2 = new Function1<ScreenListItemCell, EList<UIComponentMemberConfiguration>>() {

        public EList<UIComponentMemberConfiguration> apply(final ScreenListItemCell it) {
            EList<UIComponentMemberConfiguration> _configurations = it.getConfigurations();
            return _configurations;
        }
    };
    Iterable<EList<UIComponentMemberConfiguration>> _map_2 = IterableExtensions.<ScreenListItemCell, EList<UIComponentMemberConfiguration>>map(_flatten, _function_2);
    Iterable<UIComponentMemberConfiguration> _flatten_1 = Iterables.<UIComponentMemberConfiguration>concat(_map_2);
    return _flatten_1;
}
Also used : ScreenListItemCell(org.applause.lang.applauseDsl.ScreenListItemCell) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1) ScreenSectionItems(org.applause.lang.applauseDsl.ScreenSectionItems) ScreenSection(org.applause.lang.applauseDsl.ScreenSection) EList(org.eclipse.emf.common.util.EList) UIComponentMemberConfiguration(org.applause.lang.applauseDsl.UIComponentMemberConfiguration)

Aggregations

ScreenListItemCell (org.applause.lang.applauseDsl.ScreenListItemCell)11 Function1 (org.eclipse.xtext.xbase.lib.Functions.Function1)8 ScreenSection (org.applause.lang.applauseDsl.ScreenSection)5 ScreenSectionItems (org.applause.lang.applauseDsl.ScreenSectionItems)5 EList (org.eclipse.emf.common.util.EList)5 UIAction (org.applause.lang.applauseDsl.UIAction)3 UIActionSpecification (org.applause.lang.applauseDsl.UIActionSpecification)3 DataSourceAccessMethod (org.applause.lang.applauseDsl.DataSourceAccessMethod)2 RESTMethodCall (org.applause.lang.applauseDsl.RESTMethodCall)2 UIActionDeleteAction (org.applause.lang.applauseDsl.UIActionDeleteAction)2 UIComponentMemberConfiguration (org.applause.lang.applauseDsl.UIComponentMemberConfiguration)2 Screen (org.applause.lang.applauseDsl.Screen)1 UIActionNavigateAction (org.applause.lang.applauseDsl.UIActionNavigateAction)1 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)1