summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSBrowser.java
blob: 407df55a9c773610e79c4266314a1dc6e530844c (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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
/*******************************************************************************
 * Copyright (c) 2007 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 NSBrowser extends NSControl {

public NSBrowser() {
	super();
}

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

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

public void addColumn() {
	OS.objc_msgSend(this.id, OS.sel_addColumn);
}

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

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

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

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

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

public boolean canDragRowsWithIndexes(NSIndexSet rowIndexes, int column, NSEvent event) {
	return OS.objc_msgSend(this.id, OS.sel_canDragRowsWithIndexes_1inColumn_1withEvent_1, rowIndexes != null ? rowIndexes.id : 0, column, event != null ? event.id : 0) != 0;
}

public static int cellClass() {
	return OS.objc_msgSend(OS.class_NSBrowser, OS.sel_cellClass);
}

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

public float columnContentWidthForColumnWidth(float columnWidth) {
	return (float)OS.objc_msgSend_fpret(this.id, OS.sel_columnContentWidthForColumnWidth_1, columnWidth);
}

public int columnOfMatrix(NSMatrix matrix) {
	return OS.objc_msgSend(this.id, OS.sel_columnOfMatrix_1, matrix != null ? matrix.id : 0);
}

public int columnResizingType() {
	return OS.objc_msgSend(this.id, OS.sel_columnResizingType);
}

public float columnWidthForColumnContentWidth(float columnContentWidth) {
	return (float)OS.objc_msgSend_fpret(this.id, OS.sel_columnWidthForColumnContentWidth_1, columnContentWidth);
}

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

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

public void displayAllColumns() {
	OS.objc_msgSend(this.id, OS.sel_displayAllColumns);
}

public void displayColumn(int column) {
	OS.objc_msgSend(this.id, OS.sel_displayColumn_1, column);
}

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

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

public int doubleAction() {
	return OS.objc_msgSend(this.id, OS.sel_doubleAction);
}

public NSImage draggingImageForRowsWithIndexes(NSIndexSet rowIndexes, int column, NSEvent event, int dragImageOffset) {
	int result = OS.objc_msgSend(this.id, OS.sel_draggingImageForRowsWithIndexes_1inColumn_1withEvent_1offset_1, rowIndexes != null ? rowIndexes.id : 0, column, event != null ? event.id : 0, dragImageOffset);
	return result != 0 ? new NSImage(result) : null;
}

public void drawTitleOfColumn(int column, NSRect aRect) {
	OS.objc_msgSend(this.id, OS.sel_drawTitleOfColumn_1inRect_1, column, aRect);
}

public int firstVisibleColumn() {
	return OS.objc_msgSend(this.id, OS.sel_firstVisibleColumn);
}

public NSRect frameOfColumn(int column) {
	NSRect result = new NSRect();
	OS.objc_msgSend_stret(result, this.id, OS.sel_frameOfColumn_1, column);
	return result;
}

public NSRect frameOfInsideOfColumn(int column) {
	NSRect result = new NSRect();
	OS.objc_msgSend_stret(result, this.id, OS.sel_frameOfInsideOfColumn_1, column);
	return result;
}

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

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

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

public int lastColumn() {
	return OS.objc_msgSend(this.id, OS.sel_lastColumn);
}

public int lastVisibleColumn() {
	return OS.objc_msgSend(this.id, OS.sel_lastVisibleColumn);
}

public void loadColumnZero() {
	OS.objc_msgSend(this.id, OS.sel_loadColumnZero);
}

public id loadedCellAtRow(int row, int col) {
	int result = OS.objc_msgSend(this.id, OS.sel_loadedCellAtRow_1column_1, row, col);
	return result != 0 ? new id(result) : null;
}

public int matrixClass() {
	return OS.objc_msgSend(this.id, OS.sel_matrixClass);
}

public NSMatrix matrixInColumn(int column) {
	int result = OS.objc_msgSend(this.id, OS.sel_matrixInColumn_1, column);
	return result != 0 ? new NSMatrix(result) : null;
}

public int maxVisibleColumns() {
	return OS.objc_msgSend(this.id, OS.sel_maxVisibleColumns);
}

public float minColumnWidth() {
	return (float)OS.objc_msgSend_fpret(this.id, OS.sel_minColumnWidth);
}

public int numberOfVisibleColumns() {
	return OS.objc_msgSend(this.id, OS.sel_numberOfVisibleColumns);
}

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

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

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

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

public void reloadColumn(int column) {
	OS.objc_msgSend(this.id, OS.sel_reloadColumn_1, column);
}

public static void removeSavedColumnsWithAutosaveName(NSString name) {
	OS.objc_msgSend(OS.class_NSBrowser, OS.sel_removeSavedColumnsWithAutosaveName_1, name != null ? name.id : 0);
}

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

public void scrollColumnToVisible(int column) {
	OS.objc_msgSend(this.id, OS.sel_scrollColumnToVisible_1, column);
}

public void scrollColumnsLeftBy(int shiftAmount) {
	OS.objc_msgSend(this.id, OS.sel_scrollColumnsLeftBy_1, shiftAmount);
}

public void scrollColumnsRightBy(int shiftAmount) {
	OS.objc_msgSend(this.id, OS.sel_scrollColumnsRightBy_1, shiftAmount);
}

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

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

public void selectRow(int row, int column) {
	OS.objc_msgSend(this.id, OS.sel_selectRow_1inColumn_1, row, column);
}

public void selectRowIndexes(NSIndexSet indexes, int column) {
	OS.objc_msgSend(this.id, OS.sel_selectRowIndexes_1inColumn_1, indexes != null ? indexes.id : 0, column);
}

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

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

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

public int selectedColumn() {
	return OS.objc_msgSend(this.id, OS.sel_selectedColumn);
}

public int selectedRowInColumn(int column) {
	return OS.objc_msgSend(this.id, OS.sel_selectedRowInColumn_1, column);
}

public NSIndexSet selectedRowIndexesInColumn(int column) {
	int result = OS.objc_msgSend(this.id, OS.sel_selectedRowIndexesInColumn_1, column);
	return result != 0 ? new NSIndexSet(result) : null;
}

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

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

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

public void setAcceptsArrowKeys(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setAcceptsArrowKeys_1, flag);
}

public void setAllowsBranchSelection(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setAllowsBranchSelection_1, flag);
}

public void setAllowsEmptySelection(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setAllowsEmptySelection_1, flag);
}

public void setAllowsMultipleSelection(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setAllowsMultipleSelection_1, flag);
}

public void setAllowsTypeSelect(boolean value) {
	OS.objc_msgSend(this.id, OS.sel_setAllowsTypeSelect_1, value);
}

public void setBackgroundColor(NSColor color) {
	OS.objc_msgSend(this.id, OS.sel_setBackgroundColor_1, color != null ? color.id : 0);
}

//public void setCellClass(int factoryId) {
//	OS.objc_msgSend(this.id, OS.sel_setCellClass_1, factoryId);
//}

public void setCellPrototype(NSCell aCell) {
	OS.objc_msgSend(this.id, OS.sel_setCellPrototype_1, aCell != null ? aCell.id : 0);
}

public void setColumnResizingType(int columnResizingType) {
	OS.objc_msgSend(this.id, OS.sel_setColumnResizingType_1, columnResizingType);
}

public void setColumnsAutosaveName(NSString name) {
	OS.objc_msgSend(this.id, OS.sel_setColumnsAutosaveName_1, name != null ? name.id : 0);
}

public void setDelegate(id anObject) {
	OS.objc_msgSend(this.id, OS.sel_setDelegate_1, anObject != null ? anObject.id : 0);
}

public void setDoubleAction(int aSelector) {
	OS.objc_msgSend(this.id, OS.sel_setDoubleAction_1, aSelector);
}

public void setDraggingSourceOperationMask(int mask, boolean isLocal) {
	OS.objc_msgSend(this.id, OS.sel_setDraggingSourceOperationMask_1forLocal_1, mask, isLocal);
}

public void setHasHorizontalScroller(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setHasHorizontalScroller_1, flag);
}

public void setLastColumn(int column) {
	OS.objc_msgSend(this.id, OS.sel_setLastColumn_1, column);
}

public void setMatrixClass(int factoryId) {
	OS.objc_msgSend(this.id, OS.sel_setMatrixClass_1, factoryId);
}

public void setMaxVisibleColumns(int columnCount) {
	OS.objc_msgSend(this.id, OS.sel_setMaxVisibleColumns_1, columnCount);
}

public void setMinColumnWidth(float columnWidth) {
	OS.objc_msgSend(this.id, OS.sel_setMinColumnWidth_1, columnWidth);
}

public boolean setPath(NSString path) {
	return OS.objc_msgSend(this.id, OS.sel_setPath_1, path != null ? path.id : 0) != 0;
}

public void setPathSeparator(NSString newString) {
	OS.objc_msgSend(this.id, OS.sel_setPathSeparator_1, newString != null ? newString.id : 0);
}

public void setPrefersAllColumnUserResizing(boolean prefersAllColumnResizing) {
	OS.objc_msgSend(this.id, OS.sel_setPrefersAllColumnUserResizing_1, prefersAllColumnResizing);
}

public void setReusesColumns(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setReusesColumns_1, flag);
}

public void setSendsActionOnArrowKeys(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setSendsActionOnArrowKeys_1, flag);
}

public void setSeparatesColumns(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setSeparatesColumns_1, flag);
}

public void setTakesTitleFromPreviousColumn(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setTakesTitleFromPreviousColumn_1, flag);
}

public void setTitle(NSString aString, int column) {
	OS.objc_msgSend(this.id, OS.sel_setTitle_1ofColumn_1, aString != null ? aString.id : 0, column);
}

public void setTitled(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setTitled_1, flag);
}

public void setWidth(float columnWidth, int columnIndex) {
	OS.objc_msgSend(this.id, OS.sel_setWidth_1ofColumn_1, columnWidth, columnIndex);
}

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

public void tile() {
	OS.objc_msgSend(this.id, OS.sel_tile);
}

public NSRect titleFrameOfColumn(int column) {
	NSRect result = new NSRect();
	OS.objc_msgSend_stret(result, this.id, OS.sel_titleFrameOfColumn_1, column);
	return result;
}

public float titleHeight() {
	return (float)OS.objc_msgSend_fpret(this.id, OS.sel_titleHeight);
}

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

public void updateScroller() {
	OS.objc_msgSend(this.id, OS.sel_updateScroller);
}

public void validateVisibleColumns() {
	OS.objc_msgSend(this.id, OS.sel_validateVisibleColumns);
}

public float widthOfColumn(int column) {
	return (float)OS.objc_msgSend_fpret(this.id, OS.sel_widthOfColumn_1, column);
}

}