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


Java Tree.setLayoutData方法代码示例

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


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

示例1: CustomElementSelectionForm

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
/**
 * Create the composite.
 */
public CustomElementSelectionForm(Composite parent, int style) {
	super(parent, style);
	setLayout(new GridLayout(2, false));

	treeViewer = new TreeViewer(this, SWT.BORDER);
	Tree tree = getTreeViewer().getTree();

	// Set a minimum height to prevent weird dialog dimensions
	tree.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).span(2, 1).minSize(0, 200).create());

	elementLabel = new Label(this, SWT.NONE);
	elementLabel.setLayoutData(GridDataFactory.swtDefaults().create());
	elementLabel.setText("New Label");

	elementInput = new SuffixText(this, SWT.BORDER);// new Text(this, SWT.BORDER);
	elementInput.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:21,代码来源:CustomElementSelectionForm.java

示例2: createTreeViewer

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
/**
 * Creates tree viewer to manage content
 * 
 * @param parent
 *            parent control
 */
private void createTreeViewer(Composite parent) {
	int style = SWT.H_SCROLL | SWT.V_SCROLL;
	// Create the tree
	Tree widget = new Tree(parent, style);
	// Configure the layout
	GridData data = new GridData(GridData.FILL_BOTH);
	data.heightHint = widget.getItemHeight() * 12;
	widget.setLayoutData(data);

	treeViewer = new TreeViewer(widget);
	namePatternFilter = new QuickOutlineNamePatternFilter();
	treeViewer.addFilter(namePatternFilter);
	treeContentProvider = getContentProvider();
	treeViewer.setContentProvider(treeContentProvider);
	treeLabelProvider = getLabelProvider();
	treeViewer.setLabelProvider(treeLabelProvider);
	treeViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
	treeViewer.setUseHashlookup(true);
	treeViewer.setInput(getInitialInput());
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:27,代码来源:AbstractInformationControl.java

示例3: createControl

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
/**
 * Create contents of the wizard.
 *
 * @param parent the parent
 */
public void createControl(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	container.setLayout(new GridLayout(1, false));
	
	treeViewer = new WorkbenchTreeViewer(container, SWT.SINGLE, CarchaWizard.EXTENSIONS_ADO);
	Tree tree = treeViewer.getTree();
	tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event) {
			setPageComplete(validatePage());
		}
	});
	StructuredSelection selection = getSelection();
	if(selection != null)
		treeViewer.setSelection(selection);
	
	setControl(container);
	
	setPageComplete(validatePage());
}
 
开发者ID:germanattanasio,项目名称:traceability-assistant-eclipse-plugins,代码行数:28,代码来源:ADOSelectionPage.java

示例4: createControl

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
/**
 * Create contents of the wizard.
 *
 * @param parent the parent
 */
public void createControl(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	container.setLayout(new GridLayout(1, false));
	
	treeViewer = new WorkbenchTreeViewer(container, SWT.SINGLE, CarchaWizard.EXTENSIONS_DXMI);
	Tree tree = treeViewer.getTree();
	tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event) {
			setPageComplete(validatePage());
		}
	});
	StructuredSelection selection = getSelection();
	if(selection != null)
		treeViewer.setSelection(selection);
	
	setControl(container);
	
	setPageComplete(validatePage());
}
 
开发者ID:germanattanasio,项目名称:traceability-assistant-eclipse-plugins,代码行数:28,代码来源:DXMISelectionPage.java

示例5: createControl

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
/**
 * Create contents of the wizard.
 *
 * @param parent the parent
 */
public void createControl(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	container.setLayout(new GridLayout(1, false));
	
	treeViewer = new WorkbenchTreeViewer(container, SWT.SINGLE, CarchaWizard.EXTENSIONS_REA);
	Tree tree = treeViewer.getTree();
	tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event) {
			setPageComplete(validatePage());
		}
	});
	StructuredSelection selection = getSelection();
	if(selection != null)
		treeViewer.setSelection(selection);
	
	setControl(container);
	
	setPageComplete(validatePage());
}
 
开发者ID:germanattanasio,项目名称:traceability-assistant-eclipse-plugins,代码行数:28,代码来源:REASelectionPage.java

