com.ibm.carma.ui.property
Class CarmaPreferenceStore

java.lang.Object
  extended by com.ibm.carma.ui.property.CarmaPreferenceStore
All Implemented Interfaces:
org.eclipse.jface.preference.IPreferenceStore

public class CarmaPreferenceStore
extends java.lang.Object
implements org.eclipse.jface.preference.IPreferenceStore

This class is used to access CARMA Specific preferences.

The suggested way to use this class is as follows:

 CarmaPreferenceStore cStore = null;
 IPreferenceStore store = CarmaUIPlugin.getDefault().getPreferenceStore();
 if (store instanceof CarmaPreferenceStore)
    cStore = (CarmaPreferenceStore) store;
 else
    cStore = new CarmaPreferenceStore(store);
 

This class can be instantiated and subclassed if desired.


Field Summary
static java.lang.String COPYRIGHT
           
 
Fields inherited from interface org.eclipse.jface.preference.IPreferenceStore
BOOLEAN_DEFAULT_DEFAULT, DOUBLE_DEFAULT_DEFAULT, FALSE, FLOAT_DEFAULT_DEFAULT, INT_DEFAULT_DEFAULT, LONG_DEFAULT_DEFAULT, STRING_DEFAULT_DEFAULT, TRUE
 
Constructor Summary
CarmaPreferenceStore(org.eclipse.jface.preference.IPreferenceStore store)
           
 
Method Summary
 void addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
           
 void clearStoredCustomParameters()
          Should not be called by clients.
 boolean contains(java.lang.String name)
           
 boolean displayUnsupportedActions()
           
 void firePropertyChangeEvent(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
           
 java.lang.String getActionConfirmationKey(java.lang.String actionId)
          Generates the key needed to locate the preference for the given action confirmation.
 boolean getBoolean(java.lang.String name)
           
 boolean getDefaultBoolean(java.lang.String name)
           
 double getDefaultDouble(java.lang.String name)
           
 float getDefaultFloat(java.lang.String name)
           
 int getDefaultInt(java.lang.String name)
           
 long getDefaultLong(java.lang.String name)
           
 java.lang.String getDefaultString(java.lang.String name)
           
 double getDouble(java.lang.String name)
           
 float getFloat(java.lang.String name)
           
 int getInt(java.lang.String name)
           
 long getLong(java.lang.String name)
           
 int[] getParameterSearchOrder()
          Deprecated. use getParameterSearchOrderEnum() for type safety
 ICarmaPreferenceConstants.ParameterOrder[] getParameterSearchOrderEnum()
          Returns the parameter search order as specified in the preferences.
 java.lang.Object[] getStoredCustomParameterValues(RepositoryInstance repository, Action action)
          Clients shouldn't call this method directly, they should call CustomActionParameterManager.getUserStoredParamValues()
 java.lang.Object[] getStoredCustomParameterValues(RepositoryManager repositoryManager, Action action)
          Clients shouldn't call this method directly, they should call CustomActionParameterManager.getUserStoredParamValues()
 java.lang.String getString(java.lang.String name)
           
 boolean isDefault(java.lang.String name)
           
 boolean needsSaving()
           
 void putValue(java.lang.String name, java.lang.String value)
           
 void removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
           
 void setDefault(java.lang.String name, boolean value)
           
 void setDefault(java.lang.String name, double value)
           
 void setDefault(java.lang.String name, float value)
           
 void setDefault(java.lang.String name, int value)
           
 void setDefault(java.lang.String name, long value)
           
 void setDefault(java.lang.String name, java.lang.String defaultObject)
           
 void setStoredCustomParameter(RepositoryInstance repository, Action action, java.lang.Object[] values)
          Should not be called by clients.
 void setStoredCustomParameter(RepositoryManager repositoryManager, Action action, java.lang.Object[] values)
          Should not be called by clients.
 void setToDefault(java.lang.String name)
           
 void setValue(java.lang.String name, boolean value)
           
 void setValue(java.lang.String name, double value)
           
 void setValue(java.lang.String name, float value)
           
 void setValue(java.lang.String name, int value)
           
 void setValue(java.lang.String name, long value)
           
 void setValue(java.lang.String name, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Constructor Detail

CarmaPreferenceStore

public CarmaPreferenceStore(org.eclipse.jface.preference.IPreferenceStore store)
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface org.eclipse.jface.preference.IPreferenceStore

contains

public boolean contains(java.lang.String name)
Specified by:
contains in interface org.eclipse.jface.preference.IPreferenceStore

firePropertyChangeEvent

public void firePropertyChangeEvent(java.lang.String name,
                                    java.lang.Object oldValue,
                                    java.lang.Object newValue)
Specified by:
firePropertyChangeEvent in interface org.eclipse.jface.preference.IPreferenceStore

getBoolean

public boolean getBoolean(java.lang.String name)
Specified by:
getBoolean in interface org.eclipse.jface.preference.IPreferenceStore

getDefaultBoolean

public boolean getDefaultBoolean(java.lang.String name)
Specified by:
getDefaultBoolean in interface org.eclipse.jface.preference.IPreferenceStore

getDefaultDouble

public double getDefaultDouble(java.lang.String name)
Specified by:
getDefaultDouble in interface org.eclipse.jface.preference.IPreferenceStore

getDefaultFloat

public float getDefaultFloat(java.lang.String name)
Specified by:
getDefaultFloat in interface org.eclipse.jface.preference.IPreferenceStore

getDefaultInt

public int getDefaultInt(java.lang.String name)
Specified by:
getDefaultInt in interface org.eclipse.jface.preference.IPreferenceStore

getDefaultLong

public long getDefaultLong(java.lang.String name)
Specified by:
getDefaultLong in interface org.eclipse.jface.preference.IPreferenceStore

getDefaultString

public java.lang.String getDefaultString(java.lang.String name)
Specified by:
getDefaultString in interface org.eclipse.jface.preference.IPreferenceStore

getDouble

public double getDouble(java.lang.String name)
Specified by:
getDouble in interface org.eclipse.jface.preference.IPreferenceStore

getFloat

public float getFloat(java.lang.String name)
Specified by:
getFloat in interface org.eclipse.jface.preference.IPreferenceStore

getInt

public int getInt(java.lang.String name)
Specified by:
getInt in interface org.eclipse.jface.preference.IPreferenceStore

getLong

public long getLong(java.lang.String name)
Specified by:
getLong in interface org.eclipse.jface.preference.IPreferenceStore

getString

public java.lang.String getString(java.lang.String name)
Specified by:
getString in interface org.eclipse.jface.preference.IPreferenceStore

isDefault

public boolean isDefault(java.lang.String name)
Specified by:
isDefault in interface org.eclipse.jface.preference.IPreferenceStore

needsSaving

public boolean needsSaving()
Specified by:
needsSaving in interface org.eclipse.jface.preference.IPreferenceStore

putValue

public void putValue(java.lang.String name,
                     java.lang.String value)
Specified by:
putValue in interface org.eclipse.jface.preference.IPreferenceStore

removePropertyChangeListener

public void removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface org.eclipse.jface.preference.IPreferenceStore

setDefault

public void setDefault(java.lang.String name,
                       double value)
Specified by:
setDefault in interface org.eclipse.jface.preference.IPreferenceStore

setDefault

public void setDefault(java.lang.String name,
                       float value)
Specified by:
setDefault in interface org.eclipse.jface.preference.IPreferenceStore

setDefault

public void setDefault(java.lang.String name,
                       int value)
Specified by:
setDefault in interface org.eclipse.jface.preference.IPreferenceStore

setDefault

public void setDefault(java.lang.String name,
                       long value)
Specified by:
setDefault in interface org.eclipse.jface.preference.IPreferenceStore

setDefault

public void setDefault(java.lang.String name,
                       java.lang.String defaultObject)
Specified by:
setDefault in interface org.eclipse.jface.preference.IPreferenceStore

setDefault

public void setDefault(java.lang.String name,
                       boolean value)
Specified by:
setDefault in interface org.eclipse.jface.preference.IPreferenceStore

setToDefault

public void setToDefault(java.lang.String name)
Specified by:
setToDefault in interface org.eclipse.jface.preference.IPreferenceStore

setValue

public void setValue(java.lang.String name,
                     double value)
Specified by:
setValue in interface org.eclipse.jface.preference.IPreferenceStore

setValue

public void setValue(java.lang.String name,
                     float value)
Specified by:
setValue in interface org.eclipse.jface.preference.IPreferenceStore

setValue

public void setValue(java.lang.String name,
                     int value)
Specified by:
setValue in interface org.eclipse.jface.preference.IPreferenceStore

setValue

public void setValue(java.lang.String name,
                     long value)
Specified by:
setValue in interface org.eclipse.jface.preference.IPreferenceStore

setValue

public void setValue(java.lang.String name,
                     java.lang.String value)
Specified by:
setValue in interface org.eclipse.jface.preference.IPreferenceStore

setValue

public void setValue(java.lang.String name,
                     boolean value)
Specified by:
setValue in interface org.eclipse.jface.preference.IPreferenceStore

displayUnsupportedActions

public boolean displayUnsupportedActions()

getParameterSearchOrderEnum

public ICarmaPreferenceConstants.ParameterOrder[] getParameterSearchOrderEnum()
Returns the parameter search order as specified in the preferences. *

Returns:
an array containing the parameter value search order. The array must contain all the values of ICarmaPreferenceConstants.ParameterOrder but in possibly a different order
Since:
7.0

getParameterSearchOrder

@Deprecated
public int[] getParameterSearchOrder()
Deprecated. use getParameterSearchOrderEnum() for type safety

Returns:
an intereger array containing each of the following once and only once
  • ICarmaPreferenceConstants.PREF_PARAM_ORDER_DEFAULT_ID
  • ICarmaPreferenceConstants.PREF_PARAM_ORDER_METADATA_ID
  • ICarmaPreferenceConstants.PREF_PARAM_ORDER_USER_ID

clearStoredCustomParameters

public void clearStoredCustomParameters()
Should not be called by clients. Clients should instead call CustomActionParameterManager.clearAllUserStoredParamValues() instead.


setStoredCustomParameter

public void setStoredCustomParameter(RepositoryManager repositoryManager,
                                     Action action,
                                     java.lang.Object[] values)
Should not be called by clients. Clients should instead call CustomActionParameterManager.setUserStoredParamValues(repositoryManager, action, values) if values contains a null, that entry will not be modified

Parameters:
repositoryManager - RepositoryManager to store this information for
action - Action to store this information for
values - The values to remember, must be the same length as action.getParameters().size()
Throws:
ArrayOutOfBoundsException - if values.length < action.getParameters().size()

setStoredCustomParameter

public void setStoredCustomParameter(RepositoryInstance repository,
                                     Action action,
                                     java.lang.Object[] values)
Should not be called by clients. Clients should instead call CustomActionParameterManager.setUserStoredParamValues(repository, action, values) if values contains a null, that entry will not be modified

Parameters:
repository - RepositoryInstance to store this information for
action - Action to store this information for
values - The values to remember, must be the same length as action.getParameters().size()
Throws:
ArrayOutOfBoundsException - if values.length < action.getParameters().size()

getStoredCustomParameterValues

public java.lang.Object[] getStoredCustomParameterValues(RepositoryManager repositoryManager,
                                                         Action action)
Clients shouldn't call this method directly, they should call CustomActionParameterManager.getUserStoredParamValues()

Parameters:
repositoryManager -
action -
Returns:
an Object[] of parameter values stored, or null, if no value was stored for that param.

getStoredCustomParameterValues

public java.lang.Object[] getStoredCustomParameterValues(RepositoryInstance repository,
                                                         Action action)
Clients shouldn't call this method directly, they should call CustomActionParameterManager.getUserStoredParamValues()

Parameters:
repository -
action -
Returns:
an Object[] of parameter values stored, or null, if no value was stored for that param.

getActionConfirmationKey

public java.lang.String getActionConfirmationKey(java.lang.String actionId)
Generates the key needed to locate the preference for the given action confirmation. The confirmation key indicates if a "successful" message should be shown to the user after completion of the given action.

Parameters:
actionId - the Id of the action to determine the key for
Returns:
Generated action confirmation preference key