本文整理汇总了Java中org.eclipse.swt.widgets.Button.setText方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setText方法的具体用法?Java Button.setText怎么用?Java Button.setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Button
的用法示例。
在下文中一共展示了Button.setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FileTypeComponent
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
* Creates a new definition file component using model in container.
*
* @param model
* The model to bind it to
* @param container
* The container to create it in
*/
public FileTypeComponent(DefinitionFileModel model, WizardComponentContainer container) {
super(container);
this.model = model;
Composite parent = getParentComposite();
Label definitionFileLabel = new Label(parent, SWT.NONE);
definitionFileLabel.setLayoutData(fillLabelDefaults());
definitionFileLabel.setText("File type:");
definitionFileBox = new Button(parent, SWT.CHECK);
definitionFileBox.setText("Definition file (.n4jsd)");
definitionFileBox.setLayoutData(fillLabelDefaults());
WizardComponentUtils.emptyGridCell(parent);
setupBindings();
}
示例2: createSaveJobPromtGroup
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
* @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);
}
}
示例3: createGroup
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
* 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);
}
示例4: createAbove
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
public void createAbove(Composite container, int span) {
fUseTemplate = new Button(container, SWT.CHECK);
fUseTemplate.setText(PDEUIMessages.WizardListSelectionPage_label);
GridData gd = new GridData();
gd.horizontalSpan = span;
fUseTemplate.setLayoutData(gd);
fUseTemplate.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
wizardSelectionViewer.getControl().setEnabled(fUseTemplate.getSelection());
if (!fUseTemplate.getSelection())
setDescription(""); //$NON-NLS-1$
setDescriptionEnabled(fUseTemplate.getSelection());
getContainer().updateButtons();
}
});
}
示例5: createButtonsForButtonBar
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
Button ok = getButton(IDialogConstants.OK_ID);
ok.setText("Apply");
ok.setEnabled(false);
setButtonLayoutData(ok);
Button cancel = getButton(IDialogConstants.CANCEL_ID);
cancel.setText("Cancel");
setButtonLayoutData(cancel);
cancel.addListener(SWT.Selection, e -> {
if (futureTask != null && ! futureTask.isDone()) {
futureTask.cancel(true);
}
credentials.setApplication(null);
});
}
示例6: createIsPeriodicCheckbox
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected Composite createIsPeriodicCheckbox(Composite parent) {
isPeriodic = new Button(parent, SWT.CHECK);
isPeriodic.setText(getDescription(GrmViewsRepository.General.Properties.isPeriodic,
GrmMessages.GeneralPropertiesEditionPart_IsPeriodicLabel));
isPeriodic.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,
GrmViewsRepository.General.Properties.isPeriodic, PropertiesEditionEvent.COMMIT,
PropertiesEditionEvent.SET, null, new Boolean(isPeriodic.getSelection())));
}
});
GridData isPeriodicData = new GridData(GridData.FILL_HORIZONTAL);
isPeriodicData.horizontalSpan = 2;
isPeriodic.setLayoutData(isPeriodicData);
EditingUtils.setID(isPeriodic, GrmViewsRepository.General.Properties.isPeriodic);
EditingUtils.setEEFtype(isPeriodic, "eef::Checkbox"); //$NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent
.getHelpContent(GrmViewsRepository.General.Properties.isPeriodic, GrmViewsRepository.SWT_KIND), null); // $NON-NLS-1$
// Start of user code for createIsPeriodicCheckbox
// End of user code
return parent;
}
示例7: calendar
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private static Object[] calendar(Shell shell, int style, Predicate<Date> test, boolean nullable) {
Text text1 = new Text(shell, SWT.BORDER);
Button button1 = new Button(shell, SWT.PUSH);
button1.setText("click");
button1.addSelectionListener(new XSelectionAdapter(text1, style, test, nullable));
return new Object[]{text1, button1};
}
示例8: 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();
}
});
}
示例9: attachWidget
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
public void attachWidget(Composite container) {
defaultELTButton = new Button(container, SWT.CENTER);
GridData gd_defaultELTButton = new GridData(SWT.FILL, SWT.CENTER, grabExcessSpace, false, 1, 1);
gd_defaultELTButton.widthHint = buttonWidth;
if (OSValidator.isMac()) {
gd_defaultELTButton.horizontalIndent=-3;
}
gd_defaultELTButton.heightHint = buttonHeight;
defaultELTButton.setLayoutData(gd_defaultELTButton);
defaultELTButton.setText(buttonText);
widget = defaultELTButton;
}
示例10: createIsProtectedCheckbox
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected Composite createIsProtectedCheckbox(Composite parent) {
isProtected = new Button(parent, SWT.CHECK);
isProtected.setText(getDescription(GrmViewsRepository.General.Properties.isProtected,
GrmMessages.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,
GrmViewsRepository.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, GrmViewsRepository.General.Properties.isProtected);
EditingUtils.setEEFtype(isProtected, "eef::Checkbox"); //$NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent
.getHelpContent(GrmViewsRepository.General.Properties.isProtected, GrmViewsRepository.SWT_KIND), null); // $NON-NLS-1$
// Start of user code for createIsProtectedCheckbox
// End of user code
return parent;
}
示例11: createDialogArea
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
Button button = new Button(container, SWT.PUSH);
button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
button.setText("Press me");
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
System.out.println("Pressed");
}
});
return container;
}
示例12: createIsProtectedCheckbox
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected Composite createIsProtectedCheckbox(Composite parent) {
isProtected = new Button(parent, SWT.CHECK);
isProtected.setText(getDescription(LibraryViewsRepository.General.Properties.isProtected, LibraryMessages.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, LibraryViewsRepository.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, LibraryViewsRepository.General.Properties.isProtected);
EditingUtils.setEEFtype(isProtected, "eef::Checkbox"); //$NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(LibraryViewsRepository.General.Properties.isProtected, LibraryViewsRepository.SWT_KIND), null); //$NON-NLS-1$
// Start of user code for createIsProtectedCheckbox
// End of user code
return parent;
}
示例13: createIsPreemptableCheckbox
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected Composite createIsPreemptableCheckbox(Composite parent) {
isPreemptable = new Button(parent, SWT.CHECK);
isPreemptable.setText(getDescription(SrmViewsRepository.Timing.Properties.isPreemptable,
SrmMessages.TimingPropertiesEditionPart_IsPreemptableLabel));
isPreemptable.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(TimingPropertiesEditionPartImpl.this,
SrmViewsRepository.Timing.Properties.isPreemptable, PropertiesEditionEvent.COMMIT,
PropertiesEditionEvent.SET, null, new Boolean(isPreemptable.getSelection())));
}
});
GridData isPreemptableData = new GridData(GridData.FILL_HORIZONTAL);
isPreemptableData.horizontalSpan = 2;
isPreemptable.setLayoutData(isPreemptableData);
EditingUtils.setID(isPreemptable, SrmViewsRepository.Timing.Properties.isPreemptable);
EditingUtils.setEEFtype(isPreemptable, "eef::Checkbox"); //$NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent
.getHelpContent(SrmViewsRepository.Timing.Properties.isPreemptable, SrmViewsRepository.SWT_KIND), null); // $NON-NLS-1$
// Start of user code for createIsPreemptableCheckbox
// End of user code
return parent;
}
示例14: createDialogArea
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout(2, false);
layout.marginRight = 5;
layout.marginLeft = 10;
layout.marginTop = 10;
container.setLayout(layout);
TMTreeViewerDataSource dataSource = treeViewer.getDataSource();
int columnsCount = dataSource.numberOfColumns();
for (int i = 0; i < columnsCount; i++) {
final int columnIndex = i;
Button checkBoxButton = new Button(container, SWT.CHECK);
checkBoxButton.setText(dataSource.columnTitleForColumnIndex(columnIndex));
checkBoxButton.setSelection(!collapsedColumnsIndexes.contains(columnIndex));
checkBoxButton.addListener(SWT.Selection, event -> {
if (collapsedColumnsIndexes.contains(columnIndex)) {
collapsedColumnsIndexes.remove(columnIndex);
} else {
collapsedColumnsIndexes.add(columnIndex);
}
});
}
return container;
}
示例15: createIsBufferedCheckbox
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected Composite createIsBufferedCheckbox(Composite parent) {
isBuffered = new Button(parent, SWT.CHECK);
isBuffered.setText(getDescription(SrmViewsRepository.General.Properties.isBuffered,
SrmMessages.GeneralPropertiesEditionPart_IsBufferedLabel));
isBuffered.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,
SrmViewsRepository.General.Properties.isBuffered, PropertiesEditionEvent.COMMIT,
PropertiesEditionEvent.SET, null, new Boolean(isBuffered.getSelection())));
}
});
GridData isBufferedData = new GridData(GridData.FILL_HORIZONTAL);
isBufferedData.horizontalSpan = 2;
isBuffered.setLayoutData(isBufferedData);
EditingUtils.setID(isBuffered, SrmViewsRepository.General.Properties.isBuffered);
EditingUtils.setEEFtype(isBuffered, "eef::Checkbox"); //$NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent
.getHelpContent(SrmViewsRepository.General.Properties.isBuffered, SrmViewsRepository.SWT_KIND), null); // $NON-NLS-1$
// Start of user code for createIsBufferedCheckbox
// End of user code
return parent;
}