当前位置: 首页>>代码示例>>Java>>正文


Java ST.DELETE_WORD_PREVIOUS属性代码示例

本文整理汇总了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);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:6,代码来源:XtextEditor.java

示例2: DeletePreviousSubWordAction

/**
 * Creates a new delete previous sub-word action.
 */
public DeletePreviousSubWordAction() {
    super(ST.DELETE_WORD_PREVIOUS);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:6,代码来源:SubWordActions.java

示例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);
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:77,代码来源:ScriptConsoleViewer.java


注:本文中的org.eclipse.swt.custom.ST.DELETE_WORD_PREVIOUS属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。