import org.eclipse.swt.widgets.Label; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
/* Titre dialogue. */
this.getShell().setText("About KSP Plugin");
/* Layout */
Composite container = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout(1, false);
layout.marginRight = 5;
layout.marginLeft = 10;
Color white = Display.getCurrent().getSystemColor(SWT.COLOR_WHITE);
container.setBackground(white);
container.setLayout(layout);
/* Logo */
Label lblLogo = new Label(container, SWT.NONE);
lblLogo.setBackgroundImage(getImage());
lblLogo.setBackground(white);
lblLogo.setText(" ");
lblLogo.setSize(LOGO_SIZE, LOGO_SIZE);
/* Produit */
Label lblProduct = new Label(container, SWT.NONE);
lblProduct.setText("Vertigo Chroma KSP Plugin");
lblProduct.setBackground(white);
/* Version */
Version version = FrameworkUtil.getBundle(getClass()).getVersion();
String fullVersion = version.toString();
Label lblVersion = new Label(container, SWT.NONE);
lblVersion.setText("Version : " + fullVersion);
lblVersion.setBackground(white);
/* Version */
Label lblAuthor = new Label(container, SWT.NONE);
lblAuthor.setText("Author : @sebez");
lblAuthor.setBackground(white);
/* Libellé documentation */
Label lblDoc = new Label(container, SWT.NONE);
lblDoc.setText("Documentation, sources, releases are published in the KSP plugin github repository : ");
lblDoc.setBackground(white);
/* Lien vers le github */
Link link = new Link(container, SWT.NONE);
String message = "" + GITHUB_URL + "";
link.setText(message);
link.setBackground(white);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Program.launch(GITHUB_URL);
}
});
return container;
}