本文整理匯總了Java中org.eclipse.swt.widgets.Button.setSelection方法的典型用法代碼示例。如果您正苦於以下問題:Java Button.setSelection方法的具體用法?Java Button.setSelection怎麽用?Java Button.setSelection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Button
的用法示例。
在下文中一共展示了Button.setSelection方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createBottomControls
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
/**
* Creates the bottom controls.
*/
private void createBottomControls(Composite parent) {
Composite bottomControls = new Composite(parent, SWT.NONE);
bottomControls
.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).align(SWT.RIGHT, SWT.CENTER).create());
bottomControls.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).extendedMargins(0, 5, 0, 0).create());
previewToggleButton = new Button(bottomControls, SWT.PUSH);
previewToggleButton.setText(HIDE_PREVIEW_TEXT);
previewToggleButton.setSelection(true);
previewToggleButton.setLayoutData(GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.BOTTOM).create());
previewToggleButton.setToolTipText(PREVIEW_BUTTON_TOOLTIP);
previewToggleButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (!previewVisible) {
showContentPreview();
} else {
hideContentPreview();
}
}
});
}
示例2: addRadioButton
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
protected void addRadioButton(Composite container) {
Composite composite_1 = new Composite(container, SWT.NONE);
composite_1.setLayout(new GridLayout(1, false));
composite_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
xmlRadioButton = new Button(composite_1, SWT.RADIO);
xmlRadioButton.setText("XML File");
xmlRadioButton.setEnabled(true);
xmlRadioButton.setSelection(true);
xsdRadioButton = new Button(composite_1, SWT.RADIO);
xsdRadioButton.setText("XSD File");
addSelectionListenerOnXMLRadioBtn();
addSelectionListenerOnXSDRadioBtn();
}
示例3: createAdvancedContent
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
private Composite createAdvancedContent ( final Composite advWrapper )
{
final Composite advContent = new Composite ( advWrapper, SWT.NONE );
advContent.setLayout ( new GridLayout ( 1, false ) );
final Button credentialsAsProperties = new Button ( advContent, SWT.CHECK );
credentialsAsProperties.setText ( Messages.LoginDialog_CredentialsButtons_Text );
credentialsAsProperties.setToolTipText ( Messages.LoginDialog_CredentialsButtons_ToolTip );
credentialsAsProperties.setSelection ( this.flagCredentialsAsProperties );
credentialsAsProperties.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final SelectionEvent e )
{
LoginDialog.this.flagCredentialsAsProperties = credentialsAsProperties.getSelection ();
}
} );
return advContent;
}
示例4: createControl
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
/**
* Creates the boolean option control. Option reserves the right to modify
* the actual widget used as long as the user can modify its boolean state.
*
* @param parent
* the parent composite of the option widget
* @param span
* the number of columns that the widget should span
*/
public void createControl(Composite parent, int span) {
button = new Button(parent, SWT.CHECK);
button.setText(getLabel());
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = span;
button.setLayoutData(gd);
button.setSelection(isSelected());
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
BooleanOption.super.setValue(button.getSelection() ? Boolean.TRUE : Boolean.FALSE);
getSection().validateOptions(BooleanOption.this);
}
});
button.setEnabled(isEnabled());
}
示例5: createParentControls
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
@Override
protected void createParentControls(Composite composite) {
Label label = new Label(composite, SWT.WRAP);
label.setText("Preference scope:");
Composite group = new Composite(composite, SWT.NONE);
group.setLayout(new RowLayout());
for (int i = 0; i < SCOPE_LABELS.length; i++) {
Button btn = new Button(group, SWT.RADIO);
btn.setText(SCOPE_LABELS[i]);
btn.setData(SCOPE_VALUES[i]);
if (SCOPE_VALUES[i].equals(scope) || (scope.isEmpty() && i == 0)) {
btn.setSelection(true);
}
scopeRadios[i] = btn;
}
super.createParentControls(composite);
}
示例6: createRemoveBlockedElementGroup
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
private void createRemoveBlockedElementGroup (Composite parent) {
Label lfiller = new Label(parent, SWT.NONE);
lfiller.setText("");
Label lblRemoveBlockedElement = new Label(parent, SWT.NONE);
lblRemoveBlockedElement.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblRemoveBlockedElement.setText(MessageUtil.getString("removeBlockedElement"));
removeBockedElementButton = new Button(parent, SWT.CHECK);
removeBockedElementButton.setText("");
removeBockedElementButton.setSelection(true);
removeBockedElementButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
validatePage();
}
});
}
示例7: createContents
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
@Override
protected Control createContents(Composite parent) {
GridLayout gridLayout = new GridLayout();
gridLayout.marginHeight = 0;
gridLayout.marginWidth = 0;
parent.setLayout(gridLayout);
parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
new Label(parent, SWT.NONE).setText(Messages.IgnoredObjectsPrefPage_these_objects_are_ignored_info);
btnIsWhite = new Button(parent, SWT.CHECK);
btnIsWhite.setText(Messages.IgnoredObjectsPrefPage_convert_to_white_list);
IgnoreList ignore = InternalIgnoreList.readInternalList();
btnIsWhite.setSelection(!ignore.isShow());
listEditor = new IgnoredObjectPrefListEditor(parent);
listEditor.setInputList(new LinkedList<>(ignore.getList()));
return parent;
}
示例8: createRadioButton
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
/**
* Create a radio button for the disk image format list.
*/
protected void createRadioButton(Composite composite, String label,
final int format, String helpText) {
Button button = new Button(composite, SWT.RADIO);
button.setText(label);
button.setSelection(wizard.getFormat() == format);
button.setToolTipText(helpText);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
getWizard().setFormat(format);
}
});
}
示例9: GenericBooleanParameter
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
public GenericBooleanParameter(GenericParameterAdapter _adapter,
Composite composite, final String _name, Boolean _defaultValue,
String textKey, IAdditionalActionPerformer actionPerformer) {
adapter = _adapter;
name = _name;
defaultValue = _defaultValue;
if (actionPerformer != null) {
performers.add(actionPerformer);
}
Boolean value = adapter.getBooleanValue(name, defaultValue);
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);
}
});
}
示例10: renderDirection
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
private void renderDirection(Shell shell) {
Group group = new Group(shell, SWT.NONE);
group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 3, 1));
group.setLayout(new GridLayout(1, false));
group.setText("Direction");
directionForward = new Button(group, SWT.RADIO);
directionForward.setText("Fordward");
directionBackward = new Button(group, SWT.RADIO);
directionBackward.setText("Backwards");
directionForward.setSelection(true);
}
示例11: createSwitchToExpressionButton
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
private void createSwitchToExpressionButton(Composite switchToCompsite) {
expressionRadioButton = new Button(switchToCompsite, SWT.RADIO);
expressionRadioButton.setText("Expression");
expressionRadioButton.setSelection(true);
expressionRadioButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
// dialog.switchToExpression();
// dialog.getDataStructure().setOperation(false);
// dialog.refreshErrorLogs();
}
});
}
示例12: createRadioButton
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
/**
* Create a radio button for the disk image size list.
*/
protected void createRadioButton(Composite composite, String label,
final int order, String helpText) {
Button button = new Button(composite, SWT.RADIO);
button.setText(label);
button.setToolTipText(helpText);
button.setSelection(wizard.getOrder() == order);
button.setEnabled(!wizard.isHardDisk());
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
getWizard().setOrder(order);
}
});
}
示例13: createAppendMode
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
private void createAppendMode() {
btnAppendRadioButton = new Button(this, SWT.RADIO);
btnAppendRadioButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
btnAppendRadioButton.setText(MessageUtil.getString("append_mode"));
btnAppendRadioButton.setSelection(true);
btnAppendRadioButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
switch (e.type) {
case SWT.Selection:
updateUI();
break;
}
}
});
btnAppendRadioButton.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_APPEND_CHECKBOX);
Composite composite = new Composite(this, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
composite.setLayout(new GridLayout(12, false));
lblAppendClassNameLabel = new Label(composite, SWT.NONE);
lblAppendClassNameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
lblAppendClassNameLabel.setText("Class name");
comboAppendClassnameViewer = new AncestorViewer(composite);
comboAppendClassnameViewer.initialize(GW4E_CONVERSION_COMBO_ANCESTOR_EXTEND_TEST, false);
comboAppendClassnameViewer.getCombo().setData(GW4E_CONVERSION_WIDGET_ID, GW4E_CONVERSION_COMBO_ANCESTOR_APPEND_TEST);
Combo combo = comboAppendClassnameViewer.getCombo();
combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 8, 1));
combo.setEnabled(true);
}
示例14: createNewMode
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
private void createNewMode() {
btnCreateNewRadioButton = new Button(this, SWT.RADIO);
btnCreateNewRadioButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
btnCreateNewRadioButton.setText(MessageUtil.getString("standalone_mode"));
btnCreateNewRadioButton.setSelection(false);
btnCreateNewRadioButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
switch (e.type) {
case SWT.Selection:
updateUI();
break;
}
}
});
btnCreateNewRadioButton.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_NEWCLASS_CHECKBOX);
Composite composite = new Composite(this, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
composite.setLayout(new GridLayout(12, false));
lblNewClassnameLabel = new Label(composite, SWT.NONE);
lblNewClassnameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
lblNewClassnameLabel.setText("Class name");
lblNewClassnameLabel.setEnabled(false);
newClassnameText = new Text(composite, SWT.BORDER);
newClassnameText.setEnabled(false);
newClassnameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent event) {
listener.handleEvent(null);
}
});
newClassnameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 8, 1));
newClassnameText.setEnabled(false);
newClassnameText.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_NEWCLASS_TEXT);
}
示例15: createSwitchToOperationButton
import org.eclipse.swt.widgets.Button; //導入方法依賴的package包/類
private void createSwitchToOperationButton(Composite switchToCompsite) {
operationRadioButton = new Button(switchToCompsite, SWT.RADIO);
operationRadioButton.setText("Operation");
operationRadioButton.setSelection(true);
operationRadioButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
// dialog.switchToOperation();
// dialog.getDataStructure().setOperation(true);
// dialog.refreshErrorLogs();
}
});
}