gpt4 book ai didi

org.eclipse.jface.databinding.swt.WidgetProperties类的使用及代码示例

转载 作者:知者 更新时间:2024-03-22 13:59:05 28 4
gpt4 key购买 nike

本文整理了Java中org.eclipse.jface.databinding.swt.WidgetProperties类的一些代码示例,展示了WidgetProperties类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WidgetProperties类的具体详情如下:
包路径:org.eclipse.jface.databinding.swt.WidgetProperties
类名称:WidgetProperties

WidgetProperties介绍

[英]A factory for creating properties of SWT Widget.
[中]用于创建SWT小部件属性的工厂。

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding

/**
 * Returns a value property for observing the text of a {@link StyledText}
 * or {@link Text}.
 *
 * @param event
 *            the SWT event type to register for change events. May be
 *            {@link SWT#None}, {@link SWT#Modify}, {@link SWT#FocusOut} or
 *            {@link SWT#DefaultSelection}.
 *
 * @return a value property for observing the text of a {@link StyledText}
 *         or {@link Text}.
 */
public static IWidgetValueProperty text(final int event) {
  return text(new int[] { event });
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding

/**
 * Returns an observable observing the selection attribute of the provided
 * <code>control</code>. The supported types are:
 * <ul>
 * <li>org.eclipse.swt.widgets.Spinner</li>
 * <li>org.eclipse.swt.widgets.Button</li>
 * <li>org.eclipse.swt.widgets.Combo</li>
 * <li>org.eclipse.swt.custom.CCombo</li>
 * <li>org.eclipse.swt.widgets.List</li>
 * <li>org.eclipse.swt.widgets.MenuItem (since 1.5)</li>
 * <li>org.eclipse.swt.widgets.Scale</li>
 * </ul>
 *
 * @param widget
 * @return observable value
 * @throws IllegalArgumentException
 *             if <code>control</code> type is unsupported
 * @since 1.5
 * @deprecated use <code>WidgetProperties</code> instead
 */
@Deprecated
public static ISWTObservableValue observeSelection(Widget widget) {
  return WidgetProperties.selection().observe(widget);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding

/**
 * Returns an observable value tracking the background color of the given
 * control
 *
 * @param control
 *            the control to observe
 * @return an observable value tracking the background color of the given
 *         control
 * @deprecated use <code>WidgetProperties</code> instead
 */
@Deprecated
public static ISWTObservableValue observeBackground(Control control) {
  return WidgetProperties.background().observe(control);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding

/**
 * Returns an observable value tracking the bounds of the given control.
 *
 * @param control
 *            the control to observe
 * @return an observable value tracking the bounds of the given control
 * @since 1.3
 * @deprecated use <code>WidgetProperties</code> instead
 */
@Deprecated
public static ISWTObservableValue observeBounds(Control control) {
  return WidgetProperties.bounds().observe(control);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding

/**
   * Returns an observable observing the editable attribute of the provided
   * <code>control</code>. The supported types are:
   * <ul>
   * <li>org.eclipse.swt.custom.CCombo (since 1.6)</li>
   * <li>org.eclipse.swt.custom.StyledText (since 1.6)</li>
   * <li>org.eclipse.swt.widgets.Text</li>
   * </ul>
   *
   * @param control
   * @return observable value
   * @throws IllegalArgumentException
   *             if <code>control</code> type is unsupported
   * @deprecated use <code>WidgetProperties</code> instead
   */
  @Deprecated
  public static ISWTObservableValue observeEditable(Control control) {
    return WidgetProperties.editable().observe(control);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding

/**
 * Returns an observable observing the text attribute of the provided
 * <code>control</code>. The supported types are:
 * <ul>
 * <li>org.eclipse.swt.widgets.Text</li>
 * <li>org.eclipse.swt.custom.StyledText (as of 1.3)</li>
 * </ul>
 *
 * @param control
 * @param event
 *            event type to register for change events
 * @return observable value
 * @throws IllegalArgumentException
 *             if <code>control</code> type is unsupported
 * @deprecated use <code>WidgetProperties</code> instead
 */
@Deprecated
public static ISWTObservableValue observeText(Control control, int event) {
  return WidgetProperties.text(event).observe(control);
}

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.ca.ui.editor.forms.common

public void createStandardCheckbox ( final Composite parent, final String attributeName, final String label, final IObservableMap data, final Object valueType )
{
  final Button button = this.toolkit.createButton ( parent, label, SWT.CHECK );
  {
    final GridData gd = new GridData ( GridData.FILL_HORIZONTAL );
    gd.horizontalSpan = 3;
    button.setLayoutData ( gd );
    final IObservableValue value = Observables.observeMapEntry ( data, attributeName, valueType );
    this.dbc.bindValue ( WidgetProperties.selection ().observe ( button ), value );
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding

/**
 * Returns an observable observing the text attribute of the provided
 * <code>control</code>. The supported types are:
 * <ul>
 * <li>org.eclipse.swt.widgets.Text</li>
 * <li>org.eclipse.swt.custom.StyledText (as of 1.3)</li>
 * </ul>
 *
 * @param control
 * @param events
 *            array of SWT event types to register for change events. May
 *            include {@link SWT#None}, {@link SWT#Modify},
 *            {@link SWT#FocusOut} or {@link SWT#DefaultSelection}.
 * @return observable value
 * @throws IllegalArgumentException
 *             if <code>control</code> type is unsupported
 * @since 1.3
 * @deprecated use <code>WidgetProperties</code> instead
 */
@Deprecated
public static ISWTObservableValue observeText(Control control, int[] events) {
  return WidgetProperties.text(events).observe(control);
}

代码示例来源:origin: de.dentrassi.eclipse.neoscada.hmi/org.eclipse.scada.ca.ui.editor.forms.common

public void createStandardCheckbox ( final Composite parent, final String attributeName, final String label, final IObservableMap data, final Object valueType )
{
  final Button button = this.toolkit.createButton ( parent, label, SWT.CHECK );
  {
    final GridData gd = new GridData ( GridData.FILL_HORIZONTAL );
    gd.horizontalSpan = 3;
    button.setLayoutData ( gd );
    final IObservableValue value = Observables.observeMapEntry ( data, attributeName, valueType );
    this.dbc.bindValue ( WidgetProperties.selection ().observe ( button ), value );
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding

/**
 * Returns an observable observing the text attribute of the provided
 * <code>widget</code>. The supported types are:
 * <ul>
 * <li>org.eclipse.swt.widgets.Button (as of 1.3)</li>
 * <li>org.eclipse.swt.custom.CCombo</li>
 * <li>org.eclipse.swt.custom.CLabel</li>
 * <li>org.eclipse.swt.widgets.Combo</li>
 * <li>org.eclipse.swt.widgets.Group (as of 1.7)</li>
 * <li>org.eclipse.swt.widgets.Item</li>
 * <li>org.eclipse.swt.widgets.Label</li>
 * <li>org.eclipse.swt.widgets.Link (as of 1.2)</li>
 * <li>org.eclipse.swt.widgets.Shell</li>
 * <li>org.eclipse.swt.widgets.StyledText (as of 1.3)</li>
 * <li>org.eclipse.swt.widgets.Text (as of 1.3)</li>
 * </ul>
 *
 * @param widget
 * @return observable value
 * @throws IllegalArgumentException
 *             if the type of <code>widget</code> is unsupported
 *
 * @since 1.3
 * @deprecated use <code>WidgetProperties</code> instead
 */
@Deprecated
public static ISWTObservableValue observeText(Widget widget) {
  return WidgetProperties.text().observe(widget);
}

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.ca.ui.editor.forms.common

@Override
protected IObservableValue doCreateCellEditorObservable ( final CellEditor cellEditor )
{
  return WidgetProperties.text ( SWT.Modify ).observe ( cellEditor.getControl () );
}

代码示例来源:origin: de.dentrassi.eclipse.neoscada.hmi/org.eclipse.scada.sec.ui

@Override
protected void createInput ( final DataBindingContext dbc, final Label label, final Composite composite )
{
  this.input = new Text ( composite, SWT.BORDER );
  this.input.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false ) );
  dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( this.input ), PojoProperties.value ( TextCallback.PROP_VALUE ).observe ( this.callback ) );
}

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.sec.ui

@Override
protected void createInput ( final DataBindingContext dbc, final Label label, final Composite composite )
{
  this.input = new Text ( composite, SWT.BORDER );
  this.input.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false ) );
  dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( this.input ), PojoProperties.value ( TextCallback.PROP_VALUE ).observe ( this.callback ) );
}

代码示例来源:origin: de.dentrassi.eclipse.neoscada.hmi/org.eclipse.scada.ca.ui.editor.forms.common

@Override
protected IObservableValue doCreateCellEditorObservable ( final CellEditor cellEditor )
{
  return WidgetProperties.text ( SWT.Modify ).observe ( cellEditor.getControl () );
}

代码示例来源:origin: de.dentrassi.eclipse.neoscada.hmi/org.eclipse.scada.sec.ui

@Override
protected void createInput ( final DataBindingContext dbc, final Label label, final Composite composite )
{
  this.input = new Text ( composite, SWT.BORDER );
  this.input.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false ) );
  dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( this.input ), PojoProperties.value ( TextCallback.PROP_VALUE ).observe ( this.callback ) );
}

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.sec.ui

