📄 createclustershell.java
字号:
tc.setWidth(100);
// 来自何处
tc = new TableColumn(table, SWT.CENTER);
tc.setText(LumaQQ.getResourceString("create.cluster.member.table.header.from"));
tc.setWidth(120);
table.setHeaderVisible(true);
// 好友选择窗口
fss = new FriendSelectShell(shell);
fss.setModel(main.model);
fss.addFriendSelectionListener(this);
}
/**
* 创建基本信息填写面板
*/
private void initBasicPanel() {
basic = createPanel();
basic.setVisible(false);
// 提示标签
Label lblHint = new Label(basic, SWT.NONE);
lblHint.setText(LumaQQ.getResourceString("create.cluster.basic.label.basic"));
FormData fd = new FormData();
fd.left = fd.top = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
lblHint.setLayoutData(fd);
// 创建人标签
Label lblCreator = new Label(basic, SWT.NONE);
lblCreator.setText(LumaQQ.getResourceString("create.cluster.basic.label.creator"));
fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment(lblHint, 5, SWT.BOTTOM);
lblCreator.setLayoutData(fd);
// 群组名称标签
Label lblName = new Label(basic, SWT.NONE);
lblName.setText(LumaQQ.getResourceString("create.cluster.basic.label.name"));
fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.right = new FormAttachment(20, 0);
fd.top = new FormAttachment(lblCreator, 5, SWT.BOTTOM);
lblName.setLayoutData(fd);
// 名称文本框
textName = new Text(basic, SWT.SINGLE | SWT.BORDER);
textName.setTextLimit(22);
fd = new FormData();
fd.left = new FormAttachment(lblName, 5, 0);
fd.right = new FormAttachment(50, -5);
fd.top = new FormAttachment(lblCreator, 5, SWT.BOTTOM);
textName.setLayoutData(fd);
// 分类标签
Label lblCategory = new Label(basic, SWT.RIGHT);
lblCategory.setText(LumaQQ.getResourceString("create.cluster.basic.label.category"));
fd = new FormData();
fd.left = new FormAttachment(50, 0);
fd.right = new FormAttachment(70, -5);
fd.top = new FormAttachment(lblCreator, 5, SWT.BOTTOM);
lblCategory.setLayoutData(fd);
// 分类下拉框
comboCategory = new CCombo(basic, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY);
comboCategory.add(LumaQQ.getResourceString("create.cluster.basic.category.classmate"));
comboCategory.add(LumaQQ.getResourceString("create.cluster.basic.category.friend"));
comboCategory.add(LumaQQ.getResourceString("create.cluster.basic.category.colleague"));
comboCategory.add(LumaQQ.getResourceString("create.cluster.basic.category.other"));
comboCategory.select(0);
fd = new FormData();
fd.left = new FormAttachment(70, 0);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment(lblCreator, 5, SWT.BOTTOM);
comboCategory.setLayoutData(fd);
// 公告标签
Label lblNotice = new Label(basic, SWT.NONE);
lblNotice.setText(LumaQQ.getResourceString("create.cluster.basic.label.notice"));
fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment(comboCategory, 5, SWT.BOTTOM);
lblNotice.setLayoutData(fd);
// 公告文本框
textNotice = new Text(basic, SWT.MULTI | SWT.WRAP | SWT.BORDER);
textNotice.setTextLimit(255);
fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment(lblNotice, 2, SWT.BOTTOM);
fd.bottom = new FormAttachment(lblNotice, 52, SWT.BOTTOM);
textNotice.setLayoutData(fd);
// 简介标签
Label lblDescription = new Label(basic, SWT.NONE);
lblDescription.setText(LumaQQ.getResourceString("create.cluster.basic.label.description"));
fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment(textNotice, 2, SWT.BOTTOM);
lblDescription.setLayoutData(fd);
// 简介文本框
textDescription = new Text(basic, SWT.MULTI | SWT.WRAP | SWT.BORDER);
textDescription.setTextLimit(255);
fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment(lblDescription, 2, SWT.BOTTOM);
fd.bottom = new FormAttachment(lblDescription, 52, SWT.BOTTOM);
textDescription.setLayoutData(fd);
// 认证方式组
authGroup = new Group(basic, SWT.SHADOW_ETCHED_OUT);
authGroup.setText(LumaQQ.getResourceString("create.cluster.basic.group.auth"));
fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment(textDescription, 2, SWT.BOTTOM);
fd.bottom = new FormAttachment(100, 0);
authGroup.setLayoutData(fd);
authGroup.setLayout(new GridLayout());
// 不需要认证
radioNoAuth = new Button(authGroup, SWT.RADIO);
radioNoAuth.setText(LumaQQ.getResourceString("create.cluster.basic.no.auth"));
radioNoAuth.addSelectionListener(
new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
authType = QQ.QQ_CLUSTER_NO_AUTH;
}
}
);
// 需要认证
radioNeedAuth = new Button(authGroup, SWT.RADIO);
radioNeedAuth.setText(LumaQQ.getResourceString("create.cluster.basic.need.auth"));
radioNeedAuth.setSelection(true);
radioNoAuth.addSelectionListener(
new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
authType = QQ.QQ_CLUSTER_NEED_AUTH;
}
}
);
// 不允许任何人加入
radioNoAdd = new Button(authGroup, SWT.RADIO);
radioNoAdd.setText(LumaQQ.getResourceString("create.cluster.basic.no.add"));
radioNoAuth.addSelectionListener(
new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
authType = QQ.QQ_CLUSTER_NO_ADD;
}
}
);
}
/**
* 创建初始面板
*/
private void initFirstPanel() {
first = createPanel();
prevPanel = first;
// 群类型标签
lblType = new Label(first, SWT.NONE);
lblType.setText(LumaQQ.getResourceString("create.cluster.type.permanent"));
FormData fd = new FormData();
fd.left = fd.top = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
lblType.setLayoutData(fd);
// 说明标签
lblDescription = new Label(first, SWT.WRAP);
lblDescription.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.description"));
fd = new FormData();
fd.left = new FormAttachment(lblType, 5, SWT.LEFT);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment(lblType, 5, SWT.BOTTOM);
fd.bottom = new FormAttachment(20, 0);
lblDescription.setLayoutData(fd);
// 用户类型标签
lblMember = new Label(first, SWT.NONE);
lblMember.setText(LumaQQ.getResourceString("create.cluster.first.label.member"));
fd = new FormData();
fd.left = new FormAttachment(lblDescription, 10, SWT.LEFT);
fd.right = new FormAttachment(100, 0);
fd.top = new FormAttachment(lblDescription, 5, SWT.BOTTOM);
lblMember.setLayoutData(fd);
// 群类型组
Group group = new Group(first, SWT.SHADOW_ETCHED_OUT);
group.setText(LumaQQ.getResourceString("create.cluster.first.group.type"));
fd = new FormData();
fd.left = new FormAttachment(15, 0);
fd.right = new FormAttachment(85, 0);
fd.top = new FormAttachment(lblMember, 20, SWT.BOTTOM);
fd.bottom = new FormAttachment(lblMember, 65, SWT.BOTTOM);
group.setLayoutData(fd);
group.setLayout(new GridLayout(2, true));
// 固定群radio button
Button radioPermanent = new Button(group, SWT.RADIO);
radioPermanent.setSelection(true);
radioPermanent.setText(LumaQQ.getResourceString("create.cluster.type.permanent"));
radioPermanent.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.HORIZONTAL_ALIGN_CENTER));
radioPermanent.addSelectionListener(
new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
lblType.setText(LumaQQ.getResourceString("create.cluster.type.permanent"));
lblDescription.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.description"));
lblMember.setText(LumaQQ.getResourceString("create.cluster.first.label.member"));
lblMemberManage.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.member.manage"));
lblMemberNumber.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.member.number"));
lblAlbum.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.album"));
lblOfflineMessage.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.offline.message"));
lblAddressList.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.address.list"));
lblLeaveWord.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.leave.word"));
type = QQ.QQ_CLUSTER_TYPE_PERMANENT;
}
}
);
// 临时群radio button
Button radioTemporary = new Button(group, SWT.RADIO);
radioTemporary.setText(LumaQQ.getResourceString("create.cluster.type.temporary"));
radioTemporary.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER | GridData.HORIZONTAL_ALIGN_CENTER));
radioTemporary.addSelectionListener(
new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
lblType.setText(LumaQQ.getResourceString("create.cluster.type.temporary"));
lblDescription.setText(LumaQQ.getResourceString("create.cluster.first.label.temporary.description"));
lblMember.setText("");
lblMemberManage.setText(LumaQQ.getResourceString("create.cluster.first.label.temporary.member.manage"));
lblMemberNumber.setText(LumaQQ.getResourceString("create.cluster.first.label.temporary.member.number"));
lblAlbum.setText(LumaQQ.getResourceString("create.cluster.first.label.temporary.album"));
lblOfflineMessage.setText(LumaQQ.getResourceString("create.cluster.first.label.temporary.offline.message"));
lblAddressList.setText(LumaQQ.getResourceString("create.cluster.first.label.temporary.address.list"));
lblLeaveWord.setText(LumaQQ.getResourceString("create.cluster.first.label.temporary.leave.word"));
type = QQ.QQ_CLUSTER_TYPE_TEMPORARY;
}
}
);
// 成员管理说明
lblMemberManage = new Label(first, SWT.LEFT);
lblMemberManage.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.member.manage"));
fd = new FormData();
fd.left = new FormAttachment(5, 0);
fd.right = new FormAttachment(95, 0);
fd.top = new FormAttachment(group, 20, SWT.BOTTOM);
lblMemberManage.setLayoutData(fd);
// 成员数量说明
lblMemberNumber = new Label(first, SWT.LEFT);
lblMemberNumber.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.member.number"));
fd = new FormData();
fd.left = new FormAttachment(5, 0);
fd.right = new FormAttachment(50, 0);
fd.top = new FormAttachment(lblMemberManage, 5, SWT.BOTTOM);
lblMemberNumber.setLayoutData(fd);
// 相册说明
lblAlbum = new Label(first, SWT.RIGHT);
lblAlbum.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.album"));
fd = new FormData();
fd.left = new FormAttachment(50, 0);
fd.right = new FormAttachment(95, 0);
fd.top = new FormAttachment(lblMemberManage, 5, SWT.BOTTOM);
lblAlbum.setLayoutData(fd);
// 离线消息说明
lblOfflineMessage = new Label(first, SWT.LEFT);
lblOfflineMessage.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.offline.message"));
fd = new FormData();
fd.left = new FormAttachment(5, 0);
fd.right = new FormAttachment(50, 0);
fd.top = new FormAttachment(lblMemberNumber, 5, SWT.BOTTOM);
lblOfflineMessage.setLayoutData(fd);
// 通讯录说明
lblAddressList = new Label(first, SWT.RIGHT);
lblAddressList.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.address.list"));
fd = new FormData();
fd.left = new FormAttachment(50, 0);
fd.right = new FormAttachment(95, 0);
fd.top = new FormAttachment(lblMemberNumber, 5, SWT.BOTTOM);
lblAddressList.setLayoutData(fd);
// 留言本说明
lblLeaveWord = new Label(first, SWT.LEFT);
lblLeaveWord.setText(LumaQQ.getResourceString("create.cluster.first.label.permanent.leave.word"));
fd = new FormData();
fd.left = new FormAttachment(5, 0);
fd.right = new FormAttachment(50, 0);
fd.top = new FormAttachment(lblOfflineMessage, 5, SWT.BOTTOM);
lblLeaveWord.setLayoutData(fd);
}
/**
* 当用户按了上一步按钮时调用此方法
*/
protected void navigatePrevious() {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -