Example usage for org.eclipse.jface.databinding.swt SWTObservables observeFont

List of usage examples for org.eclipse.jface.databinding.swt SWTObservables observeFont

Introduction

In this page you can find the example usage for org.eclipse.jface.databinding.swt SWTObservables observeFont.

Prototype

@Deprecated
public static ISWTObservableValue observeFont(Control control) 

Source Link

Document

Returns an observable value tracking the font of the given control.

Usage

From source file:com.rcpcompany.uibindings.uiAttributes.SimpleUIAttribute.java

License:Open Source License

@Override
public IObservableValue getFontValue() {
    Assert.isTrue(!isDisposed());//  w w w.ja  va2s.c  o  m
    if (myWidget instanceof Control) {
        final Control c = (Control) myWidget;
        return addObservable(SWTObservables.observeFont(c));
    }
    return null;
}

From source file:org.reap.internal.core.binding.BindingManager.java

License:Open Source License

private IObservable createSWTObservable(final Control control, final BindingConfig binding) {
    IObservable obs = null;/*from   w ww. ja v a  2  s .  c o m*/
    switch (binding.getType()) {
    case BACKGROUND:
        obs = SWTObservables.observeBackground(control);
        break;
    case EDITABLE:
        obs = SWTObservables.observeEditable(control);
        break;
    case ENABLED:
        obs = SWTObservables.observeEnabled(control);
        break;
    case FONT:
        obs = SWTObservables.observeFont(control);
        break;
    case FOREGROUND:
        obs = SWTObservables.observeForeground(control);
        break;
    case ITEMS:
        obs = SWTObservables.observeItems(control);
        break;
    case MAX:
        obs = SWTObservables.observeMax(control);
        break;
    case MIN:
        obs = SWTObservables.observeMin(control);
        break;
    case SELECTION:
        obs = SWTObservables.observeSelection(control);
        break;
    case SINGLESELECTIONINDEX:
        obs = SWTObservables.observeSingleSelectionIndex(control);
        break;
    case TEXT:
        obs = SWTObservables.observeText(control);
        break;
    case TEXTFOCUSOUT:
        obs = SWTObservables.observeText(control, SWT.FocusOut);
        break;
    case TEXTMODIFY:
        obs = SWTObservables.observeText(control, SWT.Modify);
        break;
    case TEXTNONE:
        obs = SWTObservables.observeText(control, SWT.None);
        break;
    case TOOLTIPTEXT:
        obs = SWTObservables.observeTooltipText(control);
        break;
    case VISIBLE:
        obs = SWTObservables.observeVisible(control);
        break;
    default:
        throw new IllegalArgumentException();
    }
    return obs;
}