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


Java CoolItem.setMinimumSize方法代码示例

本文整理汇总了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);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:28,代码来源:HTMLEditor.java

示例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();
}
 
开发者ID:evilwan,项目名称:raptor-chess-interface,代码行数:14,代码来源:ChessBoardUtils.java

示例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);
}
 
开发者ID:jakepoz,项目名称:RepDev,代码行数:12,代码来源:MainShell.java

示例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);
}
 
开发者ID:Totallicks,项目名称:totallicks-tuxguitar,代码行数:8,代码来源:ItemManager.java


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