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


Java Button.addSelectionListener方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Button.addSelectionListener方法的典型用法代码示例。如果您正苦于以下问题:Java Button.addSelectionListener方法的具体用法?Java Button.addSelectionListener怎么用?Java Button.addSelectionListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Button的用法示例。


在下文中一共展示了Button.addSelectionListener方法的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: attachToPropertySubGroup

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
public void attachToPropertySubGroup(AbstractELTContainerWidget container) {
	ELTDefaultSubgroupComposite defaultSubgroupComposite = new ELTDefaultSubgroupComposite(
			container.getContainerControl());
	defaultSubgroupComposite.createContainerWidget();

	AbstractELTWidget defaultLable = new ELTDefaultLable(Messages.EXTRACT_FROM_METASTORE);
	defaultSubgroupComposite.attachWidget(defaultLable);
	setPropertyHelpWidget((Control) defaultLable.getSWTWidgetControl());
	
	
	AbstractELTWidget defaultButton;
	if(OSValidator.isMac()){
		defaultButton = new ELTDefaultButton(Messages.EXTRACT).buttonWidth(120);
	}else{
		defaultButton = new ELTDefaultButton(Messages.EXTRACT);
	}
	defaultSubgroupComposite.attachWidget(defaultButton);
	Button button = (Button) defaultButton.getSWTWidgetControl();
	
	
	button.addSelectionListener(attachExtractButtonListner());
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:24,代码来源:ELTExtractMetaStoreDataWidget.java

示例3: initialize

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void initialize() {
	checkBoxNone = new Button(this, SWT.CHECK);
	checkBoxNone.setText("none");
	checkBoxNone
			.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
				public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
					setUIState(!((Button)e.getSource()).getSelection());
				}
			});
	GridLayout gridLayout = new GridLayout();
	gridLayout.numColumns = 2;
	this.setLayout(gridLayout);
	label = new Label(this, SWT.NONE);
	label.setText("");
	createGroupColor();
	createGroupDecoration();
	this.setSize(new org.eclipse.swt.graphics.Point(253,241));
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:19,代码来源:JavelinAttributeEditorComposite.java

示例4: addCheckButtonInTable

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void addCheckButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName, 
		String groupPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final Button button = new Button(buttonPane, SWT.CHECK);
	button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	if(null != buttonSelectionListener){
		button.addSelectionListener(buttonSelectionListener);
	}
	tableItem.setData(columnName, button);
	tableItem.setData(groupPaneName, buttonPane);
	
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	button.setData(editorName, editor);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:20,代码来源:FilterConditionsDialog.java

示例5: createGroup

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
 * This method initializes group	
 *
 */
private void createGroup() {
	GridData gridData1 = new GridData();
	gridData1.horizontalAlignment = GridData.BEGINNING;
	gridData1.grabExcessHorizontalSpace = true;
	gridData1.verticalAlignment = GridData.CENTER;
	GridData gridData = new GridData();
	gridData.horizontalAlignment = GridData.FILL;
	gridData.verticalAlignment = GridData.CENTER;
	GridLayout gridLayout1 = new GridLayout();
	gridLayout1.numColumns = 2;
	GridData gridData3 = new GridData();
	gridData3.horizontalAlignment = GridData.FILL;
	gridData3.horizontalSpan = 2;
	gridData3.grabExcessHorizontalSpace = true;
	gridData3.grabExcessVerticalSpace = false;
	gridData3.verticalAlignment = GridData.FILL;
	group = new Group(this, SWT.NONE);
	group.setText("Target Server");
	group.setLayoutData(gridData3);
	group.setLayout(gridLayout1);
	label = new Label(group, SWT.NONE);
	label.setText("HTTP Server");
	httpServer = new Text(group, SWT.BORDER);
	httpServer.setLayoutData(gridData);
	
	label2 = new Label(group, SWT.NONE);
	label2.setText("HTTP Port");
	httpPort = new Text(group, SWT.BORDER);
	httpPort.setLayoutData(gridData1);
	label3 = new Label(group, SWT.NONE);
	label3.setText("SSL");
	ssl = new Button(group, SWT.CHECK);
	
	httpServer.addModifyListener(modifyListener);
       httpPort.addModifyListener(modifyListener);
       ssl.addSelectionListener(selectionListener);
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:42,代码来源:NewProjectWizardComposite6.java

示例6: 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

示例7: createAddButton

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createAddButton(Composite composite_11) {
	btnAdd = new Button(composite_11, SWT.NONE);
	btnAdd.setImage(ImagePathConstant.ADD_BUTTON.getImageFromRegistry());
	btnAdd.setToolTipText(Messages.ADD_KEY_SHORTCUT_TOOLTIP);
	btnAdd.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			addNewRow();
		}
	});
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:12,代码来源:LookupMapDialog.java

