Java Code Examples for org.eclipse.swt.custom.CLabel#setLeftMargin()

The following examples show how to use org.eclipse.swt.custom.CLabel#setLeftMargin() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractDialog.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
protected void createErrorComposite(final Composite parent) {
    errorMessageText = new CLabel(parent, SWT.NONE);
    errorMessageText.setLeftMargin(0);
    errorMessageText.setText("");

    final GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.heightHint = 30 * getErrorLine();
    gridData.horizontalSpan = numColumns;

    errorMessageText.setLayoutData(gridData);
    errorMessageText.setForeground(ColorConstants.red);
}
 
Example 2
Source File: WidgetMessageDecorator.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public WidgetMessageDecorator(Composite parent, Optional<String> defaultMessage) {
    createComposite(parent);
    this.resourceManager = new LocalResourceManager(JFaceResources.getResources(), parent);
    errorColor = resourceManager.createColor(ColorConstants.ERROR_RGB);
    warningColor = resourceManager.createColor(ColorConstants.WARNING_RGB);
    this.defaultMessage = defaultMessage;
    messageLabel = new CLabel(composite, SWT.NONE);
    messageLabel.setTopMargin(1);
    messageLabel.setLeftMargin(0);
    messageLabel.setFont(getMessageFont());
    messageLabel.setText(defaultMessage.orElse(""));
    foregroundColor = Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND);
    updateExpandState();
}