80 lines
2.5 KiB
Java
80 lines
2.5 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.client;
|
||
|
|
|
||
|
|
import org.eclipse.swt.widgets.Shell;
|
||
|
|
|
||
|
|
import com.foundation.tcv.swt.*;
|
||
|
|
import com.foundation.tcv.view.ViewMessage;
|
||
|
|
|
||
|
|
public abstract class Dialog extends AbstractComponent implements IDialog {
|
||
|
|
private org.eclipse.swt.widgets.Dialog swtDialog = null;
|
||
|
|
/**
|
||
|
|
* Dialog constructor.
|
||
|
|
*/
|
||
|
|
public Dialog() {
|
||
|
|
super();
|
||
|
|
}//Dialog()//
|
||
|
|
/* (non-Javadoc)
|
||
|
|
* @see com.foundation.tcv.swt.client.AbstractComponent#getContainer()
|
||
|
|
*/
|
||
|
|
public Container getContainer() {
|
||
|
|
//TODO: Verify that this is not used.//
|
||
|
|
return null;
|
||
|
|
}//getContainer()//
|
||
|
|
/**
|
||
|
|
* Gets the SWT dialog that represents this dialog.
|
||
|
|
* @return The SWT dialog providing visualization for this dialog.
|
||
|
|
*/
|
||
|
|
public org.eclipse.swt.widgets.Dialog getSwtDialog() {
|
||
|
|
return swtDialog;
|
||
|
|
}//getSwtDialog()//
|
||
|
|
/* (non-Javadoc)
|
||
|
|
* @see com.foundation.tcv.swt.client.AbstractComponent#getShell()
|
||
|
|
*/
|
||
|
|
public Shell getShell() {
|
||
|
|
return getSwtDialog() != null ? getSwtDialog().getParent() : null;
|
||
|
|
}//getShell()//
|
||
|
|
/**
|
||
|
|
* Sets the SWT dialog that represents this dialog.
|
||
|
|
* @param dialog The SWT dialog providing visualization for this dialog.
|
||
|
|
*/
|
||
|
|
protected void setSwtDialog(org.eclipse.swt.widgets.Dialog dialog) {
|
||
|
|
this.swtDialog = dialog;
|
||
|
|
}//setSwtDialog()//
|
||
|
|
/* (non-Javadoc)
|
||
|
|
* @see com.foundation.tcv.swt.client.AbstractComponent#internalViewInitialize()
|
||
|
|
*/
|
||
|
|
protected void internalViewInitialize() {
|
||
|
|
super.internalViewInitialize();
|
||
|
|
}//internalViewInitialize()//
|
||
|
|
/* (non-Javadoc)
|
||
|
|
* @see com.foundation.tcv.swt.client.AbstractComponent#internalViewRelease()
|
||
|
|
*/
|
||
|
|
protected void internalViewRelease() {
|
||
|
|
super.internalViewRelease();
|
||
|
|
}//internalViewRelease()//
|
||
|
|
/* (non-Javadoc)
|
||
|
|
* @see com.foundation.tcv.swt.client.AbstractComponent#internalProcessMessage(com.foundation.tcv.model.ViewMessage)
|
||
|
|
*/
|
||
|
|
public Object internalProcessMessage(ViewMessage viewMessage) {
|
||
|
|
Object retVal = null;
|
||
|
|
|
||
|
|
switch(viewMessage.getMessageNumber()) {
|
||
|
|
case MESSAGE_SET_TEXT: {
|
||
|
|
getSwtDialog().setText((String) viewMessage.getMessageData());
|
||
|
|
break;
|
||
|
|
}//case//
|
||
|
|
default: {
|
||
|
|
retVal = super.internalProcessMessage(viewMessage);
|
||
|
|
}//default//
|
||
|
|
}//switch//
|
||
|
|
|
||
|
|
return retVal;
|
||
|
|
}//internalProcessMessage()//
|
||
|
|
}//Dialog//
|