本文整理汇总了Java中com.intellij.xdebugger.breakpoints.XLineBreakpoint类的典型用法代码示例。如果您正苦于以下问题:Java XLineBreakpoint类的具体用法?Java XLineBreakpoint怎么用?Java XLineBreakpoint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XLineBreakpoint类属于com.intellij.xdebugger.breakpoints包,在下文中一共展示了XLineBreakpoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEditorsProvider
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
@Override
public XDebuggerEditorsProvider getEditorsProvider(@NotNull XLineBreakpoint<XBreakpointProperties> breakpoint, @NotNull Project project)
{
final XSourcePosition position = breakpoint.getSourcePosition();
if (position == null)
{
return null;
}
final PsiFile file = PsiManager.getInstance(project).findFile(position.getFile());
if (file == null)
{
return null;
}
return new MuleDebuggerEditorsProvider();
}
示例2: getEditorsProvider
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
@Override
public XDebuggerEditorsProvider getEditorsProvider(@NotNull XLineBreakpoint<XBreakpointProperties> breakpoint, @NotNull Project project)
{
final XSourcePosition position = breakpoint.getSourcePosition();
if (position == null)
{
return null;
}
final PsiFile file = PsiManager.getInstance(project).findFile(position.getFile());
if (file == null)
{
return null;
}
return new WeaveDebuggerEditorsProvider();
}
示例3: getHighlightRange
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
@Nullable
@Override
public TextRange getHighlightRange(XLineBreakpoint<JavaLineBreakpointProperties> breakpoint) {
JavaLineBreakpointProperties properties = breakpoint.getProperties();
if (properties != null) {
Integer ordinal = properties.getLambdaOrdinal();
if (ordinal != null) {
Breakpoint javaBreakpoint = BreakpointManager.getJavaBreakpoint(breakpoint);
if (javaBreakpoint instanceof LineBreakpoint) {
PsiElement method = getContainingMethod((LineBreakpoint)javaBreakpoint);
if (method != null) {
return method.getTextRange();
}
}
}
}
return null;
}
示例4: findLineBreakpoints
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
@NotNull
private static Set<XLineBreakpoint> findLineBreakpoints(AnActionEvent e) {
Project project = e.getProject();
Editor editor = e.getData(CommonDataKeys.EDITOR);
if (project == null || editor == null) return Collections.emptySet();
XBreakpointManagerImpl breakpointManager = (XBreakpointManagerImpl)XDebuggerManager.getInstance(project).getBreakpointManager();
XLineBreakpointManager lineBreakpointManager = breakpointManager.getLineBreakpointManager();
Document document = editor.getDocument();
Collection<Range<Integer>> lineRanges = new ArrayList<Range<Integer>>();
for (Caret caret : editor.getCaretModel().getAllCarets()) {
lineRanges.add(new Range<Integer>(document.getLineNumber(caret.getSelectionStart()), document.getLineNumber(caret.getSelectionEnd())));
}
Collection<XLineBreakpointImpl> breakpoints = lineBreakpointManager.getDocumentBreakpoints(document);
HashSet<XLineBreakpoint> res = new HashSet<XLineBreakpoint>();
for (XLineBreakpointImpl breakpoint : breakpoints) {
int line = breakpoint.getLine();
for (Range<Integer> range : lineRanges) {
if (range.isWithin(line)) {
res.add(breakpoint);
}
}
}
return res;
}
示例5: getGroup
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
public XBreakpointFileGroup getGroup(@NotNull final B breakpoint, @NotNull final Collection<XBreakpointFileGroup> groups) {
if (!(breakpoint instanceof XLineBreakpoint)) {
return null;
}
XSourcePosition position = ((XLineBreakpoint)breakpoint).getSourcePosition();
if (position == null) return null;
VirtualFile file = position.getFile();
for (XBreakpointFileGroup group : groups) {
if (group.getFile().equals(file)) {
return group;
}
}
return new XBreakpointFileGroup(file);
}
示例6: init
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
public void init(Project project, XBreakpointManager breakpointManager, @NotNull B breakpoint, @Nullable XDebuggerEditorsProvider debuggerEditorsProvider) {
init(project, breakpointManager, breakpoint);
if (debuggerEditorsProvider != null) {
ActionListener listener = new ActionListener() {
public void actionPerformed(final ActionEvent e) {
onCheckboxChanged();
}
};
myLogExpressionComboBox = new XDebuggerExpressionComboBox(project, debuggerEditorsProvider, LOG_EXPRESSION_HISTORY_ID, myBreakpoint.getSourcePosition());
JComponent logExpressionComponent = myLogExpressionComboBox.getComponent();
myLogExpressionPanel.add(logExpressionComponent, BorderLayout.CENTER);
myLogExpressionComboBox.setEnabled(false);
myTemporaryCheckBox.setVisible(breakpoint instanceof XLineBreakpoint);
myLogExpressionCheckBox.addActionListener(listener);
DebuggerUIUtil.focusEditorOnCheck(myLogExpressionCheckBox, myLogExpressionComboBox.getEditorComponent());
}
else {
myExpressionPanel.getParent().remove(myExpressionPanel);
}
}
示例7: saveProperties
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
@Override
void saveProperties() {
myBreakpoint.setLogMessage(myLogMessageCheckBox.isSelected());
if (myBreakpoint instanceof XLineBreakpoint) {
((XLineBreakpoint)myBreakpoint).setTemporary(myTemporaryCheckBox.isSelected());
}
if (myLogExpressionComboBox != null) {
XExpression expression = myLogExpressionComboBox.getExpression();
XExpression logExpression = !XDebuggerUtilImpl.isEmptyExpression(expression) ? expression : null;
myBreakpoint.setLogExpressionEnabled(logExpression == null || myLogExpressionCheckBox.isSelected());
myBreakpoint.setLogExpressionObject(logExpression);
myLogExpressionComboBox.saveTextInHistory();
}
}
示例8: testSerialize
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
public void testSerialize() throws Exception {
XLineBreakpoint<?> master = createMaster();
XLineBreakpoint<?> slave = createSlave();
myDependentBreakpointManager.setMasterBreakpoint(slave, master, true);
Element element = save();
myDependentBreakpointManager.clearMasterBreakpoint(slave);
//System.out.println(JDOMUtil.writeElement(element, SystemProperties.getLineSeparator()));
load(element);
List<XBreakpoint<?>> breakpoints = getAllBreakpoints();
assertEquals(3, breakpoints.size());
assertEquals("default", ((MyBreakpointProperties)breakpoints.get(0).getProperties()).myOption);
XLineBreakpoint newMaster = (XLineBreakpoint)breakpoints.get(1);
XLineBreakpoint newSlave = (XLineBreakpoint)breakpoints.get(2);
assertEquals("file://master", newMaster.getFileUrl());
assertEquals("file://slave", newSlave.getFileUrl());
assertSame(newMaster, myDependentBreakpointManager.getMasterBreakpoint(newSlave));
assertTrue(myDependentBreakpointManager.isLeaveEnabled(newSlave));
}
示例9: testAddRemove
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
public void testAddRemove() {
XBreakpoint<MyBreakpointProperties> defaultBreakpoint = myBreakpointManager.getDefaultBreakpoint(MY_SIMPLE_BREAKPOINT_TYPE);
assertSameElements(getAllBreakpoints(), defaultBreakpoint);
XLineBreakpoint<MyBreakpointProperties> lineBreakpoint =
myBreakpointManager.addLineBreakpoint(MY_LINE_BREAKPOINT_TYPE, "url", 239, new MyBreakpointProperties("123"));
XBreakpoint<MyBreakpointProperties> breakpoint = myBreakpointManager.addBreakpoint(MY_SIMPLE_BREAKPOINT_TYPE, new MyBreakpointProperties("abc"));
assertSameElements(getAllBreakpoints(), breakpoint, lineBreakpoint, defaultBreakpoint);
assertSame(lineBreakpoint, assertOneElement(myBreakpointManager.getBreakpoints(MY_LINE_BREAKPOINT_TYPE)));
assertSameElements(myBreakpointManager.getBreakpoints(MY_SIMPLE_BREAKPOINT_TYPE), breakpoint, defaultBreakpoint);
myBreakpointManager.removeBreakpoint(lineBreakpoint);
assertSameElements(getAllBreakpoints(), breakpoint, defaultBreakpoint);
assertTrue(myBreakpointManager.getBreakpoints(MY_LINE_BREAKPOINT_TYPE).isEmpty());
assertSameElements(myBreakpointManager.getBreakpoints(MY_SIMPLE_BREAKPOINT_TYPE), breakpoint, defaultBreakpoint);
myBreakpointManager.removeBreakpoint(breakpoint);
assertSameElements(getAllBreakpoints(), defaultBreakpoint);
assertSameElements(myBreakpointManager.getBreakpoints(MY_SIMPLE_BREAKPOINT_TYPE), defaultBreakpoint);
}
示例10: testConditionConvert
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
public void testConditionConvert() {
String condition = "old-style condition";
String logExpression = "old-style expression";
String oldStyle =
"<breakpoint-manager>" +
"<breakpoints>" +
"<line-breakpoint enabled=\"true\" type=\"" + MY_LINE_BREAKPOINT_TYPE.getId() + "\">" +
" <condition>" + condition + "</condition>" +
" <url>url</url>" +
" <log-expression>" + logExpression + "</log-expression>" +
"</line-breakpoint>" +
"</breakpoints>" +
"<option name=\"time\" value=\"1\" />" +
"</breakpoint-manager>";
try {
Document document = JDOMUtil.loadDocument(oldStyle);
load(document.getRootElement());
}
catch (Exception e) {
e.printStackTrace();
fail();
}
XLineBreakpoint<MyBreakpointProperties> breakpoint = assertOneElement(myBreakpointManager.getBreakpoints(MY_LINE_BREAKPOINT_TYPE));
assertEquals(condition, breakpoint.getCondition());
assertEquals(logExpression, breakpoint.getLogExpression());
}
示例11: getFunctionName
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
private String getFunctionName(final XLineBreakpoint breakpoint) {
final VirtualFile file = breakpoint.getSourcePosition().getFile();
AccessToken lock = ApplicationManager.getApplication().acquireReadActionLock();
try {
final Document document = FileDocumentManager.getInstance().getDocument(file);
final Project project = getSession().getProject();
final String[] funcName = new String[1];
if (document != null) {
if (file.getFileType() == PythonFileType.INSTANCE) {
PsiElement psiElement = XDebuggerUtil.getInstance().findContextElement(file, breakpoint.getSourcePosition().getOffset(),
project, false);
PyFunction function = PsiTreeUtil.getParentOfType(psiElement, PyFunction.class);
if (function != null) {
funcName[0] = function.getName();
}
}
}
return funcName[0];
}
finally {
lock.finish();
}
}
示例12: testXDebugger
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
public void testXDebugger() throws Exception {
final WorkingContextManager manager = getContextManager();
final XBreakpointManager breakpointManager = XDebuggerManager.getInstance(getProject()).getBreakpointManager();
final XsltBreakpointType type = XBreakpointType.EXTENSION_POINT_NAME.findExtension(XsltBreakpointType.class);
ApplicationManager.getApplication().runWriteAction(new Runnable() {
public void run() {
XLineBreakpointImpl<XBreakpointProperties> breakpoint =
(XLineBreakpointImpl<XBreakpointProperties>)breakpointManager.addLineBreakpoint(type, "foo", 0, null);
final String name = "foo";
manager.saveContext(name, null);
breakpointManager.removeBreakpoint(breakpoint);
}
});
manager.loadContext("foo");
Collection<? extends XLineBreakpoint<XBreakpointProperties>> breakpoints = breakpointManager.getBreakpoints(type);
assertEquals(1, breakpoints.size());
manager.clearContext();
}
示例13: getEditorsProvider
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
@Override
public XDebuggerEditorsProvider getEditorsProvider(@NotNull XLineBreakpoint<XBreakpointProperties> breakpoint, @NotNull Project project) {
final XSourcePosition position = breakpoint.getSourcePosition();
if (position == null) {
return null;
}
final PsiFile file = PsiManager.getInstance(project).findFile(position.getFile());
if (file == null) {
return null;
}
final XsltChecker.LanguageLevel level = XsltSupport.getXsltLanguageLevel(file);
if (level == XsltChecker.LanguageLevel.V1) {
return myMyEditorsProvider1;
} else if (level == XsltChecker.LanguageLevel.V2) {
return myMyEditorsProvider2;
}
return null;
}
示例14: loadFrom
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
@Override
public void loadFrom(@NotNull XLineBreakpoint<CloudLineBreakpointProperties> breakpoint) {
XBreakpointBase lineBreakpointImpl =
breakpoint instanceof XBreakpointBase ? (XBreakpointBase) breakpoint : null;
Breakpoint javaBreakpoint = BreakpointManager.getJavaBreakpoint(breakpoint);
CloudLineBreakpoint cloudBreakpoint = null;
if (javaBreakpoint instanceof CloudLineBreakpoint) {
cloudBreakpoint = (CloudLineBreakpoint) javaBreakpoint;
}
if (cloudBreakpoint == null || lineBreakpointImpl == null) {
return;
}
errorPanel.setVisible(cloudBreakpoint.hasError());
if (cloudBreakpoint.hasError()) {
errorLabel.setForeground(JBColor.RED);
errorDescription.setText(cloudBreakpoint.getErrorMessage());
}
}
示例15: unregisterBreakpoint
import com.intellij.xdebugger.breakpoints.XLineBreakpoint; //导入依赖的package包/类
@Override
public void unregisterBreakpoint(
@NotNull XLineBreakpoint<CloudLineBreakpointProperties> ideBreakpoint, boolean temporary) {
// If the state was set to disabled as a result of a server update,
// then we do not need to update the server side.
if (!ideBreakpoint.getProperties().isDisabledByServer()) {
String breakpointId = ideBreakpoint.getUserData(CLOUD_ID);
if (!Strings.isNullOrEmpty(breakpointId)) {
process.getStateController().deleteBreakpointAsync(breakpointId);
} else {
LOG.warn("could not delete breakpoint because it was not added through the cloud handler.");
}
}
// reset this flag: either it has been disabled by the server or the client has deleted it, in
// both cases we need to add it again, if it is re-enabled
ideBreakpoint.getProperties().setAddedOnServer(false);
}