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

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

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

Button.getData介绍

暂无

代码示例

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

private void
selectButtonGroup(
  List<Button>        buttons,
  int					data )
{
  for ( Button b: buttons ){
    b.setSelection( (Integer)b.getData() == data );
  }
}

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

/**
 * Returns the value of the given button.
 * 
 * @param button the button for which to fetch value
 * @return the value of the button
 */
private int getIntData(Button button) {
  return ((Integer)button.getData()).intValue();
}

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

private int getIntValue(Button button) {
  Integer bData= (Integer) button.getData();
  if (bData != null) {
    return bData.intValue();
  }
  return 0;
}

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

private void
selectButtonGroup(
  List<Button>        buttons,
  String                data )
{
  for ( Button b: buttons ){
    String str = (String)b.getData();
    b.setSelection( str != null && str.endsWith( data ));
  }
}

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

@Override
  public void widgetSelected(SelectionEvent e) {
    int index = listLogTypes.getSelectionIndex();
    if (index < 0 || index >= logTypes.length)
      return;
    Button item = (Button) e.widget;
    if (item.getSelection())
      ignoredComponents[index].remove(item.getData("LOGID"));
    else
      ignoredComponents[index].add(item.getData("LOGID"));
  }
};

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

@Override
  public void handleEvent(Event event) {
    Button btn = (Button) event.widget;
    String sName = (String) btn.getData("ColorName");
    if (sName != null) {
      COConfigurationManager.setParameter(sName + ".override", false);
      btn.setEnabled(false);
    }
  }
});

代码示例来源:origin: org.eclipse/org.eclipse.datatools.connectivity.sqm.fe.ui

public void widgetSelected(SelectionEvent e) {
  int i = 0;
  for (Iterator it = m_Buttons.iterator(); it.hasNext(); i++)
  {
    Button button = (Button)it.next();
    ((EngineeringOption) button.getData()).setBoolean(((Boolean)m_Default.get(i)).booleanValue());
    button.setSelection(((Boolean)m_Default.get(i)).booleanValue());
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.datatools.connectivity.sqm.fe.ui

public void widgetSelected(SelectionEvent e) {
  for (Iterator it = m_Buttons.iterator(); it.hasNext(); )
  {
    Button button = (Button)it.next();
    ((EngineeringOption) button.getData()).setBoolean(false);
    button.setSelection(false);
  }
}

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

protected Button getCheckBox(Key key) {
  for (int i= fCheckBoxes.size() - 1; i >= 0; i--) {
    Button curr= (Button) fCheckBoxes.get(i);
    ControlData data= (ControlData) curr.getData();
    if (key.equals(data.getKey())) {
      return curr;
    }
  }
  return null;		
}

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

protected Link getCheckBoxLink(Key key) {
  if (fCheckBoxes == null)
    return null;
  
  for (int i= fCheckBoxes.size() - 1; i >= 0; i--) {
    Button curr= fCheckBoxes.get(i);
    ControlData data= (ControlData) curr.getData();
    if (key.equals(data.getKey()) && data instanceof LinkControlData) {
      return ((LinkControlData)data).getLink();
    }
  }
  return null;
}

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

protected Link getCheckBoxLink(Key key) {
  if (fCheckBoxes == null)
    return null;
  
  for (int i= fCheckBoxes.size() - 1; i >= 0; i--) {
    Button curr= fCheckBoxes.get(i);
    ControlData data= (ControlData) curr.getData();
    if (key.equals(data.getKey()) && data instanceof LinkControlData) {
      return ((LinkControlData)data).getLink();
    }
  }
  return null;
}

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

void updateEnablement() {
  if (updateButton == null || updateButton.isDisposed())
    return;
  Button[] buttons = {updateButton, uninstallButton, propertiesButton};
  for (int i = 0; i < buttons.length; i++) {
    Action action = (Action) buttons[i].getData(BUTTON_ACTION);
    if (action == null || !action.isEnabled())
      buttons[i].setEnabled(false);
    else
      buttons[i].setEnabled(true);
  }
}

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

private void handleScopeChanged(SelectionEvent e) {
  Object source= e.getSource();
  if (source instanceof Button) {
    Button button= (Button) source;
    if (button.getSelection())
      setSelectedScope(((Integer) button.getData()).intValue());
  }
}

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

private String gatherSettings() {
  String[][] settings = new String[checkBoxButtons.length][3];
  for (int i = 0; i < checkBoxButtons.length; i++) {
    Button currentCheckBox = checkBoxButtons[i];
    String name = currentCheckBox.getText();
    String value = (String) currentCheckBox.getData();
    String checked = String.valueOf(currentCheckBox.getSelection());
    settings[i] = new String[] { name, value, checked };
  }
  return calculateResult(settings);
}

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

@Override
  public void runSupport()
  {
    boolean i2p_installed = I2PHelpers.isI2PInstalled();
    i2p_install_button.setText( MessageText.getString( i2p_installed?"devices.installed":"privacy.view.install.i2p" ));
    i2p_install_button.setEnabled( !i2p_installed );
    i2p_lookup_button.setEnabled( i2p_installed && i2p_lookup_button.getData( "hash" ) != null );
    i2p_options_link.setEnabled( i2p_installed );
  }
});

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

public static void restoreDefaultImage(Button button) {
  Image defaultImage = (Image) button.getData(DEFAULT_IMAGE);
  if (defaultImage != null) {
    button.setImage(defaultImage.isDisposed() ? null : defaultImage);
  }
}

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

protected void updateCheckBox(Button curr) {
  ControlData data= (ControlData) curr.getData();
  String currValue= getValue(data.getKey());
  curr.setSelection(data.getSelection(currValue) == 0);
}

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

protected void updateCheckBox(Button curr) {
  ControlData data= (ControlData) curr.getData();
  
  String currValue= getValue(data.getKey());    
  curr.setSelection(data.getSelection(currValue) == 0);						
}

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

protected void updateCheckBox(Button curr) {
  ControlData data= (ControlData) curr.getData();
  String currValue= getValue(data.getKey());
  curr.setSelection(data.getSelection(currValue) == 0);
}

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

@Override
  public void handleEvent(Event event) {
    Subscription subscription = (Subscription) addButton.getData("subscription");
    if(subscription != null) {
      subscription.setSubscribed(true);
      subscription.requestAttention();
      shell.close();
    }
  }
});

相关文章

Button类方法