本文整理汇总了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);
}
}
示例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;
}
}
});
*/
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
}
示例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;
}
}
}
示例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);
}
}
}
示例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();
}
示例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);
}
}
示例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);
}
}
示例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 ));
}
}