當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。