本文整理了Java中org.eclipse.swt.widgets.Button.setGrayed()
方法的一些代码示例,展示了Button.setGrayed()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setGrayed()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Button
类名称:Button
方法名:setGrayed
[英]Sets the grayed state of the receiver. This state change only applies if the control was created with the SWT.CHECK style.
[中]设置接收器的灰色状态。此状态更改仅适用于使用SWT创建控件的情况。检查样式。
代码示例来源:origin: stackoverflow.com
button.addSelectionListener( new SelectionAdapter() {
private int state;
public void widgetSelected( SelectionEvent event ) {
state++;
if( state > 2 ) {
state = 0;
}
Button button = ( Button )event.widget;
switch( state ) {
case 0:
button.setSelection( false );
button.setGrayed( false );
break;
case 1:
button.setSelection( true );
button.setGrayed( false );
break;
case 2:
button.setSelection( true );
button.setGrayed( true );
break;
}
}
} );
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void runSupport() {
Boolean selected = isSelected();
if (selected == null) {
checkBox.setGrayed(true);
checkBox.setSelection(true);
} else {
checkBox.setGrayed(false);
if (checkBox.getSelection() != selected) {
checkBox.setSelection(selected);
}
}
}
});
代码示例来源:origin: eclipse-jetty/eclipse-jetty-plugin
includeButton.setGrayed(true);
type = Type.DEFAULT;
fillItem(item);
includeButton.setGrayed(false);
includeButton.setSelection(true);
type = Type.ALWAYS_INCLUDED;
代码示例来源:origin: BiglySoftware/BiglyBT
public GenericBooleanParameter(GenericParameterAdapter _adapter,
Composite composite, final String paramID,
String textKey, IAdditionalActionPerformer actionPerformer) {
adapter = _adapter;
this.paramID = paramID;
if (actionPerformer != null) {
performers.add(actionPerformer);
}
Boolean value = adapter.getBooleanValue(this.paramID);
checkBox = new Button(composite, SWT.CHECK);
if (textKey != null)
Messages.setLanguageText(checkBox, textKey);
if (value != null) {
checkBox.setGrayed(false);
checkBox.setSelection(value);
} else {
checkBox.setGrayed(true);
checkBox.setSelection(true);
}
checkBox.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
setSelected(checkBox.getSelection(), true);
}
});
}
代码示例来源:origin: BiglySoftware/BiglyBT
button.setEnabled( !auto_add );
button.setGrayed(true);
button.setSelection(true);
} else {
button.setGrayed(false);
button.setSelection(hasTag);
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void widgetSelected(SelectionEvent e) {
Button button = (Button) e.widget;
Tag tag = (Tag) button.getData("Tag");
if (button.getGrayed()) {
button.setGrayed(false);
button.setSelection(!button.getSelection());
button.getParent().redraw();
}
boolean doTag = button.getSelection();
trigger.tagButtonTriggered(tag, doTag);
button.getParent().redraw();
button.getParent().update();
}
代码示例来源:origin: eclipse-jetty/eclipse-jetty-plugin
includeButton.setGrayed(true);
includeButton.setSelection(true);
break;
includeButton.setGrayed(false);
includeButton.setSelection(false);
break;
includeButton.setGrayed(false);
includeButton.setSelection(true);
break;
内容来源于网络,如有侵权,请联系作者删除!