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,37 @@
package com.foundation.tcv.swt.client.controller;
import com.foundation.attribute.ReflectionContext;
import com.foundation.view.IViewContext;
/**
* Copyright Wynne Crisman 2005<p>
*/
public abstract class AbstractViewController extends com.foundation.controller.ViewController {
/**
* AbstractViewController constructor.
* @param context
*/
public AbstractViewController(IViewContext context) {
super(context);
}//AbstractViewController()//
/**
* AbstractViewController constructor.
* @param context
* @param reflectionContext
*/
public AbstractViewController(IViewContext context, ReflectionContext reflectionContext) {
super(context, reflectionContext);
}//AbstractViewController()//
/* (non-Javadoc)
* @see com.foundation.common.IEntity#getApplication()
*/
public com.foundation.application.IApplication getApplication() {
return com.foundation.tcv.client.application.AbstractClientApplication.getSingleton();
}//getApplication()//
/* (non-Javadoc)
* @see com.foundation.controller.ViewController#validate()
*/
public boolean validate() {
return true;
}//validate()//
}//AbstractViewController//

View File

@@ -0,0 +1,54 @@
package com.foundation.tcv.swt.client.controller;
import com.foundation.metadata.Attribute;
import com.foundation.view.IViewContext;
/**
* Copyright Wynne Crisman 2003<p>
* TODO: Could add a retry button to this view?
*/
public class ConnectionErrorViewController extends AbstractViewController {
public static final Attribute ERROR_TEXT = registerAttribute(ConnectionErrorViewController.class, "errorText", AO_LAZY);
/**
* ConnectionErrorViewController constructor.
* @param context
*/
public ConnectionErrorViewController(IViewContext context) {
super(context);
}//ConnectionErrorViewController()//
/* (non-Javadoc)
* @see com.foundation.controller.ViewController#getViewClass()
*/
protected Class getViewClass() {
return com.foundation.tcv.swt.client.view.ConnectionErrorView.class;
}//getViewClass()//
/* (non-Javadoc)
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
*/
protected Object lazyLoadAttribute(Attribute attribute) {
Object result = null;
if(attribute == ERROR_TEXT) {
result = "The client was unable to make a connection to the server. Please check your internet connection and try the application at a later time. My may contact the application provider for furthor error resolution.";
}//if//
else {
result = super.lazyLoadAttribute(attribute);
}//else//
return result;
}//lazyLoadAttribute()//
/**
* Gets the license information to be displayed.
* @return The license information displayed when an application is being run without a valid license.
*/
public String getErrorText() {
return (String) getAttributeValue(ERROR_TEXT);
}//getErrorText()//
/**
* Closes the view.
*/
public void doClose() {
//Close the window.//
close();
}//doClose()//
}//ConnectionErrorViewController//

View File

