Initial commit from SVN.
This commit is contained in:
@@ -0,0 +1,152 @@
|
||||
package test.transfer.view;
|
||||
|
||||
/**
|
||||
* LocalView
|
||||
*/
|
||||
public class LocalView extends com.foundation.view.swt.Panel implements com.foundation.view.IAssociationHandler {
|
||||
//Component Names//
|
||||
public static final String CONTROLLER_HOLDER_COMPONENT = "controllerHolder";
|
||||
public static final String MAIN_COMPONENT = "main";
|
||||
public static final String LOCAL_VIEW_COMPONENT = "LocalView";
|
||||
|
||||
//View Components//
|
||||
private com.foundation.view.swt.ValueHolder controllerHolder = null;
|
||||
private com.foundation.view.swt.Panel main = null;
|
||||
/**
|
||||
* LocalView 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 LocalView() {
|
||||
}//LocalView()//
|
||||
/**
|
||||
* LocalView 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.
|
||||
* @param parentComponent The non-null parent view component which this frame will be contained in.
|
||||
*/
|
||||
public LocalView(com.foundation.controller.ViewController controller, com.foundation.view.IView parentComponent) {
|
||||
super((com.foundation.view.IAbstractContainer) parentComponent, LOCAL_VIEW_COMPONENT, com.foundation.view.swt.Panel.STYLE_BORDER);
|
||||
|
||||
setController(controller);
|
||||
}//LocalView()//
|
||||
public void initializeControllerHolder(com.foundation.view.swt.Container parent) {
|
||||
controllerHolder = new com.foundation.view.swt.ValueHolder(parent, CONTROLLER_HOLDER_COMPONENT, test.transfer.view.controller.LocalViewController.class);
|
||||
}//initializeControllerHolder()//
|
||||
public void initializeMain(com.foundation.view.swt.Container parent) {
|
||||
main = new com.foundation.view.swt.Panel(parent, MAIN_COMPONENT, com.foundation.view.swt.Panel.STYLE_BORDER);
|
||||
|
||||
main.setTabOrder(new com.common.util.LiteList(new Object[] {}));
|
||||
main.setDefaultBackgroundColor(new com.foundation.view.JefGradient("blue"));
|
||||
}//initializeMain()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.view.IView#internalViewInitialize()
|
||||
*/
|
||||
public void internalViewInitialize() {
|
||||
initializeControllerHolder(this);
|
||||
initializeMain(this);
|
||||
com.foundation.view.swt.FillLayout layout = new com.foundation.view.swt.FillLayout(this);
|
||||
|
||||
layout.setMarginHeight(2);
|
||||
layout.setMarginWidth(2);
|
||||
this.setLayout(layout);
|
||||
this.setTabOrder(new com.common.util.LiteList(new Object[] {main}));
|
||||
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) {
|
||||
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) {
|
||||
default:
|
||||
com.common.debug.Debug.log("Association (getter) broken.");
|
||||
break;
|
||||
}//switch//
|
||||
|
||||
}//if//
|
||||
else if(flags == INVOKE_ORIGINAL_VALUE_GETTER_METHOD_FLAG) {
|
||||
switch(associationNumber) {
|
||||
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() {
|
||||
}//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.Panel getVpMain() {
|
||||
return main;
|
||||
}//getVpMain()//
|
||||
}//LocalView//
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
Copyright (c) 2008,2009 Declarative Engineering LLC.
|
||||
All rights reserved. This program and the accompanying materials
|
||||
are made available under the terms of the Declarative Engineering LLC
|
||||
verson 1 which accompanies this distribution, and is available at
|
||||
http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
-->
|
||||
<vml>
|
||||
<metadata>
|
||||
<platform name="thick:swt"/>
|
||||
</metadata>
|
||||
|
||||
<panel name="LocalView" style="border" container-image="" container-title="">
|
||||
<fill-layout margin-height="2" margin-width="2"/>
|
||||
|
||||
<value-holder name="controllerHolder" type="test.transfer.view.controller.LocalViewController"/>
|
||||
|
||||
<panel name="main" style="border" tab-order="1" background-color="blue">
|
||||
</panel>
|
||||
</panel>
|
||||
</vml>
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (c) 2006,2007 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.transfer.view.controller;
|
||||
|
||||
import com.foundation.application.IApplication;
|
||||
import com.foundation.attribute.ReflectionContext;
|
||||
import com.foundation.controller.ViewController;
|
||||
import com.foundation.tcv.client.application.AbstractClientApplication;
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public abstract class AbstractViewController extends ViewController {
|
||||
/**
|
||||
* AbstractViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
*/
|
||||
public AbstractViewController(IViewContext context) {
|
||||
super(context);
|
||||
}//AbstractViewController()//
|
||||
/**
|
||||
* AbstractViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
* @param reflectionContext The reflection context to be used by the view.
|
||||
*/
|
||||
public AbstractViewController(IViewContext context, ReflectionContext reflectionContext) {
|
||||
super(context, reflectionContext);
|
||||
}//AbstractViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#validate()
|
||||
*/
|
||||
public boolean validate() {
|
||||
return true;
|
||||
}//validate()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.common.IEntity#getApplication()
|
||||
*/
|
||||
public IApplication getApplication() {
|
||||
return AbstractClientApplication.getSingleton();
|
||||
}//getApplication()//
|
||||
}//AbstractViewController//
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2007 Declarative Engineering LLC.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Declarative Engineering LLC
|
||||
* verson 1 which accompanies this distribution, and is available at
|
||||
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||||
*/
|
||||
package test.transfer.view.controller;
|
||||
|
||||
import test.transfer.view.LocalView;
|
||||
|
||||
import com.foundation.view.IViewContext;
|
||||
|
||||
public class LocalViewController extends AbstractViewController {
|
||||
/**
|
||||
* LocalViewController constructor.
|
||||
* @param context The context underwhich the view is being created. This context manages the threading, resources, and request handling for the view as well as ties together related views.
|
||||
*/
|
||||
public LocalViewController(IViewContext context) {
|
||||
super(context);
|
||||
}//LocalViewController()//
|
||||
/* (non-Javadoc)
|
||||
* @see com.foundation.controller.AbstractViewController#getViewClass()
|
||||
*/
|
||||
protected Class getViewClass() {
|
||||
return LocalView.class;
|
||||
}//getViewClass()//
|
||||
/**
|
||||
* Closes the view.
|
||||
*/
|
||||
public void doClose() {
|
||||
close();
|
||||
}//doClose()//
|
||||
}//LocalViewController//
|
||||
Reference in New Issue
Block a user