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


Java Button.getSelection方法代码示例

本文整理汇总了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;
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:18,代码来源:ZnodeAclComposite.java

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

示例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;
	      }
	    }
	  });
	*/
}
 
开发者ID:sergueik,项目名称:SWET,代码行数:27,代码来源:ComplexFormEx.java

示例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();
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:11,代码来源:NewPlatformPreferenceDialog.java

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

	}

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

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

示例7: isJmxEnabled

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
public boolean isJmxEnabled() {
    Button enableCheckBox = (Button) getGridComposite().getControl(CONTROL_NAME_ENABLED_BUTTON);
    return enableCheckBox.getSelection();
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:5,代码来源:ZooKeeperServerNewWizardPage2.java

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

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


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