当前位置: 首页>>代码示例>>Java>>正文


Java Button.setSelection方法代码示例

本文整理汇总了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();
			}
		}
	});
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:28,代码来源:PreviewableWizardPage.java

示例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();
	
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:19,代码来源:SourceSelectionPage.java

示例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;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:21,代码来源:LoginDialog.java

示例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());
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:25,代码来源:BooleanOption.java

示例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);
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:18,代码来源:NewPlatformPreferenceDialog.java

示例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();
	}
});

	
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:22,代码来源:GW4ELaunchConfigurationTab.java

示例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;
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:21,代码来源:IgnoredObjectsPrefPage.java

示例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);
		}
	});
}
 
开发者ID:marvinmalkowskijr,项目名称:applecommander,代码行数:17,代码来源:DiskImageFormatPane.java

示例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);
		}
	});
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:29,代码来源:GenericBooleanParameter.java

示例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);
}
 
开发者ID:juanerasmoe,项目名称:pmTrans,代码行数:13,代码来源:FindReplaceDialog.java

示例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();
			}
		});
	}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:14,代码来源:ExpressionComposite.java

示例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);
		}
	});
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:18,代码来源:DiskImageOrderPane.java

示例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);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:32,代码来源:GeneratorChoiceComposite.java

示例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);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:37,代码来源:GeneratorChoiceComposite.java

示例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();
			}
		});
	}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:14,代码来源:OperationComposite.java


注:本文中的org.eclipse.swt.widgets.Button.setSelection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。