示例6: createObjectsNavigator

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
private void createObjectsNavigator(Composite parent) {
	objectsNavigator = new TreeViewer(parent, SWT.BORDER);
	Tree tree = objectsNavigator.getTree();
	tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	objectsNavigator
			.setContentProvider(new ObjectsNavigatorContentProvider());
	objectsNavigator.setLabelProvider(new ObjectsNavigatorLabelProvider());

	objectsNavigator
			.addSelectionChangedListener(new ISelectionChangedListener() {

				public void selectionChanged(SelectionChangedEvent event) {
					Object selItem = ((IStructuredSelection) event
							.getSelection()).getFirstElement();
					if (selItem instanceof ObjectCategoryItem) {
						updateDetailsPanel((ObjectCategoryItem) selItem);
					}
				}
			});
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:21,代码来源:JavaExpressionEditorComposite.java

示例7: SystemTree

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
/**
 * Create a new tree listing Solr system information.
 * 
 * @param composite
 *            Parent composite.
 */
public SystemTree(Composite composite) throws SophieException {
	// Instantiate Tree.
	tree = new Tree(composite, SWT.BORDER);
	tree.setHeaderVisible(true);
	tree.setLayoutData(new GridData(GridData.FILL_BOTH));

	// Create name/value columns.
	columnName = new TreeColumn(tree, SWT.LEFT);
	columnName.setText("Name");
	columnValue = new TreeColumn(tree, SWT.LEFT);
	columnValue.setText("Value");

	// Populate tree with data from Solr.
	populate();

	// Pack columns.
	columnName.pack();
	columnValue.pack();
}
 
开发者ID:fengtan,项目名称:sophie,代码行数:26,代码来源:SystemTree.java

示例8: createControl

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
public void createControl(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	GridLayout layout = new GridLayout();
	container.setLayout(layout);
	layout.numColumns = 2;
	layout.verticalSpacing = 9;

	Label label = new Label(container, SWT.NULL);
	label.setText("&Project:");
	
	tree = new Tree(container, SWT.SINGLE | SWT.BORDER);
	tree.setHeaderVisible(false);
	GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
	gridData.verticalSpan = 20;
	gridData.horizontalSpan = 2;
	tree.setLayoutData(gridData);		
	tree.addListener(SWT.Selection, new Listener() {
		public void handleEvent(final Event event) {
			TreeItem item = (TreeItem) event.item;
			projectName = item.getText();
			dialogChanged();
		}
	});
	tree.setVisible(false);
	
	initialize();
	setControl(container);
	dialogChanged();
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:30,代码来源:ProjectSchemaWizardPage.java

示例9: createControl

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
	container = new Composite(parent, SWT.NONE);
	Label label1 = new Label(container, SWT.NONE);
	label1.setText(SELECTION_LABEL);
	tree = new Tree(container, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	GridLayout layout = new GridLayout();
	container.setLayout(layout);
	layout.numColumns = 1;
	GridData treeGridData = new GridData(GridData.FILL_BOTH);
	tree.setLayoutData(treeGridData);
	tree.addListener(SWT.Selection, new Listener() {

		@Override
		public void handleEvent(Event event) {
			if (event.detail == SWT.CHECK) {
				TreeItem item = (TreeItem) event.item;
				if (item.getChecked()) {
					selectedApplications.add((VitruvApplication) item.getData());
				} else {
					selectedApplications.remove(item.getData());
				}
				setPageComplete(!selectedApplications.isEmpty());
			}
		}
	});

	setControl(container);
	setPageComplete(false);
}
 
开发者ID:vitruv-tools,项目名称:Vitruv,代码行数:31,代码来源:ApplicationSelectionPage.java

示例10: createTreeControl

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
/**
 * Create a directory tree settings box.
 * @param parent the parent container
 */
private void createTreeControl(Composite parent) {

    dirTree = new Tree(parent, SWT.SINGLE | SWT.BORDER);
    dirTree.setToolTipText(TexlipsePlugin.getResourceString("projectWizardDirTreeTooltip"));
    dirTree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));

    recreateSubTree();
}
 
开发者ID:eclipse,项目名称:texlipse,代码行数:13,代码来源:TexlipseProjectFilesWizardPage.java

