121 lines
3.9 KiB
Java
121 lines
3.9 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.server;
|
|
|
|
import org.eclipse.swt.SWT;
|
|
|
|
import com.foundation.view.*;
|
|
import com.foundation.controller.AbstractViewController;
|
|
import com.foundation.controller.RemoteViewController;
|
|
import com.foundation.tcv.swt.*;
|
|
import com.foundation.tcv.server.controller.*;
|
|
import com.foundation.tcv.view.*;
|
|
|
|
public class Window extends Frame implements IWindow {
|
|
/**
|
|
* Window default constructor.
|
|
* <p>Warning: This is only for use by the framework. This should never be called to create a useable instance.</p>
|
|
*/
|
|
public Window() {
|
|
}//Window()//
|
|
/**
|
|
* Window constructor.
|
|
* @param parent The parent window, or nu.
|
|
* @param sessionViewController The non-null view context (passed to the createView method as the context).
|
|
* @param name
|
|
* @param style
|
|
* @see #STYLE_BORDER
|
|
* @see #STYLE_H_SCROLL
|
|
* @see #STYLE_V_SCROLL
|
|
* @see #STYLE_BORDER
|
|
* @see #STYLE_LEFT_TO_RIGHT
|
|
* @see #STYLE_RIGHT_TO_LEFT
|
|
* @see #STYLE_NO_BACKGROUND
|
|
* @see #STYLE_NO_FOCUS
|
|
* @see #STYLE_NO_MERGE_PAINTS
|
|
* @see #STYLE_NO_REDRAW_RESIZE
|
|
* @see #STYLE_NO_RADIO_GROUP
|
|
* @see #STYLE_CLOSE
|
|
* @see #STYLE_MIN
|
|
* @see #STYLE_MAX
|
|
* @see #STYLE_RESIZE
|
|
* @see #STYLE_TITLE
|
|
* @see #STYLE_NO_TRIM
|
|
* @see #STYLE_SHELL_TRIM
|
|
* @see #STYLE_DIALOG_TRIM
|
|
* @see #STYLE_ON_TOP
|
|
* @see #STYLE_TOOL
|
|
* @see #STYLE_MODELESS
|
|
* @see #STYLE_PRIMARY_MODAL
|
|
* @see #STYLE_APPLICATION_MODAL
|
|
* @see #STYLE_SYSTEM_MODAL
|
|
*/
|
|
public Window(Window parent, SessionViewController sessionViewController, String name, int style, RemoteViewController viewController) {
|
|
super(sessionViewController != null ? sessionViewController : parent.getSessionViewController(), name, style);
|
|
|
|
setController(viewController);
|
|
|
|
//Set the modal flag.//
|
|
switch(viewController.getOptions()) {
|
|
case AbstractViewController.OPTION_MODELESS: {
|
|
style |= SWT.MODELESS;
|
|
break;
|
|
}//case//
|
|
case AbstractViewController.OPTION_MODAL: {
|
|
style |= SWT.PRIMARY_MODAL;
|
|
break;
|
|
}//case//
|
|
case AbstractViewController.OPTION_APPLICATION_MODAL: {
|
|
style |= SWT.APPLICATION_MODAL;
|
|
break;
|
|
}//case//
|
|
case AbstractViewController.OPTION_SYSTEM_MODAL: {
|
|
style |= SWT.SYSTEM_MODAL;
|
|
break;
|
|
}//case//
|
|
default: {
|
|
//Does nothing.//
|
|
}//default//
|
|
}//switch//
|
|
|
|
sendMessage(MESSAGE_INITIALIZE, parent != null ? parent.getIdentity() : null, null, style, -1);
|
|
}//Window()//
|
|
/* (non-Javadoc)
|
|
* @see com.foundation.tcv.swt.server.AbstractComponent#processMessage(com.foundation.tcv.model.ViewMessage)
|
|
*/
|
|
public Object processMessage(ViewMessage viewMessage) {
|
|
Object retVal = null;
|
|
|
|
switch(viewMessage.getMessageNumber()) {
|
|
default: {
|
|
retVal = super.processMessage(viewMessage);
|
|
break;
|
|
}//default//
|
|
}//switch//
|
|
|
|
return retVal;
|
|
}//processMessage()//
|
|
/* (non-Javadoc)
|
|
* @see com.foundation.tcv.swt.server.AbstractComponent#internalOnEventFired(com.foundation.tcv.swt.server.IEventAssociation, java.lang.Object[])
|
|
*/
|
|
public void internalOnEventFired(IEventAssociation eventAssociation, Object[] eventArguments) {
|
|
super.internalOnEventFired(eventAssociation, eventArguments);
|
|
}//internalOnEventFired()//
|
|
/* (non-Javadoc)
|
|
* @see com.foundation.view.swt.Component#internalOnValueChanged(com.foundation.view.swt.IAttributeAssociation)
|
|
*/
|
|
public void internalOnValueChanged(IAttributeAssociation attributeAssociation) {
|
|
super.internalOnValueChanged(attributeAssociation);
|
|
}//internalOnValueChanged()//
|
|
/* (non-Javadoc)
|
|
* @see com.foundation.tcv.swt.server.AbstractComponent#getClientClassName()
|
|
*/
|
|
protected String getClientClassName() {
|
|
return "com.foundation.tcv.swt.client.Window";
|
|
}//getClientClassName()//
|
|
}//Window// |