Search in sources :

Example 16 with Function1

use of org.eclipse.xtext.xbase.lib.Functions.Function1 in project applause by applause.

the class DefaultListScreenClassExtensions 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)

Example 17 with Function1

use of org.eclipse.xtext.xbase.lib.Functions.Function1 in project applause by applause.

the class DefaultListScreenClassExtensions method defaultCell.

public ScreenListItemCell defaultCell(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);
    ScreenListItemCell _head = IterableExtensions.<ScreenListItemCell>head(_flatten);
    return _head;
}
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 18 with Function1

use of org.eclipse.xtext.xbase.lib.Functions.Function1 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 19 with Function1

use of org.eclipse.xtext.xbase.lib.Functions.Function1 in project applause by applause.

the class RESTURLExtensions method _value.

protected String _value(final RelativeRESTURL it) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("/");
    EList<UrlFragment> _fragments = it.getFragments();
    final Function1<UrlFragment, String> _function = new Function1<UrlFragment, String>() {

        public String apply(final UrlFragment fragment) {
            String _value = RESTURLExtensions.this.value(fragment);
            return _value;
        }
    };
    List<String> _map = ListExtensions.<UrlFragment, String>map(_fragments, _function);
    String _join = IterableExtensions.join(_map, "/");
    _builder.append(_join, "");
    return _builder.toString();
}
Also used : UrlFragment(org.applause.lang.applauseDsl.UrlFragment) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1)

Example 20 with Function1

use of org.eclipse.xtext.xbase.lib.Functions.Function1 in project applause by applause.

the class RESTURLExtensions method _value.

protected String _value(final AbsoluteRESTURL it) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("http://");
    UrlFragment _host = it.getHost();
    String _value = this.value(_host);
    _builder.append(_value, "");
    String _xifexpression = null;
    int _port = it.getPort();
    boolean _notEquals = (_port != 0);
    if (_notEquals) {
        int _port_1 = it.getPort();
        String _plus = (":" + Integer.valueOf(_port_1));
        _xifexpression = _plus;
    }
    _builder.append(_xifexpression, "");
    _builder.append("/");
    EList<UrlFragment> _fragments = it.getFragments();
    final Function1<UrlFragment, String> _function = new Function1<UrlFragment, String>() {

        public String apply(final UrlFragment fragment) {
            String _value = RESTURLExtensions.this.value(fragment);
            return _value;
        }
    };
    List<String> _map = ListExtensions.<UrlFragment, String>map(_fragments, _function);
    String _join = IterableExtensions.join(_map, "/");
    _builder.append(_join, "");
    return _builder.toString();
}
Also used : UrlFragment(org.applause.lang.applauseDsl.UrlFragment) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1)

Aggregations

Function1 (org.eclipse.xtext.xbase.lib.Functions.Function1)37 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)17 ColumnSource (com.robotoworks.mechanoid.db.sqliteModel.ColumnSource)13 EList (org.eclipse.emf.common.util.EList)11 ScreenListItemCell (org.applause.lang.applauseDsl.ScreenListItemCell)8 ColumnType (com.robotoworks.mechanoid.db.sqliteModel.ColumnType)7 CreateViewStatement (com.robotoworks.mechanoid.db.sqliteModel.CreateViewStatement)5 DatabaseBlock (com.robotoworks.mechanoid.db.sqliteModel.DatabaseBlock)5 ArrayList (java.util.ArrayList)5 ScreenSection (org.applause.lang.applauseDsl.ScreenSection)5 ScreenSectionItems (org.applause.lang.applauseDsl.ScreenSectionItems)5 ActionStatement (com.robotoworks.mechanoid.db.sqliteModel.ActionStatement)4 ResultColumn (com.robotoworks.mechanoid.db.sqliteModel.ResultColumn)4 UIComponentMemberConfiguration (org.applause.lang.applauseDsl.UIComponentMemberConfiguration)4 ColumnDef (com.robotoworks.mechanoid.db.sqliteModel.ColumnDef)3 ConfigBlock (com.robotoworks.mechanoid.db.sqliteModel.ConfigBlock)3 ConfigurationStatement (com.robotoworks.mechanoid.db.sqliteModel.ConfigurationStatement)3 ContentUri (com.robotoworks.mechanoid.db.sqliteModel.ContentUri)3 CreateTableStatement (com.robotoworks.mechanoid.db.sqliteModel.CreateTableStatement)3 TableDefinition (com.robotoworks.mechanoid.db.sqliteModel.TableDefinition)3