use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.
the class ScreensDefiningScreensSpec method _screensMustBeUnique.
/**
* Screens must be unique. Currently, this means they must be unique across the board and __cannot__
* be namespaced.
* @filter('''|.hasDuplicateScreen)
*/
@Test
@Named("Screens must be unique")
@Order(2)
public void _screensMustBeUnique() throws Exception {
StringConcatenation _builder = new StringConcatenation();
_builder.append("screen DefaultList PersonList {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
_builder.append("screen DefaultList PersonList {");
_builder.newLine();
_builder.append("}");
_builder.newLine();
this._screensValidationTestHelper.hasDuplicateScreen(_builder);
}
use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.
the class DefaultListScreenEditActionCompiler method compileCommitEditing.
public CharSequence compileCommitEditing(final Screen it) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath");
_builder.newLine();
_builder.append("{");
_builder.newLine();
_builder.append("\t");
Entity _resourceType = this._defaultListScreenClassExtensions.resourceType(it);
String _typeName = this._typeExtensions.typeName(_resourceType);
_builder.append(_typeName, " ");
_builder.append(" *item= self.items[indexPath.row];");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("[item ");
DataSourceAccessMethod _deleteMethod = this.deleteMethod(it);
String _name = _deleteMethod.getName();
_builder.append(_name, " ");
_builder.append(":^(");
Entity _resourceType_1 = this._defaultListScreenClassExtensions.resourceType(it);
String _typeName_1 = this._typeExtensions.typeName(_resourceType_1);
_builder.append(_typeName_1, " ");
_builder.append(" *item, NSError *error)");
_builder.newLineIfNotEmpty();
_builder.append("\t");
_builder.append("{");
_builder.newLine();
_builder.append("\t\t");
_builder.append("if (error) {");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("NSLog(@\"Error %@\", error);");
_builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t\t");
_builder.append("else {");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("if (indexPath.row < self.items.count) {");
_builder.newLine();
_builder.append("\t\t\t\t");
_builder.append("[self.items removeObjectAtIndex:indexPath.row];");
_builder.newLine();
_builder.append("\t\t\t\t");
_builder.append("[self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.append("}];");
_builder.newLine();
_builder.append("}");
_builder.newLine();
return _builder;
}
use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.
the class DefaultListScreenHeaderFileCompiler method compileHeader.
public CharSequence compileHeader(final Screen it) {
StringConcatenation _builder = new StringConcatenation();
_builder.append("#import <UIKit/UIKit.h>");
_builder.newLine();
_builder.newLine();
_builder.append("@interface ");
String _controllerClassName = this._defaultListScreenClassExtensions.controllerClassName(it);
_builder.append(_controllerClassName, "");
_builder.append(" : UITableViewController");
_builder.newLineIfNotEmpty();
_builder.newLine();
_builder.append("@end");
_builder.newLine();
return _builder;
}
use of org.eclipse.xtend2.lib.StringConcatenation 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;
}
use of org.eclipse.xtend2.lib.StringConcatenation in project applause by applause.
the class ParserTest method parseDomainModel.
@Test
public void parseDomainModel() {
try {
StringConcatenation _builder = new StringConcatenation();
_builder.append("datatype String");
_builder.newLine();
_builder.append("datatype Integer");
_builder.newLine();
final Model model = this.parser.parse(_builder);
EList<NamedElement> _elements = model.getElements();
NamedElement _head = IterableExtensions.<NamedElement>head(_elements);
final DataType dtString = ((DataType) _head);
String _name = dtString.getName();
Assert.assertEquals("String", _name);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations