com.sysord.mad.ui.swt
Class SWTSpecificWidgetContext

java.lang.Object
  extended by com.sysord.mad.ui.swt.SWTSpecificWidgetContext
All Implemented Interfaces:
com.sysord.mad.widget.SpecificWidgetContext, java.lang.Cloneable

public class SWTSpecificWidgetContext
extends java.lang.Object
implements com.sysord.mad.widget.SpecificWidgetContext, java.lang.Cloneable

SpecificWidgetContext for SWT widgets.

Author:
Fabien Vignal

Field Summary
protected  com.sysord.emf.tools.misc.ActivatableAdapter[] adapters
           
protected  org.eclipse.swt.custom.ScrolledComposite currentContainer
          Deprecated. It was used with the old emitter and the creation of a ScrolledComposite for each tab.

Now, you should use formBody and the corresponding getters/setters.
This is due to the SWTViewBuilder using FormToolkit.

protected  org.eclipse.emf.ecore.EObject currentElement
           
protected  org.eclipse.swt.widgets.TabItem currentTab
           
protected  org.eclipse.swt.widgets.TabFolder currentTabbedContainer
           
protected  org.eclipse.emf.ecore.EObject element
           
protected  java.util.Map<com.sysord.mad.widget.InputWidget<?>,java.lang.String> errorMessages
           
protected  org.eclipse.swt.widgets.Composite formBody
          Obtained with ScrolledForm.getBody() on scrolledForm.
protected  java.lang.Object id
           
protected  com.sysord.mad.emitter.ModelElementView modelElementView
           
protected  org.eclipse.swt.widgets.Composite parent
           
protected  org.eclipse.ui.forms.widgets.ScrolledForm scrolledForm
           
protected  org.eclipse.swt.widgets.Composite sectionDescriptionContainer
           
protected  org.eclipse.swt.widgets.Label sectionErrorLabel
           
protected  org.eclipse.ui.forms.widgets.FormToolkit toolkit
           
protected  com.sysord.mad.emitter.ViewHolder viewHolder
           
protected  com.sysord.mad.widget.WidgetBuilder widgetBuilder
           
protected  org.eclipse.swt.widgets.Composite widgetContainer
           
 
Constructor Summary
SWTSpecificWidgetContext()
           
 
Method Summary
 SWTSpecificWidgetContext clone()
           
 com.sysord.emf.tools.misc.ActivatableAdapter[] getAdapters()
          Return the value of adapters.
 org.eclipse.swt.custom.ScrolledComposite getCurrentContainer()
          Deprecated. Use getFormBody() instead.
 org.eclipse.emf.ecore.EObject getCurrentElement()
           
 org.eclipse.swt.widgets.TabItem getCurrentTab()
          Return the value of currentTab.
 org.eclipse.swt.widgets.TabFolder getCurrentTabbedContainer()
          Return the value of currentTabbedContainer.
 org.eclipse.emf.ecore.EObject getElement()
           
 java.util.Map<com.sysord.mad.widget.InputWidget<?>,java.lang.String> getErrorMessages()
          Return the value of errorMessages.
 org.eclipse.ui.forms.widgets.ScrolledForm getForm()
          Return the value of currentForm.
 org.eclipse.swt.widgets.Composite getFormBody()
          Return the value of formBody.
 java.lang.Object getId()
           
 com.sysord.mad.emitter.ModelElementView getModelElementView()
           
 org.eclipse.swt.widgets.Composite getParentComposite()
           
 org.eclipse.swt.widgets.Composite getSectionDescriptionContainer()
          Return the value of sectionDescriptionContainer.
 org.eclipse.swt.widgets.Label getSectionErrorLabel()
          Return the value of sectionErrorLabel.
 org.eclipse.ui.forms.widgets.FormToolkit getToolkit()
          Return the value of toolkit.
 com.sysord.mad.emitter.ViewHolder getViewHolder()
           
 com.sysord.mad.widget.WidgetBuilder getWidgetBuilder()
          Return the value of widgetBuilder.
 org.eclipse.swt.widgets.Composite getWidgetContainer()
          Return the value of widgetContainer.
 void putErrorMessage(com.sysord.mad.widget.InputWidget<?> widget, java.lang.String message)
          Put the given error message into this context.
 void setAdapters(com.sysord.emf.tools.misc.ActivatableAdapter... adapters)
          Set the specified value adapters for adapters.
 void setCurrentContainer(org.eclipse.swt.custom.ScrolledComposite currentContainer)
          Deprecated. Use setFormBody(Composite) instead.
 void setCurrentElement(org.eclipse.emf.ecore.EObject element)
           
 void setCurrentTab(org.eclipse.swt.widgets.TabItem currentTab)
          Set the specified value currentTab for currentTab.
 void setCurrentTabbedContainer(org.eclipse.swt.widgets.TabFolder currentTabbedContainer)
          Set the specified value currentTabbedContainer for currentTabbedContainer.
 void setElement(org.eclipse.emf.ecore.EObject element)
           
 void setForm(org.eclipse.ui.forms.widgets.ScrolledForm currentForm)
          Set the specified value currentForm for currentForm.
 void setFormBody(org.eclipse.swt.widgets.Composite formBody)
          Set the specified value formBody for formBody.
 void setId(java.lang.Object id)
           
 void setModelElementView(com.sysord.mad.emitter.ModelElementView modelElementView)
           
 void setParentComposite(org.eclipse.swt.widgets.Composite parent)
           
 void setSectionDescriptionContainer(org.eclipse.swt.widgets.Composite sectionDescriptionContainer)
          Set the specified value sectionDescriptionContainer for sectionDescriptionContainer.
 void setSectionErrorLabel(org.eclipse.swt.widgets.Label sectionErrorLabel)
          Set the specified value sectionErrorLabel for sectionErrorLabel.
 void setToolkit(org.eclipse.ui.forms.widgets.FormToolkit toolkit)
          Set the specified value toolkit for toolkit.
 void setViewHolder(com.sysord.mad.emitter.ViewHolder viewHolder)
           
 void setWidgetBuilder(com.sysord.mad.widget.WidgetBuilder widgetBuilder)
          Set the specified value widgetBuilder for widgetBuilder.
 void setWidgetContainer(org.eclipse.swt.widgets.Composite widgetContainer)
          Set the specified value widgetContainer for widgetContainer.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.Object id

