本文整理汇总了Java中org.eclipse.swt.widgets.CoolItem.setSize方法的典型用法代码示例。如果您正苦于以下问题:Java CoolItem.setSize方法的具体用法?Java CoolItem.setSize怎么用?Java CoolItem.setSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.CoolItem
的用法示例。
在下文中一共展示了CoolItem.setSize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContents
import org.eclipse.swt.widgets.CoolItem; //导入方法依赖的package包/类
protected Control createContents(Composite parent) {
// --- Create the window title. ---
getShell().setText("CoolBar Test");
String asCoolItemSection[] = { "File", "Formatting", "Search" };
CoolBar composite = new CoolBar(parent, SWT.NONE);
for (int idxCoolItem = 0; idxCoolItem < 3; ++idxCoolItem) {
CoolItem item = new CoolItem(composite, SWT.NONE);
ToolBar tb = new ToolBar(composite, SWT.FLAT);
for (int idxItem = 0; idxItem < 3; ++idxItem) {
ToolItem ti = new ToolItem(tb, SWT.NONE);
ti
.setText(asCoolItemSection[idxCoolItem] + " Item #"
+ idxItem);
}
Point p = tb.computeSize(SWT.DEFAULT, SWT.DEFAULT);
tb.setSize(p);
Point p2 = item.computeSize(p.x, p.y);
item.setControl(tb);
item.setSize(p2);
}
return composite;
}
示例2: createToolBar
import org.eclipse.swt.widgets.CoolItem; //导入方法依赖的package包/类
public void createToolBar() {
Composite compCoolBar = new Composite(shell, SWT.BORDER);
compCoolBar.setLayout(new FillLayout());
CoolBar coolBarSort = new CoolBar(compCoolBar, SWT.NONE);
CoolItem coolItemSort = new CoolItem(coolBarSort, SWT.NONE);
Combo prjCombo = new Combo(coolBarSort, SWT.READ_ONLY);
prjCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
prjCombo.setItems(new String[] { "显示所有用例", "只显示成功的用例", "只显示失败的用例" });
prjCombo.select(0);
Point p = prjCombo.computeSize(SWT.DEFAULT, SWT.DEFAULT);
prjCombo.setSize(p);
Point p2 = coolItemSort.computeSize(p.x, p.y);
coolItemSort.setSize(p2);
coolItemSort.setControl(prjCombo);
coolBarSort.pack();
}
示例3: createDialogArea
import org.eclipse.swt.widgets.CoolItem; //导入方法依赖的package包/类
/**
* Create contents of the dialog.
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
container.setLayout(new GridLayout(1, false));
Shell shell=container.getShell();
shell.setText("View Transform");
shell.setImage(ImagePathConstant.APP_ICON.getImageFromRegistry());
CoolBar coolBar = new CoolBar(container, SWT.FLAT);
coolBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
CoolItem buttonItem = new CoolItem(coolBar, SWT.NONE | SWT.DROP_DOWN);
Composite buttonComposite = new Composite(coolBar, SWT.NONE);
buttonComposite.setLayout(new GridLayout(3, false));
createWrapButton(buttonComposite);
createCopyButton(buttonComposite);
buttonComposite.pack();
Point size = buttonComposite.getSize();
buttonItem.setControl(buttonComposite);
buttonItem.setSize(buttonItem.computeSize(size.x, size.y));
createStyleTextEditor(container);
getShell().setMinimumSize(290,290);
return container;
}
示例4: 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();
}
示例5: createStatusBar
import org.eclipse.swt.widgets.CoolItem; //导入方法依赖的package包/类
private void createStatusBar() {
coolBar1 = new CoolBar(shell, SWT.NONE);
FormData formData1 = new FormData();
formData1.left = new FormAttachment(0, 0);
formData1.right = new FormAttachment(100, 0);
formData1.top = new FormAttachment(100, -24);
formData1.bottom = new FormAttachment(100, 0);
coolBar1.setLayoutData(formData1);
CoolItem coolItem1 = new CoolItem(coolBar1, SWT.NONE);
toolBar1 = new ToolBar(coolBar1, SWT.NONE);
ToolItem tiStatusBarTotal = new ToolItem(toolBar1, SWT.NONE);
ToolItem tiStatusBarPass = new ToolItem(toolBar1, SWT.NONE);
ToolItem tiStatusBarFail = new ToolItem(toolBar1, SWT.NONE);
ToolItem tiStatusBarRate = new ToolItem(toolBar1, SWT.NONE);
tiStatusBarPass.setText("通过:0");
tiStatusBarFail.setText("失败:0");
tiStatusBarRate.setText("通过率:0%");
tiStatusBarTotal.setText("总用例数:0");
coolItem1.setControl(toolBar1);
Control control = coolItem1.getControl();
Point pt = control.computeSize(SWT.DEFAULT, SWT.DEFAULT);
pt = coolItem1.computeSize(pt.x, pt.y);
coolItem1.setSize(pt);
coolBar1.pack();
}
示例6: addFeatures
import org.eclipse.swt.widgets.CoolItem; //导入方法依赖的package包/类
@Override
public void addFeatures() {
setWeights(new int[] { 25, 75 });
isoTreeCLabel.setText("Iso explorer");
isoTreeCLabel.setImage(ImageUtils.getInstance().loadImage("iso.png"));
CoolBarManager coolbar = new CoolBarManager(isoTableCoolBar);
ToolBarManager toolbar = new ToolBarManager(SWT.WRAP | SWT.FLAT);
toolbar.add(OpenIsoEntryAction.getInstance());
toolbar.add(GoToIsoEntryParentAction.getInstance());
toolbar.add(ShowIsoInformationAction.getInstance());
toolbar.add(DeleteIsoEntryAction.getInstance());
coolbar.add(toolbar);
coolbar.update(true);
CoolItem coolItem = new CoolItem(isoTableCoolBar, SWT.WRAP | SWT.FLAT);
isoTableText = new Text(isoTableCoolBar, SWT.READ_ONLY | SWT.SINGLE | SWT.BORDER);
isoTableText.pack();
coolItem.setSize(isoTableText.getSize());
coolItem.setControl(isoTableText);
List<String> columnNames = new ArrayList<String>();
{
columnNames.add("Name");
columnNames.add("Size");
columnNames.add("Type");
columnNames.add("Last Modified Date");
}
List<String> tooltips = new ArrayList<String>();
{
tooltips.add("Name");
tooltips.add("Size");
tooltips.add("Type");
tooltips.add("Last Modified Date");
}
Iterator<String> it = tooltips.iterator();
for (String columnName : columnNames) {
TableColumn tvc = new TableColumn(isoDirectoriesTable.getTable(), SWT.LEFT);
tvc.setText(columnName);
tvc.setToolTipText(it.next());
tvc.setWidth(200);
tvc.setMoveable(true);
tvc.setResizable(true);
}
isoDirectoriesTable.getTable().setHeaderVisible(true);
isoDirectoriesTree.setContentProvider(new IsoTreeContentProvider());
isoDirectoriesTree.setLabelProvider(new IsoTreeLabelProvider());
isoDirectoriesTree.addFilter(new ShowOnlyIsoDirectoriesFilter());
isoDirectoriesTree.setSorter(new SortByIsoEntryFirstSorter());
isoDirectoriesTable.setContentProvider(new IsoTableProvider());
isoDirectoriesTable.setLabelProvider(new IsoTableProvider());
isoDirectoriesTable.setSorter(new SortByIsoEntryFirstSorter());
GridDataFactory.defaultsFor(isoTreeCLabel).grab(true, false).applyTo(isoTreeCLabel);
GridDataFactory.defaultsFor(isoDirectoriesTree.getControl()).grab(true, true)
.applyTo(isoDirectoriesTree.getControl());
GridLayoutFactory.fillDefaults().generateLayout(composites.get(0));
GridDataFactory.defaultsFor(isoTableCoolBar).grab(true, false).applyTo(isoTableCoolBar);
GridDataFactory.defaultsFor(isoDirectoriesTable.getControl()).grab(true, true)
.applyTo(isoDirectoriesTable.getControl());
GridLayoutFactory.fillDefaults().generateLayout(composites.get(1));
}
示例7: addFeatures
import org.eclipse.swt.widgets.CoolItem; //导入方法依赖的package包/类
@Override
public void addFeatures() {
setWeights(new int[] { 25, 75 });
osTreeCLabel.setText("File explorer");
osTreeCLabel.setImage(ImageUtils.getInstance().loadImage("drive.png"));
CoolBarManager coolbar = new CoolBarManager(osTableCoolBar);
ToolBarManager toolbar = new ToolBarManager(SWT.WRAP | SWT.FLAT);
toolbar.add(OpenAction.getInstance());
toolbar.add(GoToParentAction.getInstance());
toolbar.add(RefreshExplorerAction.getInstance());
toolbar.add(AddFileAction.getInstance());
toolbar.add(ShowHiddenFilesAction.getInstance());
coolbar.add(toolbar);
coolbar.update(true);
CoolItem coolItem = new CoolItem(osTableCoolBar, SWT.WRAP | SWT.FLAT);
osTableText = new Text(osTableCoolBar, SWT.READ_ONLY | SWT.SINGLE | SWT.BORDER);
osTableText.pack();
coolItem.setSize(osTableText.getSize());
coolItem.setControl(osTableText);
List<String> tooltips = new ArrayList<String>();
{
tooltips.add("File name");
tooltips.add("File size, in bytes");
tooltips.add("File type");
tooltips.add("File kast modified date");
}
List<String> columnNames = new ArrayList<String>();
{
columnNames.add("Name");
columnNames.add("Size");
columnNames.add("Type");
columnNames.add("Last Modified Date");
}
Iterator<String> it = tooltips.iterator();
for (String columnName : columnNames) {
TableColumn tvc = new TableColumn(osDirectoriesTable.getTable(), SWT.LEFT);
tvc.setText(columnName);
tvc.setToolTipText(it.next());
tvc.setWidth(200);
tvc.setMoveable(true);
tvc.setResizable(true);
}
osDirectoriesTable.getTable().setHeaderVisible(true);
osDirectoriesTree.setContentProvider(new OSTreeContentProvider());
osDirectoriesTree.setLabelProvider(new OSTreeLabelProvider());
osDirectoriesTree.addFilter(new ShowOnlyDirectoriesFilter());
osDirectoriesTree.addFilter(new HideHiddenFilesFilter());
osDirectoriesTree.setSorter(new SortByDirectoriesFirstSorter());
osDirectoriesTree.setInput(OSExplorer.getInstance());
osDirectoriesTable.setContentProvider(new OsTableProvider());
osDirectoriesTable.setLabelProvider(new OsTableProvider());
osDirectoriesTable.addFilter(new HideHiddenFilesFilter());
osDirectoriesTable.setSorter(new SortByDirectoriesFirstSorter());
GridDataFactory.defaultsFor(osTreeCLabel).grab(true, false).applyTo(osTreeCLabel);
GridDataFactory.defaultsFor(osDirectoriesTree.getControl()).grab(true, true)
.applyTo(osDirectoriesTree.getControl());
GridLayoutFactory.fillDefaults().generateLayout(composites.get(0));
GridDataFactory.defaultsFor(osTableCoolBar).grab(true, false).applyTo(osTableCoolBar);
GridDataFactory.defaultsFor(osDirectoriesTable.getControl()).grab(true, true)
.applyTo(osDirectoriesTable.getControl());
GridLayoutFactory.fillDefaults().generateLayout(composites.get(1));
}