本文整理匯總了Java中org.eclipse.swt.widgets.Label.setSize方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setSize方法的具體用法?Java Label.setSize怎麽用?Java Label.setSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Label
的用法示例。
在下文中一共展示了Label.setSize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createDialogArea
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 = "<a href=\"" + GITHUB_URL + "\">" + GITHUB_URL + "</a>";
link.setText(message);
link.setBackground(white);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Program.launch(GITHUB_URL);
}
});
return container;
}