@@ -0,0 +1,84 @@
package com.foundation.tcv.swt.client.controller;
import com.foundation.metadata.Attribute;
import com.foundation.view.IViewContext;
/**
* Copyright Wynne Crisman 2003<p>
* Tracks the download of a new client version and displays the current progress.
* <p>TODO: Could allow pausing and cancelling... resume would be automatic upon the next download attempt.
*/
public class DownloadProgressViewController extends AbstractViewController {
public static final Attribute MESSAGE = registerAttribute(DownloadProgressViewController.class, "message", AO_LAZY);
public static final Attribute PROGRESS = registerAttribute(DownloadProgressViewController.class, "progress");
/**
* DownloadProgressViewController constructor.
* @param context
*/
public DownloadProgressViewController(IViewContext context) {
super(context);
}//DownloadProgressViewController()//
/* (non-Javadoc)
* @see com.foundation.controller.ViewController#getViewClass()
*/
protected Class getViewClass() {
return com.foundation.tcv.swt.client.view.DownloadProgressView.class;
}//getViewClass()//
/* (non-Javadoc)
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
*/
protected Object lazyLoadAttribute(Attribute attribute) {
Object result = null;
if(attribute == MESSAGE) {
result = "The client is currently downloading an update for use with the requested application. The application will automatically start after the download is completed.";
}//if//
else {
result = super.lazyLoadAttribute(attribute);
}//else//
return result;
}//lazyLoadAttribute()//
/**
* Closes the view.
*/
public void doClose() {
//Close the window.//
close();
}//doClose()//
/**
* Requests that the download be canceled.
*/
public void doCancel() {
//TODO: Cancel the download..
}//doCancel()//
/**
* Gets the message displayed to the user.
* @return The displayed message.
*/
public String getMessage() {
return (String) getAttributeValue(MESSAGE);
}//getMessage()//
/**
* Sets the message displayed to the user.
* @param message The displayed message.
*/
public void setMessage(String message) {
setAttributeValue(MESSAGE, message);
}//setMessage()//
/**
* Gets the current progress percentage.
* @return The percentage (0-100) representing the current task progress.
*/
public Integer getProgress() {
return (Integer) getAttributeValue(PROGRESS);
}//getProgress()//
/**
* Sets the current progress percentage.
* @param progress The percentage (0-100) representing the current task progress.
*/
public void setProgress(Integer progress) {
setAttributeValue(PROGRESS, progress);
}//setProgress()//
}//DownloadProgressViewController//

View File

@@ -0,0 +1,66 @@
package com.foundation.tcv.swt.client.controller;
import com.foundation.view.IView;
import com.foundation.view.IViewContext;
import com.foundation.metadata.Attribute;
/**
* Copyright Wynne Crisman 2003<p>
* Displays the license terms similar to how a shareware application will. If the license window is closed, so is the application.
* This allows testing and development, but makes deployment difficult without a license.
*/
public class LicenseSplashViewController extends AbstractViewController {
public static final Attribute LICENSE_INFORMATION = registerAttribute(LicenseSplashViewController.class, "licenseInformation", AO_LAZY);
private static final String emailAddress = "wcrisman@softwarezealot.com"; //TODO: Extract this.//
/**
* LicenseSplashViewController constructor.
* @param context
*/
public LicenseSplashViewController(IViewContext context) {
super(context);
}//LicenseSplashViewController()//
/* (non-Javadoc)
* @see com.foundation.controller.ViewController#getViewClass()
*/
protected Class getViewClass() {
return com.foundation.tcv.swt.client.view.LicenseSplashView.class;
}//getViewClass()//
/* (non-Javadoc)
* @see com.foundation.common.Entity#lazyLoadAttribute(com.foundation.metadata.Attribute)
*/
protected Object lazyLoadAttribute(Attribute attribute) {
Object result = null;
if(attribute == LICENSE_INFORMATION) {
result = "The application you are currently using is not licensed. A valid license is required for deployment of any application using this product. To obtain a valid license please send email to: " + emailAddress;
}//if//
else {
result = super.lazyLoadAttribute(attribute);
}//else//
return result;
}//lazyLoadAttribute()//
/**
* Gets the license information to be displayed.
* @return The license information displayed when an application is being run without a valid license.
*/
public String getLicenseInformation() {
return (String) getAttributeValue(LICENSE_INFORMATION);
}//getLicenseInformation()//
/**
* Closes the license window.
*/
public void doClose() {
//Close the window.//
close();
//Shutdown the application if the license message is not kept open.//
((com.foundation.application.Application) getApplication()).shutdown();
}//doClose()//
/* (non-Javadoc)
* @see com.foundation.controller.ViewController#postOpenInitialization(com.foundation.view.IView)
*/
protected void postOpenInitialization(IView view) {
((com.foundation.tcv.swt.client.view.LicenseSplashView) view).center();
super.postOpenInitialization(view);
}//postOpenInitialization()//
}//LicenseSplashViewController//

View File

