Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 03a91d1634df906f387d1c8f0396e8a0d9d99634 (plain) (blame)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/*******************************************************************************
 * Copyright (c) 2007, 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.swt.internal.cocoa;

public class NSBundle extends NSObject {

public NSBundle() {
	super();
}

public NSBundle(int id) {
	super(id);
}

public static NSArray allBundles() {
	int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_allBundles);
	return result != 0 ? new NSArray(result) : null;
}

public static NSArray allFrameworks() {
	int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_allFrameworks);
	return result != 0 ? new NSArray(result) : null;
}

public NSString builtInPlugInsPath() {
	int result = OS.objc_msgSend(this.id, OS.sel_builtInPlugInsPath);
	return result != 0 ? new NSString(result) : null;
}

public static NSBundle bundleForClass(int aClass) {
	int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_bundleForClass_1, aClass);
	return result != 0 ? new NSBundle(result) : null;
}

public NSString bundleIdentifier() {
	int result = OS.objc_msgSend(this.id, OS.sel_bundleIdentifier);
	return result != 0 ? new NSString(result) : null;
}

public NSString bundlePath() {
	int result = OS.objc_msgSend(this.id, OS.sel_bundlePath);
	return result != 0 ? new NSString(result) : null;
}

public static NSBundle bundleWithIdentifier(NSString identifier) {
	int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_bundleWithIdentifier_1, identifier != null ? identifier.id : 0);
	return result != 0 ? new NSBundle(result) : null;
}

public static NSBundle bundleWithPath(NSString path) {
	int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_bundleWithPath_1, path != null ? path.id : 0);
	return result != 0 ? new NSBundle(result) : null;
}

public int classNamed(NSString className) {
	return OS.objc_msgSend(this.id, OS.sel_classNamed_1, className != null ? className.id : 0);
}

public NSString developmentLocalization() {
	int result = OS.objc_msgSend(this.id, OS.sel_developmentLocalization);
	return result != 0 ? new NSString(result) : null;
}

public NSArray executableArchitectures() {
	int result = OS.objc_msgSend(this.id, OS.sel_executableArchitectures);
	return result != 0 ? new NSArray(result) : null;
}

public NSString executablePath() {
	int result = OS.objc_msgSend(this.id, OS.sel_executablePath);
	return result != 0 ? new NSString(result) : null;
}

public NSDictionary infoDictionary() {
	int result = OS.objc_msgSend(this.id, OS.sel_infoDictionary);
	return result != 0 ? new NSDictionary(result) : null;
}

public NSBundle initWithPath(NSString path) {
	int result = OS.objc_msgSend(this.id, OS.sel_initWithPath_1, path != null ? path.id : 0);
	return result != 0 ? this : null;
}

public boolean isLoaded() {
	return OS.objc_msgSend(this.id, OS.sel_isLoaded) != 0;
}

//public boolean load() {
//	return OS.objc_msgSend(this.id, OS.sel_load) != 0;
//}

public boolean loadAndReturnError(int error) {
	return OS.objc_msgSend(this.id, OS.sel_loadAndReturnError_1, error) != 0;
}

public NSArray localizations() {
	int result = OS.objc_msgSend(this.id, OS.sel_localizations);
	return result != 0 ? new NSArray(result) : null;
}

public NSDictionary localizedInfoDictionary() {
	int result = OS.objc_msgSend(this.id, OS.sel_localizedInfoDictionary);
	return result != 0 ? new NSDictionary(result) : null;
}

public NSString localizedStringForKey(NSString key, NSString value, NSString tableName) {
	int result = OS.objc_msgSend(this.id, OS.sel_localizedStringForKey_1value_1table_1, key != null ? key.id : 0, value != null ? value.id : 0, tableName != null ? tableName.id : 0);
	return result != 0 ? new NSString(result) : null;
}

public static NSBundle mainBundle() {
	int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_mainBundle);
	return result != 0 ? new NSBundle(result) : null;
}

public id objectForInfoDictionaryKey(NSString key) {
	int result = OS.objc_msgSend(this.id, OS.sel_objectForInfoDictionaryKey_1, key != null ? key.id : 0);
	return result != 0 ? new id(result) : null;
}

public NSString pathForAuxiliaryExecutable(NSString executableName) {
	int result = OS.objc_msgSend(this.id, OS.sel_pathForAuxiliaryExecutable_1, executableName != null ? executableName.id : 0);
	return result != 0 ? new NSString(result) : null;
}

public NSString pathForResource_ofType_(NSString name, NSString ext) {
	int result = OS.objc_msgSend(this.id, OS.sel_pathForResource_1ofType_1, name != null ? name.id : 0, ext != null ? ext.id : 0);
	return result != 0 ? new NSString(result) : null;
}

public NSString pathForResource_ofType_inDirectory_(NSString name, NSString ext, NSString subpath) {
	int result = OS.objc_msgSend(this.id, OS.sel_pathForResource_1ofType_1inDirectory_1, name != null ? name.id : 0, ext != null ? ext.id : 0, subpath != null ? subpath.id : 0);
	return result != 0 ? new NSString(result) : null;
}

public static NSString static_pathForResource_ofType_inDirectory_(NSString name, NSString ext, NSString bundlePath) {
	int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_pathForResource_1ofType_1inDirectory_1, name != null ? name.id : 0, ext != null ? ext.id : 0, bundlePath != null ? bundlePath.id : 0);
	return result != 0 ? new NSString(result) : null;
}

public NSString pathForResource_ofType_inDirectory_forLocalization_(NSString name, NSString ext, NSString subpath, NSString localizationName) {
	int result = OS.objc_msgSend(this.id, OS.sel_pathForResource_1ofType_1inDirectory_1forLocalization_1, name != null ? name.id : 0, ext != null ? ext.id : 0, subpath != null ? subpath.id : 0, localizationName != null ? localizationName.id : 0);
	return result != 0 ? new NSString(result) : null;
}

public static NSArray static_pathsForResourcesOfType_inDirectory_(NSString ext, NSString bundlePath) {
	int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_pathsForResourcesOfType_1inDirectory_1, ext != null ? ext.id : 0, bundlePath != null ? bundlePath.id : 0);
	return result != 0 ? new NSArray(result) : null;
}

public NSArray pathsForResourcesOfType_inDirectory_(NSString ext, NSString subpath) {
	int result = OS.objc_msgSend(this.id, OS.sel_pathsForResourcesOfType_1inDirectory_1, ext != null ? ext.id : 0, subpath != null ? subpath.id : 0);
	return result != 0 ? new NSArray(result) : null;
}

public NSArray pathsForResourcesOfType_inDirectory_forLocalization_(NSString ext, NSString subpath, NSString localizationName) {
	int result = OS.objc_msgSend(this.id, OS.sel_pathsForResourcesOfType_1inDirectory_1forLocalization_1, ext != null ? ext.id : 0, subpath != null ? subpath.id : 0, localizationName != null ? localizationName.id : 0);
	return result != 0 ? new NSArray(result) : null;
}

public NSArray preferredLocalizations() {
	int result = OS.objc_msgSend(this.id, OS.sel_preferredLocalizations);
	return result != 0 ? new NSArray(result) : null;
}

public static NSArray static_preferredLocalizationsFromArray_(NSArray localizationsArray) {
	int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_preferredLocalizationsFromArray_1, localizationsArray != null ? localizationsArray.id : 0);
	return result != 0 ? new NSArray(result) : null;
}

public static NSArray static_preferredLocalizationsFromArray_forPreferences_(NSArray localizationsArray, NSArray preferencesArray) {
	int result = OS.objc_msgSend(OS.class_NSBundle, OS.sel_preferredLocalizationsFromArray_1forPreferences_1, localizationsArray != null ? localizationsArray.id : 0, preferencesArray != null ? preferencesArray.id : 0);
	return result != 0 ? new NSArray(result) : null;
}

public boolean preflightAndReturnError(int error) {
	return OS.objc_msgSend(this.id, OS.sel_preflightAndReturnError_1, error) != 0;
}

public int principalClass() {
	return OS.objc_msgSend(this.id, OS.sel_principalClass);
}

public NSString privateFrameworksPath() {
	int result = OS.objc_msgSend(this.id, OS.sel_privateFrameworksPath);
	return result != 0 ? new NSString(result) : null;
}

public NSString resourcePath() {
	int result = OS.objc_msgSend(this.id, OS.sel_resourcePath);
	return result != 0 ? new NSString(result) : null;
}

public NSString sharedFrameworksPath() {
	int result = OS.objc_msgSend(this.id, OS.sel_sharedFrameworksPath);
	return result != 0 ? new NSString(result) : null;
}

public NSString sharedSupportPath() {
	int result = OS.objc_msgSend(this.id, OS.sel_sharedSupportPath);
	return result != 0 ? new NSString(result) : null;
}

public boolean unload() {
	return OS.objc_msgSend(this.id, OS.sel_unload) != 0;
}

public static boolean loadNibFile(id fileName, id dict, id zone) {
	return OS.objc_msgSend(OS.class_NSBundle, OS.sel_loadNibFile_1externalNameTable_1withZone_1, fileName.id, dict.id, 0) != 0;
}

}

Back to the top