本文整理汇总了Java中org.eclipse.swt.widgets.CoolItem.setMinimumSize方法的典型用法代码示例。如果您正苦于以下问题:Java CoolItem.setMinimumSize方法的具体用法?Java CoolItem.setMinimumSize怎么用?Java CoolItem.setMinimumSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.CoolItem
的用法示例。
在下文中一共展示了CoolItem.setMinimumSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCoolItem
import org.eclipse.swt.widgets.CoolItem; //导入方法依赖的package包/类
private void createCoolItem(final CoolBar coolBar, final ToolBar toolBar) {
Check.notNull(coolBar, "coolBar"); //$NON-NLS-1$
Check.notNull(toolBar, "toolBar"); //$NON-NLS-1$
// Compute the size of the toolbar
toolBar.pack();
final Point toolBarSize = toolBar.getSize();
// Create a CoolItem to hold the toolbar
final CoolItem coolItem = new CoolItem(coolBar, SWT.NONE);
coolItem.setControl(toolBar);
// Set the preferred size to what was computed from the toolbar
final Point coolItemSize = coolItem.computeSize(toolBarSize.x, toolBarSize.y);
/*
* SWT Quirk (Bug?)
*
* The cool item should have its PREFERRED size set to the result of its
* OWN computeSize() calculation, but its MINIMUM size should be set to
* its "child" TOOL BAR's computed size. I think it should rightly use
* the same size (its OWN computed size) for minimum size, but this
* leaves way too much empty space in the right side of the toolbar.
*/
coolItem.setPreferredSize(coolItemSize);
coolItem.setMinimumSize(toolBarSize);
}
示例2: adjustCoolbar
import org.eclipse.swt.widgets.CoolItem; //导入方法依赖的package包/类
public static void adjustCoolbar(ChessBoard board, ToolBar toolbar) {
clearCoolbar(board);
toolbar.pack();
Point size = toolbar.getSize();
board.getCoolbar().setVisible(true);
board.getCoolbar().setLocked(true);
CoolItem coolItem = new CoolItem(board.getCoolbar(), SWT.NONE);
coolItem.setControl(toolbar);
coolItem.setSize(size.x, size.y);
coolItem.setPreferredSize(size.x, size.y);
coolItem.setMinimumSize(size);
board.getControl().layout();
}
示例3: addBar
import org.eclipse.swt.widgets.CoolItem; //导入方法依赖的package包/类
/**
* Add a toolbar to the coolBar (sorry, but no pun intended.)
*/
public void addBar(ToolBar b) {
CoolItem item = new CoolItem(coolBar, SWT.NONE);
item.setControl(b);
Point size = b.computeSize(SWT.DEFAULT, SWT.DEFAULT);
item.setMinimumSize(size);
coolItems.add(item);
}
示例4: makeCoolItem
import org.eclipse.swt.widgets.CoolItem; //导入方法依赖的package包/类
private void makeCoolItem(ToolBar toolBar){
Point size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
CoolItem coolItem = new CoolItem(this.coolBar, SWT.NONE);
coolItem.setMinimumSize(size);
coolItem.setPreferredSize(coolItem.computeSize(size.x, size.y));
coolItem.setControl(toolBar);
}