示例11: createCheckedTreeViewer

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
public static ContainerCheckedTreeViewer createCheckedTreeViewer(final AbstractDialog dialog, final Composite parent, final int height, final int span) {
    final GridData gridData = new GridData();
    gridData.heightHint = height;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalSpan = span;

    final ContainerCheckedTreeViewer viewer = new ContainerCheckedTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    final Tree tree = viewer.getTree();
    tree.setLayoutData(gridData);

    viewer.setContentProvider(new TreeNodeContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());

    if (dialog != null) {
        viewer.addCheckStateListener(new ICheckStateListener() {

            @Override
            public void checkStateChanged(final CheckStateChangedEvent event) {
                dialog.validate();
            }

        });
    }

    return viewer;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:28,代码来源:CompositeFactory.java

示例12: createCheckedTreeViewer

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
public static ContainerCheckedTreeViewer createCheckedTreeViewer(
		final AbstractDialog dialog, Composite parent, int height, int span) {
	GridData gridData = new GridData();
	gridData.heightHint = height;
	gridData.horizontalAlignment = GridData.FILL;
	gridData.grabExcessHorizontalSpace = true;
	gridData.horizontalSpan = span;

	ContainerCheckedTreeViewer viewer = new ContainerCheckedTreeViewer(
			parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
	Tree tree = viewer.getTree();
	tree.setLayoutData(gridData);

	viewer.setContentProvider(new TreeNodeContentProvider());
	viewer.setLabelProvider(new ViewLabelProvider());

	if (dialog != null) {
		viewer.addCheckStateListener(new ICheckStateListener() {

			public void checkStateChanged(CheckStateChangedEvent event) {
				dialog.validate();
			}

		});
	}

	return viewer;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:29,代码来源:CompositeFactory.java

示例13: createComposite

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
/**
 * 뷰어가 담길 컴포지트 생성
 * 
 * @param parent
 * @return Composite
 */
public Composite createComposite(final Composite parent) {
    Tree tree = new Tree(parent, SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);

    tree.setLinesVisible(true);
    tree.setHeaderVisible(true);

    String[] strHeadings = { UMLMessage.LABEL_PROPERTY, UMLMessage.LABEL_VALUE };

    TreeColumn propertyTreeColumn = new TreeColumn(tree, SWT.NONE);
    propertyTreeColumn.setWidth(240);
    propertyTreeColumn.setText(strHeadings[0]);
    propertyTreeColumn.setAlignment(SWT.LEFT);
    propertyTreeColumn.setResizable(true);

    TreeColumn valueTreeColumn = new TreeColumn(tree, SWT.NONE);
    valueTreeColumn.setWidth(300);
    valueTreeColumn.setText(strHeadings[1]);
    valueTreeColumn.setAlignment(SWT.LEFT);
    valueTreeColumn.setResizable(true);

    GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.heightHint = 150;
    gridData.horizontalSpan = 2;
    tree.setLayoutData(gridData);

    viewer = new TreeViewer(tree);
    tree.setItemCount(20);

    viewer.setContentProvider(new StereotypePropertyTreeContentProvider());
    viewer.setLabelProvider(new StereotypePropertyTableColumnLabelProvider(this));

    // viewer.setInput(input);
    viewer.addSelectionChangedListener(new StereotypePropertySelectionChangedListener(parent, this));

    return parent;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:43,代码来源:StereotypePropertyComposite.java

示例14: createTreeViewer

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
protected void createTreeViewer(Composite parent, int width, int height)
{
    Tree tree = new Tree(parent, 32);
    GridData data = new GridData(1808);
    data.widthHint = width;
    data.heightHint = height;
    tree.setLayoutData(data);
    fTreeViewer = new CheckboxTreeViewer(tree);
    fTreeViewer.setUseHashlookup(true);
    fTreeViewer.setContentProvider(fTreeContentProvider);
    fTreeViewer.setLabelProvider(fTreeLabelProvider);
    fTreeViewer.addTreeListener(this);
    fTreeViewer.addCheckStateListener(this);
    fTreeViewer.addSelectionChangedListener(this);
}
 
开发者ID:qxo,项目名称:eclipse-code-lines-plugin,代码行数:16,代码来源:CheckboxTreeAndListGroup.java

示例15: createAllObjectGroup

import org.eclipse.swt.widgets.Tree; //导入方法依赖的package包/类
private void createAllObjectGroup(Composite composite) {
    final GridData gridData = new GridData();
    gridData.heightHint = 300;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;

    this.viewer = new ContainerCheckedTreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    final Tree tree = viewer.getTree();
    tree.setLayoutData(gridData);

    viewer.setContentProvider(new TreeNodeContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:14,代码来源:AbstractSelectImportedObjectDialog.java


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