本文整理汇总了Java中org.eclipse.swt.custom.ST.DELETE_WORD_PREVIOUS属性的典型用法代码示例。如果您正苦于以下问题:Java ST.DELETE_WORD_PREVIOUS属性的具体用法?Java ST.DELETE_WORD_PREVIOUS怎么用?Java ST.DELETE_WORD_PREVIOUS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.custom.ST
的用法示例。
在下文中一共展示了ST.DELETE_WORD_PREVIOUS属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DeletePreviousSubWordAction
/**
* Creates a new delete previous sub-word action.
*/
public DeletePreviousSubWordAction() {
super(ST.DELETE_WORD_PREVIOUS);
}
示例2: DeletePreviousSubWordAction
/**
* Creates a new delete previous sub-word action.
*/
public DeletePreviousSubWordAction() {
super(ST.DELETE_WORD_PREVIOUS);
}
示例3: invokeAction
/**
* Execute some action.
*/
@Override
public void invokeAction(int action) {
//some actions have a different scope (not in selected range / out of selected range)
switch (action) {
case ST.LINE_START:
if (handleLineStartAction.execute(getDocument(), getCaretOffset(), getCommandLineOffset(),
ScriptConsoleViewer.this)) {
return;
} else {
super.invokeAction(action);
}
}
if (isSelectedRangeEditable()) {
try {
int historyChange = 0;
switch (action) {
case ST.LINE_UP:
historyChange = 1;
break;
case ST.LINE_DOWN:
historyChange = 2;
break;
case ST.DELETE_PREVIOUS:
handleBackspaceAction.execute(getDocument(),
(ITextSelection) ScriptConsoleViewer.this.getSelection(), getCommandLineOffset());
return;
case ST.DELETE_WORD_PREVIOUS:
handleDeletePreviousWord.execute(getDocument(), getCaretOffset(), getCommandLineOffset());
return;
}
if (historyChange != 0) {
if (changedAfterLastHistoryRequest) {
//only set a new match if it didn't change since the last time we did an UP/DOWN
history.setMatchStart(getCommandLine());
}
boolean didChange;
if (historyChange == 1) {
didChange = history.prev();
} else {
didChange = history.next();
}
if (didChange) {
inHistoryRequests += 1;
try {
listener.setCommandLine(history.get());
setCaretOffset(getDocument().getLength());
} finally {
inHistoryRequests -= 1;
}
}
changedAfterLastHistoryRequest = false;
return;
}
} catch (BadLocationException e) {
Log.log(e);
return;
}
super.invokeAction(action);
} else {
//we're not in the editable range (so, as the command was already checked to be valid,
//let's just let it keep its way)
super.invokeAction(action);
}
}