Search in sources :

Example 1 with Expression

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

the class DefaultListScreenModuleFileCompiler method compileConfiguration.

public CharSequence compileConfiguration(final UIComponentMemberConfiguration it) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("cell.");
    UIComponentMemberCall _type = it.getType();
    UIComponentMemberDeclaration _component = _type.getComponent();
    String _name = _component.getName();
    _builder.append(_name, "");
    _builder.append(".");
    UIComponentMemberCall _type_1 = it.getType();
    UIComponentMemberDeclaration _member = _type_1.getMember();
    String _name_1 = _member.getName();
    _builder.append(_name_1, "");
    _builder.append(" = item.");
    Expression _value = it.getValue();
    String _evaluateExpression = this._expressionExtensions.evaluateExpression(_value);
    _builder.append(_evaluateExpression, "");
    _builder.append(";");
    _builder.newLineIfNotEmpty();
    return _builder;
}
Also used : Expression(org.applause.lang.applauseDsl.Expression) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) UIComponentMemberCall(org.applause.lang.applauseDsl.UIComponentMemberCall) UIComponentMemberDeclaration(org.applause.lang.applauseDsl.UIComponentMemberDeclaration)

Example 2 with Expression

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

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

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

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

the class DefaultDetailsScreenModuleFileCompiler method entryElementName.

public String entryElementName(final ScreenListItemCell it) {
    UIComponentMemberConfiguration _detailsConfig = this.detailsConfig(it);
    Expression _value = _detailsConfig.getValue();
    String _evaluateExpression = this._expressionExtensions.evaluateExpression(_value);
    String _firstLower = StringExtensions.toFirstLower(_evaluateExpression);
    String _plus = (_firstLower + "Element");
    return _plus;
}
Also used : Expression(org.applause.lang.applauseDsl.Expression) UIComponentMemberConfiguration(org.applause.lang.applauseDsl.UIComponentMemberConfiguration)

Aggregations

Expression (org.applause.lang.applauseDsl.Expression)6 UIComponentMemberConfiguration (org.applause.lang.applauseDsl.UIComponentMemberConfiguration)4 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)4 UIComponentMemberCall (org.applause.lang.applauseDsl.UIComponentMemberCall)1 UIComponentMemberDeclaration (org.applause.lang.applauseDsl.UIComponentMemberDeclaration)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1