本文整理了Java中org.eclipse.swt.widgets.Tree.getStyle()
方法的一些代码示例,展示了Tree.getStyle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.getStyle()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名:getStyle
暂无
代码示例来源:origin: org.codehaus.openxma/xmartclient
/**
* Returns true if selection is performed via check boxes and not by
* conventionally highlighting lines
*/
private boolean checkedSelection () {
return (tree_.getStyle() & SWT.CHECK) != 0;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private static boolean isVirtual( Tree tree ) {
return ( tree.getStyle() & SWT.VIRTUAL ) != 0;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private void updateSelection() {
TreeItem[] selection = parent.getSelection();
List<TreeItem> selectedItems = new ArrayList<>( Arrays.asList( selection ) );
if( deselectChildren( selectedItems ) ) {
if( ( parent.getStyle() & SWT.SINGLE ) != 0 ) {
selectedItems.add( this );
}
parent.setSelection( selectedItems.toArray( new TreeItem[ 0 ] ) );
Event event = new Event();
event.item = this;
parent.notifyListeners( SWT.Selection, event );
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Sets the grayed state of the checkbox for this item. This state change only
* applies if the Tree was created with the SWT.CHECK style.
*
* @param grayed the new grayed state of the checkbox
* @exception SWTException <ul> <li>ERROR_WIDGET_DISPOSED - if the receiver
* has been disposed</li> <li>ERROR_THREAD_INVALID_ACCESS - if
* not called from the thread that created the receiver</li>
* </ul>
*/
public void setGrayed( boolean grayed ) {
checkWidget();
if( ( parent.getStyle() & SWT.CHECK ) != 0 ) {
if( this.grayed != grayed ) {
this.grayed = grayed;
markCached();
}
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Sets the checked state of the receiver.
* <p>
*
* @param checked the new checked state
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed
* </li> <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
* thread that created the receiver</li>
* </ul>
*/
public void setChecked( boolean checked ) {
checkWidget();
if( ( parent.getStyle() & SWT.CHECK ) != 0 ) {
if( this.checked != checked ) {
this.checked = checked;
markCached();
}
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
protected void hookControl(Control control) {
super.hookControl(control);
Tree treeControl = (Tree) control;
if ((treeControl.getStyle() & SWT.VIRTUAL) != 0) {
treeControl.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
treeIsDisposed = true;
unmapAllElements();
}
});
treeControl.addListener(SWT.SetData, new Listener() {
public void handleEvent(Event event) {
if (contentProviderIsLazy) {
TreeItem item = (TreeItem) event.item;
TreeItem parentItem = item.getParentItem();
int index = event.index;
virtualLazyUpdateWidget(
parentItem == null ? (Widget) getTree()
: parentItem, index);
}
}
});
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
writer.newWidget( "org.eclipse.rwt.widgets.Tree" );
ControlLCAUtil.writeStyleFlags( tree );
if( ( tree.getStyle() & SWT.NO_SCROLL ) != 0 ) {
writer.set( "hasNoScroll", true );
if( ( tree.getStyle() & SWT.MULTI ) != 0 ) {
writer.set( "hasMultiSelection", true );
if( ( tree.getStyle() & SWT.FULL_SELECTION ) != 0 ) {
writer.set( "hasFullSelection", true );
} else {
} );
if( ( tree.getStyle() & SWT.CHECK ) != 0 ) {
writer.set( "hasCheckBoxes", true );
writer.set( "checkBoxMetrics", new Object[]{
} );
if( ( tree.getStyle() & SWT.VIRTUAL ) != 0 ) {
writer.set( "isVirtual", true );
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
noScrollButton.setSelection ((tree1.getStyle () & SWT.NO_SCROLL) != 0);
checkButton.setSelection ((tree1.getStyle () & SWT.CHECK) != 0);
fullSelectionButton.setSelection ((tree1.getStyle () & SWT.FULL_SELECTION) != 0);
try {
TreeColumn column = tree1.getColumn(0);
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
protected void mapElement(Object element, final Widget item) {
super.mapElement(element, item);
// make sure to unmap elements if the tree is virtual
if ((getTree().getStyle() & SWT.VIRTUAL) != 0) {
// only add a dispose listener if item hasn't already on assigned
// because it is reused
if (item.getData(VIRTUAL_DISPOSE_KEY) == null) {
item.setData(VIRTUAL_DISPOSE_KEY, Boolean.TRUE);
item.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
if (!treeIsDisposed) {
Object data = item.getData();
if (usingElementMap() && data != null) {
unmapElement(data, item);
}
}
}
});
}
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
@Override
protected void hookControl(Control control) {
super.hookControl(control);
Tree treeControl = (Tree) control;
if ((treeControl.getStyle() & SWT.VIRTUAL) != 0) {
treeControl.addDisposeListener(e -> {
treeIsDisposed = true;
unmapAllElements();
});
treeControl.addListener(SWT.SetData, event -> {
if (contentProviderIsLazy) {
TreeItem item = (TreeItem) event.item;
TreeItem parentItem = item.getParentItem();
int index = event.index;
virtualLazyUpdateWidget(
parentItem == null ? (Widget) getTree()
: parentItem, index);
}
});
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
@Override
protected void hookControl(Control control) {
super.hookControl(control);
Tree treeControl = (Tree) control;
if ((treeControl.getStyle() & SWT.VIRTUAL) != 0) {
treeControl.addDisposeListener(e -> {
treeIsDisposed = true;
unmapAllElements();
});
treeControl.addListener(SWT.SetData, event -> {
if (contentProviderIsLazy) {
TreeItem item = (TreeItem) event.item;
TreeItem parentItem = item.getParentItem();
int index = event.index;
virtualLazyUpdateWidget(
parentItem == null ? (Widget) getTree()
: parentItem, index);
}
});
}
}
代码示例来源:origin: org.codehaus.openxma/xmartclient
if (control instanceof Tree) {
Tree tree = (Tree)control;
int style = tree.getStyle();
boolean treeIsMulti = (style & SWT.CHECK) != 0 || (style & SWT.MULTI) != 0;
if (treeIsMulti != wModel_.isMultiSelect())
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
@Override
protected void mapElement(Object element, final Widget item) {
super.mapElement(element, item);
// make sure to unmap elements if the tree is virtual
if ((getTree().getStyle() & SWT.VIRTUAL) != 0) {
// only add a dispose listener if item hasn't already on assigned
// because it is reused
if (item.getData(VIRTUAL_DISPOSE_KEY) == null) {
item.setData(VIRTUAL_DISPOSE_KEY, Boolean.TRUE);
item.addDisposeListener(e -> {
if (!treeIsDisposed) {
Object data = item.getData();
if (usingElementMap() && data != null) {
unmapElement(data, item);
}
}
});
}
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
@Override
protected void mapElement(Object element, final Widget item) {
super.mapElement(element, item);
// make sure to unmap elements if the tree is virtual
if ((getTree().getStyle() & SWT.VIRTUAL) != 0) {
// only add a dispose listener if item hasn't already on assigned
// because it is reused
if (item.getData(VIRTUAL_DISPOSE_KEY) == null) {
item.setData(VIRTUAL_DISPOSE_KEY, Boolean.TRUE);
item.addDisposeListener(e -> {
if (!treeIsDisposed) {
Object data = item.getData();
if (usingElementMap() && data != null) {
unmapElement(data, item);
}
}
});
}
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
Point pt = new Point(event.x, event.y);
TreeItem item = tree.getItem(pt);
if (item == null && (tree.getStyle() & SWT.FULL_SELECTION) == 0) {
TreeItem currentItem = tree.getTopItem();
TreeItem parentItem = currentItem.getParentItem();
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
Point pt = new Point(event.x, event.y);
TreeItem item = tree.getItem(pt);
if (item == null && (tree.getStyle() & SWT.FULL_SELECTION) == 0) {
TreeItem currentItem = tree.getTopItem();
TreeItem parentItem = currentItem.getParentItem();
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
GdkRectangle rect = new GdkRectangle ();
OS.gtk_tree_view_get_cell_area (parentHandle, path, column, rect);
if ((parent.getStyle () & SWT.MIRRORED) != 0) rect.x = parent.getClientWidth () - rect.width - rect.x;
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
GdkRectangle rect = new GdkRectangle ();
OS.gtk_tree_view_get_cell_area (parentHandle, path, column, rect);
if ((parent.getStyle () & SWT.MIRRORED) != 0) rect.x = parent.getClientWidth () - rect.width - rect.x;
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
remoteObject.set( "appearance", "tree" );
ITreeAdapter adapter = getTreeAdapter( tree );
if( ( tree.getStyle() & SWT.CHECK ) != 0 ) {
JsonArray metrics = new JsonArray()
.add( adapter.getCheckLeft() )
remoteObject.set( "splitContainer", true );
if( ( tree.getStyle() & SWT.FULL_SELECTION ) == 0 ) {
Rectangle textMargin = getTreeAdapter( tree ).getTextMargin();
JsonArray padding = new JsonArray()
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
GdkRectangle rect = new GdkRectangle ();
OS.gtk_tree_view_get_cell_area (parentHandle, path, column, rect);
if ((parent.getStyle () & SWT.MIRRORED) != 0) rect.x = parent.getClientWidth () - rect.width - rect.x;
内容来源于网络,如有侵权,请联系作者删除!