Oolite 1.91.0.7646-241128-10e222e
Loading...
Searching...
No Matches
OOShipGroupDebugInspectorModule Class Reference

#include <OOShipGroupDebugInspectorModule.h>

+ Inheritance diagram for OOShipGroupDebugInspectorModule:
+ Collaboration diagram for OOShipGroupDebugInspectorModule:

Instance Methods

(IBAction) - inspectLeader:
 
(IBAction) - inspectMember:
 
(void) - awakeFromNib [implementation]
 
(void) - update [implementation]
 
(NSInteger) - numberOfRowsInTableView: [implementation]
 
(id) - tableView:objectValueForTableColumn:row: [implementation]
 
- Instance Methods inherited from OODebugInspectorModule
(id) - initWithObject:
 
(BOOL) - loadUserInterface
 
(NSString *) - nibName
 
(NSView *) - rootView
 
(id) - object
 
(void) - dealloc [implementation]
 

Private Attributes

IBOutlet NSTextField * leaderField
 
IBOutlet NSTableView * membersList
 
NSArray * _members
 

Detailed Description

Definition at line 33 of file OOShipGroupDebugInspectorModule.h.

Method Documentation

◆ awakeFromNib

- (void) awakeFromNib
implementation

Definition at line 1 of file OOShipGroupDebugInspectorModule.m.

45{
46 [membersList setDoubleAction:[membersList action]];
47 [membersList setAction:NULL];
48}

◆ inspectLeader:

- (IBAction) inspectLeader: (id) sender

Definition at line 1 of file OOShipGroupDebugInspectorModule.m.

81 :(id)sender
82{
83 [[[self object] leader] inspect];
84}

◆ inspectMember:

- (IBAction) inspectMember: (id) sender

Definition at line 1 of file OOShipGroupDebugInspectorModule.m.

87 :(id)sender
88{
89 NSInteger clickedRow = [sender clickedRow];
90 if (clickedRow < 0) return;
91
92 [[_members objectAtIndex:clickedRow] inspect];
93}

◆ numberOfRowsInTableView:

- (NSInteger) numberOfRowsInTableView: (NSTableView *) tableView
implementation

Definition at line 1 of file OOShipGroupDebugInspectorModule.m.

96 :(NSTableView *)tableView
97{
98 return [_members count];
99}

◆ tableView:objectValueForTableColumn:row:

- (id) tableView: (NSTableView *) tableView
objectValueForTableColumn: (NSTableColumn *) tableColumn
row: (NSInteger) row 
implementation

Definition at line 1 of file OOShipGroupDebugInspectorModule.m.

102 :(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
103{
104 return [[_members objectAtIndex:row] inspDescription];
105}

◆ update

- (void) update
implementation

Reimplemented from OODebugInspectorModule.

Definition at line 1 of file OOShipGroupDebugInspectorModule.m.

52{
53 OOShipGroup *object = [self object];
54 NSString *placeholder = InspectorUnknownValueString();
55 NSEnumerator *memberEnum = nil;
56 ShipEntity *member = nil;
57 NSMutableArray *members = nil;
58
59 [leaderField setStringValue:[[object leader] inspDescription] ?: placeholder];
60
61 // Make array of weakRefs to group members.
62 members = [NSMutableArray array];
63 for (memberEnum = [object objectEnumerator]; (member = [memberEnum nextObject]); )
64 {
65 id memberRef = [member weakRetain];
66 [members addObject:memberRef];
67 [memberRef release];
68 }
69
70 // Sort array.
71 [members sortUsingSelector:@selector(ooCompareByPointerValue:)];
72 if (![_members isEqualToArray:members])
73 {
74 [_members release];
75 _members = [members copy];
76 [membersList reloadData];
77 }
78}
NSString * InspectorUnknownValueString(void)
return nil
ShipEntity * leader()

Member Data Documentation

◆ _members

- (NSArray*) _members
private

Definition at line 39 of file OOShipGroupDebugInspectorModule.h.

◆ leaderField

- (IBOutlet NSTextField*) leaderField
private

Definition at line 36 of file OOShipGroupDebugInspectorModule.h.

◆ membersList

- (IBOutlet NSTableView*) membersList
private

Definition at line 37 of file OOShipGroupDebugInspectorModule.h.


The documentation for this class was generated from the following files: