mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-27 08:47:50 +08:00
code samples: update deprecated API use
This commit is contained in:
parent
a8f4efb314
commit
1509ba9966
@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package icons;
|
||||
|
||||
@ -8,6 +8,6 @@ import javax.swing.*;
|
||||
|
||||
public class SdkIcons {
|
||||
|
||||
public static final Icon Sdk_default_icon = IconLoader.getIcon("/icons/sdk_16.svg");
|
||||
public static final Icon Sdk_default_icon = IconLoader.getIcon("/icons/sdk_16.svg", SdkIcons.class);
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package icons;
|
||||
|
||||
@ -8,6 +8,6 @@ import javax.swing.*;
|
||||
|
||||
public class SdkIcons {
|
||||
|
||||
public static final Icon Sdk_default_icon = IconLoader.getIcon("/icons/sdk_16.svg");
|
||||
public static final Icon Sdk_default_icon = IconLoader.getIcon("/icons/sdk_16.svg", SdkIcons.class);
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package icons;
|
||||
|
||||
@ -8,6 +8,6 @@ import javax.swing.*;
|
||||
|
||||
public class SdkIcons {
|
||||
|
||||
public static final Icon Sdk_default_icon = IconLoader.getIcon("/icons/sdk_16.svg");
|
||||
public static final Icon Sdk_default_icon = IconLoader.getIcon("/icons/sdk_16.svg", SdkIcons.class);
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package icons;
|
||||
|
||||
@ -8,6 +8,6 @@ import javax.swing.*;
|
||||
|
||||
public class SdkIcons {
|
||||
|
||||
public static final Icon Sdk_default_icon = IconLoader.getIcon("/icons/sdk_16.svg");
|
||||
public static final Icon Sdk_default_icon = IconLoader.getIcon("/icons/sdk_16.svg", SdkIcons.class);
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package icons;
|
||||
|
||||
@ -8,6 +8,6 @@ import javax.swing.*;
|
||||
|
||||
public class SdkIcons {
|
||||
|
||||
public static final Icon Sdk_default_icon = IconLoader.getIcon("/icons/sdk_16.svg");
|
||||
public static final Icon Sdk_default_icon = IconLoader.getIcon("/icons/sdk_16.svg", SdkIcons.class);
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package icons;
|
||||
|
||||
@ -8,6 +8,6 @@ import javax.swing.*;
|
||||
|
||||
public class SdkIcons {
|
||||
|
||||
public static final Icon Sdk_default_icon = IconLoader.getIcon("/icons/sdk_16.svg");
|
||||
public static final Icon Sdk_default_icon = IconLoader.getIcon("/icons/sdk_16.svg", SdkIcons.class);
|
||||
|
||||
}
|
||||
|
@ -1,16 +1,11 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package org.intellij.sdk.language;
|
||||
|
||||
import com.intellij.formatting.*;
|
||||
import com.intellij.lang.ASTNode;
|
||||
import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.codeStyle.CodeStyleSettings;
|
||||
import org.intellij.sdk.language.psi.SimpleTypes;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class SimpleFormattingModelBuilder implements FormattingModelBuilder {
|
||||
|
||||
@ -22,22 +17,16 @@ public class SimpleFormattingModelBuilder implements FormattingModelBuilder {
|
||||
.none();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public FormattingModel createModel(PsiElement element, CodeStyleSettings settings) {
|
||||
public @NotNull FormattingModel createModel(@NotNull FormattingContext formattingContext) {
|
||||
final CodeStyleSettings codeStyleSettings = formattingContext.getCodeStyleSettings();
|
||||
return FormattingModelProvider
|
||||
.createFormattingModelForPsiFile(element.getContainingFile(),
|
||||
new SimpleBlock(element.getNode(),
|
||||
.createFormattingModelForPsiFile(formattingContext.getContainingFile(),
|
||||
new SimpleBlock(formattingContext.getNode(),
|
||||
Wrap.createWrap(WrapType.NONE, false),
|
||||
Alignment.createAlignment(),
|
||||
createSpaceBuilder(settings)),
|
||||
settings);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public TextRange getRangeAffectingIndent(PsiFile file, int offset, ASTNode elementAtOffset) {
|
||||
return null;
|
||||
createSpaceBuilder(codeStyleSettings)),
|
||||
codeStyleSettings);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
package org.intellij.sdk.language;
|
||||
|
||||
@ -8,6 +8,6 @@ import javax.swing.*;
|
||||
|
||||
public class SimpleIcons {
|
||||
|
||||
public static final Icon FILE = IconLoader.getIcon("/icons/jar-gray.png");
|
||||
public static final Icon FILE = IconLoader.getIcon("/icons/jar-gray.png", SimpleIcons.class);
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user