示例8: createButton

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createButton(Composite parent) {
	buttonSetJarLoaction = new Button(parent, SWT.PUSH);
	buttonSetJarLoaction.setText("设置Jdbc驱动位置");
	buttonSetJarLoaction.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			openDbDriverLocationDialog();
		}
	});
	buttonSetJarLoaction.setEnabled(false);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:11,代码来源:DbToolPreferencePage.java

示例9: createIsNonVolatileCheckbox

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected Composite createIsNonVolatileCheckbox(Composite parent) {
	isNonVolatile = new Button(parent, SWT.CHECK);
	isNonVolatile.setText(getDescription(HrmViewsRepository.General.Properties.isNonVolatile,
			HrmMessages.GeneralPropertiesEditionPart_IsNonVolatileLabel));
	isNonVolatile.addSelectionListener(new SelectionAdapter() {

		/**
		 * {@inheritDoc}
		 *
		 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
		 * 
		 */
		public void widgetSelected(SelectionEvent e) {
			if (propertiesEditionComponent != null)
				propertiesEditionComponent
						.firePropertiesChanged(new PropertiesEditionEvent(GeneralPropertiesEditionPartImpl.this,
								HrmViewsRepository.General.Properties.isNonVolatile, PropertiesEditionEvent.COMMIT,
								PropertiesEditionEvent.SET, null, new Boolean(isNonVolatile.getSelection())));
		}

	});
	GridData isNonVolatileData = new GridData(GridData.FILL_HORIZONTAL);
	isNonVolatileData.horizontalSpan = 2;
	isNonVolatile.setLayoutData(isNonVolatileData);
	EditingUtils.setID(isNonVolatile, HrmViewsRepository.General.Properties.isNonVolatile);
	EditingUtils.setEEFtype(isNonVolatile, "eef::Checkbox"); //$NON-NLS-1$
	SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(
			HrmViewsRepository.General.Properties.isNonVolatile, HrmViewsRepository.SWT_KIND), null); // $NON-NLS-1$
	// Start of user code for createIsNonVolatileCheckbox

	// End of user code
	return parent;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:34,代码来源:GeneralPropertiesEditionPartImpl.java

示例10: createDependency

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected void createDependency(Button master, Control slave) {
	Assert.isNotNull(slave);
	indent(slave);
	MasterButtonSlaveSelectionListener listener = new MasterButtonSlaveSelectionListener(master, slave);
	master.addSelectionListener(listener);
	this.masterSlaveListeners.add(listener);
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:8,代码来源:BatchEditorPreferencePage.java

示例11: createExpressionEditingTextBox

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createExpressionEditingTextBox(Composite composite_1) {
	Composite composite = new Composite(composite_1, SWT.NONE);
	composite.setLayout(new GridLayout(2, false));
	GridData gd_composite = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
	gd_composite.heightHint = 29;
	composite.setLayoutData(gd_composite);

	logicTextBox = new Text(composite, SWT.BORDER);
	logicTextBox.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	logicTextBox.setEditable(false);
	logicTextBox.setText(expressionDataStructure.getExpressionEditorData().getExpression());

	Button openEditorButton = new Button(composite, SWT.NONE);
	openEditorButton.setText("...");
	openEditorButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			ExpressionEditorData expressionEditorData = expressionDataStructure.getExpressionEditorData();
			expressionEditorData.getSelectedInputFieldsForExpression().clear();
			expressionEditorData.getSelectedInputFieldsForExpression().putAll(FieldDataTypeMap.INSTANCE
					.createFieldDataTypeMap(expressionDataStructure.getInputFields(), dialog.getSchemaFields()));
			LaunchExpressionEditor launchExpressionEditor = new LaunchExpressionEditor();
			String oldExpression = expressionEditorData.getExpression();
			launchExpressionEditor.launchExpressionEditor(expressionEditorData, dialog.getSchemaFields(),
					dialog.getComponent().getComponentLabel().getLabelContents());
			if (!StringUtils.equals(expressionEditorData.getExpression(), oldExpression)) {
				dialog.getPropertyDialogButtonBar().enableApplyButton(true);
			}
			logicTextBox.setText(expressionEditorData.getExpression());
			dialog.refreshErrorLogs();
		}
	});

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:35,代码来源:ExpressionComposite.java