parent

protected org.eclipse.swt.widgets.Composite parent

viewHolder

protected com.sysord.mad.emitter.ViewHolder viewHolder

toolkit

protected org.eclipse.ui.forms.widgets.FormToolkit toolkit

scrolledForm

protected org.eclipse.ui.forms.widgets.ScrolledForm scrolledForm

sectionDescriptionContainer

protected org.eclipse.swt.widgets.Composite sectionDescriptionContainer

sectionErrorLabel

protected org.eclipse.swt.widgets.Label sectionErrorLabel

element

protected org.eclipse.emf.ecore.EObject element

currentElement

protected org.eclipse.emf.ecore.EObject currentElement

modelElementView

protected com.sysord.mad.emitter.ModelElementView modelElementView

widgetBuilder

protected com.sysord.mad.widget.WidgetBuilder widgetBuilder

adapters

protected com.sysord.emf.tools.misc.ActivatableAdapter[] adapters

currentTabbedContainer

protected org.eclipse.swt.widgets.TabFolder currentTabbedContainer

currentTab

protected org.eclipse.swt.widgets.TabItem currentTab

errorMessages

protected java.util.Map<com.sysord.mad.widget.InputWidget<?>,java.lang.String> errorMessages

currentContainer

@Deprecated
protected org.eclipse.swt.custom.ScrolledComposite currentContainer
Deprecated. It was used with the old emitter and the creation of a ScrolledComposite for each tab.

Now, you should use formBody and the corresponding getters/setters.
This is due to the SWTViewBuilder using FormToolkit.


formBody

protected org.eclipse.swt.widgets.Composite formBody
Obtained with ScrolledForm.getBody() on scrolledForm.

The ScrolledForm being created with FormToolkit.


widgetContainer

protected org.eclipse.swt.widgets.Composite widgetContainer
Constructor Detail

SWTSpecificWidgetContext

public SWTSpecificWidgetContext()
Method Detail

getId

public java.lang.Object getId()
Specified by:
getId in interface com.sysord.mad.widget.SpecificWidgetContext

setId

public void setId(java.lang.Object id)
Specified by:
setId in interface com.sysord.mad.widget.SpecificWidgetContext

getViewHolder

public com.sysord.mad.emitter.ViewHolder getViewHolder()
Specified by:
getViewHolder in interface com.sysord.mad.widget.SpecificWidgetContext

setViewHolder

public void setViewHolder(com.sysord.mad.emitter.ViewHolder viewHolder)
Specified by:
setViewHolder in interface com.sysord.mad.widget.SpecificWidgetContext

getElement

public org.eclipse.emf.ecore.EObject getElement()
Specified by:
getElement in interface com.sysord.mad.widget.SpecificWidgetContext

setElement

public void setElement(org.eclipse.emf.ecore.EObject element)
Specified by:
setElement in interface com.sysord.mad.widget.SpecificWidgetContext

getCurrentElement

public org.eclipse.emf.ecore.EObject getCurrentElement()
Specified by:
getCurrentElement in interface com.sysord.mad.widget.SpecificWidgetContext

setCurrentElement

public void setCurrentElement(org.eclipse.emf.ecore.EObject element)
Specified by:
setCurrentElement in interface com.sysord.mad.widget.SpecificWidgetContext

getModelElementView

public com.sysord.mad.emitter.ModelElementView getModelElementView()
Specified by:
getModelElementView in interface com.sysord.mad.widget.SpecificWidgetContext

setModelElementView

public void setModelElementView(com.sysord.mad.emitter.ModelElementView modelElementView)
Specified by:
setModelElementView in interface com.sysord.mad.widget.SpecificWidgetContext

getParentComposite

public org.eclipse.swt.widgets.Composite getParentComposite()

setParentComposite

public void setParentComposite(org.eclipse.swt.widgets.Composite parent)