@Override
protected void createInput ( final DataBindingContext dbc, final Label label, final Composite composite )
{
  this.input = new Text ( composite, SWT.BORDER );
  this.input.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false ) );
  dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( this.input ), PojoProperties.value ( TextCallback.PROP_VALUE ).observe ( this.callback ) );
}

代码示例来源:origin: org.eclipse.recommenders.completion.rcp/calls

private void bindValue(final DataBindingContext ctx, final Widget widget, final Class<?> clazz,
    final String property, final IObservableValue value) {
  final IObservableValue widgetValue = WidgetProperties.text(SWT.Modify).observe(widget);
  final IObservableValue modelValue = BeanProperties.value(clazz, property).observeDetail(value);
  ctx.bindValue(widgetValue, modelValue);
}

代码示例来源:origin: de.dentrassi.eclipse.neoscada.hmi/org.eclipse.scada.ca.ui.editor.forms.common

public void createStandardText ( final Composite parent, final String attributeName, final int style, final String label, final String textMessage, final IObservableMap data, final Object valueType )
{
  final Label labelControl = this.toolkit.createLabel ( parent, label + ":" );
  final boolean multi = ( style & SWT.MULTI ) > 0;
  if ( multi )
  {
    labelControl.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, false, false ) );
  }
  final Text text = this.toolkit.createText ( parent, "", style );
  text.setMessage ( textMessage );
  final GridData gd = new GridData ( GridData.FILL, multi ? GridData.FILL : GridData.BEGINNING, true, true );
  gd.horizontalSpan = 2;
  text.setLayoutData ( gd );
  text.setToolTipText ( textMessage );
  final IObservableValue value = Observables.observeMapEntry ( data, attributeName, String.class );
  if ( valueType != null && valueType != String.class )
  {
    final WritableValue conversionValue = new WritableValue ( null, valueType );
    this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), conversionValue );
    this.dbc.bindValue ( conversionValue, value );
  }
  else
  {
    this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), value );
  }
}

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.ca.ui.editor.forms.common

