Skip to main content
summaryrefslogtreecommitdiffstats
blob: b37344b0405f022f2e146ea4e24dd8fe0fab9b12 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*******************************************************************************
 * Copyright (c) 2006 Oracle Corporation.
 * 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:
 *    Cameron Bateman/Oracle - initial API and implementation
 *    
 ********************************************************************************/

package org.eclipse.jst.jsf.context.symbol.provider;

import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.swt.graphics.Image;

/**
 * Adapts an object to appropriate content proposal
 * 
 * <p><b>Provisional API - subject to change</b></p>
 * 
 * @author cbateman
 *
 */
public interface IContentProposalProvider 
{
	/**
	 * @param target 
	 * @param proposalFactory 
	 * @return an content proposal for target or null
	 * if nothing appropriate can be created
	 */
	ICompletionProposal[]  getProposals(Object target, 
                                        IProposalCreationFactory proposalFactory);
    
    /**
     * Implementors of the class can configure certain aspects of the returned
     * proposals
     * 
     * @author cbateman
     *
     */
    public interface IProposalCreationFactory
    {
        /**
         * @param replacementText  The text to be replaced
         * @param displayText  The text to be displayed in the assist window
         * @param additionalText The text to be displayed in the "addition info"
         *                          or null
         * @param displayImage The image to be displayed or null
         * @param sourceObject  The original source object.  Implementors should
         * make no assumptions (i.e. always test instanceof before casting)
         * @return a configured completion proposal for the parameters
         */
        ICompletionProposal createProposal(final String  replacementText,
                final String  displayText,
                final String  additionalText,
                final Image   displayImage,
                final Object  sourceObject);
    }
}

Back to the top