summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSDocumentController.java
blob: aeb3f82751ada5fa1a5c7910bc599619f267b453 (plain)
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
package org.eclipse.swt.internal.cocoa;

public class NSDocumentController extends NSObject {

public NSDocumentController() {
	super();
}

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

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

public void addDocument(NSDocument document) {
	OS.objc_msgSend(this.id, OS.sel_addDocument_1, document != null ? document.id : 0);
}

public double autosavingDelay() {
	return OS.objc_msgSend_fpret(this.id, OS.sel_autosavingDelay);
}

public void clearRecentDocuments(id sender) {
	OS.objc_msgSend(this.id, OS.sel_clearRecentDocuments_1, sender != null ? sender.id : 0);
}

public void closeAllDocumentsWithDelegate(id delegate, int didCloseAllSelector, int contextInfo) {
	OS.objc_msgSend(this.id, OS.sel_closeAllDocumentsWithDelegate_1didCloseAllSelector_1contextInfo_1, delegate != null ? delegate.id : 0, didCloseAllSelector, contextInfo);
}

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

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

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

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

public int documentClassForType(NSString typeName) {
	return OS.objc_msgSend(this.id, OS.sel_documentClassForType_1, typeName != null ? typeName.id : 0);
}

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

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

public id documentForURL(NSURL absoluteURL) {
	int result = OS.objc_msgSend(this.id, OS.sel_documentForURL_1, absoluteURL != null ? absoluteURL.id : 0);
	return result != 0 ? new id(result) : null;
}

public id documentForWindow(NSWindow window) {
	int result = OS.objc_msgSend(this.id, OS.sel_documentForWindow_1, window != null ? window.id : 0);
	return result != 0 ? new id(result) : null;
}

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

public NSArray fileExtensionsFromType(NSString typeName) {
	int result = OS.objc_msgSend(this.id, OS.sel_fileExtensionsFromType_1, typeName != null ? typeName.id : 0);
	return result != 0 ? new NSArray(result) : null;
}

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

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

public id makeDocumentForURL(NSURL absoluteDocumentURL, NSURL absoluteDocumentContentsURL, NSString typeName, int outError) {
	int result = OS.objc_msgSend(this.id, OS.sel_makeDocumentForURL_1withContentsOfURL_1ofType_1error_1, absoluteDocumentURL != null ? absoluteDocumentURL.id : 0, absoluteDocumentContentsURL != null ? absoluteDocumentContentsURL.id : 0, typeName != null ? typeName.id : 0, outError);
	return result != 0 ? new id(result) : null;
}

public id makeDocumentWithContentsOfFile(NSString fileName, NSString type) {
	int result = OS.objc_msgSend(this.id, OS.sel_makeDocumentWithContentsOfFile_1ofType_1, fileName != null ? fileName.id : 0, type != null ? type.id : 0);
	return result != 0 ? new id(result) : null;
}

public id makeDocumentWithContentsOfURL_ofType_(NSURL url, NSString type) {
	int result = OS.objc_msgSend(this.id, OS.sel_makeDocumentWithContentsOfURL_1ofType_1, url != null ? url.id : 0, type != null ? type.id : 0);
	return result != 0 ? new id(result) : null;
}

public id makeDocumentWithContentsOfURL_ofType_error_(NSURL absoluteURL, NSString typeName, int outError) {
	int result = OS.objc_msgSend(this.id, OS.sel_makeDocumentWithContentsOfURL_1ofType_1error_1, absoluteURL != null ? absoluteURL.id : 0, typeName != null ? typeName.id : 0, outError);
	return result != 0 ? new id(result) : null;
}

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

public id makeUntitledDocumentOfType_error_(NSString typeName, int outError) {
	int result = OS.objc_msgSend(this.id, OS.sel_makeUntitledDocumentOfType_1error_1, typeName != null ? typeName.id : 0, outError);
	return result != 0 ? new id(result) : null;
}

public int maximumRecentDocumentCount() {
	return OS.objc_msgSend(this.id, OS.sel_maximumRecentDocumentCount);
}

public void newDocument(id sender) {
	OS.objc_msgSend(this.id, OS.sel_newDocument_1, sender != null ? sender.id : 0);
}

public void noteNewRecentDocument(NSDocument document) {
	OS.objc_msgSend(this.id, OS.sel_noteNewRecentDocument_1, document != null ? document.id : 0);
}

public void noteNewRecentDocumentURL(NSURL absoluteURL) {
	OS.objc_msgSend(this.id, OS.sel_noteNewRecentDocumentURL_1, absoluteURL != null ? absoluteURL.id : 0);
}

public void openDocument(id sender) {
	OS.objc_msgSend(this.id, OS.sel_openDocument_1, sender != null ? sender.id : 0);
}

public id openDocumentWithContentsOfFile(NSString fileName, boolean display) {
	int result = OS.objc_msgSend(this.id, OS.sel_openDocumentWithContentsOfFile_1display_1, fileName != null ? fileName.id : 0, display);
	return result != 0 ? new id(result) : null;
}

public id openDocumentWithContentsOfURL_display_(NSURL url, boolean display) {
	int result = OS.objc_msgSend(this.id, OS.sel_openDocumentWithContentsOfURL_1display_1, url != null ? url.id : 0, display);
	return result != 0 ? new id(result) : null;
}

public id openDocumentWithContentsOfURL_display_error_(NSURL absoluteURL, boolean displayDocument, int outError) {
	int result = OS.objc_msgSend(this.id, OS.sel_openDocumentWithContentsOfURL_1display_1error_1, absoluteURL != null ? absoluteURL.id : 0, displayDocument, outError);
	return result != 0 ? new id(result) : null;
}

public id openUntitledDocumentAndDisplay(boolean displayDocument, int outError) {
	int result = OS.objc_msgSend(this.id, OS.sel_openUntitledDocumentAndDisplay_1error_1, displayDocument, outError);
	return result != 0 ? new id(result) : null;
}

public id openUntitledDocumentOfType(NSString type, boolean display) {
	int result = OS.objc_msgSend(this.id, OS.sel_openUntitledDocumentOfType_1display_1, type != null ? type.id : 0, display);
	return result != 0 ? new id(result) : null;
}

public boolean presentError_(NSError error) {
	return OS.objc_msgSend(this.id, OS.sel_presentError_1, error != null ? error.id : 0) != 0;
}

public void presentError_modalForWindow_delegate_didPresentSelector_contextInfo_(NSError error, NSWindow window, id delegate, int didPresentSelector, int contextInfo) {
	OS.objc_msgSend(this.id, OS.sel_presentError_1modalForWindow_1delegate_1didPresentSelector_1contextInfo_1, error != null ? error.id : 0, window != null ? window.id : 0, delegate != null ? delegate.id : 0, didPresentSelector, contextInfo);
}

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

public void removeDocument(NSDocument document) {
	OS.objc_msgSend(this.id, OS.sel_removeDocument_1, document != null ? document.id : 0);
}

public boolean reopenDocumentForURL(NSURL absoluteDocumentURL, NSURL absoluteDocumentContentsURL, int outError) {
	return OS.objc_msgSend(this.id, OS.sel_reopenDocumentForURL_1withContentsOfURL_1error_1, absoluteDocumentURL != null ? absoluteDocumentURL.id : 0, absoluteDocumentContentsURL != null ? absoluteDocumentContentsURL.id : 0, outError) != 0;
}

public void reviewUnsavedDocumentsWithAlertTitle(NSString title, boolean cancellable, id delegate, int didReviewAllSelector, int contextInfo) {
	OS.objc_msgSend(this.id, OS.sel_reviewUnsavedDocumentsWithAlertTitle_1cancellable_1delegate_1didReviewAllSelector_1contextInfo_1, title != null ? title.id : 0, cancellable, delegate != null ? delegate.id : 0, didReviewAllSelector, contextInfo);
}

public int runModalOpenPanel(NSOpenPanel openPanel, NSArray types) {
	return OS.objc_msgSend(this.id, OS.sel_runModalOpenPanel_1forTypes_1, openPanel != null ? openPanel.id : 0, types != null ? types.id : 0);
}

public void saveAllDocuments(id sender) {
	OS.objc_msgSend(this.id, OS.sel_saveAllDocuments_1, sender != null ? sender.id : 0);
}

public void setAutosavingDelay(double autosavingDelay) {
	OS.objc_msgSend(this.id, OS.sel_setAutosavingDelay_1, autosavingDelay);
}

public void setShouldCreateUI(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setShouldCreateUI_1, flag);
}

public static id sharedDocumentController() {
	int result = OS.objc_msgSend(OS.class_NSDocumentController, OS.sel_sharedDocumentController);
	return result != 0 ? new id(result) : null;
}

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

public NSString typeForContentsOfURL(NSURL inAbsoluteURL, int outError) {
	int result = OS.objc_msgSend(this.id, OS.sel_typeForContentsOfURL_1error_1, inAbsoluteURL != null ? inAbsoluteURL.id : 0, outError);
	return result != 0 ? new NSString(result) : null;
}

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

public boolean validateUserInterfaceItem(id  anItem) {
	return OS.objc_msgSend(this.id, OS.sel_validateUserInterfaceItem_1, anItem != null ? anItem.id : 0) != 0;
}

public NSError willPresentError(NSError error) {
	int result = OS.objc_msgSend(this.id, OS.sel_willPresentError_1, error != null ? error.id : 0);
	return result != 0 ? new NSError(result) : null;
}

}