PageRenderTime 12ms CodeModel.GetById 1ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/External/Processors/UITextFieldProcessor.m

http://github.com/juancruzmdq/objc-generator
Objective C | 102 lines | 89 code | 6 blank | 7 comment | 33 complexity | 6e877e39f0d8aa46594459229df64c72 MD5 | raw file
  1//
  2//  UITextFieldProcessor.m
  3//  nib2objc
  4//
  5//  Created by Adrian on 3/14/09.
  6//  Adrian Kosmaczewski 2009
  7//
  8
  9#import "UITextFieldProcessor.h"
 10#import "NSString+Nib2ObjcExtensions.h"
 11#import "NSNumber+Nib2ObjcExtensions.h"
 12#import "NSDictionary+Nib2ObjcExtensions.h"
 13
 14@implementation UITextFieldProcessor
 15
 16- (void)dealloc
 17{
 18    [super dealloc];
 19}
 20
 21- (NSString *)getProcessedClassName
 22{
 23    return @"UITextField";
 24}
 25
 26- (void)processKey:(id)item value:(id)value
 27{
 28    if ([item isEqualToString:@"text"])
 29    {
 30        [output setObject:[OGInstruction initWithStringLocalized:[value quotedAsCodeString]] forKey:item];
 31    }
 32    else if ([item isEqualToString:@"placeholder"])
 33    {
 34        [output setObject:[OGInstruction initWithStringLocalized:[value quotedAsCodeString]] forKey:item];
 35    }
 36    else if ([item isEqualToString:@"textAlignment"])
 37    {
 38        [output setObject:[OGInstruction initWithString:[value textAlignmentString]] forKey:item];
 39    }
 40    else if ([item isEqualToString:@"textColor"])
 41    {
 42        [output setObject:[OGInstruction initWithString:[value colorString]] forKey:item];
 43    }
 44    else if ([item isEqualToString:@"font"])
 45    {
 46        [output setObject:[OGInstruction initWithString:[value fontString]] forKey:item];
 47    }
 48    else if ([item isEqualToString:@"borderStyle"])
 49    {
 50        [output setObject:[OGInstruction initWithString:[value borderStyleString]] forKey:item];
 51    }
 52    else if ([item isEqualToString:@"clearsOnBeginEditing"])
 53    {
 54        [output setObject:[OGInstruction initWithString:[value booleanString]] forKey:item];
 55    }
 56    else if ([item isEqualToString:@"adjustsFontSizeToFitWidth"])
 57    {
 58        [output setObject:[OGInstruction initWithString:[value booleanString]] forKey:item];
 59    }
 60    else if ([item isEqualToString:@"minimumFontSize"])
 61    {
 62        [output setObject:[OGInstruction initWithString:[value floatString]] forKey:item];
 63    }
 64    else if ([item isEqualToString:@"textInputTraits.enablesReturnKeyAutomatically"])
 65    {
 66        [output setObject:[OGInstruction initWithString:[value booleanString]] forKey:@"enablesReturnKeyAutomatically"];
 67    }
 68    else if ([item isEqualToString:@"textInputTraits.secureTextEntry"])
 69    {
 70        [output setObject:[OGInstruction initWithString:[value booleanString]] forKey:@"secureTextEntry"];
 71    }
 72    else if ([item isEqualToString:@"textInputTraits.keyboardAppearance"])
 73    {
 74        [output setObject:[OGInstruction initWithString:[value keyboardAppearanceString]] forKey:@"keyboardAppearance"];
 75    }
 76    else if ([item isEqualToString:@"textInputTraits.returnKeyType"])
 77    {
 78        [output setObject:[OGInstruction initWithString:[value returnKeyTypeString]] forKey:@"returnKeyType"];
 79    }
 80    else if ([item isEqualToString:@"textInputTraits.autocapitalizationType"])
 81    {
 82        [output setObject:[OGInstruction initWithString:[value autocapitalizationTypeString]] forKey:@"autocapitalizationType"];
 83    }
 84    else if ([item isEqualToString:@"textInputTraits.autocorrectionType"])
 85    {
 86        [output setObject:[OGInstruction initWithString:[value autocorrectionTypeString]] forKey:@"autocorrectionType"];
 87    }
 88    else if ([item isEqualToString:@"textInputTraits.keyboardType"])
 89    {
 90        [output setObject:[OGInstruction initWithString:[value keyboardTypeString]] forKey:@"keyboardType"];
 91    }
 92    else if ([item isEqualToString:@"clearButtonMode"])
 93    {
 94        [output setObject:[OGInstruction initWithString:[value clearButtonModeString]] forKey:item];
 95    }
 96    else
 97    {
 98        [super processKey:item value:value];
 99    }
100}
101
102@end