Plugin data display works.

This commit is contained in:
michael starke
2017-02-03 18:35:37 +01:00
parent 11236c50f9
commit 2e7e032007
2 changed files with 15 additions and 2 deletions

View File

@@ -7,6 +7,7 @@
//
#import "MPPluginDataViewController.h"
#import "MPCustomFieldTableCellView.h"
#import <KeePassKit/KeePassKit.h>
@@ -34,6 +35,7 @@
- (void)didLoadView {
[self.pluginDataController bind:NSContentDictionaryBinding toObject:self.representedObject withKeyPath:NSStringFromSelector(@selector(customData)) options:nil];
[self.pluginDataTabelView bind:NSContentBinding toObject:self.pluginDataController withKeyPath:NSStringFromSelector(@selector(arrangedObjects)) options:nil];
self.pluginDataTabelView.backgroundColor = [NSColor clearColor];
}
@@ -49,7 +51,15 @@
}
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
NSTableCellView *view = [tableView makeViewWithIdentifier:@"PluginCell" owner:self];
MPCustomFieldTableCellView *view = [tableView makeViewWithIdentifier:@"PluginCell" owner:self];
[view.valueTextField bind:NSValueBinding
toObject:view
withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(objectValue)), NSStringFromSelector(@selector(value))]
options:nil];
[view.labelTextField bind:NSValueBinding
toObject:view
withKeyPath:[NSString stringWithFormat:@"%@.%@", NSStringFromSelector(@selector(objectValue)), NSStringFromSelector(@selector(key))]
options:nil];
return view;
}

View File

@@ -102,6 +102,9 @@
</prototypeCellViews>
</tableColumn>
</tableColumns>
<connections>
<outlet property="delegate" destination="-2" id="vlQ-Zb-6LN"/>
</connections>
</tableView>
</subviews>
</clipView>
@@ -147,7 +150,7 @@
<constraint firstItem="eUU-kx-L3U" firstAttribute="top" secondItem="ZhC-nS-vfd" secondAttribute="bottom" constant="8" symbolic="YES" id="Z31-cy-f9g"/>
<constraint firstAttribute="bottom" secondItem="wUR-gA-36a" secondAttribute="bottom" constant="20" symbolic="YES" id="ohy-oM-biY"/>
</constraints>
<point key="canvasLocation" x="-159.5" y="130"/>
<point key="canvasLocation" x="-458" y="147"/>
</customView>
</objects>
<resources>