forked from jessegrosjean/blocks
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBExtensionPoint.m
47 lines (36 loc) · 1.15 KB
/
BExtensionPoint.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// BExtensionPoint.m
// Blocks
//
// Created by Jesse Grosjean on 8/21/07.
// Copyright 2007 Blocks. All rights reserved.
//
#import "BExtensionPoint.h"
#import "BExtensionRegistry.h"
#import "BExtension.h"
#import "BPlugin.h"
#import "Blocks.h"
@implementation BExtensionPoint
#pragma mark Properties
@synthesize plugin;
@synthesize identifier;
- (NSString *)documentation {
if (!documentation) {
documentation = [NSString stringWithContentsOfFile:[self.plugin.bundle pathForResource:self.identifier ofType:@"markdown"]];
if (!documentation) {
documentation = BLocalizedString(@"No documentation could be found for this extension point.", nil);
}
}
return documentation;
}
#pragma mark Extensions
- (NSArray *)extensions {
return [[BExtensionRegistry sharedInstance] extensionsFor:identifier];
}
- (NSArray *)configurationElements {
return [[BExtensionRegistry sharedInstance] configurationElementsFor:identifier];
}
- (NSArray *)configurationElementsNamed:(NSString *)name {
return [[[BExtensionRegistry sharedInstance] configurationElementsFor:identifier] filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"name = %@", name]];
}
@end