Java Code Examples for com.intellij.openapi.util.text.StringUtil#equalsIgnoreWhitespaces()

The following examples show how to use com.intellij.openapi.util.text.StringUtil#equalsIgnoreWhitespaces() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RangesBuilder.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;

  LineWrapper wrapper = (LineWrapper)o;

  if (myHash != wrapper.myHash) return false;

  return StringUtil.equalsIgnoreWhitespaces(myLine, wrapper.myLine);
}
 
Example 2
Source File: ByLine.java    From consulo with Apache License 2.0 5 votes vote down vote up
private static boolean equals(@Nonnull CharSequence text1, @Nonnull CharSequence text2, @Nonnull ComparisonPolicy policy) {
  switch (policy) {
    case DEFAULT:
      return StringUtil.equals(text1, text2);
    case TRIM_WHITESPACES:
      return StringUtil.equalsTrimWhitespaces(text1, text2);
    case IGNORE_WHITESPACES:
      return StringUtil.equalsIgnoreWhitespaces(text1, text2);
    default:
      throw new IllegalArgumentException(policy.toString());
  }
}
 
Example 3
Source File: ComparisonUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Contract(pure = true)
public static boolean isEquals(@Nonnull CharSequence text1, @Nonnull CharSequence text2, @Nonnull ComparisonPolicy policy) {
  switch (policy) {
    case DEFAULT:
      return StringUtil.equals(text1, text2);
    case TRIM_WHITESPACES:
      return equalsTrimWhitespaces(text1, text2);
    case IGNORE_WHITESPACES:
      return StringUtil.equalsIgnoreWhitespaces(text1, text2);
    default:
      throw new IllegalArgumentException(policy.name());
  }
}
 
Example 4
Source File: PantsTestRunConfigurationProducer.java    From intellij-pants-plugin with Apache License 2.0 4 votes vote down vote up
private boolean compareSettings(ExternalSystemTaskExecutionSettings settings1, ExternalSystemTaskExecutionSettings settings2) {
  return settings1.equals(settings2) &&
         StringUtil.equalsIgnoreWhitespaces(settings1.getScriptParameters(), settings2.getScriptParameters()) &&
         StringUtil.equals(settings1.getExecutionName(), settings2.getExecutionName());
}
 
Example 5
Source File: LineFragmentSplitter.java    From consulo with Apache License 2.0 4 votes vote down vote up
private boolean isEqualsIgnoreWhitespace(@Nonnull WordBlock block) {
  CharSequence sequence1 = myText1.subSequence(block.offsets.start1, block.offsets.end1);
  CharSequence sequence2 = myText2.subSequence(block.offsets.start2, block.offsets.end2);

  return StringUtil.equalsIgnoreWhitespaces(sequence1, sequence2);
}
 
Example 6
Source File: AmendComponent.java    From consulo with Apache License 2.0 4 votes vote down vote up
private void substituteCommitMessage(@Nonnull String newMessage) {
  if (!StringUtil.equalsIgnoreWhitespaces(myPreviousMessage, newMessage)) {
    VcsConfiguration.getInstance(myCheckinPanel.getProject()).saveCommitMessage(myPreviousMessage);
    myCheckinPanel.setCommitMessage(newMessage);
  }
}