Search in sources :

Example 1 with UIComponentMemberConfiguration

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

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

the class DefaultDetailsScreenModuleFileCompiler method compileTextCell.

public CharSequence compileTextCell(final ScreenListItemCell it) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("QEntryElement *");
    String _entryElementName = this.entryElementName(it);
    _builder.append(_entryElementName, "");
    _builder.append(" = [[QEntryElement alloc] init];");
    _builder.newLineIfNotEmpty();
    String _entryElementName_1 = this.entryElementName(it);
    _builder.append(_entryElementName_1, "");
    _builder.append(".title = @\"");
    UIComponentMemberConfiguration _labelConfig = this.labelConfig(it);
    Expression _value = _labelConfig.getValue();
    String _evaluateExpression = this._expressionExtensions.evaluateExpression(_value);
    _builder.append(_evaluateExpression, "");
    _builder.append("\";");
    _builder.newLineIfNotEmpty();
    String _entryElementName_2 = this.entryElementName(it);
    _builder.append(_entryElementName_2, "");
    _builder.append(".key = @\"");
    UIComponentMemberConfiguration _detailsConfig = this.detailsConfig(it);
    Expression _value_1 = _detailsConfig.getValue();
    String _evaluateExpression_1 = this._expressionExtensions.evaluateExpression(_value_1);
    _builder.append(_evaluateExpression_1, "");
    _builder.append("\";");
    _builder.newLineIfNotEmpty();
    String _entryElementName_3 = this.entryElementName(it);
    _builder.append(_entryElementName_3, "");
    _builder.append(".bind = @\"textValue:");
    UIComponentMemberConfiguration _detailsConfig_1 = this.detailsConfig(it);
    Expression _value_2 = _detailsConfig_1.getValue();
    String _evaluateExpression_2 = this._expressionExtensions.evaluateExpression(_value_2);
    _builder.append(_evaluateExpression_2, "");
    _builder.append("\";");
    _builder.newLineIfNotEmpty();
    _builder.append("[sectionMain addElement:");
    String _entryElementName_4 = this.entryElementName(it);
    _builder.append(_entryElementName_4, "");
    _builder.append("];");
    _builder.newLineIfNotEmpty();
    return _builder;
}
Also used : Expression(org.applause.lang.applauseDsl.Expression) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) UIComponentMemberConfiguration(org.applause.lang.applauseDsl.UIComponentMemberConfiguration)

Example 3 with UIComponentMemberConfiguration

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

the class DefaultDetailsScreenModuleFileCompiler method compileBooleanCell.

public CharSequence compileBooleanCell(final ScreenListItemCell it) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("QBooleanElement *");
    String _entryElementName = this.entryElementName(it);
    _builder.append(_entryElementName, "");
    _builder.append(" = [[QBooleanElement alloc] init];");
    _builder.newLineIfNotEmpty();
    String _entryElementName_1 = this.entryElementName(it);
    _builder.append(_entryElementName_1, "");
    _builder.append(".title = @\"");
    UIComponentMemberConfiguration _labelConfig = this.labelConfig(it);
    Expression _value = _labelConfig.getValue();
    String _evaluateExpression = this._expressionExtensions.evaluateExpression(_value);
    _builder.append(_evaluateExpression, "");
    _builder.append("\";");
    _builder.newLineIfNotEmpty();
    String _entryElementName_2 = this.entryElementName(it);
    _builder.append(_entryElementName_2, "");
    _builder.append(".key = @\"");
    UIComponentMemberConfiguration _detailsConfig = this.detailsConfig(it);
    Expression _value_1 = _detailsConfig.getValue();
    String _evaluateExpression_1 = this._expressionExtensions.evaluateExpression(_value_1);
    _builder.append(_evaluateExpression_1, "");
    _builder.append("\";");
    _builder.newLineIfNotEmpty();
    String _entryElementName_3 = this.entryElementName(it);
    _builder.append(_entryElementName_3, "");
    _builder.append(".bind = @\"boolValue:");
    UIComponentMemberConfiguration _detailsConfig_1 = this.detailsConfig(it);
    Expression _value_2 = _detailsConfig_1.getValue();
    String _evaluateExpression_2 = this._expressionExtensions.evaluateExpression(_value_2);
    _builder.append(_evaluateExpression_2, "");
    _builder.append("\";");
    _builder.newLineIfNotEmpty();
    _builder.append("[sectionMain addElement:");
    String _entryElementName_4 = this.entryElementName(it);
    _builder.append(_entryElementName_4, "");
    _builder.append("];");
    _builder.newLineIfNotEmpty();
    return _builder;
}
Also used : Expression(org.applause.lang.applauseDsl.Expression) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) UIComponentMemberConfiguration(org.applause.lang.applauseDsl.UIComponentMemberConfiguration)

