Annotation of Examples/EnterpriseObjects/QueryByExample/QBEPalette/TableMagic.m, revision 1.1.1.1

1.1       root        1: // TableMagic - some useful methods for dealing with tableViews tied to controllers.
                      2: 
                      3: #import "TableMagic.h"
                      4: 
                      5: @implementation NXTableView (tableMagic)
                      6: + keyTableView
                      7: {
                      8:     id view = [[NXApp mainWindow] firstResponder];
                      9:     return ([view isKindOf:[NXTableView class]]) ? view : nil;
                     10: }
                     11: 
                     12: - (EOController *)eoController
                     13: {
                     14:     id assoc = [self delegate];
                     15:     if ([assoc isKindOfClass:[EOAssociation class]])
                     16:         return [assoc controller];
                     17:     else
                     18:         return nil;
                     19: }
                     20: 
                     21: - (NSString *)associationKeyForColumn: (unsigned int)colNum
                     22: {
                     23:     id vector = [self columnAt:colNum];
                     24:     id assoc  = [vector identifier];
                     25:     return ([assoc isKindOfClass:[EOAssociation class]]) ? [assoc key] : nil;
                     26: }
                     27: 
                     28: - (NSArray *)associationKeysForSelectedColumns
                     29: {
                     30:     int numselected = [self selectedColumnCount];
                     31:     int colNum;
                     32:     NSMutableArray *keys;
                     33: 
                     34:     keys = [NSMutableArray arrayWithCapacity:numselected];
                     35: 
                     36:     colNum = NX_NoIndex;
                     37:     while ((colNum = [self selectedColumnAfter:colNum])!=NX_NoIndex) {
                     38:         [keys addObject:[self associationKeyForColumn:colNum]];
                     39:     }
                     40: 
                     41:     return keys;
                     42: }
                     43: @end

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.