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


Java Button.setEnabled方法代码示例

本文整理汇总了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);
	}

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

示例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); 
    });
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:20,代码来源:ApplicationsSWT.java

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

}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:18,代码来源:LoginDialog.java

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

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

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

示例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);
    });
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:31,代码来源:AccountSWT.java

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

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

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

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

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

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

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

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

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


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