📄 cfshell.java
字号:
package com.cn.darkblue.window;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import com.cn.darkblue.helper.IGroupChat;
import com.cn.darkblue.helper.IPGResource;
import com.cn.darkblue.util.CFResource;
public class CFShell extends Shell {
private static final Log log = LogFactory.getLog(CFShell.class);
/**
* Create the shell
* @param display
* @param style
*/
public CFShell(Display display, int style) {
super(display, style);
createContents();
setLayout(new GridLayout());
CFResource.getInstance().getShellCache().add(this);
}
/**
* Create contents of the window
*/
protected void createContents() {
setText(" 组创建 ");
setSize(400, 300);
}
@Override
public void close() {
try{
CFResource.getInstance().getShellCache().remove(this);//从缓存中移除
log.info(this.toString()+" UI 已从缓存中移除 ");
if(this instanceof IGroupChat)
CFResource.getInstance().getGroupItrtWins().remove(this);
if(this instanceof ChatWin){
ChatWin win = (ChatWin)this;
IPGResource res = (IPGResource)CFResource.getInstance().getJoinPGMap().get(win.getGroup());
res.getOScreens().remove(win.getChater());
}
}catch(Exception e){
e.printStackTrace();
}
super.close();
super.dispose();
}
@Override
protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -