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


Java Button.getData方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Button.getData方法的典型用法代码示例。如果您正苦于以下问题:Java Button.getData方法的具体用法?Java Button.getData怎么用?Java Button.getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Button的用法示例。


在下文中一共展示了Button.getData方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: enableButton

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected void enableButton(Button button, boolean enable) {
	Boolean b = Boolean.valueOf(enable);
	if (button.getData("enable") == null || !button.getData("enable").equals(b)) {
		String imageURL = "" + button.getData("image_url");
		String tooltip = "" + button.getData("tooltip");
		if (!enable) {
			if (button.getData("disable_msg") != null) {
				tooltip += " (To enable button, " + button.getData("disable_msg") + ")";
			}
			int index = imageURL.lastIndexOf('.');
			imageURL = imageURL.substring(0, index) + ".d" + imageURL.substring(index);
		}
		button.setImage(new Image(Display.getCurrent(), getClass().getResourceAsStream(imageURL)));
		button.setToolTipText(tooltip);
		button.setData("enable", b);
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:18,代码来源:XpathEvaluatorComposite.java

示例2: 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

示例3: 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

示例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: doSetValue

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
protected void doSetValue(Object value) {
	this.msst = ((MobileSmartSourceType) value).clone();
	Mode mode = this.msst.getMode();
	
	comboBox.setText(this.msst.getValue());
	
	for (Button button : buttons) {
		if (button.getData(DataKeys.SMART_TYPE.name()) == mode) {
			button.notifyListeners(SWT.Selection, null);
			break;
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:15,代码来源:MobileSmartSourceTypeCellEditor.java

示例6: doSetValue

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
protected void doSetValue(Object value) {
	this.value = ((SmartType) value).clone();
	Mode mode = this.value.getMode();
	
	for (Button button : buttons) {
		if (button.getData(DataKeys.SMART_TYPE.name()) == mode) {
			button.notifyListeners(SWT.Selection, null);
			break;
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:13,代码来源:SmartTypeCellEditor.java

示例7: refreshButtonsEnable

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
protected void refreshButtonsEnable() {
	for (Button button : buttonsMap.values()) {
		if (button != null && !button.isDisposed()) {
			boolean enable = true;
			String name = (String) button.getData("name");
			if (name.equals("anchor")) {
				enable = (lastEval != null || currentAnchor != null) && !isAnchorDisabled;
			} else if (name.equals("calcxpath")) {
				enable = lastEval == null && xpath.getText().length() > 0;
			} else if (name.equals("forward")) {
				enable = currentHistory != 0;
			} else if (name.equals("backward")) {
				int size = xpathHistory.size();
				enable = size != 0 && currentHistory != (size - 1);
			} else {
				enable = isButtonEnabled(name);
			}
			
			if (enable &&(name.equals("anchor"))) {
				Node root = nodesResult.getDocument().getFirstChild();
				enable = root.getChildNodes().getLength() != 0 ?
					true
					: root.getAttributes().getLength() != 0;
			}
			
			enableButton(button, enable);
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:30,代码来源:XpathEvaluatorComposite.java

示例8: 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

示例9: 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

示例10: disabledWidgetsifWholeOperationIsParameter

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void disabledWidgetsifWholeOperationIsParameter(Button isParam,boolean isWholeOperationParameter) 
{
	if (isWholeOperationParameter) {
		Button text = (Button) isParam;
		Text parameterTextBox = (Text) text.getData(PARAMETER_TEXT_BOX);
		TableViewer operationInputFieldTableViewer = (TableViewer) text.getData(OPERATION_INPUT_FIELD_TABLE_VIEWER);
		TableViewer operationalOutputFieldTableViewer = (TableViewer) text.getData(OPERATION_OUTPUT_FIELD_TABLE_VIEWER);
		Text operationClassTextBox = (Text) text.getData(OPERATION_CLASS_TEXT_BOX);
		Text operationIDTextBox = (Text) text.getData(OPERATION_ID_TEXT_BOX);
		Button btnNewButton = (Button) text.getData(BTN_NEW_BUTTON);
		Button inputAdd = (Button) text.getData(INPUT_ADD_BUTTON);

		Button inputDelete = (Button) text.getData(INPUT_DELETE_BUTTON);
		Button outputAdd = (Button) text.getData(OUTPUT_ADD_BUTTON);
		Button outputDelete = (Button) text.getData(OUTPUT_DELETE_BUTTON);
		parameterTextBox.setEnabled(true);

		operationInputFieldTableViewer.getTable().setEnabled(false);

		operationalOutputFieldTableViewer.getTable().setEnabled(false);
		operationClassTextBox.setEnabled(false);

		operationIDTextBox.setEnabled(false);

		btnNewButton.setEnabled(false);
		inputAdd.setEnabled(false);
		inputDelete.setEnabled(false);

		outputAdd.setEnabled(false);
		outputDelete.setEnabled(false);

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

示例11: selectButtonGroup

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void
selectButtonGroup(
	List<Button>		buttons,
	String				data )
{
	for ( Button b: buttons ){

		String str = (String)b.getData();

		b.setSelection( str != null && str.endsWith( data ));
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:13,代码来源:BuddyPluginView.java


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