📄 aboutdialog.java
字号:
/*
* 创建日期 2003-9-11
*
* 更改所生成文件模板为
* 窗口 > 首选项 > Java > 代码生成 > 代码和注释
*/
package com.tanghan.plugin;
import java.util.ResourceBundle;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
/**
* @author Jerry Tang
* @version v0.1.0
* @copyright (C) 2003 Tanghan Studio
*
*/
public class AboutDialog extends Dialog {
/**资源文件*/
private static ResourceBundle res = TanghanPlugin.getDefault().getResourceBundle();
/**
* @param parentShell
*/
public AboutDialog(Shell parentShell) {
super(parentShell);
}
/* (非 Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
protected Control createDialogArea(Composite parent) {
getShell().setText(res.getString("Tanghan.Plugin.Abount"));
getShell().setMaximized(false);
getShell().setMinimized(false);
// create the top level composite for the dialog area
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = 5;
layout.marginWidth = 5;
layout.numColumns = 1;
composite.setLayout(layout);
GridData data = new GridData(GridData.FILL_BOTH);
composite.setLayoutData(data);
Label lb = new Label(composite,SWT.NORMAL);
lb.setText(res.getString("Tanghan.Plugin.Copyright"));
lb = new Label(composite,SWT.NORMAL);
lb.setText(res.getString("Tanghan.Plugin.Author"));
lb = new Label(composite,SWT.NORMAL);
lb.setText(res.getString("Tanghan.Plugin.Author.Email"));
lb = new Label(composite,SWT.NORMAL);
lb.setText(res.getString("Tanghan.Plugin.Version"));
//this.createButtonBar()
return super.createDialogArea(parent);
}
/* (非 Javadoc)
* @see org.eclipse.jface.window.Window#open()
*/
public int open() {
return super.open();
}
/* (非 Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
*/
protected Control createButtonBar(Composite parent) {
Control ct = super.createButtonBar(parent);
getButton(IDialogConstants.CANCEL_ID).setVisible(false);
return ct;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -