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


Java Control.setLayoutData方法代码示例

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


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

示例1: createDialogArea

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
@Override
public Control createDialogArea(Composite parent) {

	final Composite main = (Composite)super.createDialogArea(parent);
	main.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

	try {
		if (preamble!=null) {
			Label label = new Label(main, SWT.WRAP);
			label.setText(preamble);
			label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
		}
		modelEditor = new ModelViewer<T>();
		Control created = modelEditor.createPartControl(main);
		created.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	} catch (Exception e) {
		logger.error("Cannot create model viewer!", e);
	}

	return main;

}
 
开发者ID:eclipse,项目名称:scanning,代码行数:23,代码来源:ModelDialog.java

示例2: createControl

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent)
{
	initializeDialogUnits(parent);

	final Composite composite = new Composite(parent, SWT.NULL);
	composite.setFont(parent.getFont());
	composite.setLayout(initGridLayout(new GridLayout(1, false), true));
	composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

	// create UI elements
	Control nameControl = createNameControl(composite);
	nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	Control locationControl = createLocationControl(composite);
	locationControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	Control workingSetControl = createWorkingSetControl(composite);
	workingSetControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	Control infoControl = createInfoControl(composite);
	infoControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	setControl(composite);
}
 
开发者ID:equella,项目名称:Equella,代码行数:26,代码来源:NewJPFRegistryWizardPageOne.java

示例3: createControl

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
public void createControl(Composite parent) {
	sash = new SashForm(parent, SWT.VERTICAL);
	IActionBars bars = getSite().getActionBars();
	ActionRegistry ar = getActionRegistry();

	bars.setGlobalActionHandler(ActionFactory.COPY.getId(), ar.getAction(ActionFactory.COPY.getId()));
	bars.setGlobalActionHandler(ActionFactory.PASTE.getId(), ar.getAction(ActionFactory.PASTE.getId()));

	OutLineComposite composite = new OutLineComposite(filter, sash, SWT.NONE);

	Control tree = getViewer().createControl(composite.getComposite());
	tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 10, 1));
	tree.setData(GW_WIDGET_ID,GW_OUTLINE_ELEMENTS_TREE);
	getViewer().setEditDomain(getEditDomain());
	getViewer().setEditPartFactory(gwtpf);
	getViewer().setContents(gWGraph);
	
	getSelectionSynchronizer().addViewer(getViewer());

}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:21,代码来源:GW4EEditor.java

示例4: initializeViewer

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
private void initializeViewer(IDocument document) {
	fAnnotationPreferences = EditorsPlugin.getDefault().getMarkerAnnotationPreferences();
	setDocument(document);
	installViewerConfiguration();
	setEditable(true);
	Font font = JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
	getTextWidget().setFont(font);
	getTextWidget().setData("document",document);
	Control control = getControl();
	GridData data = new GridData(GridData.FILL_BOTH);
	control.setLayoutData(data);
	prependVerifyKeyListener(new VerifyKeyListener() {

		@Override
		public void verifyKey(VerifyEvent event) {
			handleVerifyKeyPressed(event);
		}
	});
	addDocumentListener(document);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:21,代码来源:SourceViewer.java

示例5: createControl

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
	initializeDialogUnits(parent);

	final Composite composite= new Composite(parent, SWT.NULL);
	composite.setFont(parent.getFont());
	composite.setLayout(initGridLayout(new GridLayout(1, false), true));
	composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

	// create UI elements
	Control nameControl= createNameControl(composite);
	nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	Control locationControl= createLocationControl(composite);
	locationControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	Control infoControl= createInfoControl(composite);
	infoControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	
	setControl(composite);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:22,代码来源:WizardNewProjectCreationPage.java

示例6: createExtensions

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
private void createExtensions ( final List<ExtensionDescriptor> extensions, final Composite composite, final String location, final boolean horizontal ) throws CoreException
{
    int count = 0;
    for ( final ExtensionDescriptor extension : extensions )
    {
        if ( !location.equals ( extension.getLocation () ) )
        {
            continue;
        }

        final ViewerExtension viewerExtension = extension.createExtension ();
        if ( viewerExtension != null )
        {
            final Control result = viewerExtension.create ( composite, this, horizontal );
            if ( result != null )
            {
                count++;
                final String align = extension.getAlign ();
                if ( "END".equalsIgnoreCase ( align ) )
                {
                    result.setLayoutData ( new GridData ( horizontal ? SWT.FILL : SWT.END, SWT.FILL, !horizontal, horizontal ) );
                }
                else if ( "FILL".equalsIgnoreCase ( align ) )
                {
                    result.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) );
                }
                else
                {
                    result.setLayoutData ( new GridData ( horizontal ? SWT.FILL : SWT.BEGINNING, SWT.FILL, !horizontal, horizontal ) );
                }
            }
        }
    }
    if ( composite.getLayout () instanceof GridLayout )
    {
        ( (GridLayout)composite.getLayout () ).numColumns = count;
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:39,代码来源:SingleVisualInterfaceViewPart.java

示例7: createContents

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
@Override
protected Control createContents ( final Composite parent )
{
    final Composite wrapper = new Composite ( parent, SWT.NONE );

    wrapper.setLayout ( new GridLayout ( 1, false ) );

    final Control control = super.createContents ( wrapper );
    control.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false ) );

    createDescription ( wrapper );

    return wrapper;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:15,代码来源:StylePreferencePage.java

示例8: createControl

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent)
{
	initializeDialogUnits(parent);

	final Composite composite = new Composite(parent, SWT.NULL);
	composite.setFont(parent.getFont());
	composite.setLayout(initGridLayout(new GridLayout(1, false), true));
	composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

	// create UI elements
	Control nameControl = createNameControl(composite);
	nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	Control locationControl = createLocationControl(composite);
	locationControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));


	Control registryControl = registry.createContent(composite);
	registryControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	Control equellaControl = equella.createContent(composite);
	equellaControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	Control workingSetControl = createWorkingSetControl(composite);
	workingSetControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	Control infoControl = createInfoControl(composite);
	infoControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	setControl(composite);
}
 
开发者ID:equella,项目名称:Equella,代码行数:33,代码来源:NewJPFPluginWizardPageOne.java

示例9: fillComposite

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
protected void fillComposite (Composite composite) {
	composite.setLayout(new FormLayout());
	
	viewer = createViewer(composite);
	Control control = viewer.getControl();
	control.setEnabled(false);
	
	FormData fd_javaScript = new FormData();
	fd_javaScript.left = new FormAttachment(0, 10);
	fd_javaScript.right = new FormAttachment(100, -5);
	fd_javaScript.top = new FormAttachment(0, 10);
 		setHeight (fd_javaScript, control, 10);
	control.setLayoutData(fd_javaScript);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:15,代码来源:EdgeJavaScriptSection.java

示例10: fillComposite

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
protected void fillComposite (Composite composite) {
	composite.setLayout(new FormLayout());
   
	viewer = ViewerHelper.createEditor(composite);	
	 
	viewer.getControl().setData(WIDGET_ID, WIDGET_SCRIPT);
	FocusListener listener = new FocusListener() {
		@Override
		public void focusGained(FocusEvent e) {
		}

		@Override
		public void focusLost(FocusEvent event) {
			if (!notification) return;
            GW4EVertexEditPartProperties properties = (GW4EVertexEditPartProperties) node.getAdapter(IPropertySource.class);
            if (viewer.getDocument() == null) return;
            String content  = viewer.getDocument().get();
			properties.setPropertyValue(ModelProperties.PROPERTY_VERTEX_INIT, content);
		}
	};
	viewer.getControl().addFocusListener(listener);
	 
	Control control = viewer.getControl();
	control.setEnabled(false);
	
	FormData fd_javaScript = new FormData();
	fd_javaScript.left = new FormAttachment(0, 10);
	fd_javaScript.right = new FormAttachment(100, -5);
	fd_javaScript.top = new FormAttachment(0, 10);
 		setHeight (fd_javaScript, control, 10);
	control.setLayoutData(fd_javaScript);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:33,代码来源:VertexInitSection.java

示例11: createDescriptionIn

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
public void createDescriptionIn(Composite composite) {
	descriptionBrowser.createControl(composite);
	Control c = descriptionBrowser.getControl();
	GridData gd = new GridData(GridData.FILL_BOTH);
	gd.widthHint = 200;
	c.setLayoutData(gd);
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:8,代码来源:BaseWizardSelectionPage.java

示例12: setButtonLayoutData

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
protected void setButtonLayoutData(FontMetrics metrics, Control button,
		boolean visible) {
	GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	int widthHint = Dialog.convertHorizontalDLUsToPixels(metrics,
			IDialogConstants.BUTTON_WIDTH);
	Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
	data.widthHint = Math.max(widthHint, minSize.x);
	data.exclude = !visible;
	button.setLayoutData(data);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:11,代码来源:HydrographInstallationDialog.java

示例13: applyLayout

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
private void applyLayout ( final Control control )
{
    control.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:5,代码来源:LoginDialog.java

示例14: addPages

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
public void addPages() {
	super.addPages();

	mainPage = new NewJavaProjectWizardPageOne() {
		public void createControl(Composite parent) {
			initializeDialogUnits(parent);

			Composite composite = new Composite(parent, SWT.NULL);
			composite.setFont(parent.getFont());
			composite.setLayout(new GridLayout(1, false));
			composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));

			// create UI elements
			Control nameControl = createNameControl(composite);
			nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

			Control jreControl = createJRESelectionControl(composite);
			jreControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

			Control workingSetControl = createWorkingSetControl(composite);
			workingSetControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
			workingSetControl.setVisible(false);

			Control infoControl = createInfoControl(composite);
			infoControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
			infoControl.setVisible(false);

			setControl(composite);
		}

		public IClasspathEntry[] getSourceClasspathEntries() {
			return  GW4ENature.getSourceClasspathEntries(getProjectName());
		}

		public IPath getOutputLocation() {
			return GW4ENature.getOutputLocation(getProjectName());
		}
	};

	addPage(mainPage);
	javaPage = new NewJavaProjectWizardPageTwo(mainPage);
	addPage(javaPage);
	List<TemplateProvider>  templates = TemplateProvider.getTemplates();
	fExtraPage = new GW4ETemplatePage(this,templates,false);
	addPage(fExtraPage);
	fMavenPage = new MavenTemplatePage(this);
	addPage(fMavenPage);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:49,代码来源:GW4ECreationWizard.java

示例15: fill

import org.eclipse.swt.widgets.Control; //导入方法依赖的package包/类
protected GridData fill(Control control, int span) {
	GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
	gd.horizontalSpan = span;
	control.setLayoutData(gd);
	return gd;
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:7,代码来源:AbstractChoiceOption.java


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