本文整理匯總了Java中org.eclipse.swt.widgets.Link.setBackground方法的典型用法代碼示例。如果您正苦於以下問題:Java Link.setBackground方法的具體用法?Java Link.setBackground怎麽用?Java Link.setBackground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Link
的用法示例。
在下文中一共展示了Link.setBackground方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addlinkToAddPassThroughFieldsInMappingWindow
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private void addlinkToAddPassThroughFieldsInMappingWindow(final Composite container,
final PropertyToolTipInformation propertyInfo) {
String propertyNameCapitalized = getCapitalizedName(propertyInfo);
final Link link = new Link(container, SWT.NONE);
String tempText= propertyNameCapitalized+" : <a>" + Constants.ADD_FIELDS_AS_PASSTHROUGH_FIELDS+ "</a>";
link.setText(tempText);
if(component.getTargetConnections().isEmpty())
link.setEnabled(false);
link.setBackground(container.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
addMouseHoverListenerToLink(link,container);
addSelectionListenerToLink(propertyInfo, link);
}
示例2: createOperationClassLink
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
/**
* Create operation class link
*
* @param container
* @param propertyInfo
* @param propertyNameCapitalized
* @param filePath
* @return
*/
private Link createOperationClassLink(final Composite container,
PropertyToolTipInformation propertyInfo,
String propertyNameCapitalized, final String filePath) {
Link link = new Link(container, SWT.NONE);
String tempText= propertyNameCapitalized + " : <a>" + propertyInfo.getPropertyValue().toString() + "</a>";
link.setText(tempText);
link.setBackground(container.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
addListenerToOpenOpeartionClassFile(filePath, link);
logger.debug("ComponentTooltip.createOperationClassLink(): created opeartion class link=" + link);
return link;
}
示例3: createLink
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
protected void createLink(DomainStatus status) {
link = new Link(this, SWT.NONE);
link.setFont(DOMAIN_STATUS_FONT);
link.setBackground(ColorConstants.white);
link.setText(getMessage(status));
link.setForeground(getSeverityColor(status.getSeverity()));
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
Program.launch(LICENCE_LINK);
}
});
}
示例4: initControl
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private void initControl() {
GridLayoutFactory.fillDefaults().numColumns(3).spacing(3, 2).applyTo(this);
GridLayout layout = (GridLayout) this.getLayout();
layout.marginLeft = 7;
layout.marginTop = 2;
layout.marginBottom = 2;
Label iconLabel = new Label(this, SWT.NULL);
iconLabel.setBackground(getBackground());
GridDataFactory.swtDefaults().align(SWT.CENTER, SWT.BEGINNING).span(1, 2).applyTo(
iconLabel);
listenTo(iconLabel);
Link nameLabel = new Link(this, SWT.NONE);
nameLabel.setText(wbToolkit.getName());
nameLabel.setBackground(getBackground());
nameLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
nameLabel.setFont(getBoldFont(getFont()));
listenTo(nameLabel);
Label providerLabel = new Label(this, SWT.NONE);
providerLabel.setText(wbToolkit.getProviderDescription());
providerLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
providerLabel.setBackground(getBackground());
providerLabel.setForeground(Display.getDefault().getSystemColor(
SWT.COLOR_GRAY));
listenTo(providerLabel);
Label summaryLabel = new Label(this, SWT.WRAP);
String description = stripCRLF(wbToolkit.getDescription());
summaryLabel.setText(description);
summaryLabel.setBackground(getBackground());
GridDataFactory.fillDefaults().grab(true, false).span(2, 1).hint(100,
SWT.DEFAULT).applyTo(summaryLabel);
listenTo(summaryLabel);
listenTo(this);
}
示例5: createDialogArea
import org.eclipse.swt.widgets.Link; //導入方法依賴的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;
}
示例6: createDialogArea
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
protected Control createDialogArea(Composite parent) {
Image logoImage =
ResourceManager.getPluginImage("org.wso2.developerstudio.eclipse.platform.ui",
"icons/carbon-studio-logo.png");
logoWidth = logoImage.getImageData().width;
logoHeight = logoImage.getImageData().height;
parent.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
Composite dialogArea = (Composite) super.createDialogArea(parent);
dialogArea.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
Composite composite = new Composite(dialogArea, SWT.BORDER);
composite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
composite.setLayout(new GridLayout(1, false));
composite.setSize(new Point(logoWidth + 200, logoHeight * 4));
GridData gd_composite = new GridData(SWT.CENTER, SWT.TOP, true, true, 1, 1);
gd_composite.widthHint = logoWidth + 200;
gd_composite.heightHint = logoHeight * 4;
composite.setLayoutData(gd_composite);
Label lblDevsLogo = new Label(composite, SWT.NONE);
lblDevsLogo.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
lblDevsLogo.setImage(logoImage);
GridData gdDevsLogo = new GridData(SWT.CENTER, SWT.TOP, false, false, 1, 1);
gdDevsLogo.widthHint = logoWidth;
gdDevsLogo.heightHint = logoHeight;
lblDevsLogo.setLayoutData(gdDevsLogo);
Label lblVersion = new Label(composite, SWT.NONE);
lblVersion.setForeground(SWTResourceManager.getColor(SWT.COLOR_WIDGET_BORDER));
lblVersion.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
lblVersion.setText(KERNAL_MSG.concat(getVersion()));
Label lblLicense = new Label(composite, SWT.NONE);
lblLicense.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
lblLicense.setText(LICENSED);
Link linkDevStudioUrl = new Link(composite, SWT.NONE);
linkDevStudioUrl.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
linkDevStudioUrl.setText("Visit :<a>" + URL + "</a>");
linkDevStudioUrl.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
org.eclipse.swt.program.Program.launch(URL);
}
});
addProductIcons(composite);
return dialogArea;
}