com.intellij.psi.codeStyle.arrangement.ArrangementSettings Java Examples

The following examples show how to use com.intellij.psi.codeStyle.arrangement.ArrangementSettings. 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: ProjectViewRearranger.java    From intellij with Apache License 2.0 6 votes vote down vote up
@Override
public List<Entry> parse(
    PsiElement root,
    @Nullable Document document,
    Collection<TextRange> ranges,
    ArrangementSettings settings) {
  if (root instanceof ProjectViewPsiListSection) {
    Entry entry = fromListSection(ranges, (ProjectViewPsiListSection) root);
    return entry != null ? ImmutableList.of(entry) : ImmutableList.of();
  }
  if (root instanceof ProjectViewPsiFile) {
    return Arrays.stream(
            ((ProjectViewPsiFile) root).findChildrenByClass(ProjectViewPsiListSection.class))
        .map(section -> fromListSection(ranges, section))
        .filter(Objects::nonNull)
        .collect(toImmutableList());
  }
  return ImmutableList.of();
}
 
Example #2
Source File: ProjectViewRearranger.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public Pair<Entry, List<Entry>> parseWithNew(
    PsiElement root,
    @Nullable Document document,
    Collection<TextRange> ranges,
    PsiElement element,
    ArrangementSettings settings) {
  // no support for generating new elements
  return null;
}
 
Example #3
Source File: HaxeRearrangerModel.java    From intellij-haxe with Apache License 2.0 5 votes vote down vote up
@Nullable
@Override
public Pair parseWithNew(@NotNull PsiElement element,
                         @Nullable Document document,
                         @NotNull Collection collection,
                         @NotNull PsiElement element2,
                         @Nullable ArrangementSettings settings) {
  return null;
}
 
Example #4
Source File: HaxeRearrangerModel.java    From intellij-haxe with Apache License 2.0 5 votes vote down vote up
@NotNull
@Override
public List parse(@NotNull PsiElement element,
                  @Nullable Document document,
                  @NotNull Collection collection,
                  @Nullable ArrangementSettings settings) {
  return null;
}
 
Example #5
Source File: CommonCodeStyleSettings.java    From consulo with Apache License 2.0 5 votes vote down vote up
protected boolean arrangementSettingsEqual(CommonCodeStyleSettings obj) {
  ArrangementSettings theseSettings = myArrangementSettings;
  ArrangementSettings otherSettings = obj.getArrangementSettings();
  if (theseSettings == null && otherSettings != null) {
    Rearranger<?> rearranger = Rearranger.EXTENSION.forLanguage(myLanguage);
    if (rearranger instanceof ArrangementStandardSettingsAware) {
      theseSettings = ((ArrangementStandardSettingsAware)rearranger).getDefaultSettings();
    }
  }
  return Comparing.equal(theseSettings, obj.getArrangementSettings());
}
 
Example #6
Source File: CommonCodeStyleSettings.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nullable
public ArrangementSettings getArrangementSettings() {
  return myArrangementSettings;
}
 
Example #7
Source File: CommonCodeStyleSettings.java    From consulo with Apache License 2.0 4 votes vote down vote up
public void setArrangementSettings(@Nonnull ArrangementSettings settings) {
  myArrangementSettings = settings;
}
 
Example #8
Source File: StdArrangementSettings.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public ArrangementSettings clone() {
  return new StdArrangementSettings(cloneGroupings(), cloneSectionRules());
}