78
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2005, 2008 IBM Corporation and others.
|
|
3 * All rights reserved. This program and the accompanying materials
|
|
4 * are made available under the terms of the Eclipse Public License v1.0
|
|
5 * which accompanies this distribution, and is available at
|
|
6 * http://www.eclipse.org/legal/epl-v10.html
|
|
7 *
|
|
8 * Contributors:
|
|
9 * IBM Corporation - initial API and implementation
|
|
10 *******************************************************************************/
|
|
11 module org.eclipse.jface.internal.databinding.swt.ComboObservableList;
|
85
|
12 import org.eclipse.jface.internal.databinding.swt.SWTObservableList;
|
78
|
13
|
|
14 import java.lang.all;
|
|
15
|
|
16 import org.eclipse.jface.databinding.swt.SWTObservables;
|
|
17 import org.eclipse.swt.widgets.Combo;
|
|
18
|
|
19 /**
|
|
20 * @since 3.2
|
|
21 *
|
|
22 */
|
|
23 public class ComboObservableList : SWTObservableList {
|
|
24
|
|
25 private final Combo combo;
|
|
26
|
|
27 /**
|
|
28 * @param combo
|
|
29 */
|
|
30 public this(Combo combo) {
|
|
31 super(SWTObservables.getRealm(combo.getDisplay()));
|
|
32 this.combo = combo;
|
|
33 }
|
|
34
|
|
35 protected int getItemCount() {
|
|
36 return combo.getItemCount();
|
|
37 }
|
|
38
|
|
39 protected void setItems(String[] newItems) {
|
|
40 combo.setItems(newItems);
|
|
41 }
|
|
42
|
|
43 protected String[] getItems() {
|
|
44 return combo.getItems();
|
|
45 }
|
|
46
|
|
47 protected String getItem(int index) {
|
|
48 return combo.getItem(index);
|
|
49 }
|
|
50
|
|
51 protected void setItem(int index, String string) {
|
|
52 combo.setItem(index, string);
|
|
53 }
|
|
54 }
|