Search in sources :

Example 21 with Function1

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

the class DefaultDetailsScreenModuleFileCompiler method dataAccessMethodNameForCreate.

public String dataAccessMethodNameForCreate(final Screen it) {
    DataSourceCall _datasource = it.getDatasource();
    DataSource _datasource_1 = _datasource.getDatasource();
    EList<DataSourceAccessMethod> _methods = _datasource_1.getMethods();
    final Function1<DataSourceAccessMethod, Boolean> _function = new Function1<DataSourceAccessMethod, Boolean>() {

        public Boolean apply(final DataSourceAccessMethod it) {
            RESTSpecification _restSpecification = it.getRestSpecification();
            RESTVerb _verb = _restSpecification.getVerb();
            boolean _equals = Objects.equal(_verb, RESTVerb.POST);
            return Boolean.valueOf(_equals);
        }
    };
    DataSourceAccessMethod _findFirst = IterableExtensions.<DataSourceAccessMethod>findFirst(_methods, _function);
    String _name = _findFirst.getName();
    return _name;
}
Also used : DataSourceCall(org.applause.lang.applauseDsl.DataSourceCall) DataSourceAccessMethod(org.applause.lang.applauseDsl.DataSourceAccessMethod) RESTSpecification(org.applause.lang.applauseDsl.RESTSpecification) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1) RESTVerb(org.applause.lang.applauseDsl.RESTVerb) DataSource(org.applause.lang.applauseDsl.DataSource)

Example 22 with Function1

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

the class DefaultDetailsScreenModuleFileCompiler method labelConfig.

public UIComponentMemberConfiguration labelConfig(final ScreenListItemCell it) {
    EList<UIComponentMemberConfiguration> _configurations = it.getConfigurations();
    final Function1<UIComponentMemberConfiguration, Boolean> _function = new Function1<UIComponentMemberConfiguration, Boolean>() {

        public Boolean apply(final UIComponentMemberConfiguration it) {
            UIComponentMemberCall _type = it.getType();
            UIComponentMemberDeclaration _component = _type.getComponent();
            String _name = _component.getName();
            boolean _equals = Objects.equal(_name, "label");
            return Boolean.valueOf(_equals);
        }
    };
    UIComponentMemberConfiguration _findFirst = IterableExtensions.<UIComponentMemberConfiguration>findFirst(_configurations, _function);
    return _findFirst;
}
Also used : Function1(org.eclipse.xtext.xbase.lib.Functions.Function1) UIComponentMemberConfiguration(org.applause.lang.applauseDsl.UIComponentMemberConfiguration) UIComponentMemberCall(org.applause.lang.applauseDsl.UIComponentMemberCall) UIComponentMemberDeclaration(org.applause.lang.applauseDsl.UIComponentMemberDeclaration)

Example 23 with Function1

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

the class DefaultDetailsScreenModuleFileCompiler method dataAccessMethodNameForUpdate.

public String dataAccessMethodNameForUpdate(final Screen it) {
    DataSourceCall _datasource = it.getDatasource();
    DataSource _datasource_1 = _datasource.getDatasource();
    EList<DataSourceAccessMethod> _methods = _datasource_1.getMethods();
    final Function1<DataSourceAccessMethod, Boolean> _function = new Function1<DataSourceAccessMethod, Boolean>() {

        public Boolean apply(final DataSourceAccessMethod it) {
            RESTSpecification _restSpecification = it.getRestSpecification();
            RESTVerb _verb = _restSpecification.getVerb();
            boolean _equals = Objects.equal(_verb, RESTVerb.PUT);
            return Boolean.valueOf(_equals);
        }
    };
    DataSourceAccessMethod _findFirst = IterableExtensions.<DataSourceAccessMethod>findFirst(_methods, _function);
    String _name = _findFirst.getName();
    return _name;
}
Also used : DataSourceCall(org.applause.lang.applauseDsl.DataSourceCall) DataSourceAccessMethod(org.applause.lang.applauseDsl.DataSourceAccessMethod) RESTSpecification(org.applause.lang.applauseDsl.RESTSpecification) Function1(org.eclipse.xtext.xbase.lib.Functions.Function1) RESTVerb(org.applause.lang.applauseDsl.RESTVerb) DataSource(org.applause.lang.applauseDsl.DataSource)

Example 24 with Function1

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

the class DefaultDetailsScreenModuleFileCompiler method detailsConfig.

public UIComponentMemberConfiguration detailsConfig(final ScreenListItemCell it) {
    EList<UIComponentMemberConfiguration> _configurations = it.getConfigurations();
    final Function1<UIComponentMemberConfiguration, Boolean> _function = new Function1<UIComponentMemberConfiguration, Boolean>() {

        public Boolean apply(final UIComponentMemberConfiguration it) {
            UIComponentMemberCall _type = it.getType();
            UIComponentMemberDeclaration _component = _type.getComponent();
            String _name = _component.getName();
            boolean _equals = Objects.equal(_name, "details");
            return Boolean.valueOf(_equals);
        }
    };
    UIComponentMemberConfiguration _findFirst = IterableExtensions.<UIComponentMemberConfiguration>findFirst(_configurations, _function);
    return _findFirst;
}
Also used : Function1(org.eclipse.xtext.xbase.lib.Functions.Function1) UIComponentMemberConfiguration(org.applause.lang.applauseDsl.UIComponentMemberConfiguration) UIComponentMemberCall(org.applause.lang.applauseDsl.UIComponentMemberCall) UIComponentMemberDeclaration(org.applause.lang.applauseDsl.UIComponentMemberDeclaration)

Example 25 with Function1

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

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