Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 13af43b10c4de082d31ec165bc9842a25b0c1d9c (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
63
64
65
66
67
68
/*******************************************************************************
 * Copyright (c) 2007 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 - initial implementation
 *******************************************************************************/ 

package org.eclipse.jst.jsf.core.internal;

import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jface.preference.IPreferenceStore;

/**
 * Defines a generic JSF preferences model
 * 
 * @author cbateman
 *
 */
public interface IJSFPreferenceModel 
{
    /**
     * Loads the object from the preference store provided
     * 
     * @param prefStore
     */
    public void load(IPreferenceStore  prefStore);
    
    /**
     * Copies the object into the preference store but DOES NOT SAVE IT
     * 
     * @param prefStore
     */
    public void commit(IPreferenceStore prefStore);
    
    /**
     * Reverts the model to it's defaults.  Does not commit to pref store. 
     */
    public void setDefaults();

    /**
     * @param context
     * @param key
     * @return the preference value in context with using key as the id
     */
    public Object getValueByKey(final IScopeContext context, final String key);

    /**
     * @param context
     * @param key
     * @return the preference value in context using key as the id and drawing
     * it directly from the preference store
     */
    public Object getStoredValueByKey(final IScopeContext context, final String key);
    
    /**
     * Set the preference value indicated by key in context to value.  May
     * throw ClassCastException if value is not the type expected for the key
     * @param context
     * @param key
     * @param value
     * @return the old value
     */
    public Object setValueByKey(final IScopeContext context, final String key, final Object value);
}

Back to the top