56 lines
2.6 KiB
Java
56 lines
2.6 KiB
Java
|
|
/*
|
||
|
|
* Copyright (c) 2003,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
|
||
|
|
*/
|
||
|
|
package com.foundation.tcv.swt.builder;
|
||
|
|
|
||
|
|
import com.foundation.view.builder.*;
|
||
|
|
import com.foundation.view.definition.IComponentData;
|
||
|
|
|
||
|
|
public class WindowBuilder extends com.foundation.view.swt.builder.WindowBuilder {
|
||
|
|
/**
|
||
|
|
* WindowBuilder constructor.
|
||
|
|
*/
|
||
|
|
public WindowBuilder() {
|
||
|
|
super();
|
||
|
|
}//WindowBuilder()//
|
||
|
|
/* (non-Javadoc)
|
||
|
|
* @see com.foundation.view.swt.builder.IBuilder#getComponentClassName()
|
||
|
|
*/
|
||
|
|
public String getComponentClassName() {
|
||
|
|
return "com.foundation.tcv.swt.server.Window";
|
||
|
|
}//getComponentClassName()//
|
||
|
|
/* (non-Javadoc)
|
||
|
|
* @see com.foundation.view.builder.IBuilder#buildConstructors(com.foundation.view.builder.IViewSourceBuilder, java.lang.StringBuffer, java.lang.String, com.foundation.view.definition.ComponentData)
|
||
|
|
*/
|
||
|
|
public void buildConstructors(IViewSourceBuilder viewBuilder, StringBuffer constructor, String className, IComponentData data) {
|
||
|
|
String componentName = viewBuilder.addComponentNameIdentifier(data.getDocumentElement(), viewBuilder.getComponentName(data));
|
||
|
|
|
||
|
|
constructor.append("/**\r\n");
|
||
|
|
constructor.append(" * ");
|
||
|
|
constructor.append(className);
|
||
|
|
constructor.append(" non-modal constructor.\r\n");
|
||
|
|
constructor.append(" * @param controller The view's view controller reference.\r\n");
|
||
|
|
constructor.append(" */\r\n");
|
||
|
|
constructor.append("public ");
|
||
|
|
constructor.append(className);
|
||
|
|
constructor.append("(");
|
||
|
|
constructor.append("com.foundation.controller.RemoteViewController");
|
||
|
|
constructor.append(" controller) {\r\n");
|
||
|
|
constructor.append("\tsuper(");
|
||
|
|
appendComponentConstructorParameters(viewBuilder, constructor, data, "(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()", componentName);
|
||
|
|
constructor.append(", controller");
|
||
|
|
constructor.append(");\r\n\r\n");
|
||
|
|
//constructor.append("\tsetController(controller);\r\n");
|
||
|
|
constructor.append("}//" + className + "()//\r\n");
|
||
|
|
}//buildConstructors()//
|
||
|
|
/* (non-Javadoc)
|
||
|
|
* @see com.foundation.view.builder.IBuilder#getPrimaryInitializationMethodName()
|
||
|
|
*/
|
||
|
|
public String getPrimaryInitializationMethodName() {
|
||
|
|
return "internalViewInitialize";
|
||
|
|
}//getPrimaryInitializationMethodName()//
|
||
|
|
}//WindowBuilder//
|