view dwtx/jface/text/ITextHoverExtension2.d @ 129:eb30df5ca28b

Added JFace Text sources
author Frank Benoit <benoit@tionex.de>
date Sat, 23 Aug 2008 19:10:48 +0200
parents
children c4fb132a086c
line wrap: on
line source

/*******************************************************************************
 * Copyright (c) 2008 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 * Port to the D programming language:
 *     Frank Benoit <benoit@tionex.de>
 *******************************************************************************/
module dwtx.jface.text.ITextHoverExtension2;

import dwt.dwthelper.utils;


/**
 * Extension interface for {@link dwtx.jface.text.ITextHover}.
 * <p>
 * Provides a way for hovers to return hover-specific information objects.
 * </p>
 * 
 * @see dwtx.jface.text.ITextHover
 * @since 3.4
 */
public interface ITextHoverExtension2 {

    /**
     * Returns the information which should be presented when a hover popup is shown
     * for the specified hover region. The hover region has the same semantics
     * as the region returned by {@link ITextHover#getHoverRegion(ITextViewer, int)}.
     * If the returned information is <code>null</code>, no hover popup will be shown.
     * <p>
     * <strong>Note:</strong> Implementers have to ensure that {@link ITextHoverExtension#getHoverControlCreator()}
     * returns {@link IInformationControl}s that implement
     * {@link IInformationControlExtension2} and whose
     * {@link IInformationControlExtension2#setInput(Object)} can handle the
     * information objects returned by this method.</p>
     * <p>
     * Callers should ignore the text returned by {@link ITextHover#getHoverInfo(ITextViewer, IRegion)}.</p>
     *
     * @param textViewer the viewer on which the hover popup should be shown
     * @param hoverRegion the text range in the viewer which is used to determine
     *      the hover display information
     * @return the hover popup display information, or <code>null</code> if none available
     */
    Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion);
    
}