本文整理汇总了Java中org.eclipse.swt.SWT.RADIO属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.RADIO属性的具体用法?Java SWT.RADIO怎么用?Java SWT.RADIO使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.RADIO属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createParentControls
@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);
}
示例2: createToolbarButton
private void createToolbarButton ()
{
if ( this.button == null )
{
final int index = this.toolBarNavigator.calculateToolbarIndex ( this.descriptor );
if ( index < 0 )
{
return;
}
this.button = new ToolItem ( this.toolbar, SWT.RADIO, index );
this.button.setText ( this.descriptor.getName () );
this.button.addSelectionListener ( new SelectionAdapter () {
@Override
public void widgetSelected ( final org.eclipse.swt.events.SelectionEvent e )
{
showView ( ToolBarNavigatorItem.this.descriptor.getId () );
};
} );
// set current state
this.button.setImage ( this.currentButtonImage );
}
}
示例3: addRadioButton
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();
}
示例4: createGroup
/**
* This method initializes group
*
*/
private void createGroup() {
GridData gridData3 = new org.eclipse.swt.layout.GridData();
gridData3.grabExcessHorizontalSpace = false;
gridData3.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
gridData3.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
group = new Group(this, SWT.NONE);
group.setLayoutData(gridData3);
radioButton1 = new Button(group, SWT.RADIO);
radioButton1.setBounds(new org.eclipse.swt.graphics.Rectangle(143,18,109,16));
radioButton1.setText("Sister screen class");
radioButton2 = new Button(group, SWT.RADIO);
radioButton2.setBounds(new org.eclipse.swt.graphics.Rectangle(12,18,126,16));
radioButton2.setText("Inherited screen class");
radioButton2.setSelection(true);
}
示例5: attachRadioButtonToComposite
private void attachRadioButtonToComposite(Composite radioButtonsComposite)
{
expressionRadioButton=new Button(radioButtonsComposite, SWT.RADIO);
if(OSValidator.isMac())
{
expressionRadioButton.setText(Messages.MAC_EXPRESSION_EDITIOR_LABEL);
}
else
{
expressionRadioButton.setText(Messages.WINDOWS_EXPRESSION_EDITIOR_LABEL);
}
operationRadioButton = new Button(radioButtonsComposite, SWT.RADIO);
operationRadioButton.setText(Messages.OPERATION_CALSS_LABEL);
addSelectionListenerToExpressionRadioButton(expressionRadioButton);
addSelectionListenerToOperationRadioButton(operationRadioButton);
if(transformMapping.isExpression())
{
expressionRadioButton.setSelection(true);
}
else
{
operationRadioButton.setSelection(true);
}
}
示例6: createSaveJobPromtGroup
/**
* @param selection
*/
private void createSaveJobPromtGroup(String selection) {
HydroGroup hydroGroup = new HydroGroup(this, SWT.NONE);
hydroGroup.setHydroGroupText(Messages.SAVE_JOBS_BEFORE_LAUNCHING_MESSAGE);
hydroGroup.setLayout(new GridLayout(1, false));
hydroGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
hydroGroup.getHydroGroupClientArea().setLayout(new GridLayout(2, false));
hydroGroup.getHydroGroupClientArea().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
btnRadioButtonAlways = new Button(hydroGroup.getHydroGroupClientArea(), SWT.RADIO);
btnRadioButtonAlways.setText(StringUtils.capitalize((MessageDialogWithToggle.ALWAYS)));
btnRadioButtonPrompt = new Button(hydroGroup.getHydroGroupClientArea(), SWT.RADIO);
btnRadioButtonPrompt.setText(StringUtils.capitalize(MessageDialogWithToggle.PROMPT));
if (StringUtils.equals(selection, MessageDialogWithToggle.ALWAYS)) {
btnRadioButtonAlways.setSelection(true);
} else {
btnRadioButtonPrompt.setSelection(true);
}
}
示例7: attachWidget
@Override
public void attachWidget(Composite container) {
defaultELTButton = new Button(container, SWT.RADIO);
GridData gd_defaultELTButton = new GridData(SWT.FILL, SWT.FILL, grabExcessSpace, false, 1, 1);
if (OSValidator.isMac()) {
gd_defaultELTButton.horizontalIndent=6;
}
defaultELTButton.setLayoutData(gd_defaultELTButton);
defaultELTButton.setText(buttonText);
widget = defaultELTButton;
}
示例8: createRadioButton
/**
* 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: createCompositeReverse
/**
* This method initializes compositeReverse
*
*/
private void createCompositeReverse() {
compositeReverse = new Composite(groupDecoration, SWT.NONE);
compositeReverse.setBounds(new org.eclipse.swt.graphics.Rectangle(5,36,231,21));
radioButtonReverseOn = new Button(compositeReverse, SWT.RADIO);
radioButtonReverseOn.setBounds(new org.eclipse.swt.graphics.Rectangle(8,4,59,16));
radioButtonReverseOn.setText("reverse");
radioButtonReverseOff = new Button(compositeReverse, SWT.RADIO);
radioButtonReverseOff.setBounds(new org.eclipse.swt.graphics.Rectangle(85,4,56,16));
radioButtonReverseOff.setText("normal");
radioButtonReverseDontCare = new Button(compositeReverse, SWT.RADIO);
radioButtonReverseDontCare.setBounds(new org.eclipse.swt.graphics.Rectangle(157,4,68,16));
radioButtonReverseDontCare.setText("don't care");
}
示例10: createCompositeBlink
/**
* This method initializes compositeBlink
*
*/
private void createCompositeBlink() {
compositeBlink = new Composite(groupDecoration, SWT.NONE);
compositeBlink.setBounds(new org.eclipse.swt.graphics.Rectangle(5,82,231,21));
radioButtonBlinkOn = new Button(compositeBlink, SWT.RADIO);
radioButtonBlinkOn.setBounds(new org.eclipse.swt.graphics.Rectangle(8,4,43,16));
radioButtonBlinkOn.setText("blink");
radioButtonBlinkOff = new Button(compositeBlink, SWT.RADIO);
radioButtonBlinkOff.setBounds(new org.eclipse.swt.graphics.Rectangle(86,4,57,16));
radioButtonBlinkOff.setText("normal");
radioButtonBlinkDontCare = new Button(compositeBlink, SWT.RADIO);
radioButtonBlinkDontCare.setBounds(new org.eclipse.swt.graphics.Rectangle(157,4,68,16));
radioButtonBlinkDontCare.setText("don't care");
}
示例11: createRadioButton
/**
* Create a radio button for the disk image size list.
*/
protected void createRadioButton(Composite composite, String label,
final int size, String helpText) {
Button button = new Button(composite, SWT.RADIO);
button.setText(label);
button.setToolTipText(helpText);
button.setSelection(wizard.getSize() == size);
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
getWizard().setSize(size);
}
});
}
示例12: createRadioButton
/**
* 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
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: createRadioButton
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;
}
示例15: ExpresssionOperationImportExportComposite
public ExpresssionOperationImportExportComposite(Composite parent, int style,ImportExportType type, ExternalWidgetData externalWidgetData) {
super(parent, style);
this.externalWidgetData = externalWidgetData;
setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
setLayout(new GridLayout(1, false));
Composite exprOperImportExportComposite = new Composite(this, SWT.NONE);
exprOperImportExportComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
exprOperImportExportComposite.setLayout(new GridLayout(2, false));
labelExperssionType = new Label(exprOperImportExportComposite, SWT.NONE);
labelExperssionType.setText( type.getValue() +" Type");
radioButtonCompsite = new Composite(exprOperImportExportComposite, SWT.NONE);
radioButtonCompsite.setLayout(new GridLayout(2, false));
radioButtonCompsite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
btnRadioInternal = new Button(radioButtonCompsite, SWT.RADIO);
btnRadioInternal.setText("Internal "+type.getValue());
btnRadioExternal = new Button(radioButtonCompsite, SWT.RADIO);
btnRadioExternal.setText("External "+type.getValue());
lblExternal = new Label(exprOperImportExportComposite, SWT.NONE);
lblExternal.setText("External Path");
Composite browseButtonComposite = new Composite(exprOperImportExportComposite, SWT.NONE);
browseButtonComposite.setLayout(new GridLayout(2, false));
browseButtonComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
txtExternalPath = new Text(browseButtonComposite, SWT.BORDER);
txtExternalPath.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
decorator = WidgetUtility.addDecorator(txtExternalPath, "Field should not be blank.");
decorator.hide();
decorator.setMarginWidth(3);
btnBrowse = new Button(browseButtonComposite, SWT.NONE);
GridData gd_btnNewButton = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
gd_btnNewButton.heightHint = 25;
if(OSValidator.isMac()){
gd_btnNewButton.widthHint = 43;
gd_btnNewButton.horizontalIndent=-5;
}else{
gd_btnNewButton.widthHint = 30;
}
btnBrowse.setLayoutData(gd_btnNewButton);
btnBrowse.setText("...");
new Label(exprOperImportExportComposite, SWT.NONE);
Composite importExportButtonComposite = new Composite(exprOperImportExportComposite, SWT.NONE);
importExportButtonComposite.setLayout(new GridLayout(2, false));
importExportButtonComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
btnImport = new Button(importExportButtonComposite, SWT.NONE);
btnImport.setText("Import "+type.getValue());
btnExport = new Button(importExportButtonComposite, SWT.NONE);
btnExport.setText("Export "+type.getValue());
btnExport.setEnabled(false);
btnImport.setEnabled(false);
addListners();
updateWidgetValueWithPreviousChoices();
addSelectinListnerToExportImport();
addModifyListnerToExternalPathTextBox(externalWidgetData);
}