Example 4 with UIComponentMemberConfiguration

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

the class DefaultDetailsScreenModuleFileCompiler method compileDateCell.

public CharSequence compileDateCell(final ScreenListItemCell it) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("QDateTimeInlineElement *");
    String _entryElementName = this.entryElementName(it);
    _builder.append(_entryElementName, "");
    _builder.append(" = [[QDateTimeInlineElement alloc] init];");
    _builder.newLineIfNotEmpty();
    String _entryElementName_1 = this.entryElementName(it);
    _builder.append(_entryElementName_1, "");
    _builder.append(".title = @\"");
    UIComponentMemberConfiguration _labelConfig = this.labelConfig(it);
    Expression _value = _labelConfig.getValue();
    String _evaluateExpression = this._expressionExtensions.evaluateExpression(_value);
    _builder.append(_evaluateExpression, "");
    _builder.append("\";");
    _builder.newLineIfNotEmpty();
    String _entryElementName_2 = this.entryElementName(it);
    _builder.append(_entryElementName_2, "");
    _builder.append(".mode = UIDatePickerModeDateAndTime;");
    _builder.newLineIfNotEmpty();
    String _entryElementName_3 = this.entryElementName(it);
    _builder.append(_entryElementName_3, "");
    _builder.append(".dateValue = [NSDate date]; ");
    _builder.newLineIfNotEmpty();
    String _entryElementName_4 = this.entryElementName(it);
    _builder.append(_entryElementName_4, "");
    _builder.append(".key = @\"");
    UIComponentMemberConfiguration _detailsConfig = this.detailsConfig(it);
    Expression _value_1 = _detailsConfig.getValue();
    String _evaluateExpression_1 = this._expressionExtensions.evaluateExpression(_value_1);
    _builder.append(_evaluateExpression_1, "");
    _builder.append("\";");
    _builder.newLineIfNotEmpty();
    String _entryElementName_5 = this.entryElementName(it);
    _builder.append(_entryElementName_5, "");
    _builder.append(".bind = @\"dateValue:");
    UIComponentMemberConfiguration _detailsConfig_1 = this.detailsConfig(it);
    Expression _value_2 = _detailsConfig_1.getValue();
    String _evaluateExpression_2 = this._expressionExtensions.evaluateExpression(_value_2);
    _builder.append(_evaluateExpression_2, "");
    _builder.append("\";");
    _builder.newLineIfNotEmpty();
    _builder.append("[sectionMain addElement:");
    String _entryElementName_6 = this.entryElementName(it);
    _builder.append(_entryElementName_6, "");
    _builder.append("];");
    _builder.newLineIfNotEmpty();
    return _builder;
}
Also used : Expression(org.applause.lang.applauseDsl.Expression) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) UIComponentMemberConfiguration(org.applause.lang.applauseDsl.UIComponentMemberConfiguration)

Example 5 with UIComponentMemberConfiguration

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

Aggregations

UIComponentMemberConfiguration (org.applause.lang.applauseDsl.UIComponentMemberConfiguration)9 Expression (org.applause.lang.applauseDsl.Expression)4 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)4 Function1 (org.eclipse.xtext.xbase.lib.Functions.Function1)4 ScreenListItemCell (org.applause.lang.applauseDsl.ScreenListItemCell)2 ScreenSection (org.applause.lang.applauseDsl.ScreenSection)2 ScreenSectionItems (org.applause.lang.applauseDsl.ScreenSectionItems)2 UIComponentMemberCall (org.applause.lang.applauseDsl.UIComponentMemberCall)2 UIComponentMemberDeclaration (org.applause.lang.applauseDsl.UIComponentMemberDeclaration)2 EList (org.eclipse.emf.common.util.EList)2 DataSource (org.applause.lang.applauseDsl.DataSource)1 DataSourceAccessMethod (org.applause.lang.applauseDsl.DataSourceAccessMethod)1 DataSourceCall (org.applause.lang.applauseDsl.DataSourceCall)1 Entity (org.applause.lang.applauseDsl.Entity)1 Screen (org.applause.lang.applauseDsl.Screen)1