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


Java PixelConverter.convertHorizontalDLUsToPixels方法代码示例

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


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

示例1: getButtonWidthHint

import org.eclipse.jface.layout.PixelConverter; //导入方法依赖的package包/类
/**
 * A helper method to size the button
 * 
 * @param button
 * @return
 */
public static int getButtonWidthHint(Button button) {
	button.setFont(JFaceResources.getDialogFont());
	PixelConverter converter = new PixelConverter(button);
	int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
	return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:13,代码来源:GW4ELaunchConfigurationTab.java

示例2: getButtonWidthHint

import org.eclipse.jface.layout.PixelConverter; //导入方法依赖的package包/类
/**
 * Returns a width hint for a button control.
 * 
 * @param button
 * @return width
 */
public static int getButtonWidthHint(Button button) {
	/* button.setFont(JFaceResources.getDialogFont()); */
	PixelConverter converter = new PixelConverter(button);
	int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
	return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:13,代码来源:SWTFactory.java

示例3: newPushButton

import org.eclipse.jface.layout.PixelConverter; //导入方法依赖的package包/类
public static Button newPushButton(Composite parent, String label) {
  Button button = new Button(parent, SWT.PUSH);
  button.setText(label);

  PixelConverter converter = new PixelConverter(button);
  int width = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);

  GridData buttonGridData = new GridData(SWT.FILL, SWT.CENTER, false, false);
  buttonGridData.widthHint =
      Math.max(width, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);

  button.setLayoutData(buttonGridData);
  return button;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:15,代码来源:ButtonFactory.java

示例4: getButtonWidthHint

import org.eclipse.jface.layout.PixelConverter; //导入方法依赖的package包/类
/**
 * Returns a width hint for a button control.
 */
public static int getButtonWidthHint(Button button) {
	button.setFont(JFaceResources.getDialogFont());
	PixelConverter converter= new PixelConverter(button);
	int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
	return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:10,代码来源:SWTFactory.java

示例5: getButtonWidthHint

import org.eclipse.jface.layout.PixelConverter; //导入方法依赖的package包/类
/**
 * Returns a width hint for the given button.
 *
 * @param button the button
 * @return the width hint for the button
 */
public static int getButtonWidthHint(Button button) {
	button.setFont(JFaceResources.getDialogFont());
	PixelConverter converter = new PixelConverter(button);
	int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
	return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:13,代码来源:SwtUtil.java

示例6: getButtonWidthHint

import org.eclipse.jface.layout.PixelConverter; //导入方法依赖的package包/类
/**
 * Returns a width hint for a button control.
 */
public static int getButtonWidthHint(Button button) {
	button.setFont(JFaceResources.getDialogFont());
	PixelConverter converter= new PixelConverter(button);
	int widthHint= converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
	return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:10,代码来源:SWTUtil.java

示例7: getButtonWidthHint

import org.eclipse.jface.layout.PixelConverter; //导入方法依赖的package包/类
/**
 * Returns a width hint for a button control.
 */
public static int getButtonWidthHint(Button button)
{
	button.setFont(JFaceResources.getDialogFont());
	PixelConverter converter = new PixelConverter(button);
	int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
	return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:11,代码来源:SelectionButtonDialogField.java

示例8: setButtonLayoutData

import org.eclipse.jface.layout.PixelConverter; //导入方法依赖的package包/类
/**
 * Sets the <code>GridData</code> on the specified button to be one that is spaced for the current dialog page
 * units. The method <code>initializeDialogUnits</code> must be called once before calling this method for the first
 * time.
 * 
 * @param button
 *            the button to set the <code>GridData</code>
 * @return the <code>GridData</code> set on the specified button
 */
protected GridData setButtonLayoutData(Button button)
{
	GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	PixelConverter converter = new PixelConverter(button);
	int widthHint = converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
	Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
	data.widthHint = Math.max(widthHint, minSize.x);
	button.setLayoutData(data);
	return data;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:20,代码来源:AddRemoveList.java

示例9: initUI

import org.eclipse.jface.layout.PixelConverter; //导入方法依赖的package包/类
private void initUI(final Composite parent) {

		_pc = new PixelConverter(parent);

		_checkboxIndent = _pc.convertHorizontalDLUsToPixels(10);

		_defaultSelectionListener = new SelectionAdapter() {
			@Override
			public void widgetSelected(final SelectionEvent e) {
				enableControls();
			}
		};
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:14,代码来源:PrefPageImport.java


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