本文整理了Java中org.eclipse.swt.accessibility.Accessible.selectionChanged()
方法的一些代码示例,展示了Accessible.selectionChanged()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Accessible.selectionChanged()
方法的具体详情如下:
包路径:org.eclipse.swt.accessibility.Accessible
类名称:Accessible
方法名:selectionChanged
[英]Sends a message to accessible clients that the child selection within a custom container control has changed.
[中]向可访问的客户端发送消息,说明自定义容器控件中的子选择已更改。
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
@Override
public void notifyListeners (int eventType, Event event) {
super.notifyListeners(eventType, event);
if (eventType == SWT.Selection && event.detail != SWT.CHECK) getAccessible().selectionChanged();
}
void onArrowDown (int stateMask) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
void deselectItem (CTableItem item) {
int index = getSelectionIndex (item);
if (index == -1) return;
CTableItem[] newSelectedItems = new CTableItem [selectedItems.length - 1];
System.arraycopy (selectedItems, 0, newSelectedItems, 0, index);
System.arraycopy (
selectedItems,
index + 1,
newSelectedItems,
index,
newSelectedItems.length - index);
selectedItems = newSelectedItems;
item.getAccessible(getAccessible(), 0).selectionChanged();
}
void destroyItem (CTableColumn column) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
redraw();
getAccessible().setFocus(selectedItem);
getAccessible().selectionChanged();
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
void selectItem (CTableItem item, boolean addToSelection) {
CTableItem[] oldSelectedItems = selectedItems;
if (!addToSelection || (getStyle () & SWT.SINGLE) != 0) {
selectedItems = new CTableItem[] {item};
if (isFocusControl () || (getStyle () & SWT.HIDE_SELECTION) == 0) {
for (CTableItem oldSelectedItem : oldSelectedItems) {
if (oldSelectedItem != item) {
redrawItem (oldSelectedItem.index, true);
}
}
}
for (CTableItem oldSelectedItem : oldSelectedItems) {
oldSelectedItem.getAccessible(getAccessible(), 0).selectionChanged();
}
} else {
if (item.isSelected ()) return;
selectedItems = new CTableItem [selectedItems.length + 1];
System.arraycopy (oldSelectedItems, 0, selectedItems, 0, oldSelectedItems.length);
selectedItems [selectedItems.length - 1] = item;
}
item.getAccessible(getAccessible(), 0).selectionChanged();
getAccessible().selectionChanged();
}
@Override
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
private void notifySelectionChanged() {
Event event = new Event();
event.widget = this;
event.display = this.getDisplay();
event.type = SWT.Selection;
notifyListeners(SWT.Selection, event);
// A listener could have caused the widget to be disposed
if (!isDisposed()) {
getAccessible().selectionChanged();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
private void notifySelectionChanged() {
Event event = new Event();
event.widget = this;
event.display = this.getDisplay();
event.type = SWT.Selection;
notifyListeners(SWT.Selection, event);
// A listener could have caused the widget to be disposed
if (!isDisposed()) {
getAccessible().selectionChanged();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Deselects all selected items in the receiver.
*
* @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 deselectAll () {
checkWidget ();
CTableItem[] oldSelection = selectedItems;
selectedItems = new CTableItem [0];
if (isFocusControl () || (getStyle () & SWT.HIDE_SELECTION) == 0) {
for (CTableItem element : oldSelection) {
redrawItem (element.index, true);
}
}
for (CTableItem element : oldSelection) {
element.getAccessible(getAccessible(), 0).selectionChanged();
}
if (oldSelection.length > 0) getAccessible().selectionChanged();
}
void deselectItem (CTableItem item) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Selects all of the items in the receiver.
* <p>
* If the receiver is single-select, do nothing.
* </p>
*
* @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 selectAll () {
checkWidget ();
if ((getStyle () & SWT.SINGLE) != 0) return;
selectedItems = new CTableItem [itemsCount];
System.arraycopy (items, 0, selectedItems, 0, itemsCount);
if (isFocusControl () || (getStyle () & SWT.HIDE_SELECTION) == 0) {
redraw ();
}
for (CTableItem selectedItem : selectedItems) {
selectedItem.getAccessible(getAccessible(), 0).selectionChanged();
}
getAccessible().selectionChanged();
}
void selectItem (CTableItem item, boolean addToSelection) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Deselects the item at the given zero-relative index in the receiver.
* If the item at the index was already deselected, it remains
* deselected. Indices that are out of range are ignored.
*
* @param index the index of the item to deselect
*
* @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 deselect (int index) {
checkWidget ();
if (!(0 <= index && index < itemsCount)) return;
CTableItem item = items [index];
int selectIndex = getSelectionIndex (item);
if (selectIndex == -1) return;
CTableItem[] newSelectedItems = new CTableItem [selectedItems.length - 1];
System.arraycopy (selectedItems, 0, newSelectedItems, 0, selectIndex);
System.arraycopy (selectedItems, selectIndex + 1, newSelectedItems, selectIndex, newSelectedItems.length - selectIndex);
selectedItems = newSelectedItems;
if (isFocusControl () || (getStyle () & SWT.HIDE_SELECTION) == 0) {
redrawItem (item.index, false);
}
getAccessible().selectionChanged();
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
redrawItems (start, end, false);
getAccessible().selectionChanged();
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
if (!oldSelection [i].isSelected ()) {
redrawItem (oldSelection [i].index, true);
oldSelection[i].getAccessible(getAccessible(), 0).selectionChanged();
tableSelectionChanged = true;
selectedItem.getAccessible(getAccessible(), 0).selectionChanged();
tableSelectionChanged = true;
if (tableSelectionChanged) getAccessible().selectionChanged();
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Selects the item at the given zero-relative index in the receiver.
* If the item at the index was already selected, it remains
* selected. Indices that are out of range are ignored.
*
* @param index the index of the item to select
*
* @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 select (int index) {
checkWidget ();
if (!(0 <= index && index < itemsCount)) return;
selectItem (items [index], (getStyle () & SWT.MULTI) != 0);
if (isFocusControl () || (getStyle () & SWT.HIDE_SELECTION) == 0) {
redrawItem (index, false);
}
getAccessible().selectionChanged();
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
/**
* Selects the item at the given zero-relative index in the receiver.
* The current selection is first cleared, then the new item is selected.
*
* @param index the index of the item to select
*
* @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 CTable#deselectAll()
* @see CTable#select(int)
*/
public void setSelection (int index) {
checkWidget ();
deselectAll ();
if (!(0 <= index && index < itemsCount)) return;
selectItem (items [index], false);
setFocusItem (items [index], true);
redrawItem (index, true);
showSelection ();
getAccessible().selectionChanged();
}
/**
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
getAccessible().selectionChanged();
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
redraw();
getAccessible().setFocus(item);
getAccessible().selectionChanged();
内容来源于网络,如有侵权,请联系作者删除!