mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[java] API cleanup: remove unused deprecated API (IJPL-156972)
GitOrigin-RevId: c8cfa9d13c20cd712f9ab3ab1b8e5fcfd9a2ecaf
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4aed128d44
commit
0e4dd0cedc
@@ -1,139 +0,0 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.ui;
|
||||
|
||||
import com.intellij.execution.ExecutionBundle;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.projectRoots.ProjectJdkTable;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.ui.ComponentWithBrowseButton;
|
||||
import com.intellij.openapi.ui.TextComponentAccessors;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.GuiUtils;
|
||||
import com.intellij.ui.InsertPathAction;
|
||||
import com.intellij.ui.PanelWithAnchor;
|
||||
import com.intellij.ui.TextFieldWithHistory;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.util.PathUtil;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
*
|
||||
* @deprecated use {@link JrePathEditor} instead
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public class AlternativeJREPanel extends JPanel implements PanelWithAnchor {
|
||||
private final ComponentWithBrowseButton<TextFieldWithHistory> myPathField;
|
||||
private final JBCheckBox myCbEnabled;
|
||||
final TextFieldWithHistory myFieldWithHistory;
|
||||
private JComponent myAnchor;
|
||||
|
||||
public AlternativeJREPanel() {
|
||||
myCbEnabled = new JBCheckBox(ExecutionBundle.message("run.configuration.use.alternate.jre.checkbox"));
|
||||
|
||||
myFieldWithHistory = new TextFieldWithHistory();
|
||||
myFieldWithHistory.setHistorySize(-1);
|
||||
final ArrayList<String> foundJDKs = new ArrayList<>();
|
||||
final Sdk[] allJDKs = ProjectJdkTable.getInstance().getAllJdks();
|
||||
|
||||
for (Sdk sdk : allJDKs) {
|
||||
foundJDKs.add(sdk.getName());
|
||||
}
|
||||
|
||||
for (JreProvider provider : JreProvider.EP_NAME.getExtensionList()) {
|
||||
if (provider.isAvailable()) {
|
||||
String path = provider.getJrePath();
|
||||
if (!StringUtil.isEmpty(path)) {
|
||||
foundJDKs.add(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Sdk jdk : allJDKs) {
|
||||
String homePath = jdk.getHomePath();
|
||||
|
||||
if (!SystemInfo.isMac) {
|
||||
final File jre = new File(jdk.getHomePath(), "jre");
|
||||
if (jre.isDirectory()) {
|
||||
homePath = jre.getPath();
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundJDKs.contains(homePath)) {
|
||||
foundJDKs.add(homePath);
|
||||
}
|
||||
}
|
||||
myFieldWithHistory.setHistory(foundJDKs);
|
||||
myPathField = new ComponentWithBrowseButton<>(myFieldWithHistory, null);
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(ExecutionBundle.message("run.configuration.select.alternate.jre.label"))
|
||||
.withDescription(ExecutionBundle.message("run.configuration.select.jre.dir.label"));
|
||||
myPathField.addBrowseFolderListener(null, descriptor, TextComponentAccessors.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
|
||||
|
||||
setLayout(new MigLayout("ins 0, gap 10, fill, flowx"));
|
||||
add(myCbEnabled, "shrinkx");
|
||||
add(myPathField, "growx, pushx");
|
||||
|
||||
InsertPathAction.addTo(myFieldWithHistory.getTextEditor());
|
||||
|
||||
myCbEnabled.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
enabledChanged();
|
||||
}
|
||||
});
|
||||
enabledChanged();
|
||||
|
||||
setAnchor(myCbEnabled);
|
||||
|
||||
updateUI();
|
||||
}
|
||||
|
||||
private void enabledChanged() {
|
||||
final boolean pathEnabled = isPathEnabled();
|
||||
GuiUtils.enableChildren(myPathField, pathEnabled);
|
||||
myFieldWithHistory.invalidate(); //need to revalidate inner component
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return FileUtil.toSystemIndependentName(myPathField.getChildComponent().getText().trim());
|
||||
}
|
||||
|
||||
private void setPath(@Nullable String path) {
|
||||
myPathField.getChildComponent().setText(StringUtil.notNullize(PathUtil.toSystemDependentName(path)));
|
||||
}
|
||||
|
||||
public boolean isPathEnabled() {
|
||||
return myCbEnabled.isSelected();
|
||||
}
|
||||
|
||||
private void setPathEnabled(boolean b) {
|
||||
myCbEnabled.setSelected(b);
|
||||
enabledChanged();
|
||||
}
|
||||
|
||||
public void init(@Nullable String path, boolean isEnabled){
|
||||
setPathEnabled(isEnabled);
|
||||
setPath(path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getAnchor() {
|
||||
return myAnchor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAnchor(JComponent anchor) {
|
||||
myAnchor = anchor;
|
||||
myCbEnabled.setAnchor(anchor);
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.codeInsight.daemon.impl.analysis;
|
||||
|
||||
import com.intellij.pom.java.JavaFeature;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @deprecated use {@link JavaFeature} and {@link PreviewFeatureUtil}.
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public enum HighlightingFeature {
|
||||
GENERICS(JavaFeature.GENERICS),
|
||||
ANNOTATIONS(JavaFeature.ANNOTATIONS),
|
||||
STATIC_IMPORTS(JavaFeature.STATIC_IMPORTS),
|
||||
FOR_EACH(JavaFeature.FOR_EACH),
|
||||
VARARGS(JavaFeature.VARARGS),
|
||||
HEX_FP_LITERALS(JavaFeature.HEX_FP_LITERALS),
|
||||
DIAMOND_TYPES(JavaFeature.DIAMOND_TYPES),
|
||||
MULTI_CATCH(JavaFeature.MULTI_CATCH),
|
||||
TRY_WITH_RESOURCES(JavaFeature.TRY_WITH_RESOURCES),
|
||||
BIN_LITERALS(JavaFeature.BIN_LITERALS),
|
||||
UNDERSCORES(JavaFeature.UNDERSCORES),
|
||||
EXTENSION_METHODS(JavaFeature.EXTENSION_METHODS),
|
||||
METHOD_REFERENCES(JavaFeature.METHOD_REFERENCES),
|
||||
LAMBDA_EXPRESSIONS(JavaFeature.LAMBDA_EXPRESSIONS),
|
||||
TYPE_ANNOTATIONS(JavaFeature.TYPE_ANNOTATIONS),
|
||||
RECEIVERS(JavaFeature.RECEIVERS),
|
||||
INTERSECTION_CASTS(JavaFeature.INTERSECTION_CASTS),
|
||||
STATIC_INTERFACE_CALLS(JavaFeature.STATIC_INTERFACE_CALLS),
|
||||
REFS_AS_RESOURCE(JavaFeature.REFS_AS_RESOURCE),
|
||||
MODULES(JavaFeature.MODULES),
|
||||
LVTI(JavaFeature.LVTI),
|
||||
VAR_LAMBDA_PARAMETER(JavaFeature.VAR_LAMBDA_PARAMETER),
|
||||
ENHANCED_SWITCH(JavaFeature.ENHANCED_SWITCH),
|
||||
SWITCH_EXPRESSION(JavaFeature.SWITCH_EXPRESSION),
|
||||
RECORDS(JavaFeature.RECORDS),
|
||||
PATTERNS(JavaFeature.PATTERNS),
|
||||
TEXT_BLOCK_ESCAPES(JavaFeature.TEXT_BLOCK_ESCAPES),
|
||||
TEXT_BLOCKS(JavaFeature.TEXT_BLOCKS),
|
||||
SEALED_CLASSES(JavaFeature.SEALED_CLASSES),
|
||||
LOCAL_INTERFACES(JavaFeature.LOCAL_INTERFACES),
|
||||
LOCAL_ENUMS(JavaFeature.LOCAL_ENUMS),
|
||||
INNER_STATICS(JavaFeature.INNER_STATICS),
|
||||
PATTERNS_IN_SWITCH(JavaFeature.PATTERNS_IN_SWITCH),
|
||||
PATTERN_GUARDS_AND_RECORD_PATTERNS(JavaFeature.PATTERN_GUARDS_AND_RECORD_PATTERNS),
|
||||
RECORD_PATTERNS_IN_FOR_EACH(JavaFeature.RECORD_PATTERNS_IN_FOR_EACH),
|
||||
ENUM_QUALIFIED_NAME_IN_SWITCH(JavaFeature.ENUM_QUALIFIED_NAME_IN_SWITCH),
|
||||
STRING_TEMPLATES(JavaFeature.STRING_TEMPLATES),
|
||||
UNNAMED_PATTERNS_AND_VARIABLES(JavaFeature.UNNAMED_PATTERNS_AND_VARIABLES),
|
||||
IMPLICIT_CLASSES(JavaFeature.IMPLICIT_CLASSES),
|
||||
STATEMENTS_BEFORE_SUPER(JavaFeature.STATEMENTS_BEFORE_SUPER),
|
||||
;
|
||||
|
||||
private final JavaFeature myFeature;
|
||||
|
||||
HighlightingFeature(@NotNull JavaFeature feature) {
|
||||
myFeature = feature;
|
||||
}
|
||||
|
||||
public LanguageLevel getLevel() {
|
||||
return myFeature.getMinimumLevel();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param element a valid PsiElement to check (it's better to supply PsiFile if already known; any element is accepted for convenience)
|
||||
* @return true if this feature is available in the PsiFile the supplied element belongs to
|
||||
*/
|
||||
public boolean isAvailable(@NotNull PsiElement element) {
|
||||
return PsiUtil.isAvailable(myFeature, element);
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi;
|
||||
|
||||
import com.intellij.psi.util.PsiModificationTracker;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
/**
|
||||
* Represents psi element, which can be modified without caches reset.
|
||||
* @deprecated because {@link PsiModificationTracker}.getOutOfCodeBlockModificationCount() was removed, there is no more code that calls the method
|
||||
*/
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
@Deprecated
|
||||
public interface PsiModifiableCodeBlock {
|
||||
/**
|
||||
* @param place where change was detected
|
||||
* @return false if specific caches could be saved after the change
|
||||
*/
|
||||
boolean shouldChangeModificationCount(PsiElement place);
|
||||
}
|
||||
@@ -173,7 +173,6 @@ run.configuration.program.parameters.hint=CLI arguments to your application
|
||||
run.configuration.working.directory.label=&Working directory:
|
||||
run.configuration.working.directory.name=&Working directory
|
||||
run.configuration.working.directory.empty.error=Working directory is not specified
|
||||
run.configuration.use.alternate.jre.checkbox=Use alternative &JRE:
|
||||
run.configuration.jre.name=&JRE
|
||||
run.configuration.jre.label=&JRE:
|
||||
run.configuration.jre.hint=JDK or JRE
|
||||
|
||||
Reference in New Issue
Block a user