Initial commit from SVN.

This commit is contained in:
wcrisman
2014-05-30 10:31:51 -07:00
commit b45e56b890
1968 changed files with 370949 additions and 0 deletions

View File

@@ -0,0 +1,376 @@
package com.de22.test.multiuser.remote.view;
/**
* MainView
*/
public class MainView extends com.foundation.tcv.swt.server.Window implements com.foundation.view.IAssociationHandler {
//Component Names//
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
public static final String DATA_HOLDER_COMPONENT = "dataHolder";
public static final String MAIN_COMPONENT = "main";
public static final String NUMBER1_TEXT_COMPONENT = "number1Text";
public static final String NUMBER2_TEXT_COMPONENT = "number2Text";
public static final String APPLY_BUTTON_COMPONENT = "applyButton";
public static final String CANCEL_BUTTON_COMPONENT = "cancelButton";
public static final String MAIN_VIEW_COMPONENT = "MainView";
//Association Identifiers//
protected static final int DATA_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0 = 0;
protected static final int NUMBER1_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 1;
protected static final int NUMBER2_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 2;
//Method Association Identifiers//
protected static final int THIS_CLOSED_METHOD_ASSOCIATION = 0;
protected static final int APPLY_BUTTON_SELECTION_METHOD_ASSOCIATION = 1;
protected static final int CANCEL_BUTTON_SELECTION_METHOD_ASSOCIATION = 2;
//View Components//
private com.foundation.tcv.swt.server.ValueHolder controllerHolder = null;
private com.foundation.tcv.swt.server.ValueHolder dataHolder = null;
private com.foundation.tcv.swt.server.Panel main = null;
private com.foundation.tcv.swt.server.Label unnamedComponent0 = null;
private com.foundation.tcv.swt.server.TextField number1Text = null;
private com.foundation.tcv.swt.server.Label unnamedComponent1 = null;
private com.foundation.tcv.swt.server.TextField number2Text = null;
private com.foundation.tcv.swt.server.Button applyButton = null;
private com.foundation.tcv.swt.server.Button cancelButton = null;
/**
* MainView default constructor.
* <p>Warning: This constructor is intended for use by the metadata service <b>only</b>. This constructor should <b>never</b> be called by the view's controller.</p>
*/
public MainView() {
}//MainView()//
/**
* MainView non-modal constructor.
* @param controller The view's view controller reference.
*/
public MainView(com.foundation.controller.RemoteViewController controller) {
super((controller.getParent() != null ? ((com.foundation.tcv.swt.server.Component) (((com.foundation.controller.RemoteViewController) controller.getParent()).getView())).getContainingWindow() : null), (com.foundation.tcv.server.controller.SessionViewController) controller.getRemoteViewContext(), MAIN_VIEW_COMPONENT, com.foundation.tcv.swt.server.Window.STYLE_SHELL_TRIM, controller);
}//MainView()//
public void initializeControllerHolder(com.foundation.tcv.swt.server.Container parent) {
controllerHolder = new com.foundation.tcv.swt.server.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, com.de22.test.multiuser.remote.view.controller.MainViewController.class);
}//initializeControllerHolder()//
public void initializeDataHolder(com.foundation.tcv.swt.server.Container parent) {
dataHolder = new com.foundation.tcv.swt.server.ValueHolder(parent, DATA_HOLDER_COMPONENT, com.de22.test.multiuser.model.Data.class);
dataHolder.setParentAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(com.de22.test.multiuser.remote.view.controller.MainViewController.class, DATA_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, com.de22.test.multiuser.remote.view.controller.MainViewController.class, com.de22.test.multiuser.remote.view.controller.MainViewController.DATA)}, null,true)}));
}//initializeDataHolder()//
public void initializeUnnamedComponent0(com.foundation.tcv.swt.server.Container parent) {
unnamedComponent0 = new com.foundation.tcv.swt.server.Label(parent, null, 0);
unnamedComponent0.setText("First Number: (not auto-synchronizing)");
}//initializeUnnamedComponent0()//
public void initializeNumber1Text(com.foundation.tcv.swt.server.Container parent) {
number1Text = new com.foundation.tcv.swt.server.TextField(parent, NUMBER1_TEXT_COMPONENT, com.foundation.tcv.swt.server.TextField.STYLE_BORDER);
com.foundation.tcv.swt.server.TextField.IntegerFormat number1TextFormat = (com.foundation.tcv.swt.server.TextField.IntegerFormat) number1Text.initializeFormat(com.foundation.tcv.swt.server.TextField.IntegerFormat.class);
number1TextFormat.setValueAssociation(new com.foundation.view.SingleAssociationContainer("dataHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(com.de22.test.multiuser.model.Data.class, NUMBER1_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, com.de22.test.multiuser.model.Data.class, com.de22.test.multiuser.model.Data.NUMBER_1)}, null,true,com.de22.test.multiuser.model.Data.NUMBER_1)}));
number1Text.setAutoSynchronizeValue(false);
number1Text.setAutoValidate(false);
}//initializeNumber1Text()//
public void initializeUnnamedComponent1(com.foundation.tcv.swt.server.Container parent) {
unnamedComponent1 = new com.foundation.tcv.swt.server.Label(parent, null, 0);
unnamedComponent1.setText("Second Number: (auto-synchronizing)");
}//initializeUnnamedComponent1()//
public void initializeNumber2Text(com.foundation.tcv.swt.server.Container parent) {
number2Text = new com.foundation.tcv.swt.server.TextField(parent, NUMBER2_TEXT_COMPONENT, com.foundation.tcv.swt.server.TextField.STYLE_BORDER);
com.foundation.tcv.swt.server.TextField.IntegerFormat number2TextFormat = (com.foundation.tcv.swt.server.TextField.IntegerFormat) number2Text.initializeFormat(com.foundation.tcv.swt.server.TextField.IntegerFormat.class);
number2TextFormat.setValueAssociation(new com.foundation.view.SingleAssociationContainer("dataHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(com.de22.test.multiuser.model.Data.class, NUMBER2_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, com.de22.test.multiuser.model.Data.class, com.de22.test.multiuser.model.Data.NUMBER_2)}, null,true,com.de22.test.multiuser.model.Data.NUMBER_2)}));
number2Text.setAutoSynchronizeValue(true);
number2Text.setAutoValidate(true);
}//initializeNumber2Text()//
public void initializeMain(com.foundation.tcv.swt.server.Container parent) {
main = new com.foundation.tcv.swt.server.Panel(parent, MAIN_COMPONENT, 0);
initializeUnnamedComponent0(main);
initializeNumber1Text(main);
initializeUnnamedComponent1(main);
initializeNumber2Text(main);
com.foundation.tcv.swt.server.GridLayout layout = new com.foundation.tcv.swt.server.GridLayout(main);
layout.setNumColumns(1);
layout.setMarginHeight(3);
layout.setMarginWidth(3);
main.setLayout(layout);
main.setTabOrder(new com.common.util.LiteList(new Object[] {number1Text, number2Text}));
}//initializeMain()//
public void initializeApplyButton(com.foundation.tcv.swt.server.Container parent) {
applyButton = new com.foundation.tcv.swt.server.Button(parent, APPLY_BUTTON_COMPONENT, 0);
applyButton.setText("Apply");
applyButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, APPLY_BUTTON_SELECTION_METHOD_ASSOCIATION, applyButton, "controllerHolder", null, null));
}//initializeApplyButton()//
public void initializeCancelButton(com.foundation.tcv.swt.server.Container parent) {
cancelButton = new com.foundation.tcv.swt.server.Button(parent, CANCEL_BUTTON_COMPONENT, 0);
cancelButton.setText("Cancel");
cancelButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, CANCEL_BUTTON_SELECTION_METHOD_ASSOCIATION, cancelButton, "controllerHolder", null, null));
}//initializeCancelButton()//
/* (non-Javadoc)
* @see com.foundation.view.IView#internalViewInitialize()
*/
public void internalViewInitialize() {
this.setClosedMethod(new com.foundation.view.MethodAssociation(this, THIS_CLOSED_METHOD_ASSOCIATION, this, "controllerHolder", null, null));
initializeControllerHolder(this);
initializeDataHolder(this);
initializeMain(this);
initializeApplyButton(this);
initializeCancelButton(this);
com.foundation.tcv.swt.server.GridLayout layout = new com.foundation.tcv.swt.server.GridLayout(this);
layout.setNumColumns(2);
layout.setMarginHeight(3);
layout.setMarginWidth(3);
this.setLayout(layout);
this.setTabOrder(new com.common.util.LiteList(new Object[] {main}));
this.setDefaultChangeText("Another user has changed\n the underlying data.");
this.setDefaultChangeImage(new com.foundation.view.resource.ResourceReference("res://Application/General/WarningImage"));
this.setDefaultUpdateText("The value has changed in the model.");
this.setDefaultUpdateImage(new com.foundation.view.resource.ResourceReference("res://Application/General/InformationImage"));
this.setDefaultUpdateTimeout(new Integer(8000));
this.setDefaultContainerTitle("Main");
this.setDefaultContainerImage(new com.foundation.view.resource.ResourceReference("res://Application/General/WarningImage"));
layoutComponents();
super.internalViewInitialize();
setupLinkages();
}//internalViewInitialize()//
/* (non-Javadoc)
* @see com.foundation.view.IAssociationHandler#invokeGetMethod(int, Object)
*/
public Object invokeGetMethod(int associationNumber, Object value) {
Object retVal = null;
switch(associationNumber) {
default:
com.common.debug.Debug.log("Attribute association broken.");
break;
}//switch//
return retVal;
}//invokeGetMethod()//
/* (non-Javadoc)
* @see com.foundation.view.IAssociationHandler#invokeSetMethod(int, Object, Object)
*/
public void invokeSetMethod(int associationNumber, Object value, Object parameter) {
switch(associationNumber) {
default:
com.common.debug.Debug.log("Attribute association broken.");
break;
}//switch//
}//invokeSetMethod()//
/* (non-Javadoc)
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[])
*/
public Object invokeMethod(int associationNumber, Object value, Object[] parameters) {
Object retVal = null;
switch(associationNumber) {
case THIS_CLOSED_METHOD_ASSOCIATION:
((com.de22.test.multiuser.remote.view.controller.MainViewController) value).doClose();
break;
case APPLY_BUTTON_SELECTION_METHOD_ASSOCIATION:
((com.de22.test.multiuser.remote.view.controller.MainViewController) value).doApply();
break;
case CANCEL_BUTTON_SELECTION_METHOD_ASSOCIATION:
((com.de22.test.multiuser.remote.view.controller.MainViewController) value).doCancel();
break;
default:
com.common.debug.Debug.log("Method association broken.");
break;
}//switch//
return retVal;
}//invokeMethod()//
/* (non-Javadoc)
* @see com.foundation.view.IAssociationHandler#invokeMethod(int, Object, Object[], byte)
*/
public Object invokeMethod(int associationNumber, Object value, Object[] parameters, byte flags) {
Object result = null;
if(flags == INVOKE_GETTER_METHOD_FLAG) {
switch(associationNumber) {
case DATA_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0:
result = ((com.de22.test.multiuser.remote.view.controller.MainViewController) value).getData();
break;
case NUMBER1_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
result = ((com.de22.test.multiuser.model.Data) value).getNumber1();
break;
case NUMBER2_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
result = ((com.de22.test.multiuser.model.Data) value).getNumber2();
break;
default:
com.common.debug.Debug.log("Association (getter) broken.");
break;
}//switch//
}//if//
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
switch(associationNumber) {
case DATA_HOLDER_ASSOCIATION_PARENT_ASSOCIATION_0:
result = ((com.de22.test.multiuser.remote.view.controller.MainViewController) value).getOldAttributeValue(com.de22.test.multiuser.remote.view.controller.MainViewController.DATA);
break;
case NUMBER1_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
result = ((com.de22.test.multiuser.model.Data) value).getOldAttributeValue(com.de22.test.multiuser.model.Data.NUMBER_1);
break;
case NUMBER2_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
result = ((com.de22.test.multiuser.model.Data) value).getOldAttributeValue(com.de22.test.multiuser.model.Data.NUMBER_2);
break;
default:
com.common.debug.Debug.log("Association (original value getter) broken.");
break;
}//switch//
}//if//
else {
switch(associationNumber) {
case NUMBER1_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
((com.de22.test.multiuser.model.Data) value).setNumber1((java.lang.Integer) parameters[0]);
break;
case NUMBER2_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
((com.de22.test.multiuser.model.Data) value).setNumber2((java.lang.Integer) parameters[0]);
break;
default:
com.common.debug.Debug.log("Association (setter) broken.");
break;
}//switch//
}//else//
return result;
}//invokeMethod()//
/**
* Lays out the components.
*/
public void layoutComponents() {
{ //main//
com.foundation.tcv.swt.GridLayoutData layoutData = new com.foundation.tcv.swt.GridLayoutData();
layoutData.verticalAlignment = com.foundation.tcv.swt.GridLayoutData.FILL;
layoutData.horizontalAlignment = com.foundation.tcv.swt.GridLayoutData.FILL;
layoutData.horizontalSpan = 2;
layoutData.grabExcessHorizontalSpace = true;
layoutData.grabExcessVerticalSpace = true;
main.setLayoutData(layoutData);
}//block//
{ //null//
com.foundation.tcv.swt.GridLayoutData layoutData = new com.foundation.tcv.swt.GridLayoutData();
layoutData.horizontalAlignment = com.foundation.tcv.swt.GridLayoutData.FILL;
layoutData.grabExcessHorizontalSpace = true;
unnamedComponent0.setLayoutData(layoutData);
}//block//
{ //number1Text//
com.foundation.tcv.swt.GridLayoutData layoutData = new com.foundation.tcv.swt.GridLayoutData();
layoutData.horizontalAlignment = com.foundation.tcv.swt.GridLayoutData.FILL;
layoutData.grabExcessHorizontalSpace = true;
number1Text.setLayoutData(layoutData);
}//block//
{ //null//
com.foundation.tcv.swt.GridLayoutData layoutData = new com.foundation.tcv.swt.GridLayoutData();
layoutData.horizontalAlignment = com.foundation.tcv.swt.GridLayoutData.FILL;
layoutData.grabExcessHorizontalSpace = true;
unnamedComponent1.setLayoutData(layoutData);
}//block//
{ //number2Text//
com.foundation.tcv.swt.GridLayoutData layoutData = new com.foundation.tcv.swt.GridLayoutData();
layoutData.horizontalAlignment = com.foundation.tcv.swt.GridLayoutData.FILL;
layoutData.grabExcessHorizontalSpace = true;
number2Text.setLayoutData(layoutData);
}//block//
{ //applyButton//
com.foundation.tcv.swt.GridLayoutData layoutData = new com.foundation.tcv.swt.GridLayoutData();
layoutData.horizontalAlignment = com.foundation.tcv.swt.GridLayoutData.CENTER;
layoutData.grabExcessHorizontalSpace = true;
applyButton.setLayoutData(layoutData);
}//block//
{ //cancelButton//
com.foundation.tcv.swt.GridLayoutData layoutData = new com.foundation.tcv.swt.GridLayoutData();
layoutData.horizontalAlignment = com.foundation.tcv.swt.GridLayoutData.CENTER;
layoutData.grabExcessHorizontalSpace = true;
cancelButton.setLayoutData(layoutData);
}//block//
}//layoutComponents()//
/**
* Initializes the direct linkages between the components.
*/
public void setupLinkages() {
}//setupLinkages()//
/**
* Gets the view component.
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
* @return The view component.
*/
protected com.foundation.tcv.swt.server.ValueHolder getVpControllerHolder() {
return controllerHolder;
}//getVpControllerHolder()//
/**
* Gets the view component.
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
* @return The view component.
*/
protected com.foundation.tcv.swt.server.ValueHolder getVpDataHolder() {
return dataHolder;
}//getVpDataHolder()//
/**
* Gets the view component.
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
* @return The view component.
*/
protected com.foundation.tcv.swt.server.Panel getVpMain() {
return main;
}//getVpMain()//
/**
* Gets the view component.
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
* @return The view component.
*/
protected com.foundation.tcv.swt.server.Label getVpUnnamedComponent0() {
return unnamedComponent0;
}//getVpUnnamedComponent0()//
/**
* Gets the view component.
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
* @return The view component.
*/
protected com.foundation.tcv.swt.server.TextField getVpNumber1Text() {
return number1Text;
}//getVpNumber1Text()//
/**
* Gets the view component.
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
* @return The view component.
*/
protected com.foundation.tcv.swt.server.Label getVpUnnamedComponent1() {
return unnamedComponent1;
}//getVpUnnamedComponent1()//
/**
* Gets the view component.
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
* @return The view component.
*/
protected com.foundation.tcv.swt.server.TextField getVpNumber2Text() {
return number2Text;
}//getVpNumber2Text()//
/**
* Gets the view component.
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
* @return The view component.
*/
protected com.foundation.tcv.swt.server.Button getVpApplyButton() {
return applyButton;
}//getVpApplyButton()//
/**
* Gets the view component.
* <p>Warning: This accessor to allow for the very rare and highly discouraged derived view class.</p>
* @return The view component.
*/
protected com.foundation.tcv.swt.server.Button getVpCancelButton() {
return cancelButton;
}//getVpCancelButton()//
}//MainView//