示例12: createIsAtomicCheckbox

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected Composite createIsAtomicCheckbox(Composite parent) {
	isAtomic = new Button(parent, SWT.CHECK);
	isAtomic.setText(getDescription(GqamViewsRepository.General.Properties.isAtomic,
			GqamMessages.GeneralPropertiesEditionPart_IsAtomicLabel));
	isAtomic.addSelectionListener(new SelectionAdapter() {

		/**
		 * {@inheritDoc}
		 *
		 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
		 * 
		 */
		public void widgetSelected(SelectionEvent e) {
			if (propertiesEditionComponent != null)
				propertiesEditionComponent
						.firePropertiesChanged(new PropertiesEditionEvent(GeneralPropertiesEditionPartImpl.this,
								GqamViewsRepository.General.Properties.isAtomic, PropertiesEditionEvent.COMMIT,
								PropertiesEditionEvent.SET, null, new Boolean(isAtomic.getSelection())));
		}

	});
	GridData isAtomicData = new GridData(GridData.FILL_HORIZONTAL);
	isAtomicData.horizontalSpan = 2;
	isAtomic.setLayoutData(isAtomicData);
	EditingUtils.setID(isAtomic, GqamViewsRepository.General.Properties.isAtomic);
	EditingUtils.setEEFtype(isAtomic, "eef::Checkbox"); //$NON-NLS-1$
	SWTUtils.createHelpButton(parent, propertiesEditionComponent
			.getHelpContent(GqamViewsRepository.General.Properties.isAtomic, GqamViewsRepository.SWT_KIND), null); // $NON-NLS-1$
	// Start of user code for createIsAtomicCheckbox

	// End of user code
	return parent;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:34,代码来源:GeneralPropertiesEditionPartImpl.java

示例13: createIsStaticSchedulingFeatureCheckbox

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected Composite createIsStaticSchedulingFeatureCheckbox(Composite parent) {
	isStaticSchedulingFeature = new Button(parent, SWT.CHECK);
	isStaticSchedulingFeature.setText(getDescription(SrmViewsRepository.Other.Properties.isStaticSchedulingFeature,
			SrmMessages.OtherPropertiesEditionPart_IsStaticSchedulingFeatureLabel));
	isStaticSchedulingFeature.addSelectionListener(new SelectionAdapter() {

		/**
		 * {@inheritDoc}
		 *
		 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
		 * 
		 */
		public void widgetSelected(SelectionEvent e) {
			if (propertiesEditionComponent != null)
				propertiesEditionComponent
						.firePropertiesChanged(new PropertiesEditionEvent(OtherPropertiesEditionPartImpl.this,
								SrmViewsRepository.Other.Properties.isStaticSchedulingFeature,
								PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null,
								new Boolean(isStaticSchedulingFeature.getSelection())));
		}

	});
	GridData isStaticSchedulingFeatureData = new GridData(GridData.FILL_HORIZONTAL);
	isStaticSchedulingFeatureData.horizontalSpan = 2;
	isStaticSchedulingFeature.setLayoutData(isStaticSchedulingFeatureData);
	EditingUtils.setID(isStaticSchedulingFeature, SrmViewsRepository.Other.Properties.isStaticSchedulingFeature);
	EditingUtils.setEEFtype(isStaticSchedulingFeature, "eef::Checkbox"); //$NON-NLS-1$
	SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(
			SrmViewsRepository.Other.Properties.isStaticSchedulingFeature, SrmViewsRepository.SWT_KIND), null); // $NON-NLS-1$
	// Start of user code for createIsStaticSchedulingFeatureCheckbox

	// End of user code
	return parent;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:35,代码来源:OtherPropertiesEditionPartImpl.java

示例14: createDownButton

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createDownButton(Composite composite_11) {
	btnDown = new Button(composite_11, SWT.NONE);
	btnDown.setImage(ImagePathConstant.MOVEDOWN_BUTTON.getImageFromRegistry());
	btnDown.setToolTipText(Messages.MOVE_DOWN_KEY_SHORTCUT_TOOLTIP);
	btnDown.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			moveRowDown();
		}
	});
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:12,代码来源:LookupMapDialog.java

示例15: createIsProtectedCheckbox

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected Composite createIsProtectedCheckbox(Composite parent) {
	isProtected = new Button(parent, SWT.CHECK);
	isProtected.setText(getDescription(HrmViewsRepository.General.Properties.isProtected,
			HrmMessages.GeneralPropertiesEditionPart_IsProtectedLabel));
	isProtected.addSelectionListener(new SelectionAdapter() {

		/**
		 * {@inheritDoc}
		 *
		 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
		 * 
		 */
		public void widgetSelected(SelectionEvent e) {
			if (propertiesEditionComponent != null)
				propertiesEditionComponent
						.firePropertiesChanged(new PropertiesEditionEvent(GeneralPropertiesEditionPartImpl.this,
								HrmViewsRepository.General.Properties.isProtected, PropertiesEditionEvent.COMMIT,
								PropertiesEditionEvent.SET, null, new Boolean(isProtected.getSelection())));
		}

	});
	GridData isProtectedData = new GridData(GridData.FILL_HORIZONTAL);
	isProtectedData.horizontalSpan = 2;
	isProtected.setLayoutData(isProtectedData);
	EditingUtils.setID(isProtected, HrmViewsRepository.General.Properties.isProtected);
	EditingUtils.setEEFtype(isProtected, "eef::Checkbox"); //$NON-NLS-1$
	SWTUtils.createHelpButton(parent, propertiesEditionComponent
			.getHelpContent(HrmViewsRepository.General.Properties.isProtected, HrmViewsRepository.SWT_KIND), null); // $NON-NLS-1$
	// Start of user code for createIsProtectedCheckbox

	// End of user code
	return parent;
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:34,代码来源:GeneralPropertiesEditionPartImpl.java


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