Mobile Tools for Java
Release 1.0

org.eclipse.mtj.core.model.configuration
Class Configuration

java.lang.Object
  extended by org.eclipse.mtj.core.model.configuration.Configuration

public class Configuration
extends Object

This class contains configuration information for multi-configuration support. Now it contains "device" and "symbol set" information, and a boolean "active" to indicate if this configuration is the current active one. This class may contains more information if need in future.


Field Summary
static String ATTR_ACTIVE
           
static String ATTR_DEVICEGROUP
           
static String ATTR_DEVICENAME
           
static String ATTR_NAME
           
static String ATTR_VALUE
           
static String ELEM_DEVICE
           
static String ELEM_SYMBOL
           
static String ELEM_SYMBOL_SET
           
static String ELEM_WORKSPACE_SYMBOLSET
           
 
Constructor Summary
Configuration(Element configElement)
          Construct Configuration from meta data XML file.
Configuration(String name)
           
 
Method Summary
 void addConfigChangeListener(IConfigurationChangeListener listener)
           
 boolean equals(Object obj)
          If name equals, then configuration equals.
 void fireSymbolSetChanged()
           
 IDevice getDevice()
           
 String getName()
           
 SymbolSet getSymbolSet()
          All preprocessing related code should NOT use this method to get SymbolSet, instead, getSymbolSetForPreprocessing() should be used for preprocessing purpose.
 SymbolSet getSymbolSetForPreprocessing()
          All preprocessing related function should use this method to get SymbolSet.
 List<SymbolDefinitionSet> getWorkspaceScopeSymbolSets()
           
 int hashCode()
           
 boolean isActive()
           
 void removeConfigChangeListener(IConfigurationChangeListener listener)
          Note:Since instance of configuration have a long life cycle (as long as the Midlet project), so we should remove listener manually when it no longer used.
 void setActive(boolean active)
           
 void setDevice(IDevice device)
           
 void setName(String name)
           
 void setSymbolSet(SymbolSet symbolSet)
           
 void setWorkspaceScopeSymbolSets(List<SymbolDefinitionSet> symbolSets)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTR_NAME

public static final String ATTR_NAME
See Also:
Constant Field Values

ATTR_ACTIVE

public static final String ATTR_ACTIVE
See Also:
Constant Field Values

ELEM_DEVICE

public static final String ELEM_DEVICE
See Also:
Constant Field Values

ATTR_DEVICEGROUP

public static final String ATTR_DEVICEGROUP
See Also:
Constant Field Values

ATTR_DEVICENAME

public static final String ATTR_DEVICENAME
See Also:
Constant Field Values

ELEM_SYMBOL_SET

public static final String ELEM_SYMBOL_SET
See Also:
Constant Field Values

ELEM_WORKSPACE_SYMBOLSET

public static final String ELEM_WORKSPACE_SYMBOLSET
See Also:
Constant Field Values

ELEM_SYMBOL

public static final String ELEM_SYMBOL
See Also:
Constant Field Values

ATTR_VALUE

public static final String ATTR_VALUE
See Also:
Constant Field Values
Constructor Detail

Configuration

public Configuration(Element configElement)
              throws PersistenceException
Construct Configuration from meta data XML file.

Parameters:
configElement - - The <configuration> xml element.
Throws:
PersistenceException

Configuration

public Configuration(String name)
Method Detail

addConfigChangeListener

public void addConfigChangeListener(IConfigurationChangeListener listener)

equals

public boolean equals(Object obj)
If name equals, then configuration equals.

Overrides:
equals in class Object

fireSymbolSetChanged

public void fireSymbolSetChanged()

getDevice

public IDevice getDevice()

getName

public String getName()

getSymbolSet

public SymbolSet getSymbolSet()
All preprocessing related code should NOT use this method to get SymbolSet, instead, getSymbolSetForPreprocessing() should be used for preprocessing purpose.

Returns:

getSymbolSetForPreprocessing

public SymbolSet getSymbolSetForPreprocessing()
All preprocessing related function should use this method to get SymbolSet. This method return a SymbolSet for preprocessing using. The returned SymbolSet contains one more Symbol (whose key = this.SYMBOLKEY_CONFIG_NAME, value=this.getName()) than SymbolSet returned by this.getSymbolSet().

Returns:

getWorkspaceScopeSymbolSets

public List<SymbolDefinitionSet> getWorkspaceScopeSymbolSets()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

isActive

public boolean isActive()

removeConfigChangeListener

public void removeConfigChangeListener(IConfigurationChangeListener listener)
Note:Since instance of configuration have a long life cycle (as long as the Midlet project), so we should remove listener manually when it no longer used.

Parameters:
listener -

setActive

public void setActive(boolean active)

setDevice

public void setDevice(IDevice device)

setName

public void setName(String name)

setSymbolSet

public void setSymbolSet(SymbolSet symbolSet)

setWorkspaceScopeSymbolSets

public void setWorkspaceScopeSymbolSets(List<SymbolDefinitionSet> symbolSets)

toString

public String toString()
Overrides:
toString in class Object

Mobile Tools for Java
Release 1.0