當前位置: 首頁>>代碼示例>>Java>>正文


Java Composite.setLayout方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.Composite.setLayout方法的典型用法代碼示例。如果您正苦於以下問題:Java Composite.setLayout方法的具體用法?Java Composite.setLayout怎麽用?Java Composite.setLayout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.Composite的用法示例。


在下文中一共展示了Composite.setLayout方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createPartControl

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@Override
public void createPartControl ( final Composite parent )
{
    parent.setLayout ( new FillLayout () );

    this.wrapper = new Composite ( parent, SWT.NONE );
    this.wrapper.setLayout ( GridLayoutFactory.slimStack () );

    this.shell = parent.getShell ();

    PlatformUI.getWorkbench ().getHelpSystem ().setHelp ( this.wrapper, "org.eclipse.scada.ui.chart.view.chartView" ); //$NON-NLS-1$

    fillMenu ( getViewSite ().getActionBars ().getMenuManager () );
    fillToolbar ( getViewSite ().getActionBars ().getToolBarManager () );

    createChartControl ( parent );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:18,代碼來源:AbstractChartView.java

示例2: createControl

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
public void createControl(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	GridLayout layout = new GridLayout();
	container.setLayout(layout);
	layout.numColumns = numColumns;
	layout.verticalSpacing = 10;
	
	createXPath(container);
	createInfos(container);
	createTable(container);
	//createKTable(container);
	
	fillXMLTableDescription();
	
	setControl(container);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:17,代碼來源:XMLTableWizardPage.java

示例3: createComposite

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
/**
 * This method initializes composite	
 *
 */
private void createComposite() {
	GridData gridData7 = new org.eclipse.swt.layout.GridData();
	gridData7.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
	gridData7.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
	GridData gridData4 = new org.eclipse.swt.layout.GridData();
	gridData4.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
	gridData4.grabExcessHorizontalSpace = false;
	gridData4.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
	GridLayout gridLayout4 = new GridLayout();
	gridLayout4.numColumns = 2;
	compositeOutputFooter = new Composite(compositeOutput, SWT.NONE);
	compositeOutputFooter.setBackground(new Color(Display.getCurrent(), 162, 194, 250));
	compositeOutputFooter.setLayout(gridLayout4);
	compositeOutputFooter.setLayoutData(gridData4);
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:20,代碼來源:SequenceEditorPart.java

示例4: createPartControl

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@Override
public void createPartControl ( final Composite parent )
{
    final GridLayout layout = new GridLayout ( 1, false );
    layout.horizontalSpacing = layout.verticalSpacing = 0;
    layout.marginHeight = layout.marginWidth = 0;

    parent.setLayout ( layout );

    this.stateLabel = new Label ( parent, SWT.NONE );
    this.stateLabel.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false ) );

    final Composite wrapper = new Composite ( parent, SWT.NONE );
    wrapper.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) );

    this.viewer = EventViewHelper.createTableViewer ( wrapper, getViewSite (), this.events );

    hookContextMenu ();
    addSelectionListener ();
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:21,代碼來源:EventQueryView.java

示例5: 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

