summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/NSMatrix.java
blob: 7850576f92d409badfe994cbe0847d0486a111a1 (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
package org.eclipse.swt.internal.cocoa;

public class NSMatrix extends NSControl {

public NSMatrix() {
	super();
}

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

public boolean acceptsFirstMouse(NSEvent theEvent) {
	return OS.objc_msgSend(this.id, OS.sel_acceptsFirstMouse_1, theEvent != null ? theEvent.id : 0) != 0;
}

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

public void addColumnWithCells(NSArray newCells) {
	OS.objc_msgSend(this.id, OS.sel_addColumnWithCells_1, newCells != null ? newCells.id : 0);
}

public void addRow() {
	OS.objc_msgSend(this.id, OS.sel_addRow);
}

public void addRowWithCells(NSArray newCells) {
	OS.objc_msgSend(this.id, OS.sel_addRowWithCells_1, newCells != null ? newCells.id : 0);
}

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

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

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

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

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

//public int cellClass() {
//	return OS.objc_msgSend(this.id, OS.sel_cellClass);
//}

public NSRect cellFrameAtRow(int row, int col) {
	NSRect result = new NSRect();
	OS.objc_msgSend_stret(result, this.id, OS.sel_cellFrameAtRow_1column_1, row, col);
	return result;
}

public NSSize cellSize() {
	NSSize result = new NSSize();
	OS.objc_msgSend_stret(result, this.id, OS.sel_cellSize);
	return result;
}

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

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

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

public void deselectAllCells() {
	OS.objc_msgSend(this.id, OS.sel_deselectAllCells);
}

public void deselectSelectedCell() {
	OS.objc_msgSend(this.id, OS.sel_deselectSelectedCell);
}

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

public void drawCellAtRow(int row, int col) {
	OS.objc_msgSend(this.id, OS.sel_drawCellAtRow_1column_1, row, col);
}

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

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

public void getNumberOfRows(int rowCount, int colCount) {
	OS.objc_msgSend(this.id, OS.sel_getNumberOfRows_1columns_1, rowCount, colCount);
}

public boolean getRow_column_forPoint_(int row, int col, NSPoint aPoint) {
	return OS.objc_msgSend(this.id, OS.sel_getRow_1column_1forPoint_1, row, col, aPoint) != 0;
}

public boolean getRow_column_ofCell_(int row, int col, NSCell aCell) {
	return OS.objc_msgSend(this.id, OS.sel_getRow_1column_1ofCell_1, row, col, aCell != null ? aCell.id : 0) != 0;
}

public void highlightCell(boolean flag, int row, int col) {
	OS.objc_msgSend(this.id, OS.sel_highlightCell_1atRow_1column_1, flag, row, col);
}

public id initWithFrame_(NSRect frameRect) {
	int result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_1, frameRect);
	return result != 0 ? new id(result) : null;
}

public id initWithFrame_mode_cellClass_numberOfRows_numberOfColumns_(NSRect frameRect, int aMode, int factoryId, int rowsHigh, int colsWide) {
	int result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_1mode_1cellClass_1numberOfRows_1numberOfColumns_1, frameRect, aMode, factoryId, rowsHigh, colsWide);
	return result != 0 ? new id(result) : null;
}

public id initWithFrame_mode_prototype_numberOfRows_numberOfColumns_(NSRect frameRect, int aMode, NSCell aCell, int rowsHigh, int colsWide) {
	int result = OS.objc_msgSend(this.id, OS.sel_initWithFrame_1mode_1prototype_1numberOfRows_1numberOfColumns_1, frameRect, aMode, aCell != null ? aCell.id : 0, rowsHigh, colsWide);
	return result != 0 ? new id(result) : null;
}

public void insertColumn_(int column) {
	OS.objc_msgSend(this.id, OS.sel_insertColumn_1, column);
}

public void insertColumn_withCells_(int column, NSArray newCells) {
	OS.objc_msgSend(this.id, OS.sel_insertColumn_1withCells_1, column, newCells != null ? newCells.id : 0);
}

public void insertRow_(int row) {
	OS.objc_msgSend(this.id, OS.sel_insertRow_1, row);
}

public void insertRow_withCells_(int row, NSArray newCells) {
	OS.objc_msgSend(this.id, OS.sel_insertRow_1withCells_1, row, newCells != null ? newCells.id : 0);
}

public NSSize intercellSpacing() {
	NSSize result = new NSSize();
	OS.objc_msgSend_stret(result, this.id, OS.sel_intercellSpacing);
	return result;
}

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

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

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

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

public int mode() {
	return OS.objc_msgSend(this.id, OS.sel_mode);
}

public void mouseDown(NSEvent theEvent) {
	OS.objc_msgSend(this.id, OS.sel_mouseDown_1, theEvent != null ? theEvent.id : 0);
}

public int mouseDownFlags() {
	return OS.objc_msgSend(this.id, OS.sel_mouseDownFlags);
}

public int numberOfColumns() {
	return OS.objc_msgSend(this.id, OS.sel_numberOfColumns);
}

public int numberOfRows() {
	return OS.objc_msgSend(this.id, OS.sel_numberOfRows);
}

public boolean performKeyEquivalent(NSEvent theEvent) {
	return OS.objc_msgSend(this.id, OS.sel_performKeyEquivalent_1, theEvent != null ? theEvent.id : 0) != 0;
}

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

