本文整理汇总了Java中org.eclipse.swt.widgets.Button.getSelection方法的典型用法代码示例。如果您正苦于以下问题:Java Button.getSelection方法的具体用法?Java Button.getSelection怎么用?Java Button.getSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Button
的用法示例。
在下文中一共展示了Button.getSelection方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getItemPerms
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private int getItemPerms(TableItem item) {
int perms = 0;
Button allCheckBox = getItemPermCheckBox(item, ZooDefs.Perms.ALL);
if (allCheckBox.getSelection()) {
perms = ZooDefs.Perms.ALL;
}
else {
for (int perm : PERMS) {
Button permCheckBox = getItemPermCheckBox(item, perm);
if (permCheckBox.getSelection()) {
perms |= perm;
}
}
}
return perms;
}
示例2: getZnode
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
public Znode getZnode() throws Exception {
byte[] data = getZnodeData();
ZnodeModel parentZnodeModel = getParentZnodeModel();
Text pathText = (Text) getControl(CONTROL_NAME_PATH_TEXT);
String relativePath = pathText.getText();
Znode parentZnode = parentZnodeModel.getData();
String parentPath = parentZnode.getPath();
String absolutePath = Znode.getAbsolutePath(parentPath, relativePath);
Button sequentialCheckbox = (Button) getControl(CONTROL_NAME_CREATE_MODE_SEQUENTIAL_BUTTON);
boolean isSequential = sequentialCheckbox.getSelection();
Button ephemeralRadioButton = (Button) getControl(CONTROL_NAME_CREATE_MODE_EPHEMERAL_BUTTON);
boolean isEphemeral = ephemeralRadioButton.getSelection();
Znode znode = new Znode(absolutePath);
znode.setSequential(isSequential);
znode.setEphemeral(isEphemeral);
znode.setData(data);
return znode;
}
示例3: doSelection
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private static void doSelection(Button button) {
if (button.getSelection()) {
String key = (String) button.getData("key");
if (key != null && key != "" && elementData.containsKey(key)) {
elementData.replace("ElementSelectedBy", key);
logger.info("Set ElementSelectedBy: " + key);
} else {
// System.out.println(
// String.format("Skip processing of key '%s'", selectedKey));
}
}
/*
idRadio.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
switch (event.type) {
case SWT.Selection:
Button button = ((Button) event.widget);
if (button.getSelection()) {
System.out.println(button.getText() + " selected (*)");
}
break;
}
}
});
*/
}
示例4: getParentTxt
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
protected String getParentTxt() {
String scope = DEFAULT_SCOPE;
for (Button btn : scopeRadios) {
if (btn.getSelection()) {
scope = (String) btn.getData();
}
}
return "/" + scope + "/" + super.getParentTxt();
}
示例5: modifyText
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
public void modifyText(ModifyEvent event) {
Text textBox = (Text)event.getSource();
Button btnRemoteMode = (Button)textBox.getData(RunConfigDialog.SELECTION_BUTTON_KEY);
String txt= textBox.getText();
if (StringUtils.isBlank(txt)) {
if(errorDecorator==null){
errorDecorator = WidgetUtility.addDecorator(textBox,Messages.bind(Messages.EMPTY_FIELD, fieldName));
}
if(btnRemoteMode!=null){
if(btnRemoteMode.getSelection()){
errorDecorator.show();
}else
errorDecorator.hide();
}else{
errorDecorator.show();
}
errorDecorator.setMarginWidth(3);
} else {
if(errorDecorator!=null)
errorDecorator.hide();
}
}
示例6: storeGroupSelection
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private boolean storeGroupSelection(TableViewer tableViewer, TreeMap<Integer, List<List<Integer>>> groupSelectionMap){
boolean retVal=false;
List<List<Integer>> grpList = new ArrayList<>();
List<Integer> selectionList = new ArrayList<>();
TableItem[] items = tableViewer.getTable().getItems();
for (TableItem tableItem : items) {
Button button = (Button) tableItem.getData(GROUP_CHECKBOX);
if(button.getSelection()){
selectionList.add(tableViewer.getTable().indexOf(tableItem));
}
}
if (groupSelectionMap.isEmpty()) {
grpList.add(selectionList);
groupSelectionMap.put(0, grpList);
retVal=true;
} else {
if (FilterHelper.INSTANCE.validateUserGroupSelection(groupSelectionMap, selectionList)) {
if(FilterHelper.INSTANCE.isColumnModifiable(groupSelectionMap, selectionList)){
retVal=true;
}else{
grpList.add(selectionList);
Map<Integer, List<List<Integer>>> tempMap = new TreeMap<>();
tempMap.putAll(groupSelectionMap);
groupSelectionMap.clear();
groupSelectionMap.put(0, grpList);
for (int i = 0; i < tempMap.size(); i++) {
groupSelectionMap.put(i + 1, tempMap.get(i));
}
retVal=true;
FilterHelper.INSTANCE.rearrangeGroups(groupSelectionMap, selectionList);
}
}
}
return retVal;
}
示例7: isJmxEnabled
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
public boolean isJmxEnabled() {
Button enableCheckBox = (Button) getGridComposite().getControl(CONTROL_NAME_ENABLED_BUTTON);
return enableCheckBox.getSelection();
}
示例8: updateStatus
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
protected GridCompositeStatus updateStatus(Object source) {
GridCompositeStatus status = super.updateStatus(source);
if (status.getType().isError()) {
return status;
}
String message;
if (source instanceof GridTextInput) {
GridTextInput gridTextInput = (GridTextInput) source;
if (gridTextInput.getName().equals(CONTROL_NAME_PATH_TEXT)) {
Text pathText = gridTextInput.getText();
String relativePath = pathText.getText();
if (relativePath.indexOf(Znode.PATH_SEPARATOR_CHAR) >= 0) {
message = CONTROL_NAME_PATH_TEXT + " should not contain the '" + Znode.PATH_SEPARATOR_CHAR
+ "' character.";
return new GridCompositeStatus(CONTROL_NAME_PATH_TEXT, message,
GridCompositeStatus.Type.ERROR_INVALID);
}
// TODO: Validate characters in the text (spaces etc)?
ZnodeModel parentZnodeModel = getParentZnodeModel();
Znode parentZnode = parentZnodeModel.getData();
String parentPath = parentZnode.getPath();
String absolutePath = Znode.getAbsolutePath(parentPath, relativePath);
Button sequentialCheckbox = (Button) getControl(CONTROL_NAME_CREATE_MODE_SEQUENTIAL_BUTTON);
boolean isSequential = sequentialCheckbox.getSelection();
if (!isSequential) {
// Use the DataModelManager for a hash look-up (avoid possibly long child string list scan).
if (parentZnodeModel.getManager().findKeys(parentZnode).contains(absolutePath)) {
// TODO: Should this take the sequential flag into account (i think yes).
message = "Znode '" + absolutePath + "' already exists.";
return new GridCompositeStatus(CONTROL_NAME_PATH_TEXT, message,
GridCompositeStatus.Type.ERROR_INVALID);
}
}
try {
Znode.validatePath(absolutePath, isSequential);
}
catch (IllegalArgumentException e) {
message = e.getMessage();
return new GridCompositeStatus(CONTROL_NAME_PATH_TEXT, message,
GridCompositeStatus.Type.ERROR_INVALID);
}
}
}
return GridCompositeStatus.OK_STATUS;
}
示例9: showErrorIfOperationClassOrExpressionBlankOrOperationIDDuplicate
import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private Set<String> showErrorIfOperationClassOrExpressionBlankOrOperationIDDuplicate()
{
Set<String> setToCheckDuplicates = new HashSet<String>();
Button isParam = null;
Text idTextBox=null;
for(ExpandItem item:expandBar.getItems() )
{
if(item.getControl() !=null && item.getControl().getClass()==OperationClassComposite.class)
{
Text operationClassTextBox=((OperationClassComposite)item.getControl()).getOperationTextBox();
isParam=((OperationClassComposite)item.getControl()).getBtnIsParam();
idTextBox=((OperationClassComposite)item.getControl()).getOperationIdTextBox();
MappingSheetRow mappingSheetRow=
(MappingSheetRow)((OperationClassComposite)item.getControl()).getBrowseButton().getData(Messages.MAPPING_SHEET);
if(operationClassTextBox!=null)
{
if(StringUtils.isBlank(operationClassTextBox.getText()) && !isParam.getSelection())
{
intializeErrorLabelObject(idTextBox,"Operation Class must not be blank for");
}
else if(!isParam.getSelection()
&&!mappingSheetRow.isClassParameter()
&& !(ValidatorUtility.INSTANCE.isClassFilePresentOnBuildPath(operationClassTextBox.getText()))
)
{
intializeErrorLabelObject(idTextBox,"Java class is not present on build path of current project for");
}
}
}
if(item.getControl() instanceof AbstractExpressionComposite)
{
Text expressionTextBox=((AbstractExpressionComposite)item.getControl()).getExressionTextBox();
Text expressionTextBox2=((AbstractExpressionComposite)item.getControl()).getExressionTextBox2();
Text outputFieldTextBox=((AbstractExpressionComposite)item.getControl()).getOutputFieldTextBox();
idTextBox=((AbstractExpressionComposite)item.getControl()).getExpressionIdTextBox();
isParam=((AbstractExpressionComposite)item.getControl()).getIsParamButton();
if(expressionTextBox!=null)
{
if(StringUtils.isBlank(expressionTextBox.getText()) && !isParam.getSelection())
{
intializeErrorLabelObject(idTextBox,"Expression must not be blank for");
}
}
if(expressionTextBox2!=null)
{
if(StringUtils.isBlank(expressionTextBox2.getText()) && !isParam.getSelection())
{
intializeErrorLabelObject(idTextBox,"MergeExpression must not be blank for");
}
}
if(outputFieldTextBox!=null)
{
if(StringUtils.isBlank(outputFieldTextBox.getText()) && !isParam.getSelection())
{
intializeErrorLabelObject(idTextBox,"Output Field must not be blank for");
}
}
}
if(!setToCheckDuplicates.add(idTextBox.getText())&&!isParam.getSelection())
{
intializeErrorLabelObject(idTextBox,"Duplicate Operation Id");
}
}
return setToCheckDuplicates;
}