本文整理汇总了Java中org.eclipse.swt.widgets.Button.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setEnabled方法的具体用法?Java Button.setEnabled怎么用?Java Button.setEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Button
的用法示例。
在下文中一共展示了Button.setEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: disabledWidgetsifWholeExpressionIsParameterForAggregateCumulate
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
* @param isParam
* @param isWholeOperationParameter
*/
private void disabledWidgetsifWholeExpressionIsParameterForAggregateCumulate(Button isParam,
boolean isWholeOperationParameter) {
if (isWholeOperationParameter) {
Text textAccumulator = (Text) isParam.getData(Messages.TEXT_ACCUMULATOR);
Button isParamAccumulator = (Button) isParam.getData(Messages.ISPARAM_ACCUMULATOR);
Combo comboDataTypes = (Combo) isParam.getData(Messages.COMBODATATYPES);
Button button =(Button) isParam.getData(Constants.EXPRESSION_EDITOR_BUTTON1);
button.setEnabled(false);
textAccumulator.setEnabled(false);
isParamAccumulator.setEnabled(false);
comboDataTypes.setEnabled(false);
super.disabledWidgetsifWholeExpressionIsParameter(isParamAccumulator, isWholeOperationParameter);
}
}
示例2: 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);
});
}
示例3: update
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void update ()
{
final Button button = getButton ( OK );
try
{
setMessage ( Messages.LoginDialog_DefaultMessage, IMessageProvider.INFORMATION );
validate ();
button.setEnabled ( true );
}
catch ( final Exception e )
{
button.setEnabled ( false );
setMessage ( e.getMessage (), IMessageProvider.ERROR );
}
}
示例4: disabledWidgetsifWholeExpressionIsParameter
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
* @param isParam
* @param isWholeOperationParameter
*/
protected void disabledWidgetsifWholeExpressionIsParameter(Button isParam, boolean isWholeOperationParameter) {
if (isWholeOperationParameter) {
TableViewer tableViewer = (TableViewer) isParam.getData(Constants.INPUT_FIELD_TABLE);
Button addButton = (Button) isParam.getData(Constants.ADD_BUTTON);
Button deleteButton = (Button) isParam.getData(Constants.DELETE_BUTTON);
Text expressionIdTextBox = (Text) isParam.getData(Constants.EXPRESSION_ID_TEXT_BOX);
Button browseButton = (Button) isParam.getData(Constants.EXPRESSION_EDITOR_BUTTON);
Text outputFieldTextBox = (Text) isParam.getData(Constants.OUTPUT_FIELD_TEXT_BOX);
tableViewer.getTable().setEnabled(false);
addButton.setEnabled(false);
deleteButton.setEnabled(false);
expressionIdTextBox.setEnabled(false);
browseButton.setEnabled(false);
outputFieldTextBox.setEnabled(false);
}
}
示例5: createPushButton
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
* Creates button with {@link org.eclipse.swt.SWT#PUSH} style. Provided parameters control other aspects of the
* button.
*
* @param parent
* the parent used to create the button.
* @param text
* the text used to set text of the button.
* @param listener
* the listener added to the button.
* @param enabled
* flag controls if created button is enabled.
* @return created button.
*/
public static Button createPushButton(final Composite parent, final String text, final SelectionListener listener,
boolean enabled) {
final Button button = new Button(parent, PUSH);
button.setLayoutData(fillDefaults().align(FILL, CENTER).create());
button.setText(text);
if (null != listener) {
button.addSelectionListener(listener);
button.addDisposeListener(e -> {
button.removeSelectionListener(listener);
});
}
button.setEnabled(enabled);
return button;
}
示例6: 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);
}
});
}
示例7: 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("Sign In");
ok.setEnabled(false);
setButtonLayoutData(ok);
ok.addListener(SWT.Selection, e -> {
disableDialog();
futureTask = DialogUtils.supplyAsync(new AccountTask(userText.getText(), passwordText.getText()))
.exceptionally(ex -> {
ex.printStackTrace();
restoreDialog(null);
return null;
})
.thenAccept(this::restoreDialog);
});
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.setUserKey(false, null);
});
}
示例8: toggleSaveDisplayButton
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void toggleSaveDisplayButton(final List<Condition> conditionsList, final Map<String, String> fieldsAndTypes,
final String[] fieldNames, final Button saveButton, final Button displayButton) {
if(FilterValidator.INSTANCE.isAllFilterConditionsValid(conditionsList, fieldsAndTypes, fieldNames,debugDataViewer)){
saveButton.setEnabled(true);
displayButton.setEnabled(true);
}
else{
saveButton.setEnabled(false);
displayButton.setEnabled(false);
}
}
示例9: 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);
}
示例10: addButtonPanel
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected Composite addButtonPanel(Composite container) {
container_1.setLayout(new GridLayout(1, false));
Composite composite_1 = new Composite(container, SWT.NONE);
composite_1.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));
composite_1.setLayout(new GridLayout(5, false));
addButton = new Button(composite_1, SWT.NONE);
addButton.setToolTipText(Messages.ADD_KEY_SHORTCUT_TOOLTIP);
addButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
addButton.setImage(ImagePathConstant.ADD_BUTTON.getImageFromRegistry());
attachAddButtonListern(addButton);
deleteButton = new Button(composite_1, SWT.NONE);
deleteButton.setToolTipText(Messages.DELETE_KEY_SHORTCUT_TOOLTIP);
deleteButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
deleteButton.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
attachDeleteButtonListener(deleteButton);
upButton = new Button(composite_1, SWT.NONE);
upButton.setToolTipText(Messages.MOVE_UP_KEY_SHORTCUT_TOOLTIP);
upButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
upButton.setImage(ImagePathConstant.MOVEUP_BUTTON.getImageFromRegistry());
attachUpButtonListener(upButton);
downButton = new Button(composite_1, SWT.NONE);
downButton.setToolTipText(Messages.MOVE_DOWN_KEY_SHORTCUT_TOOLTIP);
downButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
downButton.setImage( ImagePathConstant.MOVEDOWN_BUTTON.getImageFromRegistry());
attachDownButtonListerner(downButton);
deleteButton.setEnabled(false);
upButton.setEnabled(false);
downButton.setEnabled(false);
new Label(composite_1, SWT.NONE);
return composite_1;
}
示例11: update
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void update ()
{
final Button button = getButton ( OK );
if ( button == null )
{
// too early
return;
}
button.setEnabled ( getMaster () != null );
}
示例12: disabledWidgetsifWholeExpressionIsParameterForAggregateCumulate
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
* @param isParam
* @param isWholeOperationParameter
*/
private void disabledWidgetsifWholeExpressionIsParameterForAggregateCumulate(Button isParam,
boolean isWholeOperationParameter) {
if (isWholeOperationParameter) {
Text textAccumulator = (Text) isParam.getData(Messages.TEXT_ACCUMULATOR);
Button isParamAccumulator = (Button) isParam.getData(Messages.ISPARAM_ACCUMULATOR);
Combo comboDataTypes = (Combo) isParam.getData(Messages.COMBODATATYPES);
textAccumulator.setEnabled(false);
isParamAccumulator.setEnabled(false);
comboDataTypes.setEnabled(false);
super.disabledWidgetsifWholeExpressionIsParameter(isParamAccumulator, isWholeOperationParameter);
}
}
示例13: createButtonsForButtonBar
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
* Create contents of the button bar.
*
* @param parent
*/
@Override
protected void createButtonsForButtonBar(Composite parent) {
Button buttonOk = createButton(parent, IDialogConstants.OK_ID, "OK",
true);
buttonOk.setEnabled(true);
}
示例14: addButtonPanel
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected Composite addButtonPanel(Composite KeyComposite) {
KeyComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
KeyComposite.setLayout(new GridLayout(1, false));
Composite partKeyButtonPanel = new Composite(KeyComposite, SWT.NONE);
partKeyButtonPanel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false,false, 1, 1));
partKeyButtonPanel.setSize(607, 25);
partKeyButtonPanel.setLayout(new GridLayout(5, false));
btnCheckButton = new Button(partKeyButtonPanel, SWT.CHECK);
btnCheckButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
btnCheckButton.setText(Messages.HIVE_PARTI_KEY_CHECKBOX_NAME);
btnCheckButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if(propertyList.size()>0){
lblPropertyError.setVisible(false);
createKeyValueTableAndArrangeColumns(btnCheckButton.getSelection(),propertyList);
}else{
lblPropertyError.setVisible(true);
lblPropertyError.setText(Messages.EMPTY_TARGET_FIELD_ERROR);
btnCheckButton.setSelection(false);
}
}
});
deleteButton = new Button(partKeyButtonPanel, SWT.NONE);
deleteButton.setToolTipText(Messages.DELETE_SCHEMA_TOOLTIP);
deleteButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false,
false, 1, 1));
deleteButton.setImage(ImagePathConstant.DELETE_BUTTON.getImageFromRegistry());
deleteButton.setToolTipText(Messages.HIVE_PARTI_KEY_DEL_TOOLTIP);
attachDeleteButtonListener(deleteButton);
upButton = new Button(partKeyButtonPanel, SWT.NONE);
upButton.setToolTipText(Messages.MOVE_SCHEMA_UP_TOOLTIP);
upButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false,
false, 1, 1));
upButton.setImage(ImagePathConstant.MOVEUP_BUTTON.getImageFromRegistry());
attachUpButtonListener(upButton);
downButton = new Button(partKeyButtonPanel, SWT.NONE);
downButton.setToolTipText(Messages.MOVE_SCHEMA_DOWN_TOOLTIP);
downButton.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false,
false, 1, 1));
downButton.setImage(ImagePathConstant.MOVEDOWN_BUTTON.getImageFromRegistry());
attachDownButtonListerner(downButton);
deleteButton.setEnabled(false);
upButton.setEnabled(false);
downButton.setEnabled(false);
new Label(partKeyButtonPanel, SWT.NONE);
return partKeyButtonPanel;
}
示例15: addAclTableItem
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
public TableItem addAclTableItem(ACL acl) {
final Table table = getTable();
final TableItem item = new TableItem(table, SWT.NONE);
item.setData("ACL", acl);
Id id = acl.getId();
int aclPerms = acl.getPerms();
boolean hasAll = ((aclPerms & ZooDefs.Perms.ALL) == ZooDefs.Perms.ALL);
item.setText(0, id.getScheme());
item.setText(1, id.getId());
for (final int perm : PERMS) {
final int permColumnIndex = getPermissionColumnIndex(perm);
TableEditor permCheckBoxTableEditor = new TableEditor(table);
setItemPermTableEditor(item, perm, permCheckBoxTableEditor);
final Button permCheckBox = new Button(table, SWT.CHECK);
boolean hasPerm = ((aclPerms & perm) == perm);
permCheckBox.setSelection(hasPerm);
permCheckBox.setEnabled(!hasAll || (hasAll && perm == ZooDefs.Perms.ALL));
permCheckBox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (perm == ZooDefs.Perms.ALL) {
for (int subPerm : PERMS) {
if (subPerm == ZooDefs.Perms.ALL) {
continue;
}
Button subPermCheckBox = getItemPermCheckBox(item, subPerm);
boolean allIsSelected = permCheckBox.getSelection();
if (allIsSelected) {
subPermCheckBox.setSelection(true);
}
subPermCheckBox.setEnabled(!allIsSelected);
}
}
fireOrchestrationChange();
}
});
permCheckBox.pack();
permCheckBoxTableEditor.minimumWidth = permCheckBox.getSize().x;
permCheckBoxTableEditor.horizontalAlignment = SWT.CENTER;
permCheckBoxTableEditor.setEditor(permCheckBox, item, permColumnIndex);
}
return item;
}