View File

@@ -0,0 +1,48 @@
<?xml version="1.0"?>
<vml>
<metadata>
<platform name="thin:swt"/>
</metadata>
<window name="MainView" style="window trim" container-image="res://Application/General/WarningImage" container-title="Main" change-image="res://Application/General/WarningImage" change-text="Another user has changed\\n the underlying data." update-image="res://Application/General/InformationImage" update-text="The value has changed in the model." update-timeout="8000">
<grid-layout margin-height="3" margin-width="3" column-count="2"/>
<method function="closed" name="doClose" signature="" value-holder="controllerHolder"/>
<value-holder name="controllerHolder" type="com.de22.test.multiuser.remote.view.controller.MainViewController"/>
<value-holder name="dataHolder" type="com.de22.test.multiuser.model.Data">
<association function="parent" attribute="data" value-holder="controllerHolder"/>
</value-holder>
<panel name="main" style="" tab-order="1">
<grid-layout column-count="1" margin-height="3" margin-width="3"/>
<grid-layout-data horizontal-span="2" horizontal-fill="true" vertical-fill="true" horizontal-alignment="fill" vertical-alignment="fill"/>
<label text="First Number: (not auto-synchronizing)">
<grid-layout-data horizontal-alignment='fill' horizontal-fill='true'/>
</label>
<text name="number1Text" style='border' tab-order="1" auto-synchronize-text="false" auto-validate="false">
<grid-layout-data horizontal-alignment='fill' horizontal-fill='true'/>
<integer-format>
<association function="value" attribute="number1" value-holder="dataHolder" decorate="true"/>
</integer-format>
</text>
<label text="Second Number: (auto-synchronizing)">
<grid-layout-data horizontal-alignment='fill' horizontal-fill='true'/>
</label>
<text name="number2Text" style='border' tab-order="1" auto-synchronize-text="true" auto-validate="true">
<grid-layout-data horizontal-alignment='fill' horizontal-fill='true'/>
<integer-format>
<association function="value" attribute="number2" value-holder="dataHolder" decorate="true"/>
</integer-format>
</text>
</panel>
<button name="applyButton" style="" text="Apply">
<grid-layout-data horizontal-fill="true" horizontal-alignment="center"/>
<method function="selection" name="doApply" value-holder="controllerHolder"/>
</button>
<button name="cancelButton" style="" text="Cancel">
<grid-layout-data horizontal-fill="true" horizontal-alignment="center"/>
<method function="selection" name="doCancel" value-holder="controllerHolder"/>
</button>
</window>
</vml>

