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