本文整理汇总了Java中org.eclipse.swt.widgets.Composite.getLayoutData方法的典型用法代码示例。如果您正苦于以下问题:Java Composite.getLayoutData方法的具体用法?Java Composite.getLayoutData怎么用?Java Composite.getLayoutData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Composite
的用法示例。
在下文中一共展示了Composite.getLayoutData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: betterComputeSize
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
protected Point betterComputeSize(Composite c, Point size, int wHint,
int hHint) {
if (c.getChildren().length == 0 && (size.x == 64 || size.y == 64)) {
Object ld = c.getLayoutData();
if (ld instanceof FormData) {
FormData fd = (FormData) ld;
if (fd.width != 0 && fd.height != 0) {
Rectangle trim = c.computeTrim (0, 0, fd.width, fd.height);
return new Point(trim.width, trim.height);
}
}
return new Point(1, 1);
}
if (size.x == 0 || size.y == 0) {
return size;
}
if (minWidth > 0 && size.x < minWidth) {
size.x = minWidth;
}
if (minHeight > 0 && size.y < minHeight) {
size.y = minHeight;
}
return size;
}
示例2: createDialogArea
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(final Composite parent) {
final Object layoutData = parent.getLayoutData();
if (layoutData instanceof GridData) {
((GridData) layoutData).heightHint = DEFAULT_SIZE.x;
((GridData) layoutData).widthHint = DEFAULT_SIZE.y;
}
final Browser browser = new Browser(parent, NONE);
browser.setText(html);
return browser;
}
示例3: createToolTipContentArea
import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
protected Composite createToolTipContentArea(final Event event, final Composite parent) {
final Object layoutData = parent.getLayoutData();
final StyledText text = lastDescriptor.toStyledText(parent, NONE);
if (layoutData instanceof GridData) {
((GridData) layoutData).heightHint = text.getBounds().height;
((GridData) layoutData).widthHint = text.getBounds().width;
}
return parent;
}