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.swt.widgets.Composite;
14: import org.eclipse.ui.views.properties.PropertyDescriptor;
15:
16: /**
17: * A font property descriptor.
18: *
19: * @author Anthony Hunter
20: */
21: public class FontPropertyDescriptor extends PropertyDescriptor {
22:
23: /**
24: * Creates an property descriptor with the given id and display name.
25: *
26: * @param id
27: * the id of the property
28: * @param displayName
29: * the name to display for the property
30: */
31: public FontPropertyDescriptor(Object id, String displayName) {
32: super (id, displayName);
33: }
34:
35: /**
36: * @see org.eclipse.ui.views.properties.IPropertyDescriptor#createPropertyEditor(Composite)
37: */
38: public CellEditor createPropertyEditor(Composite parent) {
39: CellEditor editor = new FontDialogCellEditor(parent);
40: if (getValidator() != null)
41: editor.setValidator(getValidator());
42: return editor;
43: }
44:
45: }
|