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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations