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