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


Java JavaBreakpointProperties类代码示例

本文整理汇总了Java中org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties的典型用法代码示例。如果您正苦于以下问题:Java JavaBreakpointProperties类的具体用法?Java JavaBreakpointProperties怎么用?Java JavaBreakpointProperties使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JavaBreakpointProperties类属于org.jetbrains.java.debugger.breakpoints.properties包,在下文中一共展示了JavaBreakpointProperties类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getContainingMethod

import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties; //导入依赖的package包/类
@Nullable
public PsiElement getContainingMethod(@NotNull LineBreakpoint<?> breakpoint) {
  SourcePosition position = breakpoint.getSourcePosition();
  if (position == null) return null;

  JavaBreakpointProperties properties = breakpoint.getProperties();
  if (properties instanceof JavaLineBreakpointProperties && !(breakpoint instanceof RunToCursorBreakpoint)) {
    Integer ordinal = ((JavaLineBreakpointProperties)properties).getLambdaOrdinal();
    if (ordinal > -1) {
      List<PsiLambdaExpression> lambdas = DebuggerUtilsEx.collectLambdas(position, true);
      if (ordinal < lambdas.size()) {
        return lambdas.get(ordinal);
      }
    }
  }
  return DebuggerUtilsEx.getContainingMethod(position);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JavaLineBreakpointType.java

示例2: createBreakpoint

import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties; //导入依赖的package包/类
/**
 * Factory method that creates and returns a {@link Breakpoint} from a given
 * {@link XBreakpoint}.
 */
public static Breakpoint createBreakpoint(XBreakpoint breakpoint) {
    Breakpoint result = new Breakpoint(breakpoint.hashCode(),
            BreakpointClassifier.classify(breakpoint));

    // Initialize enabled and SuspendPolicy fields.
    result.setEnabled(breakpoint.isEnabled());
    result.setSuspendPolicy(breakpoint.getSuspendPolicy().ordinal());

    // Initialize hit count field.
    result.setHitCount(-1);
    if (breakpoint.getProperties() instanceof JavaBreakpointProperties) {
        JavaBreakpointProperties properties = (JavaBreakpointProperties) breakpoint.getProperties();
        if (properties.isCOUNT_FILTER_ENABLED()) {
            result.setHitCount(properties.getCOUNT_FILTER());
        }
    }

    // Initialize condition fields if available.
    XExpression condition = breakpoint.getConditionExpression();
    if (condition != null) {
        result.setCondition(condition.getExpression());
        result.setConditionEnabled(true);
    }
    return result;
}
 
开发者ID:TestRoots,项目名称:watchdog,代码行数:30,代码来源:BreakpointCreator.java

示例3: matchesPosition

import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties; //导入依赖的package包/类
public boolean matchesPosition(@NotNull LineBreakpoint<?> breakpoint, @NotNull SourcePosition position)
{
	JavaBreakpointProperties properties = breakpoint.getProperties();
	if(properties instanceof JavaLineBreakpointProperties)
	{
		if(!(breakpoint instanceof RunToCursorBreakpoint) && ((JavaLineBreakpointProperties) properties).getLambdaOrdinal() == null)
		{
			return true;
		}
		PsiElement containingMethod = getContainingMethod(breakpoint);
		if(containingMethod == null)
		{
			return false;
		}
		return DebuggerUtilsEx.inTheMethod(position, containingMethod);
	}
	return true;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:19,代码来源:JavaLineBreakpointType.java

示例4: getContainingMethod

import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties; //导入依赖的package包/类
@Nullable
public PsiElement getContainingMethod(@NotNull LineBreakpoint<?> breakpoint)
{
	SourcePosition position = breakpoint.getSourcePosition();
	if(position == null)
	{
		return null;
	}

	JavaBreakpointProperties properties = breakpoint.getProperties();
	if(properties instanceof JavaLineBreakpointProperties && !(breakpoint instanceof RunToCursorBreakpoint))
	{
		Integer ordinal = ((JavaLineBreakpointProperties) properties).getLambdaOrdinal();
		if(ordinal > -1)
		{
			List<PsiLambdaExpression> lambdas = DebuggerUtilsEx.collectLambdas(position, true);
			if(ordinal < lambdas.size())
			{
				return lambdas.get(ordinal);
			}
		}
	}
	return DebuggerUtilsEx.getContainingMethod(position);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:25,代码来源:JavaLineBreakpointType.java

示例5: isVisibleOnPopup

import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties; //导入依赖的package包/类
@Override
public boolean isVisibleOnPopup(@NotNull B breakpoint) {
  JavaBreakpointProperties properties = breakpoint.getProperties();
  if (properties != null) {
    return properties.isCOUNT_FILTER_ENABLED() || properties.isCLASS_FILTERS_ENABLED() || properties.isINSTANCE_FILTERS_ENABLED();
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:JavaBreakpointFiltersPanel.java

示例6: saveTo

import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties; //导入依赖的package包/类
@Override
public void saveTo(@NotNull B breakpoint) {
  JavaBreakpointProperties properties = breakpoint.getProperties();
  if (properties == null) {
    return;
  }

  boolean changed = false;
  try {
    String text = myPassCountField.getText().trim();
    int filter = !text.isEmpty() ? Integer.parseInt(text) : 0;
    if (filter < 0) filter = 0;
    changed = properties.setCOUNT_FILTER(filter);
  }
  catch (Exception ignored) {
  }

  changed = properties.setCOUNT_FILTER_ENABLED(properties.getCOUNT_FILTER() > 0 && myPassCountCheckbox.isSelected()) || changed;
  reloadInstanceFilters();
  reloadClassFilters();
  updateInstanceFilterEditor(true);
  updateClassFilterEditor(true);

  changed = properties.setINSTANCE_FILTERS_ENABLED(myInstanceFiltersField.getText().length() > 0 && myInstanceFiltersCheckBox.isSelected()) || changed;
  changed = properties.setCLASS_FILTERS_ENABLED(myClassFiltersField.getText().length() > 0 && myClassFiltersCheckBox.isSelected()) || changed;
  changed = properties.setClassFilters(myClassFilters) || changed;
  changed = properties.setClassExclusionFilters(myClassExclusionFilters) || changed;
  changed = properties.setInstanceFilters(myInstanceFilters) || changed;
  if (changed) {
    ((XBreakpointBase)breakpoint).fireBreakpointChanged();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:JavaBreakpointFiltersPanel.java

示例7: loadFrom

import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties; //导入依赖的package包/类
@Override
public void loadFrom(@NotNull B breakpoint) {
  JavaBreakpointProperties properties = breakpoint.getProperties();
  if (properties != null) {
    if (properties.getCOUNT_FILTER() > 0) {
      myPassCountField.setText(Integer.toString(properties.getCOUNT_FILTER()));
    }
    else {
      myPassCountField.setText("");
    }

    myPassCountCheckbox.setSelected(properties.isCOUNT_FILTER_ENABLED());

    myInstanceFiltersCheckBox.setSelected(properties.isINSTANCE_FILTERS_ENABLED());
    myInstanceFiltersField.setEnabled(properties.isINSTANCE_FILTERS_ENABLED());
    myInstanceFiltersField.getTextField().setEditable(properties.isINSTANCE_FILTERS_ENABLED());
    myInstanceFilters = properties.getInstanceFilters();
    updateInstanceFilterEditor(true);

    myClassFiltersCheckBox.setSelected(properties.isCLASS_FILTERS_ENABLED());
    myClassFiltersField.setEnabled(properties.isCLASS_FILTERS_ENABLED());
    myClassFiltersField.getTextField().setEditable(properties.isCLASS_FILTERS_ENABLED());
    myClassFilters = properties.getClassFilters();
    myClassExclusionFilters = properties.getClassExclusionFilters();
    updateClassFilterEditor(true);

    XSourcePosition position = breakpoint.getSourcePosition();
    // TODO: need to calculate psi class
    //myBreakpointPsiClass = breakpoint.getPsiClass();
  }
  updateCheckboxes();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:JavaBreakpointFiltersPanel.java

示例8: matchesPosition

import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties; //导入依赖的package包/类
public boolean matchesPosition(@NotNull LineBreakpoint<?> breakpoint, @NotNull SourcePosition position) {
  JavaBreakpointProperties properties = breakpoint.getProperties();
  if (properties instanceof JavaLineBreakpointProperties) {
    if (!(breakpoint instanceof RunToCursorBreakpoint) && ((JavaLineBreakpointProperties)properties).getLambdaOrdinal() == null) return true;
    PsiElement containingMethod = getContainingMethod(breakpoint);
    if (containingMethod == null) return false;
    return DebuggerUtilsEx.inTheMethod(position, containingMethod);
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JavaLineBreakpointType.java

示例9: isVisibleOnPopup

import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties; //导入依赖的package包/类
@Override
public boolean isVisibleOnPopup(@NotNull B breakpoint)
{
	JavaBreakpointProperties properties = breakpoint.getProperties();
	if(properties != null)
	{
		return properties.isCOUNT_FILTER_ENABLED() || properties.isCLASS_FILTERS_ENABLED() || properties.isINSTANCE_FILTERS_ENABLED();
	}
	return false;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:11,代码来源:JavaBreakpointFiltersPanel.java

示例10: loadFrom

import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties; //导入依赖的package包/类
@Override
public void loadFrom(@NotNull B breakpoint)
{
	JavaBreakpointProperties properties = breakpoint.getProperties();
	if(properties != null)
	{
		if(properties.getCOUNT_FILTER() > 0)
		{
			myPassCountField.setText(Integer.toString(properties.getCOUNT_FILTER()));
		}
		else
		{
			myPassCountField.setText("");
		}

		myPassCountCheckbox.setSelected(properties.isCOUNT_FILTER_ENABLED());

		myInstanceFiltersCheckBox.setSelected(properties.isINSTANCE_FILTERS_ENABLED());
		myInstanceFiltersField.setEnabled(properties.isINSTANCE_FILTERS_ENABLED());
		myInstanceFiltersField.getTextField().setEditable(properties.isINSTANCE_FILTERS_ENABLED());
		myInstanceFilters = properties.getInstanceFilters();
		updateInstanceFilterEditor(true);

		myClassFiltersCheckBox.setSelected(properties.isCLASS_FILTERS_ENABLED());
		myClassFiltersField.setEnabled(properties.isCLASS_FILTERS_ENABLED());
		myClassFiltersField.getTextField().setEditable(properties.isCLASS_FILTERS_ENABLED());
		myClassFilters = properties.getClassFilters();
		myClassExclusionFilters = properties.getClassExclusionFilters();
		updateClassFilterEditor(true);

		XSourcePosition position = breakpoint.getSourcePosition();
		// TODO: need to calculate psi class
		//myBreakpointPsiClass = breakpoint.getPsiClass();
	}
	updateCheckboxes();
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:37,代码来源:JavaBreakpointFiltersPanel.java

示例11: saveTo

import org.jetbrains.java.debugger.breakpoints.properties.JavaBreakpointProperties; //导入依赖的package包/类
@Override
public void saveTo(@NotNull B breakpoint)
{
	JavaBreakpointProperties properties = breakpoint.getProperties();
	if(properties == null)
	{
		return;
	}

	boolean changed = false;
	try
	{
		String text = myPassCountField.getText().trim();
		int filter = !text.isEmpty() ? Integer.parseInt(text) : 0;
		if(filter < 0)
		{
			filter = 0;
		}
		changed = properties.setCOUNT_FILTER(filter);
	}
	catch(Exception ignored)
	{
	}

	changed = properties.setCOUNT_FILTER_ENABLED(properties.getCOUNT_FILTER() > 0 && myPassCountCheckbox.isSelected()) || changed;
	reloadInstanceFilters();
	reloadClassFilters();
	updateInstanceFilterEditor(true);
	updateClassFilterEditor(true);

	changed = properties.setINSTANCE_FILTERS_ENABLED(myInstanceFiltersField.getText().length() > 0 && myInstanceFiltersCheckBox.isSelected()) ||
			changed;
	changed = properties.setCLASS_FILTERS_ENABLED(myClassFiltersField.getText().length() > 0 && myClassFiltersCheckBox.isSelected()) || changed;
	changed = properties.setClassFilters(myClassFilters) || changed;
	changed = properties.setClassExclusionFilters(myClassExclusionFilters) || changed;
	changed = properties.setInstanceFilters(myInstanceFilters) || changed;
	if(changed)
	{
		((XBreakpointBase) breakpoint).fireBreakpointChanged();
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:42,代码来源:JavaBreakpointFiltersPanel.java


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