Java 类com.intellij.psi.codeStyle.arrangement.ArrangementEntry 实例源码

项目:intellij-ce-playground    文件:ArrangementEntryWrapper.java   
@SuppressWarnings("unchecked")
public ArrangementEntryWrapper(@NotNull E entry) {
  myEntry = entry;
  myStartOffset = entry.getStartOffset();
  myEndOffset = entry.getEndOffset();
  ArrangementEntryWrapper<E> previous = null;
  for (ArrangementEntry child : entry.getChildren()) {
    ArrangementEntryWrapper<E> childWrapper = new ArrangementEntryWrapper<E>((E)child);
    childWrapper.setParent(this);
    if (previous != null) {
      previous.setNext(childWrapper);
      childWrapper.setPrevious(previous);
    }
    previous = childWrapper;
    myChildren.add(childWrapper);
  }
}
项目:tools-idea    文件:ArrangementEntryWrapper.java   
@SuppressWarnings("unchecked")
public ArrangementEntryWrapper(@NotNull E entry) {
  myEntry = entry;
  myStartOffset = entry.getStartOffset();
  myEndOffset = entry.getEndOffset();
  ArrangementEntryWrapper<E> previous = null;
  for (ArrangementEntry child : entry.getChildren()) {
    ArrangementEntryWrapper<E> childWrapper = new ArrangementEntryWrapper<E>((E)child);
    childWrapper.setParent(this);
    if (previous != null) {
      previous.setNext(childWrapper);
      childWrapper.setPrevious(previous);
    }
    previous = childWrapper;
    myChildren.add(childWrapper);
  }
}
项目:consulo    文件:ArrangementEntryWrapper.java   
@SuppressWarnings("unchecked")
public ArrangementEntryWrapper(@Nonnull E entry) {
  myEntry = entry;
  myStartOffset = entry.getStartOffset();
  myEndOffset = entry.getEndOffset();
  ArrangementEntryWrapper<E> previous = null;
  for (ArrangementEntry child : entry.getChildren()) {
    ArrangementEntryWrapper<E> childWrapper = new ArrangementEntryWrapper<E>((E)child);
    childWrapper.setParent(this);
    if (previous != null) {
      previous.setNext(childWrapper);
      childWrapper.setPrevious(previous);
    }
    previous = childWrapper;
    myChildren.add(childWrapper);
  }
}
项目:intellij-ce-playground    文件:ByModifierArrangementEntryMatcher.java   
@Override
public boolean isMatched(@NotNull ArrangementEntry entry) {
  if (entry instanceof ModifierAwareArrangementEntry) {
    final Set<ArrangementSettingsToken> modifiers = ((ModifierAwareArrangementEntry)entry).getModifiers();
    for (ArrangementAtomMatchCondition condition : myModifiers) {
      final Object value = condition.getValue();
      boolean isInverted = value instanceof Boolean && !((Boolean)value);
      if (isInverted == modifiers.contains(condition.getType())) {
        return false;
      }
    }
    return true;
  }
  return false;
}
项目:intellij-ce-playground    文件:ByNamespaceArrangementEntryMatcher.java   
@Nullable
@Override
protected String getTextToMatch(@NotNull ArrangementEntry entry) {
  if (entry instanceof NamespaceAwareArrangementEntry) {
    return ((NamespaceAwareArrangementEntry)entry).getNamespace();
  }
  else {
    return null;
  }
}
项目:intellij-ce-playground    文件:ByNameArrangementEntryMatcher.java   
@Nullable
@Override
protected String getTextToMatch(@NotNull ArrangementEntry entry) {
  if (entry instanceof NameAwareArrangementEntry) {
    return  ((NameAwareArrangementEntry)entry).getName();
  }
  else {
    return null;
  }
}
项目:intellij-ce-playground    文件:CompositeArrangementEntryMatcher.java   
@Override
public boolean isMatched(@NotNull ArrangementEntry entry) {
  for (ArrangementEntryMatcher matcher : myMatchers) {
    if (!matcher.isMatched(entry)) {
      return false;
    }
  }
  return true;
}
项目:intellij-ce-playground    文件:AbstractRegexpArrangementMatcher.java   
@Override
public boolean isMatched(@NotNull ArrangementEntry entry) {
  if (myCompiledPattern == null) {
    return false;
  }
  String text = getTextToMatch(entry);
  return text != null && myCompiledPattern.matcher(text).matches();
}
项目:intellij-ce-playground    文件:ByTypeArrangementEntryMatcher.java   
@Override
public boolean isMatched(@NotNull ArrangementEntry entry) {
  if (entry instanceof TypeAwareArrangementEntry) {
    final Set<ArrangementSettingsToken> types = ((TypeAwareArrangementEntry)entry).getTypes();
    for (ArrangementAtomMatchCondition condition : myTypes) {
      final Object value = condition.getValue();
      boolean isInverted = value instanceof Boolean && !((Boolean)value);
      if (isInverted == types.contains(condition.getType())) {
        return false;
      }
    }
    return true;
  }
  return false;
}
项目:tools-idea    文件:ByModifierArrangementEntryMatcher.java   
@Override
public boolean isMatched(@NotNull ArrangementEntry entry) {
  if (entry instanceof ModifierAwareArrangementEntry) {
    return ((ModifierAwareArrangementEntry)entry).getModifiers().containsAll(myModifiers);
  }
  return false;
}
项目:tools-idea    文件:ByNamespaceArrangementEntryMatcher.java   
@Nullable
@Override
protected String getTextToMatch(@NotNull ArrangementEntry entry) {
  if (entry instanceof NamespaceAwareArrangementEntry) {
    return ((NamespaceAwareArrangementEntry)entry).getNamespace();
  }
  else {
    return null;
  }
}
项目:tools-idea    文件:ByNameArrangementEntryMatcher.java   
@Nullable
@Override
protected String getTextToMatch(@NotNull ArrangementEntry entry) {
  if (entry instanceof NameAwareArrangementEntry) {
    return  ((NameAwareArrangementEntry)entry).getName();
  }
  else {
    return null;
  }
}
项目:tools-idea    文件:CompositeArrangementEntryMatcher.java   
@Override
public boolean isMatched(@NotNull ArrangementEntry entry) {
  for (ArrangementEntryMatcher matcher : myMatchers) {
    if (!matcher.isMatched(entry)) {
      return false;
    }
  }
  return true;
}
项目:tools-idea    文件:AbstractRegexpArrangementMatcher.java   
@Override
public boolean isMatched(@NotNull ArrangementEntry entry) {
  if (myCompiledPattern == null) {
    return false;
  }
  String text = getTextToMatch(entry);
  return text != null && myCompiledPattern.matcher(text).matches();
}
项目:tools-idea    文件:ByTypeArrangementEntryMatcher.java   
@Override
public boolean isMatched(@NotNull ArrangementEntry entry) {
  if (entry instanceof TypeAwareArrangementEntry) {
    return ((TypeAwareArrangementEntry)entry).getTypes().containsAll(myTypes);
  }
  return false;
}
项目:intellij-haxe    文件:HaxeRearrangerModel.java   
@Override
public int getBlankLines(@NotNull CodeStyleSettings settings,
                         @Nullable ArrangementEntry entry,
                         @Nullable ArrangementEntry entry2,
                         @NotNull ArrangementEntry entry3) {
  return 0;
}
项目:consulo    文件:ByModifierArrangementEntryMatcher.java   
@Override
public boolean isMatched(@Nonnull ArrangementEntry entry) {
  if (entry instanceof ModifierAwareArrangementEntry) {
    final Set<ArrangementSettingsToken> modifiers = ((ModifierAwareArrangementEntry)entry).getModifiers();
    for (ArrangementAtomMatchCondition condition : myModifiers) {
      final Object value = condition.getValue();
      boolean isInverted = value instanceof Boolean && !((Boolean)value);
      if (isInverted == modifiers.contains(condition.getType())) {
        return false;
      }
    }
    return true;
  }
  return false;
}
项目:consulo    文件:ByNamespaceArrangementEntryMatcher.java   
@Nullable
@Override
protected String getTextToMatch(@Nonnull ArrangementEntry entry) {
  if (entry instanceof NamespaceAwareArrangementEntry) {
    return ((NamespaceAwareArrangementEntry)entry).getNamespace();
  }
  else {
    return null;
  }
}
项目:consulo    文件:ByNameArrangementEntryMatcher.java   
@Nullable
@Override
protected String getTextToMatch(@Nonnull ArrangementEntry entry) {
  if (entry instanceof NameAwareArrangementEntry) {
    return  ((NameAwareArrangementEntry)entry).getName();
  }
  else {
    return null;
  }
}
项目:consulo    文件:CompositeArrangementEntryMatcher.java   
@Override
public boolean isMatched(@Nonnull ArrangementEntry entry) {
  for (ArrangementEntryMatcher matcher : myMatchers) {
    if (!matcher.isMatched(entry)) {
      return false;
    }
  }
  return true;
}
项目:consulo    文件:AbstractRegexpArrangementMatcher.java   
@Override
public boolean isMatched(@Nonnull ArrangementEntry entry) {
  if (myCompiledPattern == null) {
    return false;
  }
  String text = getTextToMatch(entry);
  return text != null && myCompiledPattern.matcher(text).matches();
}
项目:consulo    文件:ByTypeArrangementEntryMatcher.java   
@Override
public boolean isMatched(@Nonnull ArrangementEntry entry) {
  if (entry instanceof TypeAwareArrangementEntry) {
    final Set<ArrangementSettingsToken> types = ((TypeAwareArrangementEntry)entry).getTypes();
    for (ArrangementAtomMatchCondition condition : myTypes) {
      final Object value = condition.getValue();
      boolean isInverted = value instanceof Boolean && !((Boolean)value);
      if (isInverted == types.contains(condition.getType())) {
        return false;
      }
    }
    return true;
  }
  return false;
}
项目:consulo-xml    文件:XmlElementArrangementEntry.java   
public XmlElementArrangementEntry(@Nullable ArrangementEntry parent,
                                  @NotNull TextRange range,
                                  @NotNull ArrangementSettingsToken type,
                                  @Nullable String name,
                                  boolean canBeMatched)
{
  super(parent, range.getStartOffset(), range.getEndOffset(), canBeMatched);
  myName = name;
  myType = type;
}
项目:intellij-ce-playground    文件:StdArrangementEntryMatcher.java   
@Override
public boolean isMatched(@NotNull ArrangementEntry entry) {
  return myDelegate.isMatched(entry);
}
项目:intellij-ce-playground    文件:ArrangementEntryMatcher.java   
@Override
public boolean isMatched(@NotNull ArrangementEntry entry) {
  return false;
}
项目:intellij-ce-playground    文件:AbstractRegexpArrangementMatcher.java   
@Nullable
protected abstract String getTextToMatch(@NotNull ArrangementEntry entry);
项目:tools-idea    文件:StdArrangementEntryMatcher.java   
@Override
public boolean isMatched(@NotNull ArrangementEntry entry) {
  return myDelegate.isMatched(entry);
}
项目:tools-idea    文件:ArrangementEntryMatcher.java   
@Override
public boolean isMatched(@NotNull ArrangementEntry entry) {
  return false;
}
项目:tools-idea    文件:AbstractRegexpArrangementMatcher.java   
@Nullable
protected abstract String getTextToMatch(@NotNull ArrangementEntry entry);
项目:consulo    文件:StdArrangementEntryMatcher.java   
@Override
public boolean isMatched(@Nonnull ArrangementEntry entry) {
  return myDelegate.isMatched(entry);
}
项目:consulo    文件:ArrangementEntryMatcher.java   
@Override
public boolean isMatched(@Nonnull ArrangementEntry entry) {
  return false;
}
项目:consulo    文件:AbstractRegexpArrangementMatcher.java   
@Nullable
protected abstract String getTextToMatch(@Nonnull ArrangementEntry entry);
项目:intellij-ce-playground    文件:ArrangementEntryMatcher.java   
/**
 * Allows to check if given entry is matched by the current rule.
 * <p/>
 * Example: entry like 'public final field' should be matched by a 'final fields' rule but not matched by a 'private fields' rule.
 *
 * @param entry  entry to check
 * @return       <code>true</code> if given entry is matched by the current rule; <code>false</code> otherwise
 */
boolean isMatched(@NotNull ArrangementEntry entry);
项目:tools-idea    文件:ArrangementEntryMatcher.java   
/**
 * Allows to check if given entry is matched by the current rule.
 * <p/>
 * Example: entry like 'public final field' should be matched by a 'final fields' rule but not matched by a 'private fields' rule.
 *
 * @param entry  entry to check
 * @return       <code>true</code> if given entry is matched by the current rule; <code>false</code> otherwise
 */
boolean isMatched(@NotNull ArrangementEntry entry);
项目:consulo    文件:ArrangementEntryMatcher.java   
/**
 * Allows to check if given entry is matched by the current rule.
 * <p/>
 * Example: entry like 'public final field' should be matched by a 'final fields' rule but not matched by a 'private fields' rule.
 *
 * @param entry  entry to check
 * @return       <code>true</code> if given entry is matched by the current rule; <code>false</code> otherwise
 */
boolean isMatched(@Nonnull ArrangementEntry entry);