| /******************************************************************************* |
| * Copyright (c) 2006, 2010 Soyatec (http://www.soyatec.com) and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Soyatec - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.xwt.tools.ui.designer.properties.editors; |
| |
| import org.eclipse.jdt.core.search.IJavaSearchConstants; |
| import org.eclipse.jdt.internal.ui.JavaUIMessages; |
| import org.eclipse.jdt.internal.ui.dialogs.OpenTypeSelectionDialog; |
| import org.eclipse.jface.window.Window; |
| import org.eclipse.swt.widgets.Composite; |
| import org.eclipse.swt.widgets.Control; |
| import org.eclipse.ui.PlatformUI; |
| import org.eclipse.ui.dialogs.SelectionDialog; |
| |
| /** |
| * @author jliu (jin.liu@soyatec.com) |
| */ |
| public class ObjectCellEditor extends AbstractCellEditor { |
| |
| public ObjectCellEditor(Composite parent, Class<?> type) { |
| super(parent); |
| } |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.eclipse.xwt.tools.ui.designer.properties.editors.AbstractCellEditor#openDialogBox(org.eclipse.swt.widgets.Control) |
| */ |
| protected Object openDialogBox(Control cellEditorWindow) { |
| SelectionDialog dialog = new OpenTypeSelectionDialog(cellEditorWindow.getShell(), false, PlatformUI.getWorkbench().getProgressService(), null, IJavaSearchConstants.TYPE); |
| dialog.setTitle(JavaUIMessages.OpenTypeAction_dialogTitle); |
| dialog.setMessage(JavaUIMessages.OpenTypeAction_dialogMessage); |
| if (Window.OK == dialog.open()) { |
| Object[] result = dialog.getResult(); |
| } |
| return super.openDialogBox(cellEditorWindow); |
| } |
| } |