public void putCell(NSCell newCell, int row, int col) {
	OS.objc_msgSend(this.id, OS.sel_putCell_1atRow_1column_1, newCell != null ? newCell.id : 0, row, col);
}

public void removeColumn(int col) {
	OS.objc_msgSend(this.id, OS.sel_removeColumn_1, col);
}

public void removeRow(int row) {
	OS.objc_msgSend(this.id, OS.sel_removeRow_1, row);
}

public void renewRows(int newRows, int newCols) {
	OS.objc_msgSend(this.id, OS.sel_renewRows_1columns_1, newRows, newCols);
}

public void resetCursorRects() {
	OS.objc_msgSend(this.id, OS.sel_resetCursorRects);
}

public void scrollCellToVisibleAtRow(int row, int col) {
	OS.objc_msgSend(this.id, OS.sel_scrollCellToVisibleAtRow_1column_1, row, col);
}

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

public void selectCellAtRow(int row, int col) {
	OS.objc_msgSend(this.id, OS.sel_selectCellAtRow_1column_1, row, col);
}

public boolean selectCellWithTag(int anInt) {
	return OS.objc_msgSend(this.id, OS.sel_selectCellWithTag_1, anInt) != 0;
}

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

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

public id selectedCell() {
	int result = OS.objc_msgSend(this.id, OS.sel_selectedCell);
	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 selectedRow() {
	return OS.objc_msgSend(this.id, OS.sel_selectedRow);
}

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

public void sendAction_to_forAllCells_(int aSelector, id anObject, boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_sendAction_1to_1forAllCells_1, aSelector, anObject != null ? anObject.id : 0, flag);
}

public void sendDoubleAction() {
	OS.objc_msgSend(this.id, OS.sel_sendDoubleAction);
}

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

public void setAutoscroll(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setAutoscroll_1, flag);
}

public void setAutosizesCells(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setAutosizesCells_1, flag);
}

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

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

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

public void setCellSize(NSSize aSize) {
	OS.objc_msgSend(this.id, OS.sel_setCellSize_1, aSize);
}

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 setDrawsBackground(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setDrawsBackground_1, flag);
}

public void setDrawsCellBackground(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setDrawsCellBackground_1, flag);
}

public void setIntercellSpacing(NSSize aSize) {
	OS.objc_msgSend(this.id, OS.sel_setIntercellSpacing_1, aSize);
}

public void setKeyCell(NSCell keyCell) {
	OS.objc_msgSend(this.id, OS.sel_setKeyCell_1, keyCell != null ? keyCell.id : 0);
}

public void setMode(int aMode) {
	OS.objc_msgSend(this.id, OS.sel_setMode_1, aMode);
}

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

public void setScrollable(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setScrollable_1, flag);
}

public void setSelectionByRect(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setSelectionByRect_1, flag);
}

public void setSelectionFrom(int startPos, int endPos, int anchorPos, boolean lit) {
	OS.objc_msgSend(this.id, OS.sel_setSelectionFrom_1to_1anchor_1highlight_1, startPos, endPos, anchorPos, lit);
}

public void setState(int value, int row, int col) {
	OS.objc_msgSend(this.id, OS.sel_setState_1atRow_1column_1, value, row, col);
}

public void setTabKeyTraversesCells(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setTabKeyTraversesCells_1, flag);
}

public void setToolTip(NSString toolTipString, NSCell cell) {
	OS.objc_msgSend(this.id, OS.sel_setToolTip_1forCell_1, toolTipString != null ? toolTipString.id : 0, cell != null ? cell.id : 0);
}

public void setValidateSize(boolean flag) {
	OS.objc_msgSend(this.id, OS.sel_setValidateSize_1, flag);
}

public void sizeToCells() {
	OS.objc_msgSend(this.id, OS.sel_sizeToCells);
}

public void sortUsingFunction(int compare, int context) {
	OS.objc_msgSend(this.id, OS.sel_sortUsingFunction_1context_1, compare, context);
}

public void sortUsingSelector(int comparator) {
	OS.objc_msgSend(this.id, OS.sel_sortUsingSelector_1, comparator);
}

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

public void textDidBeginEditing(NSNotification notification) {
	OS.objc_msgSend(this.id, OS.sel_textDidBeginEditing_1, notification != null ? notification.id : 0);
}

public void textDidChange(NSNotification notification) {
	OS.objc_msgSend(this.id, OS.sel_textDidChange_1, notification != null ? notification.id : 0);
}

public void textDidEndEditing(NSNotification notification) {
	OS.objc_msgSend(this.id, OS.sel_textDidEndEditing_1, notification != null ? notification.id : 0);
}

public boolean textShouldBeginEditing(NSText textObject) {
	return OS.objc_msgSend(this.id, OS.sel_textShouldBeginEditing_1, textObject != null ? textObject.id : 0) != 0;
}

public boolean textShouldEndEditing(NSText textObject) {
	return OS.objc_msgSend(this.id, OS.sel_textShouldEndEditing_1, textObject != null ? textObject.id : 0) != 0;
}

public NSString toolTipForCell(NSCell cell) {
	int result = OS.objc_msgSend(this.id, OS.sel_toolTipForCell_1, cell != null ? cell.id : 0);
	return result != 0 ? new NSString(result) : null;
}

}