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


Java Button.setData方法代码示例

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


在下文中一共展示了Button.setData方法的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: createParentControls

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
protected void createParentControls(Composite composite) {
	Label label = new Label(composite, SWT.WRAP);
       label.setText("Preference scope:");
       Composite group = new Composite(composite, SWT.NONE);
       group.setLayout(new RowLayout());
       for (int i = 0; i < SCOPE_LABELS.length; i++) {
		Button btn = new Button(group, SWT.RADIO);
		btn.setText(SCOPE_LABELS[i]);
		btn.setData(SCOPE_VALUES[i]);
		if (SCOPE_VALUES[i].equals(scope) || (scope.isEmpty() && i == 0)) {
			btn.setSelection(true);
		}
		scopeRadios[i] = btn;
	}
	super.createParentControls(composite);
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:18,代码来源:NewPlatformPreferenceDialog.java

示例3: addButtonInTable

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void addButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName, 
		String buttonPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener,
		ImagePathConstant imagePath) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final Button button = new Button(buttonPane, SWT.NONE);
	//button.setText(columnName);
	button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	tableItem.setData(columnName, button);
	tableItem.setData(buttonPaneName, buttonPane);
	button.addSelectionListener(buttonSelectionListener);
	button.setImage(imagePath.getImageFromRegistry());
	
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	button.setData(editorName, editor);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:21,代码来源:FilterConditionsDialog.java

示例4: addCheckButtonInTable

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void addCheckButtonInTable(TableViewer tableViewer, TableItem tableItem, String columnName, 
		String groupPaneName, String editorName, int columnIndex, SelectionListener buttonSelectionListener) {
	final Composite buttonPane = new Composite(tableViewer.getTable(), SWT.NONE);
	buttonPane.setLayout(new FillLayout());
	final Button button = new Button(buttonPane, SWT.CHECK);
	button.setData(FilterConstants.ROW_INDEX, tableViewer.getTable().indexOf(tableItem));
	if(null != buttonSelectionListener){
		button.addSelectionListener(buttonSelectionListener);
	}
	tableItem.setData(columnName, button);
	tableItem.setData(groupPaneName, buttonPane);
	
	final TableEditor editor = new TableEditor(tableViewer.getTable());
	editor.grabHorizontal = true;
	editor.grabVertical = true;
	editor.setEditor(buttonPane, tableItem, columnIndex);
	editor.layout();
	button.setData(editorName, editor);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:20,代码来源:FilterConditionsDialog.java

示例5: createAppendMode

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createAppendMode() {
	btnAppendRadioButton = new Button(this, SWT.RADIO);
	btnAppendRadioButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
	btnAppendRadioButton.setText(MessageUtil.getString("append_mode"));
	btnAppendRadioButton.setSelection(true);
	btnAppendRadioButton.addListener(SWT.Selection, new Listener() {
		public void handleEvent(Event e) {
			switch (e.type) {
			case SWT.Selection:
				updateUI();
				break;
			}
		}
	});
	btnAppendRadioButton.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_APPEND_CHECKBOX);

	Composite composite = new Composite(this, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
	composite.setLayout(new GridLayout(12, false));

	lblAppendClassNameLabel = new Label(composite, SWT.NONE);
	lblAppendClassNameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
	lblAppendClassNameLabel.setText("Class name");

	comboAppendClassnameViewer = new AncestorViewer(composite);
	comboAppendClassnameViewer.initialize(GW4E_CONVERSION_COMBO_ANCESTOR_EXTEND_TEST, false);
	comboAppendClassnameViewer.getCombo().setData(GW4E_CONVERSION_WIDGET_ID, GW4E_CONVERSION_COMBO_ANCESTOR_APPEND_TEST);
	Combo combo = comboAppendClassnameViewer.getCombo();
	combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 8, 1));
	combo.setEnabled(true);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:32,代码来源:GeneratorChoiceComposite.java

示例6: createNewMode

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createNewMode() {
	btnCreateNewRadioButton = new Button(this, SWT.RADIO);
	btnCreateNewRadioButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
	btnCreateNewRadioButton.setText(MessageUtil.getString("standalone_mode"));
	btnCreateNewRadioButton.setSelection(false);
	btnCreateNewRadioButton.addListener(SWT.Selection, new Listener() {
		public void handleEvent(Event e) {
			switch (e.type) {
			case SWT.Selection:
				updateUI();
				break;
			}
		}
	});
	btnCreateNewRadioButton.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_NEWCLASS_CHECKBOX);

	Composite composite = new Composite(this, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
	composite.setLayout(new GridLayout(12, false));

	lblNewClassnameLabel = new Label(composite, SWT.NONE);
	lblNewClassnameLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
	lblNewClassnameLabel.setText("Class name");
	lblNewClassnameLabel.setEnabled(false);

	newClassnameText = new Text(composite, SWT.BORDER);
	newClassnameText.setEnabled(false);
	newClassnameText.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent event) {
			listener.handleEvent(null);
		}
	});
	newClassnameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 8, 1));
	newClassnameText.setEnabled(false);
	newClassnameText.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_NEWCLASS_TEXT);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:37,代码来源:GeneratorChoiceComposite.java

示例7: setAllWidgetsOnIsParamButtonForAggregateCumulate

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
 * @param isParam
 */
