org.eclipse.swt.widgets.Button.setData()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(189)

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

Button.setData介绍

暂无

代码示例

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void handleEvent(Event event) {
    btnRefresh.setData("Pressing", "1");
    task.run();
    btnRefresh.setData("Pressing", null);
  }
});

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private Button createButton(Composite parent, int style, String text, int data, boolean isSelected) {
  Button button= new Button(parent, style);
  button.setText(text);
  button.setData(new Integer(data));
  button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
  button.setSelection(isSelected);
  return button;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private Button createButton(Composite parent, int style, String text, int data, boolean isSelected) {
  Button button= new Button(parent, style);
  button.setText(text);
  button.setData(Integer.valueOf(data));
  button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
  button.setSelection(isSelected);
  return button;
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private Button createButton(Composite parent, int style, String text, int data, boolean isSelected) {
  Button button= new Button(parent, style);
  button.setText(text);
  button.setData(new Integer(data));
  button.setLayoutData(new GridData());
  button.setSelection(isSelected);
  return button;
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

private Button createRadioButton(Composite parent, int span, String[] choice) {
  Button button = new Button(parent, SWT.RADIO);
  button.setData(choice[0]);
  button.setText(choice[1]);
  GridData gd = fill(button, span);
  gd.horizontalIndent = 10;
  return button;
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

private Button createRadioButton(Composite parent, int span, String[] choice) {
  Button button = new Button(parent, SWT.RADIO);
  button.setData(choice[0]);
  button.setText(choice[1]);
  GridData gd = fill(button, span);
  gd.horizontalIndent = 10;
  return button;
}

代码示例来源:origin: com.eclipsesource.tabris/tabris

private void createBackButton() {
 backButton = new Button( uiParent, SWT.PUSH );
 backButton.setData( RWT.CUSTOM_VARIANT, BACK_BUTTON_CUSTOM_VARIANT );
 backButton.setLayoutData( new GridData( BACK_BUTTON_SIZE, BACK_BUTTON_SIZE ) );
 backButton.setEnabled( false );
 backButtonSelectionListener = new BackButtonSelectionListener();
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

Button addCheckBox(Composite parent, String label, String key) { 
  GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  
  Button button= new Button(parent, SWT.CHECK);
  button.setText(label);
  button.setData(key);
  button.setLayoutData(gd);
  button.setSelection(getPreferenceStore().getBoolean(key));
  
  fCheckBoxes.add(button);
  return button;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

/**
   * Sets the specified working set.
   *
   * @param workingSet the working set
   */
  void setWorkingSet(IWorkingSet workingSet) {
    button.setData(workingSet);
    if (workingSet != null) {
      button.setText(NLS.bind(TaskListMessages.TaskList_workingSet,  workingSet.getLabel()));
    } else {
      button.setText(TaskListMessages.TaskList_noWorkingSet);
    }
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private Button addRadioButton(Composite parent, String label, String key, String value, int indent) { 
  GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  gd.horizontalSpan= 2;
  gd.horizontalIndent= indent;
  
  Button button= new Button(parent, SWT.RADIO);
  button.setText(label);
  button.setData(new String[] { key, value });
  button.setLayoutData(gd);
  button.setSelection(value.equals(getPreferenceStore().getString(key)));
  
  fRadioButtons.add(button);
  return button;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private Button addRadioButton(Composite parent, String label, String key, String value, int indent) {
  GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  gd.horizontalSpan= 2;
  gd.horizontalIndent= indent;
  Button button= new Button(parent, SWT.RADIO);
  button.setText(label);
  button.setData(new String[] { key, value });
  button.setLayoutData(gd);
  button.setSelection(value.equals(getPreferenceStore().getString(key)));
  fRadioButtons.add(button);
  return button;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private Button addRadioButton(Composite parent, String label, String key, String value) {
  GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  Button button= new Button(parent, SWT.RADIO);
  button.setText(label);
  button.setData(new String[] { key, value });
  button.setLayoutData(gd);
  button.setSelection(value.equals(getPreferenceStore().getString(key)));
  fRadioButtons.add(button);
  return button;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private Button addCheckBox(Composite parent, String label, String key) {
  GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  Button button= new Button(parent, SWT.CHECK);
  button.setText(label);
  button.setData(key);
  button.setLayoutData(gd);
  button.setSelection(getPreferenceStore().getBoolean(key));
  fCheckBoxes.add(button);
  return button;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private Button addRadioButton(Composite parent, String label, String key, String value, int indent) {
  GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  gd.horizontalSpan= 2;
  gd.horizontalIndent= indent;
  Button button= new Button(parent, SWT.RADIO);
  button.setText(label);
  button.setData(new String[] { key, value });
  button.setLayoutData(gd);
  button.setSelection(value.equals(getPreferenceStore().getString(key)));
  fRadioButtons.add(button);
  return button;
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private Button addRadioButton(Composite parent, String label, String key, String value) { 
  GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  
  Button button= new Button(parent, SWT.RADIO);
  button.setText(label);
  button.setData(new String[] { key, value });
  button.setLayoutData(gd);
  button.setSelection(value.equals(getPreferenceStore().getString(key)));
  
  fRadioButtons.add(button);
  return button;
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private Button addRadioButton(Composite parent, String label, String key, String value) {
  GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  Button button= new Button(parent, SWT.RADIO);
  button.setText(label);
  button.setData(new String[] { key, value });
  button.setLayoutData(gd);
  button.setSelection(value.equals(getPreferenceStore().getString(key)));
  fRadioButtons.add(button);
  return button;
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private Button addCheckBox(Composite parent, String label, String key) { 
  GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
  
  Button button= new Button(parent, SWT.CHECK);
  button.setText(label);
  button.setData(key);
  button.setLayoutData(gd);
  button.setSelection(getPreferenceStore().getBoolean(key));
  
  fCheckBoxes.add(button);
  return button;
}

代码示例来源:origin: openaudible/openaudible

public Button[] newRadioGroup(String label, Object titles[], boolean vertical) {
  
  Composite g = newGroup(this, label, vertical ? 1 : titles.length);
  Button out[] = new Button[titles.length];
  
  for (int x = 0; x < titles.length; x++) {
    Object title = titles[x];
    out[x] = newButton(g, SWT.RADIO, title.toString());
    out[x].setData(title);
    if (selectionListener != null)
      out[x].addSelectionListener(selectionListener);
  }
  
  return out;
}

代码示例来源:origin: org.eclipse.xtext/ui

protected Button addCheckboxWithData(Composite parent, String label, ControlData data, GridData gd) {
  Button checkBox = new Button(parent, SWT.CHECK);
  checkBox.setFont(JFaceResources.getDialogFont());
  checkBox.setText(label);
  checkBox.setData(data);
  checkBox.setLayoutData(gd);
  checkBox.addSelectionListener(getSelectionListener());
  makeScrollableCompositeAware(checkBox);
  updateCheckBox(checkBox);
  checkBoxes.add(checkBox);
  return checkBox;
}

代码示例来源:origin: com.eclipsesource.tabris/tabris

@Override
public void createUi( Composite uiParent ) {
 if( control == null ) {
  control = new Button( uiParent, SWT.PUSH );
  control.setData( RWT.CUSTOM_VARIANT, CUSTOM_VARIANT_TABRIS_UI );
  control.setEnabled( descriptor.isEnabled() );
  control.setVisible( descriptor.isVisible() );
  control.setToolTipText( descriptor.getTitle() );
  control.setImage( getImage( control.getDisplay(), descriptor.getImage() ) );
  control.addListener( SWT.Selection, new ActionSelectionListener() );
 }
}

相关文章

Button类方法