本文整理汇总了Java中org.eclipse.swt.SWT.DEL属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.DEL属性的具体用法?Java SWT.DEL怎么用?Java SWT.DEL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.DEL属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: glKeyPressed
public void glKeyPressed(KeyEvent e, boolean ctrlIsDown, boolean shiftIsDown, ParamSet paramSet) {
Sketch sketch = AvoGlobal.project.getActiveSketch();
if(sketch != null && !sketch.isConsumed){
if(e.character == SWT.DEL){
for(int i = sketch.getFeat2DListSize()-1; i >= 0; i--){
Feature2D f2D = sketch.getAtIndex(i);
if(f2D.isSelected()){
sketch.removeFeat2DAtIndex(i);
}
}
}
AvoGlobal.glView.updateGLView = true;
}
}
示例2: handleSearchKeyPress
private void handleSearchKeyPress(KeyEvent e) {
TableViewSWTFilter<?> filter = tv.getSWTFilter();
if (filter == null || e.widget == filter.widget) {
return;
}
String newText = null;
// normal character: jump to next item with a name beginning with this character
if (ASYOUTYPE_MODE == ASYOUTYPE_MODE_FIND) {
if (System.currentTimeMillis() - filter.lastFilterTime > 3000)
newText = "";
}
if (e.keyCode == SWT.BS) {
if (e.stateMask == SWT.CONTROL) {
newText = "";
} else if (filter.nextText.length() > 0) {
newText = filter.nextText.substring(0, filter.nextText.length() - 1);
}
} else if ((e.stateMask & ~SWT.SHIFT) == 0 && e.character > 32 && e.character != SWT.DEL) {
newText = filter.nextText + String.valueOf(e.character);
}
if (newText == null) {
return;
}
if (ASYOUTYPE_MODE == ASYOUTYPE_MODE_FILTER) {
if (filter != null && filter.widget != null && !filter.widget.isDisposed()) {
filter.widget.setFocus();
}
tv.setFilterText(newText);
// } else {
// TableCellCore[] cells = getColumnCells("name");
//
// //System.out.println(sLastSearch);
//
// Arrays.sort(cells, TableCellImpl.TEXT_COMPARATOR);
// int index = Arrays.binarySearch(cells, filter.text,
// TableCellImpl.TEXT_COMPARATOR);
// if (index < 0) {
//
// int iEarliest = -1;
// String s = filter.regex ? filter.text : "\\Q" + filter.text + "\\E";
// Pattern pattern = Pattern.compile(s, Pattern.CASE_INSENSITIVE);
// for (int i = 0; i < cells.length; i++) {
// Matcher m = pattern.matcher(cells[i].getText());
// if (m.find() && (m.start() < iEarliest || iEarliest == -1)) {
// iEarliest = m.start();
// index = i;
// }
// }
//
// if (index < 0)
// // Insertion Point (best guess)
// index = -1 * index - 1;
// }
//
// if (index >= 0) {
// if (index >= cells.length)
// index = cells.length - 1;
// TableRowCore row = cells[index].getTableRowCore();
// int iTableIndex = row.getIndex();
// if (iTableIndex >= 0) {
// setSelectedRows(new TableRowCore[] {
// row
// });
// }
// }
// filter.lastFilterTime = System.currentTimeMillis();
}
e.doit = false;
}