private void setAllWidgetsOnIsParamButtonForAggregateCumulate(Button isParam) {
	isParam.setData(Messages.COMBODATATYPES, comboDataTypes);
	isParam.setData(Messages.TEXT_ACCUMULATOR, textAccumulator);
	isParam.setData(Messages.ISPARAM_ACCUMULATOR, isParamAccumulator);
	isParam.setData(Constants.EXPRESSION_TEXT_BOX1, expression_text_1);
	isParam.setData(Constants.EXPRESSION_EDITOR_BUTTON1, expressionbutton);
	super.setAllWidgetsOnIsParamButton(isParam);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:12,代码来源:GroupCombineExpressionComposite.java

示例8: setAllWidgetsOnIsParamButtonForAggregateCumulate

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
 * @param isParam
 */
private void setAllWidgetsOnIsParamButtonForAggregateCumulate(Button isParam) {
	isParam.setData(Messages.COMBODATATYPES, comboDataTypes);
	isParam.setData(Messages.TEXT_ACCUMULATOR, textAccumulator);
	isParam.setData(Messages.ISPARAM_ACCUMULATOR, isParamAccumulator);
	super.setAllWidgetsOnIsParamButton(isParam);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:10,代码来源:AggregateCumulateExpressionComposite.java

示例9: setAllWidgetsOnIsParamButton

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void setAllWidgetsOnIsParamButton(Button isParam) {
	isParam.setData(PARAMETER_TEXT_BOX, parameterTextBox);
	isParam.setData(OPERATION_CLASS_TEXT_BOX, operationTextBox);
	isParam.setData(OPERATION_ID_TEXT_BOX, operationIdTextBox);
	isParam.setData(OPERATION_INPUT_FIELD_TABLE_VIEWER, inputTableViewer);
	isParam.setData(OPERATION_OUTPUT_FIELD_TABLE_VIEWER, outputTableViewer);
	isParam.setData(INPUT_ADD_BUTTON, addButtonInputTable);
	isParam.setData(INPUT_DELETE_BUTTON, deletButtonInputTable);
	isParam.setData(OUTPUT_ADD_BUTTON, addButtonOutputTable);
	isParam.setData(OUTPUT_DELETE_BUTTON, deletButtonOutputTable);
	isParam.setData(BTN_NEW_BUTTON,browseButton);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:13,代码来源:OperationClassComposite.java

示例10: setAllWidgetsOnIsParamButton

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
* @param isParam
*/
protected void setAllWidgetsOnIsParamButton(Button isParam) {
	isParam.setData(Constants.INPUT_FIELD_TABLE, tableViewer);
	isParam.setData(Constants.ADD_BUTTON, addButton);
	isParam.setData(Constants.DELETE_BUTTON, deletButton);
	isParam.setData(Constants.EXPRESSION_ID_TEXT_BOX, expressionIdTextBox);
	isParam.setData(Constants.EXPRESSION_EDITOR_BUTTON, browseButton);
	isParam.setData(Constants.OUTPUT_FIELD_TEXT_BOX, outputFieldTextBox);
	isParam.setData(Constants.PARAMETER_TEXT_BOX, parameterTextBox);
	isParam.setData(Constants.EXPRESSION_TEXT_BOX, expressionTextBox);
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:15,代码来源:AbstractExpressionComposite.java

示例11: createExtendMode

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
private void createExtendMode() {
	btnExtendRadioButton = new Button(this, SWT.RADIO);
	btnExtendRadioButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
	btnExtendRadioButton.setText(MessageUtil.getString("extending_class"));
	btnExtendRadioButton.setSelection(false);
	btnExtendRadioButton.addListener(SWT.Selection, new Listener() {
		public void handleEvent(Event e) {
			switch (e.type) {
			case SWT.Selection:
				updateUI();
				break;
			}
		}
	});
	btnExtendRadioButton.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_EXTEND_CHECKBOX);

	Composite composite = new Composite(this, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 12, 1));
	composite.setLayout(new GridLayout(12, false));

	lblExtendedLabel = new Label(composite, SWT.NONE);
	lblExtendedLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
	lblExtendedLabel.setText(MessageUtil.getString("class_extended"));
	lblExtendedLabel.setEnabled(false);

	comboExtendedClassnameViewer = new AncestorViewer(composite);
	comboExtendedClassnameViewer.initialize(GW4E_CONVERSION_COMBO_ANCESTOR_EXTEND_TEST, false);
	comboExtendedClassnameViewer.getCombo().setData(GW4E_CONVERSION_WIDGET_ID, GW4E_CONVERSION_COMBO_ANCESTOR_EXTEND_TEST);
	
	Combo combo = comboExtendedClassnameViewer.getCombo();
	combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 8, 1));
	combo.setEnabled(false);

	lblExtendingLabel = new Label(composite, SWT.NONE);
	lblExtendingLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
	lblExtendingLabel.setText(MessageUtil.getString("classname"));
	lblExtendingLabel.setEnabled(false);

	extendingClassnameText = new Text(composite, SWT.BORDER);
	extendingClassnameText.setEnabled(false);
	extendingClassnameText.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent event) {
			listener.handleEvent(null);
		}
	});
	extendingClassnameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 8, 1));
	extendingClassnameText.setEnabled(false);
	extendingClassnameText.setData(GW4E_CONVERSION_WIDGET_ID, GW4E_EXTEND_CLASS_TEXT);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:50,代码来源:GeneratorChoiceComposite.java


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