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

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

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

Button.getText介绍

[英]Returns the receiver's text, which will be an empty string if it has never been set or if the receiver is an ARROW button.
[中]返回接收者的文本,如果从未设置该文本或接收者是ARROW按钮,则该文本将为空字符串。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @return the text in the Text widget
 */
public String getText() {
 return wBox.getText();
}

代码示例来源:origin: pentaho/pentaho-kettle

private void updateAllCheckboxes() {
  DefaultCapabilityManager capabilityManager = DefaultCapabilityManager.getInstance();
  for ( Button button : buttons ) {
   button.setSelection( capabilityManager.getCapabilityById( button.getText() ).isInstalled() );
  }
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

final String ok = button.getText();
long startTime = new Date().getTime();

代码示例来源:origin: pentaho/pentaho-kettle

buttons[ i ].setToolTipText( Const.replace( buttons[ i ].getText(), "&", "" ) );

代码示例来源:origin: eclipse/aCute

@Override
  public void handleEvent(Event e) {
    configuration = ((Button) e.widget).getText();
    setLocationIfDefault();
  }
};

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
String getNameText () {
  return getText ();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
String getNameText () {
  return getText ();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
String getNameText () {
  return getText ();
}

代码示例来源:origin: eclipse/aCute

@Override
  public void handleEvent(Event e) {
    projectConfig = ((Button) e.widget).getText();
    setDirty(true);
    updateLaunchConfigurationDialog();
  }
};

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench.texteditor

/**
 * Stores the button and its mnemonic in {@link #fMnemonicButtonMap}.
 *
 * @param button button whose mnemonic has to be stored
 * @since 3.7
 */
private void storeButtonWithMnemonicInMap(Button button) {
  char mnemonic= LegacyActionTools.extractMnemonic(button.getText());
  if (mnemonic != LegacyActionTools.MNEMONIC_NONE)
    fMnemonicButtonMap.put(Character.valueOf(Character.toLowerCase(mnemonic)), button);
}

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

/**
 * Stores the button and its mnemonic in {@link #fMnemonicButtonMap}.
 * 
 * @param button button whose mnemonic has to be stored
 * @since 3.7
 */
private void storeButtonWithMnemonicInMap(Button button) {
  char mnemonic= LegacyActionTools.extractMnemonic(button.getText());
  if (mnemonic != LegacyActionTools.MNEMONIC_NONE)
    fMnemonicButtonMap.put(new Character(Character.toLowerCase(mnemonic)), button);
}

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

private void setupControls(String valueToSet) {
  for (int i = 0; i < checkBoxButtons.length; i++) {
    Button currentCheckBox = checkBoxButtons[i];
    currentCheckBox.setSelection(isSelected(currentCheckBox.getText(), valueToSet));
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

@Override
boolean mnemonicMatch (char key) {
  char mnemonic = findMnemonic (getText ());
  if (mnemonic == '\0') return false;
  return Character.toUpperCase (key) == Character.toUpperCase (mnemonic);
}

代码示例来源: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: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
  protected void setButtonLayoutData(Button button) {
    super.setButtonLayoutData(button);
    Object data= button.getLayoutData();
    if (data instanceof GridData) {
      GridData gridData= (GridData) data;
      gridData.widthHint+= button.getText().length(); 
      button.setLayoutData(gridData);
    }
  }
}

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

private void setButtonTextFromDescriptor(Button button, JREDescriptor descriptor) {
  if (button != null) {
    //update the description & JRE in case it has changed
    String currentText = button.getText();
    String newText = descriptor.getDescription();
    if (!newText.equals(currentText)) {
      button.setText(newText);
      fControl.layout();
    }
  }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

private static void renderText( Button button ) {
 String newValue = button.getText();
 if( hasChanged( button, PROP_TEXT, newValue, "" ) ) {
  String text = removeAmpersandControlCharacters( newValue );
  getRemoteObject( button ).set( PROP_TEXT, text );
 }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

private static void renderMnemonicIndex( Button button ) {
 String text = button.getText();
 if( hasChanged( button, PROP_TEXT, text, "" ) ) {
  int mnemonicIndex = findMnemonicCharacterIndex( text );
  if( mnemonicIndex != -1 ) {
   getRemoteObject( button ).set( PROP_MNEMONIC_INDEX, mnemonicIndex );
  }
 }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

static void writeText( final Button button ) throws IOException {
 JSWriter writer = JSWriter.getWriterFor( button );
 String text = button.getText();     
 if( WidgetLCAUtil.hasChanged( button, Props.TEXT, text, null ) ) {
  text = WidgetLCAUtil.escapeText( text, true );
  if( ( button.getStyle() & SWT.WRAP ) != 0 ) {
   text = WidgetLCAUtil.replaceNewLines( text, "<br/>" );
  }
  writer.set( "text", text.equals( "" ) ? null : text );
 }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

@Override
public void preserveValues( Button button ) {
 preserveProperty( button, PROP_TEXT, button.getText() );
 preserveProperty( button, PROP_IMAGE, button.getImage() );
 preserveProperty( button, PROP_SELECTION, Boolean.valueOf( button.getSelection() ) );
 preserveProperty( button, PROP_GRAYED, Boolean.valueOf( button.getGrayed() ) );
 preserveProperty( button, PROP_ALIGNMENT, getAlignment( button ) );
 preserveProperty( button, PROP_BADGE, getBadge( button ) );
}

相关文章

Button类方法