本文整理了Java中org.eclipse.swt.widgets.Tree.error()
方法的一些代码示例,展示了Tree.error()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.error()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名:error
暂无
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private void setPreloadedItems( Object value ) {
if( value == null ) {
preloadedItems = 0;
} else {
if( !( value instanceof Integer ) ) {
error( SWT.ERROR_INVALID_ARGUMENT );
}
preloadedItems = ( ( Integer )value ).intValue();
if( preloadedItems < 0 ) {
error( SWT.ERROR_INVALID_RANGE );
}
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private void setCustomItemHeight( Object value ) {
if( value == null ) {
customItemHeight = -1;
} else {
if( !( value instanceof Integer ) ) {
error( SWT.ERROR_INVALID_ARGUMENT );
}
int itemHeight = ( ( Integer )value ).intValue();
if( itemHeight < 0 ) {
error( SWT.ERROR_INVALID_RANGE );
}
customItemHeight = itemHeight;
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
protected void checkSubclass () {
if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
/**
* Sets the height of the area which would be used to
* display <em>one</em> of the items in the tree.
*
* @param itemHeight the height of one item
*
* @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>
*
* @since 3.2
*/
/*public*/ void setItemHeight (int itemHeight) {
checkWidget ();
if (itemHeight < -1) error (SWT.ERROR_INVALID_ARGUMENT);
OS.SendMessage (handle, OS.TVM_SETITEMHEIGHT, itemHeight, 0);
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Sets the header foreground color to the color specified
* by the argument, or to the default system color if the argument is null.
* @param color the new color (or null)
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_ARGUMENT - if the argument has been disposed</li>
* </ul>
* @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>
* @since 3.6
*/
public void setHeaderForeground( Color color ) {
checkWidget();
if( color != null && color.isDisposed() ) {
error( SWT.ERROR_INVALID_ARGUMENT );
}
headerForeground = color;
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
/*public*/ void setItemHeight (int itemHeight) {
checkWidget ();
if (itemHeight < -1) error (SWT.ERROR_INVALID_ARGUMENT);
if (itemHeight == -1) {
setItemHeight (null, null, true);
} else {
((NSOutlineView)view).setRowHeight (itemHeight);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
void createItem (TreeItem item, int /*long*/ parentIter, int index) {
int count = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
if (index == -1) index = count;
if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE);
item.handle = OS.g_malloc (OS.GtkTreeIter_sizeof ());
if (item.handle == 0) error(SWT.ERROR_NO_HANDLES);
/*
* Feature in GTK. It is much faster to append to a tree store
* than to insert at the end using gtk_tree_store_insert().
*/
if (index == count) {
OS.gtk_tree_store_append (modelHandle, item.handle, parentIter);
} else {
OS.gtk_tree_store_insert (modelHandle, item.handle, parentIter, index);
}
int id = getId (item.handle, false);
items [id] = item;
modelChanged = true;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
void createItem (TreeItem item, int /*long*/ parentIter, int index) {
int count = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
if (index == -1) index = count;
if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE);
item.handle = OS.g_malloc (OS.GtkTreeIter_sizeof ());
if (item.handle == 0) error(SWT.ERROR_NO_HANDLES);
/*
* Feature in GTK. It is much faster to append to a tree store
* than to insert at the end using gtk_tree_store_insert().
*/
if (index == count) {
OS.gtk_tree_store_append (modelHandle, item.handle, parentIter);
} else {
OS.gtk_tree_store_insert (modelHandle, item.handle, parentIter, index);
}
int id = getId (item.handle, false);
items [id] = item;
modelChanged = true;
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
/**
* Returns the item at the given, zero-relative index in the
* receiver. Throws an exception if the index is out of range.
*
* @param index the index of the item to return
* @return the item at the given index
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
* </ul>
* @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>
*
* @since 3.1
*/
public TreeItem getItem (int index) {
checkWidget ();
int count = getItemCount ();
if (index < 0 || index >= count) error (SWT.ERROR_INVALID_RANGE);
return _getItem (null, index, true);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
void createItem (TreeItem item, long /*int*/ parentIter, int index) {
int count = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
if (index == -1) index = count;
if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE);
item.handle = OS.g_malloc (OS.GtkTreeIter_sizeof ());
if (item.handle == 0) error(SWT.ERROR_NO_HANDLES);
/*
* Feature in GTK. It is much faster to append to a tree store
* than to insert at the end using gtk_tree_store_insert().
*/
if (index == count) {
OS.gtk_tree_store_append (modelHandle, item.handle, parentIter);
} else {
OS.gtk_tree_store_insert (modelHandle, item.handle, parentIter, index);
}
int id = getId (item.handle, false);
items [id] = item;
modelChanged = true;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Removes the listener from the collection of listeners who will be notified
* when items in the receiver are expanded or collapsed.
*
* @param listener the listener which should no longer be notified
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @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>
* @see TreeListener
* @see #addTreeListener
*/
public void removeTreeListener( TreeListener listener ) {
checkWidget();
if( listener == null ) {
error( SWT.ERROR_NULL_ARGUMENT );
}
removeListener( SWT.Expand, listener );
removeListener( SWT.Collapse, listener );
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
/**
* Returns the item at the given, zero-relative index in the
* receiver. Throws an exception if the index is out of range.
*
* @param index the index of the item to return
* @return the item at the given index
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
* </ul>
* @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>
*
* @since 3.1
*/
public TreeItem getItem (int index) {
checkWidget();
if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (modelHandle, 0))) {
error (SWT.ERROR_INVALID_RANGE);
}
return _getItem (0, index);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
/**
* Removes the listener from the collection of listeners who will
* be notified when items in the receiver are expanded or collapsed.
*
* @param listener the listener which should no longer be notified
*
* @exception IllegalArgumentException <ul>
* <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
* </ul>
* @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>
*
* @see TreeListener
* @see #addTreeListener
*/
public void removeTreeListener(TreeListener listener) {
checkWidget ();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
if (eventTable == null) return;
eventTable.unhook (SWT.Expand, listener);
eventTable.unhook (SWT.Collapse, listener);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
void recreateRenderers () {
if (checkRenderer != 0) {
display.removeWidget (checkRenderer);
OS.g_object_unref (checkRenderer);
checkRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_toggle_get_type(), 0) : OS.gtk_cell_renderer_toggle_new ();
if (checkRenderer == 0) error (SWT.ERROR_NO_HANDLES);
OS.g_object_ref (checkRenderer);
display.addWidget (checkRenderer, this);
OS.g_signal_connect_closure (checkRenderer, OS.toggled, display.getClosure (TOGGLED), false);
}
if (columnCount == 0) {
createRenderers (OS.gtk_tree_view_get_column (handle, 0), Tree.FIRST_COLUMN, true, 0);
} else {
for (int i = 0; i < columnCount; i++) {
TreeColumn column = columns [i];
createRenderers (column.handle, column.modelIndex, i == 0, column.style);
}
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
void recreateRenderers () {
if (checkRenderer != 0) {
display.removeWidget (checkRenderer);
OS.g_object_unref (checkRenderer);
checkRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_toggle_get_type(), 0) : OS.gtk_cell_renderer_toggle_new ();
if (checkRenderer == 0) error (SWT.ERROR_NO_HANDLES);
OS.g_object_ref (checkRenderer);
display.addWidget (checkRenderer, this);
OS.g_signal_connect_closure (checkRenderer, OS.toggled, display.getClosure (TOGGLED), false);
}
if (columnCount == 0) {
createRenderers (OS.gtk_tree_view_get_column (handle, 0), Tree.FIRST_COLUMN, true, 0);
} else {
for (int i = 0; i < columnCount; i++) {
TreeColumn column = columns [i];
createRenderers (column.handle, column.modelIndex, i == 0, column.style);
}
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
void recreateRenderers () {
if (checkRenderer != 0) {
display.removeWidget (checkRenderer);
OS.g_object_unref (checkRenderer);
checkRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_toggle_get_type(), 0) : OS.gtk_cell_renderer_toggle_new ();
if (checkRenderer == 0) error (SWT.ERROR_NO_HANDLES);
OS.g_object_ref (checkRenderer);
display.addWidget (checkRenderer, this);
OS.g_signal_connect_closure (checkRenderer, OS.toggled, display.getClosure (TOGGLED), false);
}
if (columnCount == 0) {
createRenderers (OS.gtk_tree_view_get_column (handle, 0), Tree.FIRST_COLUMN, true, 0);
} else {
for (int i = 0; i < columnCount; i++) {
TreeColumn column = columns [i];
createRenderers (column.handle, column.modelIndex, i == 0, column.style);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!