本文整理匯總了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();
}
}
});
}
示例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());
}
示例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));
}
示例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);
}
示例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);
}
示例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());
}
示例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();
}
});
}
示例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);
}
示例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;
}
示例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);
}
示例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();
}
});
}
示例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;
}
示例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;
}
示例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();
}
});
}
示例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;
}