getToolkit

public org.eclipse.ui.forms.widgets.FormToolkit getToolkit()
Return the value of toolkit.

Returns:
the value of toolkit.

setToolkit

public void setToolkit(org.eclipse.ui.forms.widgets.FormToolkit toolkit)
Set the specified value toolkit for toolkit.

Parameters:
toolkit - the value to set to toolkit.

getAdapters

public com.sysord.emf.tools.misc.ActivatableAdapter[] getAdapters()
Return the value of adapters.

Returns:
the value of adapters.

setAdapters

public void setAdapters(com.sysord.emf.tools.misc.ActivatableAdapter... adapters)
Set the specified value adapters for adapters.

Parameters:
adapters - the value to set to adapters.

getWidgetBuilder

public com.sysord.mad.widget.WidgetBuilder getWidgetBuilder()
Return the value of widgetBuilder.

Returns:
the value of widgetBuilder.

setWidgetBuilder

public void setWidgetBuilder(com.sysord.mad.widget.WidgetBuilder widgetBuilder)
Set the specified value widgetBuilder for widgetBuilder.

Parameters:
widgetBuilder - the value to set to widgetBuilder.

getCurrentTabbedContainer

public org.eclipse.swt.widgets.TabFolder getCurrentTabbedContainer()
Return the value of currentTabbedContainer.

Returns:
the value of currentTabbedContainer.

setCurrentTabbedContainer

public void setCurrentTabbedContainer(org.eclipse.swt.widgets.TabFolder currentTabbedContainer)
Set the specified value currentTabbedContainer for currentTabbedContainer.

Parameters:
currentTabbedContainer - the value to set to currentTabbedContainer.

getCurrentTab

public org.eclipse.swt.widgets.TabItem getCurrentTab()
Return the value of currentTab.

Returns:
the value of currentTab.

setCurrentTab

public void setCurrentTab(org.eclipse.swt.widgets.TabItem currentTab)
Set the specified value currentTab for currentTab.

Parameters:
currentTab - the value to set to currentTab.

getCurrentContainer

@Deprecated
public org.eclipse.swt.custom.ScrolledComposite getCurrentContainer()
Deprecated. Use getFormBody() instead.

Return the value of currentContainer.

Returns:
the value of currentContainer.

setCurrentContainer

@Deprecated
public void setCurrentContainer(org.eclipse.swt.custom.ScrolledComposite currentContainer)
Deprecated. Use setFormBody(Composite) instead.

Set the specified value currentContainer for currentContainer.

Parameters:
currentContainer - the value to set to currentContainer.

getFormBody

public org.eclipse.swt.widgets.Composite getFormBody()
Return the value of formBody.

Returns:
the value of formBody.

setFormBody

public void setFormBody(org.eclipse.swt.widgets.Composite formBody)
Set the specified value formBody for formBody.

Parameters:
formBody - the value to set to formBody.

getForm

public org.eclipse.ui.forms.widgets.ScrolledForm getForm()
Return the value of currentForm.

Returns:
the value of currentForm.

setForm

public void setForm(org.eclipse.ui.forms.widgets.ScrolledForm currentForm)
Set the specified value currentForm for currentForm.

Parameters:
currentForm - the value to set to currentForm.

getSectionDescriptionContainer

public org.eclipse.swt.widgets.Composite getSectionDescriptionContainer()
Return the value of sectionDescriptionContainer.

Returns:
the value of sectionDescriptionContainer.

setSectionDescriptionContainer

public void setSectionDescriptionContainer(org.eclipse.swt.widgets.Composite sectionDescriptionContainer)
Set the specified value sectionDescriptionContainer for sectionDescriptionContainer.

Parameters:
sectionDescriptionContainer - the value to set to sectionDescriptionContainer.

getSectionErrorLabel

public org.eclipse.swt.widgets.Label getSectionErrorLabel()
Return the value of sectionErrorLabel.

Returns:
the value of sectionErrorLabel.

setSectionErrorLabel

public void setSectionErrorLabel(org.eclipse.swt.widgets.Label sectionErrorLabel)
Set the specified value sectionErrorLabel for sectionErrorLabel.

Parameters:
sectionErrorLabel - the value to set to sectionErrorLabel.

getWidgetContainer

public org.eclipse.swt.widgets.Composite getWidgetContainer()
Return the value of widgetContainer.

Returns:
the value of widgetContainer.

setWidgetContainer

public void setWidgetContainer(org.eclipse.swt.widgets.Composite widgetContainer)
Set the specified value widgetContainer for widgetContainer.

Parameters:
widgetContainer - the value to set to widgetContainer.

getErrorMessages

public java.util.Map<com.sysord.mad.widget.InputWidget<?>,java.lang.String> getErrorMessages()
Return the value of errorMessages.

Returns:
the value of errorMessages.

putErrorMessage

public void putErrorMessage(com.sysord.mad.widget.InputWidget<?> widget,
                            java.lang.String message)
Put the given error message into this context.

Parameters:
widget -
message -

clone

public SWTSpecificWidgetContext clone()
Overrides:
clone in class java.lang.Object