示例6: createPartControl

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@Override
public void createPartControl(Composite content) {

	content.setLayout(new GridLayout(1, false));
	Util.removeMargins(content);

	this.viewer   = new TableViewer(content, SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
	viewer.setUseHashlookup(true);
	viewer.getTable().setHeaderVisible(true);
	viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

	createColumns();
	viewer.setContentProvider(createContentProvider());

	try {
		queueConnection = service.createSubmitter(getUri(), getSubmissionQueueName());
		queueConnection.setStatusTopicName(getTopicName());
		updateQueue();

		String name = getSecondaryIdAttribute("partName");
		if (name!=null) setPartName(name);

		createActions();

		// We just use this submitter to read the queue
		createTopicListener(getUri());

	} catch (Exception e) {
		logger.error("Cannot listen to topic of command server!", e);
	}

	selectionProvider = new DelegatingSelectionProvider(viewer);
	getViewSite().setSelectionProvider(selectionProvider);
	viewer.addSelectionChangedListener(event -> updateSelected() );
}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:36,代碼來源:StatusQueueView.java

示例7: createDialogArea

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
/**
 * Create contents of the dialog.
 * 
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {

	isAnyUpdatePerformed = false;
    getShell().setText(Constants.PARTITION_KEYS_WINDOW_TITLE);
	
	container = (Composite) super.createDialogArea(parent);
	container.setLayout(new GridLayout(1, false));
	
	SashForm outterSashForm = new SashForm(container, SWT.BORDER);
	outterSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	PartKeyComposite = new Composite(outterSashForm, SWT.NONE);
	addButtonPanel(PartKeyComposite);
	SashForm srcTgtTableSashForm = new SashForm(PartKeyComposite, SWT.NONE);
	srcTgtTableSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	createSourceTable(srcTgtTableSashForm);
	createTargetTable(srcTgtTableSashForm);
	
	partkeyValueComposite = new Composite(outterSashForm, SWT.NONE);
	createKeyValueComposite(partkeyValueComposite);
	
	outterSashForm.setWeights(new int[] {451, 176});
	
	checkTargetFieldsSequence();
	
	getShell().setMinimumSize(400,500);
	return container;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:35,代碼來源:HivePartitionKeyValueDialog.java

示例8: main

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
public static void main(String[] args) {
  // create a shell...
  Display display = new Display();
  Shell shell = new Shell(display);
  shell.setLayout(new FillLayout());
  shell.setText("KTable examples");

  // put a tab folder in it...
  TabFolder tabFolder = new TabFolder(shell, SWT.NONE);

  // Item 1: a Text Table
  TabItem item1 = new TabItem(tabFolder, SWT.NONE);
  item1.setText("Text Table");
  Composite comp1 = new Composite(tabFolder, SWT.NONE);
  item1.setControl(comp1);
  comp1.setLayout(new FillLayout());

  // put a table in tabItem1...
  KTable table = new KTable(comp1, SWT.V_SCROLL | SWT.H_SCROLL);
  table.setRowSelectionMode(true);
  //table.setMultiSelectionMode(true);
  table.setModel(new KTableModelExample());

  // display the shell...
  shell.setSize(600, 600);
  shell.open();
  while (!shell.isDisposed()) {
    if (!display.readAndDispatch())
      display.sleep();
  }
  display.dispose();
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:33,代碼來源:KTable.java

示例9: createPropertiesGroup

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
/**
 * 
 */
protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) {
	Section propertiesSection = widgetFactory.createSection(parent, Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
	propertiesSection.setText(MetamodelMessages.DiracDeltaPropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesSectionData.horizontalSpan = 3;
	propertiesSection.setLayoutData(propertiesSectionData);
	Composite propertiesGroup = widgetFactory.createComposite(propertiesSection);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	propertiesSection.setClient(propertiesGroup);
	return propertiesGroup;
}
 
開發者ID:cetic,項目名稱:SimQRI,代碼行數:17,代碼來源:DiracDeltaPropertiesEditionPartForm.java

示例10: createFigure

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
 * 			createFigure(org.eclipse.swt.widgets.Composite)
 * @generated
 */
public Composite createFigure(final Composite parent) {
	view = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(view);
	return view;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:16,代碼來源:AnalyzedSystemPropertiesEditionPartImpl.java

示例11: createFigure

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 * 
 * @see org.eclipse.emf.eef.runtime.api.parts.ISWTPropertiesEditionPart#
 * 			createFigure(org.eclipse.swt.widgets.Composite)
 * 
 */
public Composite createFigure(final Composite parent) {
	view = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	view.setLayout(layout);
	createControls(view);
	return view;
}
 
開發者ID:cetic,項目名稱:SimQRI,代碼行數:16,代碼來源:GeometricPropertiesEditionPartImpl.java

示例12: createDialogArea

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@Override
protected Control createDialogArea ( final Composite parent )
{
    final Composite composite = (Composite)super.createDialogArea ( parent );
    getShell ().setMinimumSize ( 100, 360 );
    composite.setLayout ( new FillLayout () );
    this.view = new DetailsViewComposite ( composite, SWT.NONE );
    this.view.setDataItem ( this.item );

    return composite;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:12,代碼來源:DataItemDetailsDialog.java

示例13: createPropertiesGroup

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
/**
 * 
 */
protected Composite createPropertiesGroup(FormToolkit widgetFactory, final Composite parent) {
	Section propertiesSection = widgetFactory.createSection(parent,
			Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
	propertiesSection.setText(HrmMessages.GeneralPropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesSectionData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesSectionData.horizontalSpan = 3;
	propertiesSection.setLayoutData(propertiesSectionData);
	Composite propertiesGroup = widgetFactory.createComposite(propertiesSection);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	propertiesSection.setClient(propertiesGroup);
	return propertiesGroup;
}
 
開發者ID:polarsys,項目名稱:time4sys,代碼行數:18,代碼來源:GeneralPropertiesEditionPartForm.java

示例14: createInputFieldExpandBarSection

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
private void createInputFieldExpandBarSection(Composite composite) {
	Composite composite_1 = new Composite(composite, SWT.NONE);
	GridLayout gl_composite_1 = new GridLayout(1, false);
	gl_composite_1.horizontalSpacing = 0;
	gl_composite_1.verticalSpacing = 0;
	gl_composite_1.marginWidth = 0;
	gl_composite_1.marginHeight = 0;
	composite_1.setLayout(gl_composite_1);
	GridData gd_composite_1 = new GridData(SWT.FILL, SWT.FILL, false, true,
			1, 1);
	gd_composite_1.widthHint = 276;
	composite_1.setLayoutData(gd_composite_1);
	composite_1.setBounds(0, 0, 64, 64);

	final ScrolledComposite scrolledComposite_1 = new ScrolledComposite(
			composite_1, SWT.BORDER | SWT.V_SCROLL );
	scrolledComposite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
			true, true, 1, 1));
	scrolledComposite_1.setExpandHorizontal(true);
	scrolledComposite_1.setExpandVertical(true);
	
	Composite composite_7 = new Composite(scrolledComposite_1, SWT.NONE);
	composite_7.setLayout(new GridLayout(1, false));

	final ExpandBar expandBar = new ExpandBar(composite_7, SWT.H_SCROLL);
	expandBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1,
			1));
	
	expandBar.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 240, 240, 240));
	populateInputFieldExpandBarSection(expandBar);

	expandBar.getItem(0).setExpanded(true);

	scrolledComposite_1.setContent(composite_7);
	scrolledComposite_1.setMinSize(composite_7.computeSize(SWT.DEFAULT,
			SWT.DEFAULT));
	
	
	composite_7.addControlListener(new ControlAdapter() {
		@Override
		public void controlResized(ControlEvent e) {
			
			for(ExpandItem expandItem:expandBar.getItems()){
				((TableColumn)expandItem.getData("TableColumn")).setWidth(scrolledComposite_1.getSize().x);
			}
		}
	});
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:49,代碼來源:JoinMapDialog.java

示例15: createDialogArea

import org.eclipse.swt.widgets.Composite; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
	/* Titre dialogue. */
	this.getShell().setText("About KSP Plugin");

	/* Layout */
	Composite container = (Composite) super.createDialogArea(parent);
	GridLayout layout = new GridLayout(1, false);
	layout.marginRight = 5;
	layout.marginLeft = 10;
	Color white = Display.getCurrent().getSystemColor(SWT.COLOR_WHITE);
	container.setBackground(white);
	container.setLayout(layout);

	/* Logo */
	Label lblLogo = new Label(container, SWT.NONE);
	lblLogo.setBackgroundImage(getImage());
	lblLogo.setBackground(white);
	lblLogo.setText("      ");
	lblLogo.setSize(LOGO_SIZE, LOGO_SIZE);

	/* Produit */
	Label lblProduct = new Label(container, SWT.NONE);
	lblProduct.setText("Vertigo Chroma KSP Plugin");
	lblProduct.setBackground(white);

	/* Version */
	Version version = FrameworkUtil.getBundle(getClass()).getVersion();
	String fullVersion = version.toString();
	Label lblVersion = new Label(container, SWT.NONE);
	lblVersion.setText("Version : " + fullVersion);
	lblVersion.setBackground(white);

	/* Version */
	Label lblAuthor = new Label(container, SWT.NONE);
	lblAuthor.setText("Author : @sebez");
	lblAuthor.setBackground(white);

	/* Libellé documentation */
	Label lblDoc = new Label(container, SWT.NONE);
	lblDoc.setText("Documentation, sources, releases are published in the KSP plugin github repository : ");
	lblDoc.setBackground(white);

	/* Lien vers le github */
	Link link = new Link(container, SWT.NONE);
	String message = "<a href=\"" + GITHUB_URL + "\">" + GITHUB_URL + "</a>";
	link.setText(message);
	link.setBackground(white);
	link.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			Program.launch(GITHUB_URL);
		}
	});

	return container;
}
 
開發者ID:sebez,項目名稱:vertigo-chroma-kspplugin,代碼行數:58,代碼來源:AboutDialog.java


注:本文中的org.eclipse.swt.widgets.Composite.setLayout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。