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


Java Composite.pack方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Composite.pack方法的典型用法代码示例。如果您正苦于以下问题:Java Composite.pack方法的具体用法?Java Composite.pack怎么用?Java Composite.pack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Composite的用法示例。


在下文中一共展示了Composite.pack方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createViewerToolTipContentArea

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
@Override
protected Composite createViewerToolTipContentArea(Event event, ViewerCell cell, Composite parent) {
    final Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));
    composite.setBackground(rowColorBack);
    Plugin plugin = (Plugin) cell.getElement();

    Hyperlink button = new Hyperlink(composite, SWT.FLAT);
    button.setText("\uf05A");
    button.setFont(fontAwesome);
    button.setBackground(composite.getBackground());
    button.setForeground(rowColorTitle);
    button.setUnderlined(false);
    button.addListener (SWT.MouseDown, e -> Program.launch(GLUON_PLUGIN_URL + plugin.getUrl()));
    button.setToolTipText("Click to access the service's JavaDoc");

    Label text = new Label(composite, SWT.LEFT);
    final String description = plugin.getDescription();
    text.setText(description.contains(".") ? description.substring(0, description.indexOf(".")) : description);
    text.setBackground(composite.getBackground());
    text.setForeground(rowColorTitle);
    composite.pack();
    return composite;
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:25,代码来源:PluginsSWT.java

示例2: DiskInfoTab

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
/**
 * Create the DISK INFO tab.
 */
public DiskInfoTab(CTabFolder tabFolder, FormattedDisk[] disks) {
	this.formattedDisks = disks;
	
	CTabItem ctabitem = new CTabItem(tabFolder, SWT.NULL);
	ctabitem.setText(textBundle.get("DiskInfoTab.Title")); //$NON-NLS-1$
	
	tabFolder.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent event) {
			getInfoTable().removeAll();
			buildDiskInfoTable(getFormattedDisk(0));	// FIXME!
		}
	});
	
	ScrolledComposite scrolledComposite = new ScrolledComposite(
		tabFolder, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	scrolledComposite.setExpandHorizontal(true);
	scrolledComposite.setExpandVertical(true);
	ctabitem.setControl(scrolledComposite);
	
	composite = new Composite(scrolledComposite, SWT.NONE);
	createDiskInfoTable();
	if (disks.length > 1) {
		RowLayout layout = new RowLayout(SWT.VERTICAL);
		layout.wrap = false;
		composite.setLayout(layout);
		for (int i=0; i<disks.length; i++) {
			Label label = new Label(composite, SWT.NULL);
			label.setText(disks[i].getDiskName());
			buildDiskInfoTable(disks[i]);
		}
	} else {
		composite.setLayout(new FillLayout());
		buildDiskInfoTable(disks[0]);
	}
	composite.pack();
	scrolledComposite.setContent(composite);
	scrolledComposite.setMinSize(
		composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:43,代码来源:DiskInfoTab.java

示例3: createDialogArea

import org.eclipse.swt.widgets.Composite; //导入方法依赖的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;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:37,代码来源:TransformViewDataDialog.java

示例4: open

import org.eclipse.swt.widgets.Composite; //导入方法依赖的package包/类
/**
 * Create and display the wizard pane.
 */
public void open() {
	control = new Composite(parent, SWT.NULL);
	wizard.enableNextButton(true);
	wizard.enableFinishButton(false);
	RowLayout layout = new RowLayout(SWT.VERTICAL);
	layout.justify = true;
	layout.marginBottom = 5;
	layout.marginLeft = 5;
	layout.marginRight = 5;
	layout.marginTop = 5;
	layout.spacing = 3;
	control.setLayout(layout);
	Label label = new Label(control, SWT.WRAP);
	label.setText(
		textBundle.get("DiskImageFormatPrompt")); //$NON-NLS-1$
	RowLayout subpanelLayout = new RowLayout(SWT.VERTICAL);
	subpanelLayout.justify = true;
	subpanelLayout.spacing = 3;
	Composite buttonSubpanel = new Composite(control, SWT.NULL);
	buttonSubpanel.setLayout(subpanelLayout);
	createRadioButton(buttonSubpanel, textBundle.get("Dos"),  //$NON-NLS-1$
		DiskImageWizard.FORMAT_DOS33,
		textBundle.get("DiskImageFormatDosTooltip")); //$NON-NLS-1$
	createRadioButton(buttonSubpanel, textBundle.get("Unidos"),  //$NON-NLS-1$
		DiskImageWizard.FORMAT_UNIDOS,
		textBundle.get("DiskImageFormatUnidosTooltip")); //$NON-NLS-1$
	createRadioButton(buttonSubpanel, textBundle.get("Ozdos"),  //$NON-NLS-1$
		DiskImageWizard.FORMAT_OZDOS, 
		textBundle.get("DiskImageFormatOzdosTooltip")); //$NON-NLS-1$
	createRadioButton(buttonSubpanel, textBundle.get("Prodos"),  //$NON-NLS-1$
		DiskImageWizard.FORMAT_PRODOS, 
		textBundle.get("DiskImageFormatProdosTooltip")); //$NON-NLS-1$
	createRadioButton(buttonSubpanel, textBundle.get("Pascal"),  //$NON-NLS-1$
		DiskImageWizard.FORMAT_PASCAL, 
		textBundle.get("DiskImageFormatPascalTooltip")); //$NON-NLS-1$
	createRadioButton(buttonSubpanel, textBundle.get("Rdos"),  //$NON-NLS-1$
		DiskImageWizard.FORMAT_RDOS, 
		textBundle.get("DiskImageFormatRdosTooltip")); //$NON-NLS-1$
	createRadioButton(buttonSubpanel, textBundle.get("Cpm"),  //$NON-NLS-1$
		DiskImageWizard.FORMAT_CPM, 
		textBundle.get("DiskImageFormatCpmTooltip")); //$NON-NLS-1$
	control.pack();
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:47,代码来源:DiskImageFormatPane.java


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