當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。