本文整理汇总了Java中org.eclipse.ui.dialogs.FilteredTree.setLayoutData方法的典型用法代码示例。如果您正苦于以下问题:Java FilteredTree.setLayoutData方法的具体用法?Java FilteredTree.setLayoutData怎么用?Java FilteredTree.setLayoutData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.dialogs.FilteredTree
的用法示例。
在下文中一共展示了FilteredTree.setLayoutData方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPartControl
import org.eclipse.ui.dialogs.FilteredTree; //导入方法依赖的package包/类
/**
* Create contents of the view part.
*
* @param parent
*/
@Override
public void createPartControl(Composite parent) {
// create the desired layout for this wizard page
GridLayout glLeft = new GridLayout();
glLeft.numColumns = 3;
parent.setLayout(glLeft);
// Create the sorters and filters
viewerFilterDisplay = new ViewerFilterObjectGraph();
viewerSorterDisplay = new ArchitecturalViewerSorter();
GridData gdVisualFilteredViewer = new org.eclipse.swt.layout.GridData();
gdVisualFilteredViewer.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
gdVisualFilteredViewer.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
gdVisualFilteredViewer.grabExcessHorizontalSpace = true;
gdVisualFilteredViewer.grabExcessVerticalSpace = true;
gdVisualFilteredViewer.horizontalSpan = 3;
ftDisplay = new FilteredTree(parent, SWT.BORDER | SWT.MULTI
| SWT.H_SCROLL | SWT.V_SCROLL, new ObjectGraphPatternFilter()); // Support
// single
ftDisplay.setLayoutData(gdVisualFilteredViewer);
viewer = ftDisplay.getViewer();
drillDownAdapter = new DrillDownAdapter(viewer);
viewer.setContentProvider(new ContentProviderDisplayGraph());
viewer.setLabelProvider(new ArchitecturalDecoratingLabelProvider(
ftDisplay));
// By default, no sorting
viewer.setSorter(viewerSorterDisplay);
viewer.addFilter(viewerFilterDisplay);
viewer.setUseHashlookup(true);
createActions();
initializeToolBar();
initializeMenu();
hookLogListeners();
refresh();
}
示例2: doCreateTreeViewer
import org.eclipse.ui.dialogs.FilteredTree; //导入方法依赖的package包/类
protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
FilteredTree tree = new FilteredTree(parent, style, new PatternFilter(), true);
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
applyDialogFont(tree);
TreeViewer viewer = tree.getViewer();
return viewer;
}
示例3: doCreateTreeViewer
import org.eclipse.ui.dialogs.FilteredTree; //导入方法依赖的package包/类
@Override
protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
FilteredTree tree= new FilteredTreeWithFilter(parent, style, fInitialFilter, fIsDeepFiltering);
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
applyDialogFont(tree);
TreeViewer viewer= tree.getViewer();
SWTUtil.setAccessibilityText(viewer.getControl(), Strings.removeMnemonicIndicator(getMessage()));
return viewer;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:FilteredElementTreeSelectionDialog.java
示例4: createFilterControls
import org.eclipse.ui.dialogs.FilteredTree; //导入方法依赖的package包/类
/**
* 创建包含过滤文本的 TreeViewer
* @param parent
* 顶层容器 ;
*/
private void createFilterControls(Composite parent) {
fFilteredTree = new FilteredTree(parent, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION, new PatternFilter(), true);
GridData gridData;
final GridLayout layout = new GridLayout(1, false);
layout.marginWidth = 0;
fFilteredTree.setLayout(layout);
gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.horizontalAlignment = SWT.FILL;
gridData.verticalAlignment = SWT.FILL;
fFilteredTree.setLayoutData(gridData);
final TreeViewer viewer = fFilteredTree.getViewer();
// 确保 filtered tree 有显示 ITEMS_TO_SHOW 的高度
final Tree tree = viewer.getTree();
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
final Object layoutData = tree.getLayoutData();
if (layoutData instanceof GridData) {
gridData = (GridData) layoutData;
gridData.heightHint = parent.getSize().y; // 适应大小
}
LanguageCodeComparator comparator = new LanguageCodeComparator();
final TreeColumn codeColumn = new TreeColumn(tree, SWT.LEFT, LANGUAGE_CODE_COLUMN);
codeColumn.setText(Messages.getString("languagecode.LanguageCodesPreferencePage.codeColumn"));
tree.setSortColumn(codeColumn);
tree.setSortColumn(codeColumn);
tree.setSortDirection(SWT.UP);
codeColumn.addSelectionListener(new ResortColumn(comparator, codeColumn, viewer, LANGUAGE_CODE_COLUMN));
final TreeColumn nameColumn = new TreeColumn(tree, SWT.LEFT, LANGUAGE_NAME_COLUMN);
nameColumn.setText(Messages.getString("languagecode.LanguageCodesPreferencePage.nameColumn"));
nameColumn.addSelectionListener(new ResortColumn(comparator, nameColumn, viewer, LANGUAGE_NAME_COLUMN));
final TreeColumn bidiColumn = new TreeColumn(tree, SWT.LEFT, LANGUAGE_BIDI_COLUMN);
bidiColumn.setText(Messages.getString("languagecode.LanguageCodesPreferencePage.bidiColumn"));
bidiColumn.addSelectionListener(new ResortColumn(comparator, bidiColumn, viewer, LANGUAGE_BIDI_COLUMN));
viewer.setContentProvider(new LanguageCodeContentProvider());
viewer.setLabelProvider(new LanguageCodeLabelProvider());
viewer.setComparator(comparator);
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
verifyCurrentSelected(EDIT);
}
});
fFilteredTree.getPatternFilter().setIncludeLeadingWildcard(true);
final TreeColumn[] columns = viewer.getTree().getColumns();
columns[LANGUAGE_CODE_COLUMN].setWidth(100);
columns[LANGUAGE_NAME_COLUMN].setWidth(240);
columns[LANGUAGE_BIDI_COLUMN].setWidth(100);
}
示例5: createControl
import org.eclipse.ui.dialogs.FilteredTree; //导入方法依赖的package包/类
/**
* Create contents of the wizard.
* @param parent
*/
public void createControl(Composite parent) {
final Composite container = new Composite(parent, SWT.NULL);
container.setLayout(new GridLayout(8, false));
init();
FilteredTree filteredTree = new FilteredTree(container, SWT.MULTI
| SWT.H_SCROLL | SWT.V_SCROLL, new PatternFilter(), true);
filteredTree.getFilterControl().setText("");
GridData gd_filteredTree = new GridData(SWT.FILL, SWT.FILL, true,
true, 8, 1);
gd_filteredTree.heightHint = 138;
gd_filteredTree.widthHint = 300;
filteredTree.setLayoutData(gd_filteredTree);
treeViewer = filteredTree.getViewer();
treeViewer.setContentProvider(new TreeViewerContentProvider());
treeViewer.setLabelProvider(new TreeViewerLabelProvider());
Map<String, List<String>> filesUrl = manager.getApiUrls();
treeViewer.setInput(DataFactory.getList(iProject, filesUrl));
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
ISelection iSelection = treeViewer.getSelection();
dialogChanged();
if (iSelection != null) {
Object selectItem = ((TreeSelection) iSelection)
.getFirstElement();
if (selectItem instanceof RestFulApi) {
isChosed = true;
RestFulApi api = (RestFulApi) selectItem;
changeIsUseInnerOps(api.getParent().getParent());
if (isUseInnerSchema) {
currentUrlBean = new UrlBean(manager.getApiManager().getRestApiJsonByUrl(api.getName()));
} else {
currentUrlBean = new UrlBean(manager.getUserApiManager().getRestApiJsonByUrl(api.getName()));
}
IWizardPage page = getNextPage();
if(page instanceof AddPostBodyPage2){
((AddPostBodyPage2)page).createItem(currentUrlBean);
}
} else {
isChosed = false;
}
if (selectItem instanceof SchemaFile) {
SchemaFile file = (SchemaFile) selectItem;
changeIsUseInnerOps(file.getParent());
isChosed = false;
}
}
dialogChanged();
}
});
setControl(container);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
Label label_1 = new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
}
示例6: createControl
import org.eclipse.ui.dialogs.FilteredTree; //导入方法依赖的package包/类
/**
* Create contents of the wizard.
* @param parent
*/
public void createControl(Composite parent) {
final Composite container = new Composite(parent, SWT.NULL);
container.setLayout(new GridLayout(8, false));
init();
FilteredTree filteredTree = new FilteredTree(container, SWT.MULTI
| SWT.H_SCROLL | SWT.V_SCROLL, new PatternFilter(), true);
filteredTree.getFilterControl().setText("");
GridData gd_filteredTree = new GridData(SWT.FILL, SWT.FILL, true,
true, 8, 1);
gd_filteredTree.heightHint = 138;
gd_filteredTree.widthHint = 300;
filteredTree.setLayoutData(gd_filteredTree);
treeViewer = filteredTree.getViewer();
treeViewer.setContentProvider(new TreeViewerContentProvider());
treeViewer.setLabelProvider(new TreeViewerLabelProvider());
Map<String, List<String>> filesUrl = manager.getApiUrls();
treeViewer.setInput(DataFactory.getList(iProject, filesUrl));
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
ISelection iSelection = treeViewer.getSelection();
dialogChanged();
if (iSelection != null) {
Object selectItem = ((TreeSelection) iSelection)
.getFirstElement();
if (selectItem instanceof RestFulApi) {
isChosed = true;
RestFulApi api = (RestFulApi) selectItem;
choseUrl = api.getName();
changeIsUseInnerOps(api.getParent().getParent());
if (isUseInnerSchema) {
currentUrlBean = new UrlBean(manager.getApiManager().getRestApiJsonByUrl(api.getName()));
} else {
currentUrlBean = new UrlBean(manager.getUserApiManager().getRestApiJsonByUrl(api.getName()));
}
IWizardPage page = getNextPage();
if(page instanceof AddPostBodyPage2){
((AddPostBodyPage2)page).createItem(currentUrlBean,choseUrl);
}
} else {
isChosed = false;
}
if (selectItem instanceof SchemaFile) {
SchemaFile file = (SchemaFile) selectItem;
changeIsUseInnerOps(file.getParent());
isChosed = false;
}
}
dialogChanged();
}
});
setControl(container);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
Label label_1 = new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
new Label(container, SWT.NONE);
}
示例7: createTreeControl
import org.eclipse.ui.dialogs.FilteredTree; //导入方法依赖的package包/类
/**
* Creates the default tree and sets it as the control. The default styles will show scrollbars as needed, and allows
* for multiple selection.
* <p>
* Doesn't use the default createControl method name, as that one is made final in the ScrollingGraphicalViewer base
* class...
* </p>
*
* @param parent
* The parent for the Tree
* @return the control
*/
public Control createTreeControl(Composite parent) {
PatternFilter filter = new PatternFilter();
FilteredTree tree = new PaletteFilteredTree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL, filter, true);
tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
tree.getViewer().setContentProvider(new PaletteTreeProvider(tree.getViewer()));
tree.getViewer().setLabelProvider(new PaletteLabelProvider(this));
setControl(tree);
addDropTargetListener(new UserLibraryTransferDropListener(this));
return tree;
}