KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > editor > contentassist > TypeContentProposalListener


1 /*******************************************************************************
2  * Copyright (c) 2006 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
12 package org.eclipse.pde.internal.ui.editor.contentassist;
13
14 import org.eclipse.jface.fieldassist.ContentProposalAdapter;
15 import org.eclipse.jface.fieldassist.IContentProposal;
16 import org.eclipse.jface.fieldassist.IContentProposalListener;
17 import org.eclipse.jface.fieldassist.IContentProposalListener2;
18 import org.eclipse.jface.fieldassist.IContentProposalProvider;
19
20 /**
21  * TypeContentProposalListener
22  *
23  */

24 public class TypeContentProposalListener implements IContentProposalListener,
25         IContentProposalListener2 {
26     
27     /**
28      *
29      */

30     public TypeContentProposalListener() {
31         // NO-OP
32
}
33
34     /* (non-Javadoc)
35      * @see org.eclipse.jface.fieldassist.IContentProposalListener#proposalAccepted(org.eclipse.jface.fieldassist.IContentProposal)
36      */

37     public void proposalAccepted(IContentProposal proposal) {
38         // NO-OP
39
}
40
41     /* (non-Javadoc)
42      * @see org.eclipse.jface.fieldassist.IContentProposalListener2#proposalPopupClosed(org.eclipse.jface.fieldassist.ContentProposalAdapter)
43      */

44     public void proposalPopupClosed(ContentProposalAdapter adapter) {
45         IContentProposalProvider provider = adapter.getContentProposalProvider();
46         if (provider instanceof TypeContentProposalProvider) {
47             // Reset state related information used for filtering existing proposals
48
((TypeContentProposalProvider)provider).reset();
49         }
50     }
51
52     /* (non-Javadoc)
53      * @see org.eclipse.jface.fieldassist.IContentProposalListener2#proposalPopupOpened(org.eclipse.jface.fieldassist.ContentProposalAdapter)
54      */

55     public void proposalPopupOpened(ContentProposalAdapter adapter) {
56         // NO-OP
57
}
58
59 }
60
Popular Tags