KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > common > ui > celleditor > ExtendedDialogCellEditor


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: ExtendedDialogCellEditor.java,v 1.2 2005/06/08 06:24:33 nickb Exp $
16  */

17 package org.eclipse.emf.common.ui.celleditor;
18
19
20 import org.eclipse.jface.viewers.DialogCellEditor;
21 import org.eclipse.jface.viewers.ILabelProvider;
22 import org.eclipse.swt.widgets.Composite;
23
24
25 /**
26  * This uses a label provider to display a dialog cell editor.
27  */

28 public abstract class ExtendedDialogCellEditor extends DialogCellEditor
29 {
30   protected ILabelProvider labelProvider;
31
32   public ExtendedDialogCellEditor(Composite composite, ILabelProvider labelProvider)
33   {
34     super(composite);
35     this.labelProvider = labelProvider;
36   }
37
38   protected void updateContents(Object JavaDoc object)
39   {
40     if (getDefaultLabel() != null && labelProvider != null)
41     {
42       getDefaultLabel().setText(labelProvider.getText(object));
43     }
44   }
45 }
46
Popular Tags