本文整理了Java中org.eclipse.swt.widgets.Tree.setLinesVisible()
方法的一些代码示例,展示了Tree.setLinesVisible()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.setLinesVisible()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名:setLinesVisible
[英]Marks the receiver's lines as visible if the argument is true
, and marks it invisible otherwise. Note that some platforms draw grid lines while others may draw alternating row colors.
If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.
[中]如果参数为true
,则将接收方的行标记为可见,否则将其标记为不可见。请注意,一些平台会绘制网格线,而其他平台可能会绘制交替的行颜色。
如果接收者的祖先之一不可见,或者其他一些情况使接收者不可见,那么将其标记为可见实际上可能不会导致其显示。
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Sets the lines visible state of the "Example" widgets.
*/
void setWidgetLinesVisible () {
tree1.setLinesVisible (linesVisibleButton.getSelection ());
tree2.setLinesVisible (linesVisibleButton.getSelection ());
}
代码示例来源:origin: com.diffplug.durian/durian-swt
/** Builds a table with the given columns. */
protected static Tree buildTree(Composite parent, int style, boolean linesVisible, boolean headerVisible, List<? extends ColumnBuilder> columnBuilders) {
SwtMisc.assertClean(parent);
// create the control
Tree control = new Tree(parent, style);
control.setLinesVisible(linesVisible);
control.setHeaderVisible(headerVisible);
// create the columns and layout
Function<ColumnBuilder, TreeColumn> buildFunc = builder -> builder.build(control);
List<TreeColumn> columns = columnBuilders.stream().map(buildFunc).collect(Collectors.toList());
buildLayout(control, new TreeColumnLayout(), columns, columnBuilders);
// return the control
return control;
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xsd.ui
public XSDTableTreeViewer(Composite parent)
{
super(parent);
// treeExtension.setCellModifier(null);
getTree().setLinesVisible(true);
// treeExtension = new XMLTreeExtension(getTree());
// Reassign the content provider
XMLTableTreeContentProvider provider = new MyContentProvider();
// provider.addViewer(this);
setContentProvider(provider);
setLabelProvider(provider);
// setViewerSelectionManager(new ViewerSelectionManagerImpl(null));
}
代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.converter
referencedGenModelsTree.setLinesVisible(true);
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.views
/**
* Creates a property sheet viewer on a newly-created tree control
* under the given parent. The viewer has no input, and no root entry.
*
* @param parent
* the parent control
*/
public PropertySheetViewer(Composite parent) {
tree = new Tree(parent, SWT.FULL_SELECTION | SWT.SINGLE
| SWT.HIDE_SELECTION);
// configure the widget
tree.setLinesVisible(true);
tree.setHeaderVisible(true);
// configure the columns
addColumns();
// add our listeners to the widget
hookControl();
// create a new tree editor
treeEditor = new TreeEditor(tree);
// create the entry and editor listener
createEntryListener();
createEditorListener();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.views
/**
* Creates a property sheet viewer on a newly-created tree control
* under the given parent. The viewer has no input, and no root entry.
*
* @param parent
* the parent control
*/
public PropertySheetViewer(Composite parent) {
tree = new Tree(parent, SWT.FULL_SELECTION | SWT.SINGLE
| SWT.HIDE_SELECTION);
// configure the widget
tree.setLinesVisible(true);
tree.setHeaderVisible(true);
// configure the columns
addColumns();
// add our listeners to the widget
hookControl();
// create a new tree editor
treeEditor = new TreeEditor(tree);
// create the entry and editor listener
createEntryListener();
createEditorListener();
}
代码示例来源:origin: org.eclipse/org.eclipse.ui.views
/**
* Creates a property sheet viewer on a newly-created tree control
* under the given parent. The viewer has no input, and no root entry.
*
* @param parent
* the parent control
*/
public PropertySheetViewer(Composite parent) {
tree = new Tree(parent, SWT.FULL_SELECTION | SWT.SINGLE
| SWT.HIDE_SELECTION);
// configure the widget
tree.setLinesVisible(true);
tree.setHeaderVisible(true);
// configure the columns
addColumns();
// add our listeners to the widget
hookControl();
// create a new tree editor
treeEditor = new TreeEditor(tree);
// create the entry and editor listener
createEntryListener();
createEditorListener();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
/**
* Create the columns for the receiver.
*
* @param parent
*/
private void createViewer(Composite parent) {
parent.setLayout(new FillLayout());
viewer = new MarkersTreeViewer(new Tree(parent, SWT.H_SCROLL
/*| SWT.VIRTUAL */| SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION));
viewer.getTree().setLinesVisible(true);
viewer.setUseHashlookup(true);
createColumns(new TreeColumn[0], new int[0]);
viewer.setContentProvider(getContentProvider());
/*
* Workaround for TeeColumn.getWidth() returning 0 in some cases, see
* https://bugs.eclipse.org/341865 for details.
*/
viewer.getTree().addPaintListener(new PaintListener() {
@Override
public void paintControl(PaintEvent e) {
treePainted= true;
viewer.getTree().removePaintListener(this);
}
});
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.team.ui
/**
* Create a TreeViewer that can be used to display a list of IFile instances.
* This method provides the labels and sorter but does not provide a content provider
*
* @param parent
* @return TableViewer
*/
public TreeViewer createTree(Composite parent) {
Tree tree = new Tree(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
tree.setHeaderVisible(true);
tree.setLinesVisible(false);
GridData data = new GridData(GridData.FILL_BOTH);
tree.setLayoutData(data);
TableLayout layout = new TableLayout();
tree.setLayout(layout);
this.viewer = new TreeViewer(tree);
createColumns(tree, layout);
viewer.setLabelProvider(new LocalHistoryLabelProvider());
// By default, reverse sort by revision.
// If local filter is on sort by date
HistoryComparator sorter = new HistoryComparator(COL_DATE);
sorter.setReversed(false);
viewer.setComparator(sorter);
return viewer;
}
代码示例来源:origin: org.eclipse/org.eclipse.team.ui
/**
* Create a TreeViewer that can be used to display a list of IFile instances.
* This method provides the labels and sorter but does not provide a content provider
*
* @param parent
* @return TableViewer
*/
public TreeViewer createTree(Composite parent) {
Tree tree = new Tree(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
tree.setHeaderVisible(true);
tree.setLinesVisible(false);
GridData data = new GridData(GridData.FILL_BOTH);
tree.setLayoutData(data);
TableLayout layout = new TableLayout();
tree.setLayout(layout);
this.viewer = new TreeViewer(tree);
createColumns(tree, layout);
viewer.setLabelProvider(new LocalHistoryLabelProvider());
// By default, reverse sort by revision.
// If local filter is on sort by date
HistoryComparator sorter = new HistoryComparator(COL_DATE);
sorter.setReversed(false);
viewer.setComparator(sorter);
return viewer;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench.texteditor
| SWT.FULL_SELECTION);
fTemplatesTree.setHeaderVisible(true);
fTemplatesTree.setLinesVisible(true);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.workbench.texteditor
| SWT.FULL_SELECTION);
fTemplatesTree.setHeaderVisible(true);
fTemplatesTree.setLinesVisible(true);
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
/**
* Creates the checkbox tree viewer that contains attributes.
*
* @param parent the parent composite to add this one to
* @return a {@link CheckboxTreeViewer}
*/
private CheckboxTreeViewer createCheckboxTreeViewer(Composite parent) {
Tree tree = new Tree(parent, SWT.MULTI | SWT.CHECK | SWT.H_SCROLL | SWT.V_SCROLL);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
tree.setLayoutData(gd);
tree.setHeaderVisible(true);
tree.setLinesVisible(true);
CheckboxTreeViewer treeViewer = new CheckboxTreeViewer(tree);
treeViewer.setContentProvider(new PrototypeAttributesContentProvider());
treeViewer.setCheckStateProvider(new AttributesTreeCheckStateProvider());
treeViewer.addCheckStateListener(new AttributesTreeCheckStateListener());
MenuManager menuMgr = new MenuManager();
Menu contextMenu = menuMgr.createContextMenu(tree);
menuMgr.addMenuListener(new ResetMenuListener());
menuMgr.setRemoveAllWhenShown(true);
tree.setMenu(contextMenu);
return treeViewer;
}
代码示例来源:origin: org.eclipse/org.eclipse.pde.runtime
private void createViewer(Composite parent) {
fTreeViewer = new TreeViewer(parent, SWT.FULL_SELECTION);
fTree = fTreeViewer.getTree();
fTree.setLinesVisible(true);
createColumns(fTree);
fTreeViewer.setContentProvider(new LogViewContentProvider(this));
fTreeViewer.setLabelProvider(fLabelProvider = new LogViewLabelProvider());
fLabelProvider.connect(this);
fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent e) {
handleSelectionChanged(e.getSelection());
if (fPropertiesAction.isEnabled())
((EventDetailsDialogAction) fPropertiesAction).resetSelection();
}
});
fTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator);
fPropertiesAction.run();
}
});
fTreeViewer.setInput(this);
addMouseListeners();
}
代码示例来源:origin: org.xworker/xworker_swt
tree.setLinesVisible(true);
代码示例来源:origin: org.apache.uima/uimaj-ep-cas-editor
mTableViewer.getTree().setLayoutData(gridData);
mTableViewer.getTree().setLinesVisible(true);
mTableViewer.getTree().setHeaderVisible(true);
代码示例来源:origin: org.eclipse/org.eclipse.wst.server.ui
treeTable = new Tree(parent, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
treeTable.setHeaderVisible(true);
treeTable.setLinesVisible(false);
treeTable.setLayoutData(new GridData(GridData.FILL_BOTH));
treeTable.setFont(parent.getFont());
代码示例来源:origin: org.eclipse.ui.views/log
fFilteredTree.setInitialText(Messages.LogView_show_filter_initialText);
fTree = fFilteredTree.getViewer().getTree();
fTree.setLinesVisible(true);
createColumns(fTree);
fFilteredTree.getViewer().setAutoExpandLevel(2);
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.trace
getViewer().setContentProvider(new TracingComponentContentProvider());
getViewer().setComparator(new TracingComponentComparator());
getViewerTree().setLinesVisible(true);
getViewer().addDoubleClickListener(new TracingDoubleClickListener());
代码示例来源:origin: org.eclipse.emf.cdo.transfer/ui
tree.setLinesVisible(true);
tree.setHeaderVisible(true);
内容来源于网络,如有侵权,请联系作者删除!