本文整理汇总了Java中org.eclipse.jface.text.link.ILinkedModeListener.EXIT_ALL属性的典型用法代码示例。如果您正苦于以下问题:Java ILinkedModeListener.EXIT_ALL属性的具体用法?Java ILinkedModeListener.EXIT_ALL怎么用?Java ILinkedModeListener.EXIT_ALL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jface.text.link.ILinkedModeListener
的用法示例。
在下文中一共展示了ILinkedModeListener.EXIT_ALL属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doExit
public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length) {
if (fSize == fStack.size() && !isMasked(offset)) {
if (event.character == fExitCharacter) {
BracketLevel level= (BracketLevel) fStack.peek();
if (level.fFirstPosition.offset > offset || level.fSecondPosition.offset < offset)
return null;
if (level.fSecondPosition.offset == offset && length == 0)
// don't enter the character if if its the closing peer
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
}
// when entering an anonymous class between the parenthesis', we don't want
// to jump after the closing parenthesis when return is pressed
if (event.character == SWT.CR && offset > 0) {
IDocument document= sourceViewer.getDocument();
try {
if (document.getChar(offset - 1) == '{')
return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
} catch (BadLocationException e) {
}
}
}
return null;
}
示例2: doExit
public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length) {
if (fSize == fStack.size() && !isMasked(offset)) {
if (event.character == fExitCharacter) {
BracketLevel level = (BracketLevel) fStack.peek();
if (level.fFirstPosition.offset > offset || level.fSecondPosition.offset < offset)
return null;
if (level.fSecondPosition.offset == offset && length == 0)
// don't enter the character if if its the closing peer
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
}
// when entering an anonymous class between the parenthesis', we
// don't want
// to jump after the closing parenthesis when return is pressed
if (event.character == SWT.CR && offset > 0) {
IDocument document = getSourceViewer().getDocument();
try {
if (document.getChar(offset - 1) == '{')
return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
} catch (BadLocationException e) {
}
}
}
return null;
}
示例3: doExit
public ExitFlags doExit(LinkedModeModel model, VerifyEvent event,
int offset, int length) {
if (!isMasked(offset)) {
if (event.character == fExit)
return new ExitFlags(ILinkedModeListener.UPDATE_CARET,
false);
if (event.character == '\r' || event.character == '\n'
&& offset > 0) {
try {
if (fDocument.getChar(offset - 1) == '{') {
return new ExitFlags(ILinkedModeListener.EXIT_ALL,
true);
}
} catch (BadLocationException e) {
}
}
}
return null;
}
示例4: doExit
public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length)
{
if (shouldInsertNewline())
{
if (event.character == '\n' || event.character == '\r')
{
return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
}
}
if (event.character != fExitCharacter)
return null;
if (fSize == fStack.size() && !isEscaped(offset))
{
BracketLevel level = fStack.peek();
if (offset < level.fFirstPosition.offset || level.fSecondPosition.offset < offset)
return null;
if (level.fSecondPosition.offset == offset && length == 0)
// don't enter the character if it is the closing peer
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
}
return null;
}
示例5: doExit
public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length) {
if (fSize == fStack.size() && !isMasked(offset)) {
if (event.character == fExitCharacter) {
BracketLevel level= fStack.peek();
if (level.fFirstPosition.offset > offset || level.fSecondPosition.offset < offset)
return null;
if (level.fSecondPosition.offset == offset && length == 0)
// don't enter the character if if its the closing peer
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
}
// when entering an anonymous class between the parenthesis', we don't want
// to jump after the closing parenthesis when return is pressed
if (event.character == SWT.CR && offset > 0) {
IDocument document= getSourceViewer().getDocument();
try {
if (document.getChar(offset - 1) == '{')
return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
} catch (BadLocationException e) {
}
}
}
return null;
}
示例6: doExit
@Override
public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length) {
if (fSize == fStack.size() && !isMasked(offset)) {
if (event.character == fExitCharacter) {
BracketLevel level = fStack.peek();
if (level.fFirstPosition.offset > offset || level.fSecondPosition.offset < offset)
return null;
if (level.fSecondPosition.offset == offset && length == 0)
// don't enter the character if if its the closing peer
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
}
// when entering an anonymous class between the parenthesis', we don't want
// to jump after the closing parenthesis when return is pressed
if (event.character == SWT.CR && offset > 0) {
IDocument document = getSourceViewer().getDocument();
try {
if (document.getChar(offset - 1) == '{')
return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
} catch (BadLocationException e) {}
}
}
return null;
}
示例7: doExit
@Override
public ExitFlags doExit(LinkedModeModel environment, VerifyEvent event, int offset, int length) {
if (event.character == fExitCharacter) {
if (environment.anyPositionContains(offset))
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
else
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, true);
}
switch (event.character) {
case ';':
return new ExitFlags(ILinkedModeListener.NONE, true);
case SWT.CR:
// when entering an anonymous class as a parameter, we don't
// want
// to jump after the parenthesis when return is pressed
if (offset > 0) {
try {
if (fDocument.getChar(offset - 1) == '{')
return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
} catch (BadLocationException e) {
}
}
return null;
default:
return null;
}
}
示例8: resume
public void resume(LinkedModeModel model, int flags) {
if ((flags & ILinkedModeListener.EXIT_ALL) != 0) {
leave(flags);
} else {
connect();
if ((flags & ILinkedModeListener.SELECT) != 0)
select();
ensureAnnotationModelInstalled();
redraw();
}
}
示例9: doExit
public ExitFlags doExit(LinkedModeModel environment, VerifyEvent event, int offset, int length) {
if (event.character == fExitCharacter) {
if (environment.anyPositionContains(offset))
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
else
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, true);
}
switch (event.character) {
case ';':
return new ExitFlags(ILinkedModeListener.NONE, true);
case SWT.CR:
// when entering an anonymous class as a parameter, we don't
// want
// to jump after the parenthesis when return is pressed
if (offset > 0) {
try {
if (fDocument.getChar(offset - 1) == '{')
return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
} catch (BadLocationException e) {
}
}
return null;
default:
return null;
}
}
示例10: doExit
public ExitFlags doExit(LinkedModeModel environment, VerifyEvent event, int offset, int length) {
if (event.character == fExitCharacter) {
if (environment.anyPositionContains(offset))
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
else
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, true);
}
switch (event.character) {
case ';':
return new ExitFlags(ILinkedModeListener.NONE, true);
case SWT.CR:
// 1) when entering an anonymous class as a parameter, we don't want
// to jump after the parenthesis when return is pressed
// 2) after auto completion of methods without parameters, exit from linked mode when return is pressed
if (offset > 0) {
try {
char prevOffsetChar= fDocument.getChar(offset - 1);
if (prevOffsetChar == '{' || prevOffsetChar == ';')
return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
} catch (BadLocationException e) {
}
}
return null;
default:
return null;
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:29,代码来源:AbstractJavaCompletionProposal.java
示例11: doExit
public ExitFlags doExit(LinkedModeModel environment, VerifyEvent event, int offset, int length) {
if (event.character == fExitCharacter) {
if (environment.anyPositionContains(offset))
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
else
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, true);
}
switch (event.character) {
case ';':
return new ExitFlags(ILinkedModeListener.NONE, true);
case SWT.CR:
// when entering an anonymous class as a parameter, we don't want
// to jump after the parenthesis when return is pressed
if (offset > 0) {
try {
if (fDocument.getChar(offset - 1) == '{')
return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
} catch (BadLocationException e) {
}
}
return null;
default:
return null;
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:27,代码来源:AbstractJavaCompletionProposal.java
示例12: doExit
@Override
public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length) {
switch (event.character) {
case SWT.CR:
int endOfReplacement = getReplaceOffset() + getEffectiveReplaceString(false).length();
if(offset == endOfReplacement) {
return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
}
return new ExitFlags(ILinkedModeListener.UPDATE_CARET, false);
}
return null;
}
示例13: doExit
public ExitFlags doExit(LinkedModeModel model, VerifyEvent event, int offset, int length) {
if (event.character == '=') {
return new ExitFlags(ILinkedModeListener.EXIT_ALL, true);
}
return null;
}