View File

@@ -0,0 +1,35 @@
package com.de22.test.multiuser.remote.view.controller;
import com.foundation.controller.RemoteViewController;
import com.foundation.view.IViewContext;
import com.foundation.application.*;
import com.foundation.attribute.ReflectionContext;
import com.de22.test.multiuser.application.*;
/**
*
*/
public abstract class AbstractViewController extends RemoteViewController {
/**
* AbstractViewController constructor.
* @param viewContext The view's context under which it will operate.
*/
public AbstractViewController(IViewContext viewContext) {
super(viewContext);
}//AbstractViewController()//
/**
* AbstractViewController constructor.
* @param viewContext The view's context under which it will operate.
* @param reflectionContext The reflection context to be used by the view.
*/
public AbstractViewController(IViewContext context, ReflectionContext reflectionContext) {
super(context, reflectionContext);
}//AbstractViewController()//
/**
* Gets the application object that this object is running under. The application object provides the object various services that it will need.
* @return The application reference for the application this object is running under.
*/
public IApplication getApplication() {
return TestMultiUserApplication.getSingleton();
}//getApplication()//
}//AbstractViewController//

View File

@@ -0,0 +1,90 @@
package com.de22.test.multiuser.remote.view.controller;
import com.foundation.view.ControlDecoration;
import com.foundation.view.IViewContext;
import com.common.comparison.Comparator;
import com.common.debug.Debug;
import com.de22.test.multiuser.model.Data;
import com.de22.test.multiuser.model.controller.DataController;
import com.de22.test.multiuser.remote.view.MainView;
import com.foundation.metadata.Attribute;
/**
* The main view.
*/
public class MainViewController extends AbstractViewController {
public static final Attribute DATA = registerAttribute(MainViewController.class, "data");
/**
* MainViewController constructor.
* @param viewContext
*/
public MainViewController(IViewContext viewContext) {
super(viewContext);
setData((Data) getReflectionManager().createReflection(DataController.getSingleton().getData()));
}//MainViewController()//
/* (non-Javadoc)
* @see com.foundation.controller.RemoteViewController#getViewClass()
*/
protected Class getViewClass() {
return MainView.class;
}//getViewClass()//
/* (non-Javadoc)
* @see com.foundation.controller.ViewController#validate()
*/
public boolean validate() {
boolean result = true;
getDecorationManager().clearDecorations(null, null);
if(Comparator.equals(getData().getNumber1(), getData().getNumber2())) {
getDecorationManager().addDecoration(getData(), Data.NUMBER_1, new ControlDecoration("res://Application/General/ErrorImage", "The two numbers cannot be the same."));
getDecorationManager().addDecoration(getData(), Data.NUMBER_2, new ControlDecoration("res://Application/General/ErrorImage", "The two numbers cannot be the same."));
result = false;
}//if//
getDecorationManager().applyDecorationChanges();
return result;
}//validate()//
/**
* Closes the main view.
*/
public void doClose() {
close();
}//doClose()//
/**
* Closes the main view.
*/
public void doApply() {
synchronize();
if(getReflectionManager().synchronizeAll()) {
Debug.log("Synchronize success.");
}//if//
else {
Debug.log("Synchronize failed.");
}//else//
}//doApply()//
/**
* Cancels any changes.
*/
public void doCancel() {
synchronize();
getData().reverseObjectChanges();
validate();
}//doCancel()//
/**
* Gets the data value.
* @return The data value.
*/
public Data getData() {
return (Data) getAttributeValue(DATA);
}//getData()//
/**
* Sets the data value.
* @param data The data value.
*/
public void setData(Data data) {
setAttributeValue(DATA, data);
}//setData()//
}//MainViewController//