Mobile Tools for Java
Release 1.0

org.eclipse.mtj.ui.configurations
Class ConfigManageComponent

java.lang.Object
  extended by org.eclipse.mtj.ui.configurations.ConfigManageComponent
All Implemented Interfaces:
IConfigurationsChangeListener

public class ConfigManageComponent
extends Object
implements IConfigurationsChangeListener

ConfigManageComponent provides user interface functionality for Configurations management.
ConfigManageComponent implements IConfigurationsChangeListener to refresh its UI, because Configurations may modified by other thread, the UI should reflect these changes.


Constructor Summary
ConfigManageComponent()
          Constructor used for a situation that has no associate MIDlet project.
ConfigManageComponent(IMidletSuiteProject midletSuiteProject)
           
 
Method Summary
 void activeConfigSwitched(SwitchActiveConfigEvent event)
          If Configurations modified by other thread, we should refresh ConfigManageComponent UI, to reflect the change of Configurations.
 void configurationAdded(AddConfigEvent event)
          If Configurations modified by other thread, we should refresh ConfigManageComponent UI, to reflect the change of Configurations.
 void configurationRemoved(RemoveConfigEvent event)
          If Configurations modified by other thread, we should refresh ConfigManageComponent UI, to reflect the change of Configurations.
 void createContents(Composite parent)
          Create the UI contents.
 void dispose()
          This method must be called in parent UI's(Eg.
 Configuration getActiveConfiguration()
          Return active Configuration.
 Configurations getConfigurations()
           
 void performCancel()
          Discard the modification and restore Configurations to former state.
 void performFinish()
          Do some work when perform finish, including ask user if reexport Antenna build files and clear removedConfigs and addedConfigs (removedConfigs and addedConfigs are used to restore Configurations if user discard the modification).
 void setCheckStateListener(ICheckStateListener checkStateListener)
          Set a external ICheckStateListener to listen to Configurations CheckboxTableViewer's CheckStateChangedEvent.
 void setConfigurationChangeListener(IConfigurationChangeListener listener)
          Set a external IConfigurationChangeListener to listen to Configuration change event.
 void setConfigurationsChangeListener(IConfigurationsChangeListener listener)
          Set a external IConfigurationsChangeListener to listen to Configurations change event.
 void setDescription(String description)
          If description is set, a description string will appear on the UI.
 void setIncludeGroup(boolean includeGroup)
          Indicate that if the UI contains by a Group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigManageComponent

public ConfigManageComponent()
Constructor used for a situation that has no associate MIDlet project. For example, in the MIDlet project create wizard.


ConfigManageComponent

public ConfigManageComponent(IMidletSuiteProject midletSuiteProject)
Method Detail

activeConfigSwitched

public void activeConfigSwitched(SwitchActiveConfigEvent event)
If Configurations modified by other thread, we should refresh ConfigManageComponent UI, to reflect the change of Configurations.
For example, we change configurations in project properties page, we should refresh "runtime section" in Application Descriptor form editor.

Specified by:
activeConfigSwitched in interface IConfigurationsChangeListener

configurationAdded

public void configurationAdded(AddConfigEvent event)
If Configurations modified by other thread, we should refresh ConfigManageComponent UI, to reflect the change of Configurations.
For example, we change configurations in project properties page, we should refresh "runtime section" in Application Descriptor form editor.

Specified by:
configurationAdded in interface IConfigurationsChangeListener

configurationRemoved

public void configurationRemoved(RemoveConfigEvent event)
If Configurations modified by other thread, we should refresh ConfigManageComponent UI, to reflect the change of Configurations.
For example, we change configurations in project properties page, we should refresh "runtime section" in Application Descriptor form editor.

Specified by:
configurationRemoved in interface IConfigurationsChangeListener

createContents

public void createContents(Composite parent)
Create the UI contents.

Parameters:
parent -

dispose

public void dispose()
This method must be called in parent UI's(Eg. Wizard page, properties page, editor page) dispose() method. Because Configurations have a long life cycle across a MIDlet project, we should remove unused listeners manually to avoid memory leak.


getActiveConfiguration

public Configuration getActiveConfiguration()
Return active Configuration. If no active one, return null.

Returns:

getConfigurations

public Configurations getConfigurations()

performCancel

public void performCancel()
Discard the modification and restore Configurations to former state.
This method typically be called in the performCancel() method of the parent wizard, propertiesPage, etc.


performFinish

public void performFinish()
Do some work when perform finish, including ask user if reexport Antenna build files and clear removedConfigs and addedConfigs (removedConfigs and addedConfigs are used to restore Configurations if user discard the modification).
This method must be called in parent UI's(Eg. Wizard page, properties page, editor page) performFinish() or doSave() method.
Note: MUST be called before midletProject.saveMetaData() method.


setCheckStateListener

public void setCheckStateListener(ICheckStateListener checkStateListener)
Set a external ICheckStateListener to listen to Configurations CheckboxTableViewer's CheckStateChangedEvent.

Parameters:
checkStateListener -

setConfigurationChangeListener

public void setConfigurationChangeListener(IConfigurationChangeListener listener)
Set a external IConfigurationChangeListener to listen to Configuration change event.

Parameters:
listener -

setConfigurationsChangeListener

public void setConfigurationsChangeListener(IConfigurationsChangeListener listener)
Set a external IConfigurationsChangeListener to listen to Configurations change event.

Parameters:
listener -

setDescription

public void setDescription(String description)
If description is set, a description string will appear on the UI.

Parameters:
description -

setIncludeGroup

public void setIncludeGroup(boolean includeGroup)
Indicate that if the UI contains by a Group.

Parameters:
includeGroup -

Mobile Tools for Java
Release 1.0