Skip to main content
summaryrefslogtreecommitdiffstats
blob: 8ebe2617e60c41fda6a454bb70e1389b0eab1fb3 (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
/*******************************************************************************
 * Copyright (c) 2007 Oracle. 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:
 *     Oracle - initial API and implementation
 ******************************************************************************/
package org.eclipse.jpt.utility.internal.swing;

import javax.swing.ComboBoxModel;

/**
 * This interface allows a client to better control the performance of
 * a combo box model by allowing the client to specify when it is
 * acceptable for the model to "cache" and "uncache" its list of elements.
 * The model may ignore these hints if appropriate.
 */
public interface CachingComboBoxModel extends ComboBoxModel {
    
    /**
     * Cache the comboBoxModel List.  If you call this, you
     * must make sure to call uncacheList() as well.  Otherwise
     * stale data will be in the ComboBox until cacheList() is 
     * called again or uncacheList() is called.
     */
    void cacheList();
    
    /**
     * Clear the cached list.  Next time the list is needed it will
     * be built when it is not cached.
     */
    void uncacheList();

    /**
     * Check to see if the list is already cached.  This can be used for 
     * MouseEvents, since they are not terribly predictable.
     */
    boolean isCached();

}

Back to the top