public void createStandardText ( final Composite parent, final String attributeName, final int style, final String label, final String textMessage, final IObservableMap data, final Object valueType )
{
  final Label labelControl = this.toolkit.createLabel ( parent, label + ":" );
  final boolean multi = ( style & SWT.MULTI ) > 0;
  if ( multi )
  {
    labelControl.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, false, false ) );
  }
  final Text text = this.toolkit.createText ( parent, "", style );
  text.setMessage ( textMessage );
  final GridData gd = new GridData ( GridData.FILL, multi ? GridData.FILL : GridData.BEGINNING, true, true );
  gd.horizontalSpan = 2;
  text.setLayoutData ( gd );
  text.setToolTipText ( textMessage );
  final IObservableValue value = Observables.observeMapEntry ( data, attributeName, String.class );
  if ( valueType != null && valueType != String.class )
  {
    final WritableValue conversionValue = new WritableValue ( null, valueType );
    this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), conversionValue );
    this.dbc.bindValue ( conversionValue, value );
  }
  else
  {
    this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), value );
  }
}

代码示例来源:origin: org.eclipse.neoscada.hmi/org.eclipse.scada.ca.ui.editor.forms.common

public void createStandardCombo ( final Composite parent, final String attributeName, final String label, final String[] items, final IObservableMap data, final Object valueType )
{
  this.toolkit.createLabel ( parent, label + ":" );
  final Combo combo = new Combo ( parent, SWT.DROP_DOWN );
  combo.setItems ( items );
  this.toolkit.adapt ( combo );
  final GridData gd = new GridData ( GridData.FILL, GridData.BEGINNING, true, true );
  gd.horizontalSpan = 2;
  combo.setLayoutData ( gd );
  final IObservableValue value = Observables.observeMapEntry ( data, attributeName, valueType );
  this.dbc.bindValue ( WidgetProperties.text ().observe ( combo ), value );
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com