1 /******************************************************************************* 2 * Copyright (c) 2000, 2007 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 package org.eclipse.jdt.ui.dialogs; 12 13 import org.eclipse.swt.widgets.Composite; 14 import org.eclipse.swt.widgets.Control; 15 16 import org.eclipse.ui.dialogs.ISelectionStatusValidator; 17 18 import org.eclipse.jdt.core.IType; 19 20 /** 21 * The class provides API to extend type selection dialogs like the 22 * open type dialog. 23 * <p> 24 * The class should be subclassed by clients wishing to extend the type 25 * selection dialog. 26 * </p> 27 * 28 * @see org.eclipse.jdt.ui.JavaUI#createTypeDialog(org.eclipse.swt.widgets.Shell, org.eclipse.jface.operation.IRunnableContext, org.eclipse.jdt.core.search.IJavaSearchScope, int, boolean, String, TypeSelectionExtension) 29 * @since 3.2 30 */ 31 public abstract class TypeSelectionExtension { 32 33 private ITypeSelectionComponent fComponent; 34 35 /** 36 * Initializes the type dialog extension with the given type dialog 37 * 38 * @param component the type dialog hosting this extension 39 */ 40 public final void initialize(ITypeSelectionComponent component) { 41 fComponent= component; 42 } 43 44 /** 45 * Returns the type selection dialog or <code>null</code> if 46 * the extension has not been initialized yet. 47 * 48 * @return the type selection dialog or <code>null</code> 49 */ 50 public final ITypeSelectionComponent getTypeSelectionComponent() { 51 return fComponent; 52 } 53 54 /** 55 * Creates the content area which the extensions contributes to the 56 * type selection dialog. The area will be presented between the 57 * table showing the list of types and the optional status line. 58 * 59 * @param parent the parent of the additional content area 60 * @return the additional content area or <code>null</code> if no 61 * additional content area is required 62 */ 63 public Control createContentArea(Composite parent) { 64 return null; 65 } 66 67 /** 68 * Returns the filter extension or <code>null</code> if 69 * no additional filtering is required. 70 * 71 * @return the additional filter extension 72 */ 73 public ITypeInfoFilterExtension getFilterExtension() { 74 return null; 75 } 76 77 /** 78 * Returns the selection validator or <code>null</code> if 79 * selection validation is not required. The elements passed 80 * to the selection validator are of type {@link IType}. 81 * 82 * @return the selection validator or <code>null</code> 83 */ 84 public ISelectionStatusValidator getSelectionValidator() { 85 return null; 86 } 87 88 /** 89 * Returns an image provider or <code>null</code> if the standard 90 * images should be used. 91 * 92 * @return the image provider 93 */ 94 public ITypeInfoImageProvider getImageProvider() { 95 return null; 96 } 97 } 98