@@ -0,0 +1,28 @@
package com.foundation.tcv.swt.client.util;
/**
* Copyright Wynne Crisman 2006<p>
*/
public class ActivityListener {
/**
* ActivityListener constructor.
*/
private ActivityListener() {
super();
}//ActivityListener()//
/**
* Initializes the listener.
*/
public static native void initialize();
/**
* Releases the listener.
*/
public static native void release();
/**
* Called by the listener when the system has experienced activity.
* <p>Note: This will only be called once per 10 seconds.</p>
*/
public static void logActivity() {
//TODO: log the activity and notify listeners when there is no activity for a period of time.
}//logActivity()//
}//ActivityListener//

View File

@@ -0,0 +1,212 @@
package com.foundation.tcv.swt.client.view;
/**
* ConnectionErrorView
*/
public class ConnectionErrorView extends com.foundation.view.swt.Window implements com.foundation.view.IAssociationHandler {
//Component Names//
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
public static final String OK_BUTTON_COMPONENT = "okButton";
public static final String ERROR_TEXT_COMPONENT = "errorText";
public static final String CONNECTION_ERROR_VIEW_COMPONENT = "ConnectionErrorView";
//Association Identifiers//
protected static final int ERROR_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 0;
//Method Association Identifiers//
protected static final int THIS_CLOSED_METHOD_ASSOCIATION = 0;
protected static final int OK_BUTTON_SELECTION_METHOD_ASSOCIATION = 1;
//View Components//
private com.foundation.view.swt.ValueHolder controllerHolder = null;
private com.foundation.view.swt.Button okButton = null;
private com.foundation.view.swt.TextField errorText = null;
/**
* ConnectionErrorView 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 ConnectionErrorView() {
}//ConnectionErrorView()//
/**
* ConnectionErrorView constructor.
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
*/
public ConnectionErrorView(com.foundation.controller.ViewController controller) {
super((com.foundation.controller.ViewController) controller.getParent(), CONNECTION_ERROR_VIEW_COMPONENT, com.foundation.view.swt.Window.STYLE_SHELL_TRIM, controller.getContext(), controller);
}//ConnectionErrorView()//
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, com.foundation.tcv.swt.client.controller.ConnectionErrorViewController.class);
}//initializeControllerHolder()//
public void initializeOkButton(com.foundation.view.swt.Container parent) {
okButton = new com.foundation.view.swt.Button(parent, OK_BUTTON_COMPONENT, 0);
okButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, OK_BUTTON_SELECTION_METHOD_ASSOCIATION, okButton, "controllerHolder", null, null));
}//initializeOkButton()//
public void initializeErrorText(com.foundation.view.swt.Container parent) {
errorText = new com.foundation.view.swt.TextField(parent, ERROR_TEXT_COMPONENT, com.foundation.view.swt.TextField.STYLE_BORDER|com.foundation.view.swt.TextField.STYLE_WRAP|com.foundation.view.swt.TextField.STYLE_READ_ONLY|com.foundation.view.swt.TextField.STYLE_V_SCROLL|com.foundation.view.swt.TextField.STYLE_MULTI);
com.foundation.view.swt.TextField.TextFormat errorTextFormat = (com.foundation.view.swt.TextField.TextFormat) errorText.initializeFormat(com.foundation.view.swt.TextField.TextFormat.class);
errorTextFormat.setValueAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(com.foundation.tcv.swt.client.controller.ConnectionErrorViewController.class, ERROR_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.foundation.tcv.swt.client.controller.ConnectionErrorViewController.class, com.foundation.tcv.swt.client.controller.ConnectionErrorViewController.ERROR_TEXT)}, null,true)}));
}//initializeErrorText()//
/* (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);
initializeOkButton(this);
initializeErrorText(this);
com.foundation.view.swt.FormLayout layout = new com.foundation.view.swt.FormLayout(this);
layout.setMarginHeight(10);
layout.setMarginWidth(10);
this.setLayout(layout);
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
this.setSize(220, 100);
this.setDefaultContainerTitle("Connection Error");
layoutComponents();
super.internalViewInitialize();
setupLinkages();
}//internalViewInitialize()//
/* (non-Javadoc)
* @see com.foundation.view.IView#pack()
*/
public void pack() {
//Don't pack since a custom size was specified.
}//pack()//
/* (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.foundation.tcv.swt.client.controller.ConnectionErrorViewController) value).doClose();
break;
case OK_BUTTON_SELECTION_METHOD_ASSOCIATION:
((com.foundation.tcv.swt.client.controller.ConnectionErrorViewController) value).doClose();
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 ERROR_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
result = ((com.foundation.tcv.swt.client.controller.ConnectionErrorViewController) value).getErrorText();
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 ERROR_TEXT_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
result = ((com.foundation.tcv.swt.client.controller.ConnectionErrorViewController) value).getOldAttributeValue(com.foundation.tcv.swt.client.controller.ConnectionErrorViewController.ERROR_TEXT);
break;
default:
com.common.debug.Debug.log("Association (original value getter) broken.");
break;
}//switch//
}//if//
else {
switch(associationNumber) {
default:
com.common.debug.Debug.log("Association (setter) broken.");
break;
}//switch//
}//else//
return result;
}//invokeMethod()//
/**
* Lays out the components.
*/
public void layoutComponents() {
{ //okButton//
com.foundation.view.swt.layout.FormData layoutData = new com.foundation.view.swt.layout.FormData();
layoutData.left = new com.foundation.view.swt.layout.FormAttachment(errorText.getSwtControl(), 0, org.eclipse.swt.SWT.CENTER);
layoutData.bottom = new com.foundation.view.swt.layout.FormAttachment(100, 0);
okButton.setLayoutData(layoutData);
}//block//
{ //errorText//
com.foundation.view.swt.layout.FormData layoutData = new com.foundation.view.swt.layout.FormData();
layoutData.width = 200;
layoutData.height = 200;
layoutData.left = new com.foundation.view.swt.layout.FormAttachment(0, 0);
layoutData.top = new com.foundation.view.swt.layout.FormAttachment(0, 0);
layoutData.right = new com.foundation.view.swt.layout.FormAttachment(100, 0);
layoutData.bottom = new com.foundation.view.swt.layout.FormAttachment(okButton.getSwtControl(), -10, org.eclipse.swt.SWT.DEFAULT);
errorText.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.view.swt.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.view.swt.Button getVpOkButton() {
return okButton;
}//getVpOkButton()//
/**
* 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.view.swt.TextField getVpErrorText() {
return errorText;
}//getVpErrorText()//
}//ConnectionErrorView//

View File

@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<vml>
<metadata>
<platform name="thick:swt"/>
</metadata>
<window name="ConnectionErrorView" style="window trim" width="220" height="100" container-title="Connection Error">
<form-layout margin-height="10" margin-width="10"/>
<method function="closed" name="doClose" value-holder="controllerHolder"/>
<value-holder name="controllerHolder" type="com.foundation.tcv.swt.client.controller.ConnectionErrorViewController"/>
<button name="okButton" style="">
<form-layout-data>
<attachment side="bottom" percent="100" offset="0"/>
<attachment side="left" component="errorText" alignment="center"/>
</form-layout-data>
<method function="selection" name="doClose" value-holder="controllerHolder"/>
</button>
<text name="errorText" style="border | multi line | read only | vertical scroll | wrap">
<form-layout-data width="200" height="200">
<attachment side="left" percent="0" offset="0"/>
<attachment side="right" percent="100" offset="0"/>
<attachment side="top" percent="0" offset="0"/>
<attachment side="bottom" component="okButton" offset="-10"/>
</form-layout-data>
<text-format>
<association function="value" attribute="ERROR_TEXT" value-holder="controllerHolder"/>
</text-format>
</text>
</window>
</vml>

View File

@@ -0,0 +1,244 @@
package com.foundation.tcv.swt.client.view;
/**
* DownloadProgressView
*/
public class DownloadProgressView extends com.foundation.view.swt.Window implements com.foundation.view.IAssociationHandler {
//Component Names//
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
public static final String CANCEL_BUTTON_COMPONENT = "cancelButton";
public static final String PROGRESS_COMPONENT = "progress";
public static final String MESSAGE_COMPONENT = "message";
public static final String DOWNLOAD_PROGRESS_VIEW_COMPONENT = "DownloadProgressView";
//Association Identifiers//
protected static final int PROGRESS_ASSOCIATION_PROGRESS_ASSOCIATION_0 = 0;
protected static final int MESSAGE_ASSOCIATION_TEXT_ASSOCIATION_0 = 1;
//Method Association Identifiers//
protected static final int THIS_CLOSED_METHOD_ASSOCIATION = 0;
protected static final int CANCEL_BUTTON_SELECTION_METHOD_ASSOCIATION = 1;
//View Components//
private com.foundation.view.swt.ValueHolder controllerHolder = null;
private com.foundation.view.swt.Button cancelButton = null;
private com.foundation.view.swt.Progress progress = null;
private com.foundation.view.swt.Label message = null;
/**
* DownloadProgressView 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 DownloadProgressView() {
}//DownloadProgressView()//
/**
* DownloadProgressView constructor.
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
*/
public DownloadProgressView(com.foundation.controller.ViewController controller) {
super((com.foundation.controller.ViewController) controller.getParent(), DOWNLOAD_PROGRESS_VIEW_COMPONENT, com.foundation.view.swt.Window.STYLE_DIALOG_TRIM, controller.getContext(), controller);
}//DownloadProgressView()//
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, com.foundation.tcv.swt.client.controller.DownloadProgressViewController.class);
}//initializeControllerHolder()//
public void initializeCancelButton(com.foundation.view.swt.Container parent) {
cancelButton = new com.foundation.view.swt.Button(parent, CANCEL_BUTTON_COMPONENT, 0);
cancelButton.setSelectionMethod(new com.foundation.view.MethodAssociation(this, CANCEL_BUTTON_SELECTION_METHOD_ASSOCIATION, cancelButton, "controllerHolder", null, null));
}//initializeCancelButton()//
public void initializeProgress(com.foundation.view.swt.Container parent) {
progress = new com.foundation.view.swt.Progress(parent, PROGRESS_COMPONENT, 0);
progress.setMaximum(new Integer(1));
progress.setMinimum(new Integer(0));
progress.setProgress(new java.math.BigDecimal("0"));
progress.setProgressAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(com.foundation.tcv.swt.client.controller.DownloadProgressViewController.class, PROGRESS_ASSOCIATION_PROGRESS_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, com.foundation.tcv.swt.client.controller.DownloadProgressViewController.class, com.foundation.tcv.swt.client.controller.DownloadProgressViewController.PROGRESS)}, null,true)}));
}//initializeProgress()//
public void initializeMessage(com.foundation.view.swt.Container parent) {
message = new com.foundation.view.swt.Label(parent, MESSAGE_COMPONENT, com.foundation.view.swt.Label.STYLE_BORDER|com.foundation.view.swt.Label.STYLE_WRAP);
message.setTextAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(com.foundation.tcv.swt.client.controller.DownloadProgressViewController.class, MESSAGE_ASSOCIATION_TEXT_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, com.foundation.tcv.swt.client.controller.DownloadProgressViewController.class, com.foundation.tcv.swt.client.controller.DownloadProgressViewController.MESSAGE)}, null,true)}));
}//initializeMessage()//
/* (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);
initializeCancelButton(this);
initializeProgress(this);
initializeMessage(this);
com.foundation.view.swt.FormLayout layout = new com.foundation.view.swt.FormLayout(this);
layout.setMarginHeight(10);
layout.setMarginWidth(10);
this.setLayout(layout);
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
this.setSize(220, 100);
this.setDefaultContainerTitle("Update Download");
layoutComponents();
super.internalViewInitialize();
setupLinkages();
}//internalViewInitialize()//
/* (non-Javadoc)
* @see com.foundation.view.IView#pack()
*/
public void pack() {
//Don't pack since a custom size was specified.
}//pack()//
/* (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.foundation.tcv.swt.client.controller.DownloadProgressViewController) value).doClose();
break;
case CANCEL_BUTTON_SELECTION_METHOD_ASSOCIATION:
((com.foundation.tcv.swt.client.controller.DownloadProgressViewController) 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 PROGRESS_ASSOCIATION_PROGRESS_ASSOCIATION_0:
result = ((com.foundation.tcv.swt.client.controller.DownloadProgressViewController) value).getProgress();
break;
case MESSAGE_ASSOCIATION_TEXT_ASSOCIATION_0:
result = ((com.foundation.tcv.swt.client.controller.DownloadProgressViewController) value).getMessage();
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 PROGRESS_ASSOCIATION_PROGRESS_ASSOCIATION_0:
result = ((com.foundation.tcv.swt.client.controller.DownloadProgressViewController) value).getOldAttributeValue(com.foundation.tcv.swt.client.controller.DownloadProgressViewController.PROGRESS);
break;
case MESSAGE_ASSOCIATION_TEXT_ASSOCIATION_0:
result = ((com.foundation.tcv.swt.client.controller.DownloadProgressViewController) value).getOldAttributeValue(com.foundation.tcv.swt.client.controller.DownloadProgressViewController.MESSAGE);
break;
default:
com.common.debug.Debug.log("Association (original value getter) broken.");
break;
}//switch//
}//if//
else {
switch(associationNumber) {
default:
com.common.debug.Debug.log("Association (setter) broken.");
break;
}//switch//
}//else//
return result;
}//invokeMethod()//
/**
* Lays out the components.
*/
public void layoutComponents() {
{ //cancelButton//
com.foundation.view.swt.layout.FormData layoutData = new com.foundation.view.swt.layout.FormData();
layoutData.left = new com.foundation.view.swt.layout.FormAttachment(progress.getSwtControl(), 0, org.eclipse.swt.SWT.CENTER);
layoutData.bottom = new com.foundation.view.swt.layout.FormAttachment(100, 0);
cancelButton.setLayoutData(layoutData);
}//block//
{ //progress//
com.foundation.view.swt.layout.FormData layoutData = new com.foundation.view.swt.layout.FormData();
layoutData.height = 20;
layoutData.left = new com.foundation.view.swt.layout.FormAttachment(0, 0);
layoutData.right = new com.foundation.view.swt.layout.FormAttachment(100, 0);
layoutData.bottom = new com.foundation.view.swt.layout.FormAttachment(cancelButton.getSwtControl(), -10, org.eclipse.swt.SWT.DEFAULT);
progress.setLayoutData(layoutData);
}//block//
{ //message//
com.foundation.view.swt.layout.FormData layoutData = new com.foundation.view.swt.layout.FormData();
layoutData.left = new com.foundation.view.swt.layout.FormAttachment(0, 0);
layoutData.top = new com.foundation.view.swt.layout.FormAttachment(0, 0);
layoutData.right = new com.foundation.view.swt.layout.FormAttachment(100, 0);
layoutData.bottom = new com.foundation.view.swt.layout.FormAttachment(progress.getSwtControl(), -10, org.eclipse.swt.SWT.DEFAULT);
message.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.view.swt.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.view.swt.Button getVpCancelButton() {
return cancelButton;
}//getVpCancelButton()//
/**
* 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.view.swt.Progress getVpProgress() {
return progress;
}//getVpProgress()//
/**
* 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.view.swt.Label getVpMessage() {
return message;
}//getVpMessage()//
}//DownloadProgressView//

View File

@@ -0,0 +1,41 @@
<?xml version="1.0"?>
<vml>
<metadata>
<platform name="thick:swt"/>
</metadata>
<window name="DownloadProgressView" style="dialog trim" width="220" height="100" container-title="Update Download">
<form-layout margin-height="10" margin-width="10"/>
<method function="closed" name="doClose" value-holder="controllerHolder"/>
<value-holder name="controllerHolder" type="com.foundation.tcv.swt.client.controller.DownloadProgressViewController"/>
<button name="cancelButton" style="">
<form-layout-data>
<attachment side="bottom" percent="100" offset="0"/>
<attachment side="left" component="progress" alignment="center"/>
</form-layout-data>
<method function="selection" name="doCancel" value-holder="controllerHolder"/>
</button>
<progress name="progress" style="">
<form-layout-data height="20">
<attachment side="left" percent="0" offset="0"/>
<attachment side="right" percent="100" offset="0"/>
<attachment side="bottom" component="cancelButton" offset="-10"/>
</form-layout-data>
<association function="progress" attribute="PROGRESS" value-holder="controllerHolder"/>
</progress>
<label name="message" style="border | wrap">
<form-layout-data>
<attachment side="left" percent="0" offset="0"/>
<attachment side="right" percent="100" offset="0"/>
<attachment side="top" percent="0" offset="0"/>
<attachment side="bottom" component="progress" offset="-10"/>
</form-layout-data>
<association function="text" attribute="MESSAGE" value-holder="controllerHolder"/>
</label>
</window>
</vml>

View File

@@ -0,0 +1,185 @@
package com.foundation.tcv.swt.client.view;
/**
* LicenseSplashView
*/
public class LicenseSplashView extends com.foundation.view.swt.Window implements com.foundation.view.IAssociationHandler {
//Component Names//
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
public static final String LICENSE_INFO_COMPONENT = "licenseInfo";
public static final String LICENSE_SPLASH_VIEW_COMPONENT = "LicenseSplashView";
//Association Identifiers//
protected static final int LICENSE_INFO_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0 = 0;
//Method Association Identifiers//
protected static final int THIS_CLOSED_METHOD_ASSOCIATION = 0;
//View Components//
private com.foundation.view.swt.ValueHolder controllerHolder = null;
private com.foundation.view.swt.TextField licenseInfo = null;
/**
* LicenseSplashView 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 LicenseSplashView() {
}//LicenseSplashView()//
/**
* LicenseSplashView constructor.
* @param controller The view controller which will be assigned to the value holder(s) that don't depend on another value holder for their value.
*/
public LicenseSplashView(com.foundation.controller.ViewController controller) {
super((com.foundation.controller.ViewController) controller.getParent(), LICENSE_SPLASH_VIEW_COMPONENT, com.foundation.view.swt.Window.STYLE_SHELL_TRIM, controller.getContext(), controller);
}//LicenseSplashView()//
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, com.foundation.tcv.swt.client.controller.LicenseSplashViewController.class);
}//initializeControllerHolder()//
public void initializeLicenseInfo(com.foundation.view.swt.Container parent) {
licenseInfo = new com.foundation.view.swt.TextField(parent, LICENSE_INFO_COMPONENT, com.foundation.view.swt.TextField.STYLE_BORDER|com.foundation.view.swt.TextField.STYLE_WRAP|com.foundation.view.swt.TextField.STYLE_READ_ONLY|com.foundation.view.swt.TextField.STYLE_V_SCROLL);
com.foundation.view.swt.TextField.TextFormat licenseInfoFormat = (com.foundation.view.swt.TextField.TextFormat) licenseInfo.initializeFormat(com.foundation.view.swt.TextField.TextFormat.class);
licenseInfoFormat.setValueAssociation(new com.foundation.view.SingleAssociationContainer("controllerHolder", new com.foundation.view.SingleAssociation[] {new com.foundation.view.SingleAssociation(com.foundation.tcv.swt.client.controller.LicenseSplashViewController.class, LICENSE_INFO_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0, this, false, null, null, new com.foundation.view.EventAssociation[] {new com.foundation.view.EventAssociation(null, null, null, com.foundation.tcv.swt.client.controller.LicenseSplashViewController.class, com.foundation.tcv.swt.client.controller.LicenseSplashViewController.LICENSE_INFORMATION)}, null,true)}));
}//initializeLicenseInfo()//
/* (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);
initializeLicenseInfo(this);
com.foundation.view.swt.FormLayout layout = new com.foundation.view.swt.FormLayout(this);
layout.setMarginHeight(10);
layout.setMarginWidth(10);
this.setLayout(layout);
this.setTabOrder(new com.common.util.LiteList(new Object[] {}));
this.setSize(400, 150);
this.setDefaultContainerTitle("Invalid License");
layoutComponents();
super.internalViewInitialize();
setupLinkages();
}//internalViewInitialize()//
/* (non-Javadoc)
* @see com.foundation.view.IView#pack()
*/
public void pack() {
//Don't pack since a custom size was specified.
}//pack()//
/* (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.foundation.tcv.swt.client.controller.LicenseSplashViewController) value).doClose();
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 LICENSE_INFO_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
result = ((com.foundation.tcv.swt.client.controller.LicenseSplashViewController) value).getLicenseInformation();
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 LICENSE_INFO_FORMAT_FORMAT_ASSOCIATION_VALUE_ASSOCIATION_0:
result = ((com.foundation.tcv.swt.client.controller.LicenseSplashViewController) value).getOldAttributeValue(com.foundation.tcv.swt.client.controller.LicenseSplashViewController.LICENSE_INFORMATION);
break;
default:
com.common.debug.Debug.log("Association (original value getter) broken.");
break;
}//switch//
}//if//
else {
switch(associationNumber) {
default:
com.common.debug.Debug.log("Association (setter) broken.");
break;
}//switch//
}//else//
return result;
}//invokeMethod()//
/**
* Lays out the components.
*/
public void layoutComponents() {
{ //licenseInfo//
com.foundation.view.swt.layout.FormData layoutData = new com.foundation.view.swt.layout.FormData();
layoutData.width = 200;
layoutData.height = 200;
layoutData.left = new com.foundation.view.swt.layout.FormAttachment(0, 0);
layoutData.top = new com.foundation.view.swt.layout.FormAttachment(0, 0);
layoutData.right = new com.foundation.view.swt.layout.FormAttachment(100, 0);
layoutData.bottom = new com.foundation.view.swt.layout.FormAttachment(100, 0);
licenseInfo.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.view.swt.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.view.swt.TextField getVpLicenseInfo() {
return licenseInfo;
}//getVpLicenseInfo()//
}//LicenseSplashView//

View File

@@ -0,0 +1,27 @@
<?xml version="1.0"?>
<vml>
<metadata>
<platform name="thick:swt"/>
</metadata>
<window name="LicenseSplashView" style="window trim" width="400" height="150" container-title="Invalid License">
<form-layout margin-height="10" margin-width="10"/>
<method function="closed" name="doClose" value-holder="controllerHolder"/>
<value-holder name="controllerHolder" type="com.foundation.tcv.swt.client.controller.LicenseSplashViewController"/>
<text name="licenseInfo" style="border | vertical scroll | wrap | read only">
<form-layout-data width="200" height="200">
<attachment side="left" percent="0" offset="0"/>
<attachment side="right" percent="100" offset="0"/>
<attachment side="top" percent="0" offset="0"/>
<attachment side="bottom" percent="100" offset="0"/>
</form-layout-data>
<text-format>
<association function="value" attribute="LICENSE_INFORMATION" value-holder="controllerHolder"/>
</text-format>
</text>
</window>
</vml>