01: /*******************************************************************************
02: * Copyright (c) 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.examples.views.properties.tabbed.article.views;
11:
12: import org.eclipse.jface.viewers.CellEditor;
13: import org.eclipse.jface.viewers.CheckboxCellEditor;
14: import org.eclipse.swt.widgets.Composite;
15: import org.eclipse.ui.views.properties.PropertyDescriptor;
16:
17: /**
18: * A checkbox property descriptor.
19: *
20: * @author Anthony Hunter
21: */
22: public class CheckBoxPropertyDescriptor extends PropertyDescriptor {
23:
24: /**
25: * Constructs a new property descriptor with the given id and display name.
26: *
27: * @param id
28: * the id for the descriptor.
29: * @param displayName
30: * the display name for the descriptor.
31: */
32: public CheckBoxPropertyDescriptor(Object id, String displayName) {
33: super (id, displayName);
34: }
35:
36: public CellEditor createPropertyEditor(Composite parent) {
37: CellEditor editor = new CheckboxCellEditor(parent);
38: if (getValidator() != null)
39: editor.setValidator(getValidator());
40: return editor;
41: }
42: }
|