mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup - sort modifiers
GitOrigin-RevId: 9fe82c2b5b5b2ffdba9bdea16c01e33bdb48b752
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4bca768c3a
commit
e8cbfeacc2
+5
-6
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.breadcrumbs;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -40,11 +40,10 @@ public abstract class FileBreadcrumbsCollector {
|
||||
@NotNull Disposable disposable,
|
||||
@NotNull Runnable changesHandler);
|
||||
|
||||
@NotNull
|
||||
public abstract Iterable<? extends Crumb> computeCrumbs(@NotNull VirtualFile virtualFile,
|
||||
@NotNull Document document,
|
||||
int offset,
|
||||
@Nullable Boolean forcedShown);
|
||||
public abstract @NotNull Iterable<? extends Crumb> computeCrumbs(@NotNull VirtualFile virtualFile,
|
||||
@NotNull Document document,
|
||||
int offset,
|
||||
@Nullable Boolean forcedShown);
|
||||
|
||||
public static FileBreadcrumbsCollector findBreadcrumbsCollector(Project project, VirtualFile file) {
|
||||
if (file != null) {
|
||||
|
||||
+3
-6
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.highlighting;
|
||||
|
||||
import com.intellij.codeInspection.util.InspectionMessage;
|
||||
@@ -29,8 +29,7 @@ public abstract class TooltipLinkHandler {
|
||||
* @param editor an editor in which tooltip with a link was shown.
|
||||
* @return detailed description to show.
|
||||
*/
|
||||
@Nullable
|
||||
public @InspectionMessage String getDescription(@NotNull String refSuffix, @NotNull Editor editor) {
|
||||
public @Nullable @InspectionMessage String getDescription(@NotNull String refSuffix, @NotNull Editor editor) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -41,9 +40,7 @@ public abstract class TooltipLinkHandler {
|
||||
* @param editor an editor in which tooltip with a link was shown.
|
||||
* @return title above detailed description in the expanded tooltip
|
||||
*/
|
||||
@NotNull
|
||||
@InspectionMessage
|
||||
public String getDescriptionTitle(@NotNull String refSuffix, @NotNull Editor editor) {
|
||||
public @NotNull @InspectionMessage String getDescriptionTitle(@NotNull String refSuffix, @NotNull Editor editor) {
|
||||
return IdeBundle.message("inspection.message.inspection.info");
|
||||
}
|
||||
}
|
||||
|
||||
+3
-5
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.execution.process;
|
||||
|
||||
import com.intellij.execution.ExecutionException;
|
||||
@@ -28,9 +28,8 @@ public class BinaryOSProcessHandler extends OSProcessHandler {
|
||||
return myOutput.toByteArray();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected BaseDataReader createOutputDataReader() {
|
||||
protected @NotNull BaseDataReader createOutputDataReader() {
|
||||
return new SimpleBinaryReader(myProcess.getInputStream(), readerOptions().policy());
|
||||
}
|
||||
|
||||
@@ -45,9 +44,8 @@ public class BinaryOSProcessHandler extends OSProcessHandler {
|
||||
myOutput.write(data, 0, size);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Future<?> executeOnPooledThread(@NotNull Runnable runnable) {
|
||||
protected @NotNull Future<?> executeOnPooledThread(@NotNull Runnable runnable) {
|
||||
return BinaryOSProcessHandler.this.executeTask(runnable);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-17
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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.
|
||||
*/
|
||||
// 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.execution.process;
|
||||
|
||||
import com.intellij.execution.ExecutionException;
|
||||
@@ -43,8 +29,7 @@ public class CapturingAnsiEscapesAwareProcessHandler extends CapturingProcessHan
|
||||
protected static class AnsiEscapesAwareAdapter extends CapturingProcessAdapter implements AnsiEscapeDecoder.ColoredTextAcceptor {
|
||||
private final AnsiEscapeDecoder myAnsiEscapeDecoder = new AnsiEscapeDecoder() {
|
||||
@Override
|
||||
@NotNull
|
||||
protected Key getCurrentOutputAttributes(@NotNull Key outputType) {
|
||||
protected @NotNull Key getCurrentOutputAttributes(@NotNull Key outputType) {
|
||||
return outputType; //we don't need color information - only stdout and stderr keys are added to output in CapturingProcessAdapter
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.execution.process;
|
||||
|
||||
import com.intellij.execution.ui.ConsoleViewContentType;
|
||||
@@ -6,24 +6,24 @@ import com.intellij.openapi.editor.colors.TextAttributesKey;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public final class ConsoleHighlighter {
|
||||
@NonNls static final String BLACK_ID = "CONSOLE_BLACK_OUTPUT";
|
||||
@NonNls static final String RED_ID = "CONSOLE_RED_OUTPUT";
|
||||
@NonNls static final String GREEN_ID = "CONSOLE_GREEN_OUTPUT";
|
||||
@NonNls static final String YELLOW_ID = "CONSOLE_YELLOW_OUTPUT";
|
||||
@NonNls static final String BLUE_ID = "CONSOLE_BLUE_OUTPUT";
|
||||
@NonNls static final String MAGENTA_ID = "CONSOLE_MAGENTA_OUTPUT";
|
||||
@NonNls static final String CYAN_ID = "CONSOLE_CYAN_OUTPUT";
|
||||
@NonNls static final String GRAY_ID = "CONSOLE_GRAY_OUTPUT"; //ISO white
|
||||
static final @NonNls String BLACK_ID = "CONSOLE_BLACK_OUTPUT";
|
||||
static final @NonNls String RED_ID = "CONSOLE_RED_OUTPUT";
|
||||
static final @NonNls String GREEN_ID = "CONSOLE_GREEN_OUTPUT";
|
||||
static final @NonNls String YELLOW_ID = "CONSOLE_YELLOW_OUTPUT";
|
||||
static final @NonNls String BLUE_ID = "CONSOLE_BLUE_OUTPUT";
|
||||
static final @NonNls String MAGENTA_ID = "CONSOLE_MAGENTA_OUTPUT";
|
||||
static final @NonNls String CYAN_ID = "CONSOLE_CYAN_OUTPUT";
|
||||
static final @NonNls String GRAY_ID = "CONSOLE_GRAY_OUTPUT"; //ISO white
|
||||
|
||||
|
||||
@NonNls static final String DARKGRAY_ID = "CONSOLE_DARKGRAY_OUTPUT";
|
||||
@NonNls static final String RED_BRIGHT_ID = "CONSOLE_RED_BRIGHT_OUTPUT";
|
||||
@NonNls static final String GREEN_BRIGHT_ID = "CONSOLE_GREEN_BRIGHT_OUTPUT";
|
||||
@NonNls static final String YELLOW_BRIGHT_ID = "CONSOLE_YELLOW_BRIGHT_OUTPUT";
|
||||
@NonNls static final String BLUE_BRIGHT_ID = "CONSOLE_BLUE_BRIGHT_OUTPUT";
|
||||
@NonNls static final String MAGENTA_BRIGHT_ID = "CONSOLE_MAGENTA_BRIGHT_OUTPUT";
|
||||
@NonNls static final String CYAN_BRIGHT_ID = "CONSOLE_CYAN_BRIGHT_OUTPUT";
|
||||
@NonNls static final String WHITE_ID = "CONSOLE_WHITE_OUTPUT"; //ISO bright white
|
||||
static final @NonNls String DARKGRAY_ID = "CONSOLE_DARKGRAY_OUTPUT";
|
||||
static final @NonNls String RED_BRIGHT_ID = "CONSOLE_RED_BRIGHT_OUTPUT";
|
||||
static final @NonNls String GREEN_BRIGHT_ID = "CONSOLE_GREEN_BRIGHT_OUTPUT";
|
||||
static final @NonNls String YELLOW_BRIGHT_ID = "CONSOLE_YELLOW_BRIGHT_OUTPUT";
|
||||
static final @NonNls String BLUE_BRIGHT_ID = "CONSOLE_BLUE_BRIGHT_OUTPUT";
|
||||
static final @NonNls String MAGENTA_BRIGHT_ID = "CONSOLE_MAGENTA_BRIGHT_OUTPUT";
|
||||
static final @NonNls String CYAN_BRIGHT_ID = "CONSOLE_CYAN_BRIGHT_OUTPUT";
|
||||
static final @NonNls String WHITE_ID = "CONSOLE_WHITE_OUTPUT"; //ISO bright white
|
||||
|
||||
public static final TextAttributesKey BLACK =
|
||||
TextAttributesKey.createTextAttributesKey(BLACK_ID, ConsoleViewContentType.NORMAL_OUTPUT_KEY);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.execution.process;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -19,6 +19,5 @@ public abstract class OSProcessManager {
|
||||
* @deprecated Use {@link OSProcessUtil#getProcessList()} and then {@link ProcessInfo#getCommandLine()} on items
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
@NotNull
|
||||
public abstract List<String> getCommandLinesOfRunningProcesses();
|
||||
public abstract @NotNull List<String> getCommandLinesOfRunningProcesses();
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.execution.process;
|
||||
|
||||
import com.intellij.execution.ExecutionException;
|
||||
@@ -15,13 +15,11 @@ public abstract class ProcessHandlerFactory {
|
||||
/**
|
||||
* Returns a new instance of the {@link OSProcessHandler}.
|
||||
*/
|
||||
@NotNull
|
||||
public abstract OSProcessHandler createProcessHandler(@NotNull GeneralCommandLine commandLine) throws ExecutionException;
|
||||
public abstract @NotNull OSProcessHandler createProcessHandler(@NotNull GeneralCommandLine commandLine) throws ExecutionException;
|
||||
|
||||
/**
|
||||
* Returns a new instance of the {@link OSProcessHandler} which is aware of ANSI coloring output.
|
||||
*/
|
||||
@NotNull
|
||||
public abstract OSProcessHandler createColoredProcessHandler(@NotNull GeneralCommandLine commandLine) throws ExecutionException;
|
||||
public abstract @NotNull OSProcessHandler createColoredProcessHandler(@NotNull GeneralCommandLine commandLine) throws ExecutionException;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// 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.execution.ui;
|
||||
|
||||
import com.intellij.ide.DataManager;
|
||||
@@ -268,15 +268,13 @@ public class FragmentedSettingsBuilder<Settings extends FragmentedSettings> impl
|
||||
myConfigId = configId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static @NlsContexts.PopupAdvertisement String getHint(AnAction action) {
|
||||
private static @NotNull @NlsContexts.PopupAdvertisement String getHint(AnAction action) {
|
||||
return (action != null && StringUtil.isNotEmpty(action.getTemplatePresentation().getDescription())) ?
|
||||
action.getTemplatePresentation().getDescription() : "";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private DefaultActionGroup buildGroup(List<? extends SettingsEditorFragment<Settings, ?>> fragments,
|
||||
Ref<? super JComponent> lastSelected) {
|
||||
private @NotNull DefaultActionGroup buildGroup(List<? extends SettingsEditorFragment<Settings, ?>> fragments,
|
||||
Ref<? super JComponent> lastSelected) {
|
||||
fragments.sort(Comparator.comparingInt(SettingsEditorFragment::getMenuPosition));
|
||||
DefaultActionGroup actionGroup = new DefaultActionGroup();
|
||||
String group = null;
|
||||
|
||||
@@ -163,13 +163,11 @@ public class SettingsEditorFragment<Settings, C extends JComponent> extends Sett
|
||||
return myId;
|
||||
}
|
||||
|
||||
@Nls
|
||||
public String getName() {
|
||||
public @Nls String getName() {
|
||||
return myName;
|
||||
}
|
||||
|
||||
@Nls
|
||||
public String getGroup() {
|
||||
public @Nls String getGroup() {
|
||||
return myGroup;
|
||||
}
|
||||
|
||||
@@ -205,8 +203,7 @@ public class SettingsEditorFragment<Settings, C extends JComponent> extends Sett
|
||||
return myPriority;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ActionGroup getCustomActionGroup() {
|
||||
public @Nullable ActionGroup getCustomActionGroup() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// 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.execution.ui;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -120,8 +120,7 @@ public class TagButton extends JBLayeredPane implements Disposable {
|
||||
myButton.setToolTipText(toolTip);
|
||||
}
|
||||
|
||||
@Nls
|
||||
public String getText() {
|
||||
public @Nls String getText() {
|
||||
return myText;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.execution.ui;
|
||||
|
||||
import com.intellij.ide.DataManager;
|
||||
@@ -111,18 +111,15 @@ public class VariantTagFragment<T, V> extends SettingsEditorFragment<T, TagButto
|
||||
mySetter.accept(s, mySelectedVariant);
|
||||
}
|
||||
|
||||
@Nls
|
||||
protected String getVariantName(V variant) {
|
||||
protected @Nls String getVariantName(V variant) {
|
||||
return myVariantNameProvider == null ? StringUtil.capitalize(variant.toString()) : myVariantNameProvider.apply(variant); //NON-NLS
|
||||
}
|
||||
|
||||
@Nls
|
||||
protected @Nullable String getVariantHint(V variant) {
|
||||
protected @Nls @Nullable String getVariantHint(V variant) {
|
||||
return myVariantHintProvider == null ? null : myVariantHintProvider.apply(variant); //NON-NLS
|
||||
}
|
||||
|
||||
@Nls
|
||||
protected String getVariantDescription(V variant) {
|
||||
protected @Nls String getVariantDescription(V variant) {
|
||||
return myVariantDescriptionProvider == null ? null : myVariantDescriptionProvider.apply(variant); //NON-NLS
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.featureStatistics;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -12,11 +12,11 @@ import java.util.*;
|
||||
|
||||
@SuppressWarnings("NotNullFieldNotInitialized")
|
||||
public class FeatureDescriptor {
|
||||
@NotNull private String myId;
|
||||
@Nullable private String myDisplayName;
|
||||
@Nullable private final String myGroupId;
|
||||
@Nullable private String myTipId;
|
||||
@Nullable private Set<String> myDependencies;
|
||||
private @NotNull String myId;
|
||||
private @Nullable String myDisplayName;
|
||||
private final @Nullable String myGroupId;
|
||||
private @Nullable String myTipId;
|
||||
private @Nullable Set<String> myDependencies;
|
||||
private int myDaysBeforeFirstShowUp = 1;
|
||||
private int myDaysBetweenSuccessiveShowUps = 3;
|
||||
private int myMinUsageCount = 1;
|
||||
@@ -29,23 +29,23 @@ public class FeatureDescriptor {
|
||||
private long myLastTimeShown;
|
||||
private long myLastTimeUsed;
|
||||
private int myShownCount;
|
||||
@Nullable private final ProductivityFeaturesProvider myProvider;
|
||||
private final @Nullable ProductivityFeaturesProvider myProvider;
|
||||
|
||||
@NonNls private static final String ATTRIBUTE_COUNT = "count";
|
||||
@NonNls private static final String ATTRIBUTE_LAST_SHOWN = "last-shown";
|
||||
@NonNls private static final String ATTRIBUTE_LAST_USED = "last-used";
|
||||
@NonNls private static final String ATTRIBUTE_SHOWN_COUNT = "shown-count";
|
||||
@NonNls private static final String ATTRIBUTE_ID = "id";
|
||||
@NonNls private static final String ATTRIBUTE_TIP_ID = "tip-id";
|
||||
@NonNls private static final String ATTRIBUTE_FIRST_SHOW = "first-show";
|
||||
@NonNls private static final String ATTRIBUTE_SUCCESSIVE_SHOW = "successive-show";
|
||||
@NonNls private static final String ATTRIBUTE_MIN_USAGE_COUNT = "min-usage-count";
|
||||
@NonNls private static final String ATTRIBUTE_UTILITY_SCORE = "utility-score";
|
||||
@NonNls private static final String ATTRIBUTE_SHOW_IN_GUIDE = "show-in-guide";
|
||||
@NonNls private static final String ATTRIBUTE_CLASS_NAME = "class-name";
|
||||
@NonNls private static final String ELEMENT_DEPENDENCY = "dependency";
|
||||
@NonNls private static final String ELEMENT_TRACK_ACTION = "track-action";
|
||||
@NonNls private static final String ELEMENT_TRACK_INTENTION = "track-intention";
|
||||
private static final @NonNls String ATTRIBUTE_COUNT = "count";
|
||||
private static final @NonNls String ATTRIBUTE_LAST_SHOWN = "last-shown";
|
||||
private static final @NonNls String ATTRIBUTE_LAST_USED = "last-used";
|
||||
private static final @NonNls String ATTRIBUTE_SHOWN_COUNT = "shown-count";
|
||||
private static final @NonNls String ATTRIBUTE_ID = "id";
|
||||
private static final @NonNls String ATTRIBUTE_TIP_ID = "tip-id";
|
||||
private static final @NonNls String ATTRIBUTE_FIRST_SHOW = "first-show";
|
||||
private static final @NonNls String ATTRIBUTE_SUCCESSIVE_SHOW = "successive-show";
|
||||
private static final @NonNls String ATTRIBUTE_MIN_USAGE_COUNT = "min-usage-count";
|
||||
private static final @NonNls String ATTRIBUTE_UTILITY_SCORE = "utility-score";
|
||||
private static final @NonNls String ATTRIBUTE_SHOW_IN_GUIDE = "show-in-guide";
|
||||
private static final @NonNls String ATTRIBUTE_CLASS_NAME = "class-name";
|
||||
private static final @NonNls String ELEMENT_DEPENDENCY = "dependency";
|
||||
private static final @NonNls String ELEMENT_TRACK_ACTION = "track-action";
|
||||
private static final @NonNls String ELEMENT_TRACK_INTENTION = "track-intention";
|
||||
|
||||
FeatureDescriptor(@NotNull GroupDescriptor group, @Nullable ProductivityFeaturesProvider provider, @NotNull Element featureElement) {
|
||||
myGroupId = group.getId();
|
||||
@@ -121,8 +121,7 @@ public class FeatureDescriptor {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getId() {
|
||||
public @NotNull String getId() {
|
||||
return myId;
|
||||
}
|
||||
|
||||
@@ -150,8 +149,7 @@ public class FeatureDescriptor {
|
||||
return myIntentionEvents;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getDisplayName() {
|
||||
public @NotNull String getDisplayName() {
|
||||
if (myDisplayName == null) {
|
||||
myDisplayName = FeatureStatisticsBundle.message(myId);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
*/
|
||||
// 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.featureStatistics;
|
||||
|
||||
import org.jdom.Element;
|
||||
@@ -21,9 +7,9 @@ import org.jetbrains.annotations.NonNls;
|
||||
|
||||
public class GroupDescriptor {
|
||||
private String myId;
|
||||
@Nls private String myDisplayName;
|
||||
@NonNls protected static final String ID_ATTR = "id";
|
||||
@NonNls private static final String GROUP_PREFIX = "group.";
|
||||
private @Nls String myDisplayName;
|
||||
protected static final @NonNls String ID_ATTR = "id";
|
||||
private static final @NonNls String GROUP_PREFIX = "group.";
|
||||
|
||||
GroupDescriptor() {
|
||||
}
|
||||
@@ -41,8 +27,7 @@ public class GroupDescriptor {
|
||||
return myId;
|
||||
}
|
||||
|
||||
@Nls
|
||||
public String getDisplayName() {
|
||||
public @Nls String getDisplayName() {
|
||||
if (myDisplayName == null) {
|
||||
myDisplayName = FeatureStatisticsBundle.message(GROUP_PREFIX + myId);
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.featureStatistics;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -8,8 +8,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class ProductivityFeaturesRegistry {
|
||||
@NotNull
|
||||
public abstract Set<String> getFeatureIds();
|
||||
public abstract @NotNull Set<String> getFeatureIds();
|
||||
|
||||
public abstract FeatureDescriptor getFeatureDescriptor(@NotNull String id);
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// 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.ide;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -11,8 +9,7 @@ import javax.swing.event.ChangeListener;
|
||||
import java.util.TooManyListenersException;
|
||||
|
||||
public interface ExporterToTextFile {
|
||||
@Nullable
|
||||
default JComponent getSettingsEditor() {
|
||||
default @Nullable JComponent getSettingsEditor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide;
|
||||
|
||||
import com.intellij.lang.injection.InjectedLanguageManager;
|
||||
@@ -23,21 +23,18 @@ public class FileEditorSelectInContext extends SmartSelectInContext {
|
||||
editor = fileEditor instanceof TextEditor ? (TextEditor)fileEditor : null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getSelectorInFile() {
|
||||
public @Nullable Object getSelectorInFile() {
|
||||
PsiFile file = getPsiFile();
|
||||
return file == null ? null : ObjectUtils.notNull(getElementAtCaret(file, false), file);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public PsiElement getElementAtCaret(boolean tryInjected) {
|
||||
public @Nullable PsiElement getElementAtCaret(boolean tryInjected) {
|
||||
PsiFile file = getPsiFile();
|
||||
return file == null ? null : getElementAtCaret(file, tryInjected);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private PsiElement getElementAtCaret(@NotNull PsiFile file, boolean tryInjected) {
|
||||
private @Nullable PsiElement getElementAtCaret(@NotNull PsiFile file, boolean tryInjected) {
|
||||
Editor editor = getEditor();
|
||||
if (editor == null) return null;
|
||||
int offset = editor.getCaretModel().getOffset();
|
||||
@@ -53,8 +50,7 @@ public class FileEditorSelectInContext extends SmartSelectInContext {
|
||||
return elementAt;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Editor getEditor() {
|
||||
public @Nullable Editor getEditor() {
|
||||
return editor == null ? null : editor.getEditor();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide;
|
||||
|
||||
import com.intellij.notebook.editor.BackedVirtualFile;
|
||||
@@ -33,27 +33,23 @@ public class FileSelectInContext implements SelectInContext {
|
||||
myProvider = provider;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Project getProject() {
|
||||
public @NotNull Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public VirtualFile getVirtualFile() {
|
||||
public @NotNull VirtualFile getVirtualFile() {
|
||||
return myFile;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getSelectorInFile() {
|
||||
public @Nullable Object getSelectorInFile() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public FileEditorProvider getFileEditorProvider() {
|
||||
public @Nullable FileEditorProvider getFileEditorProvider() {
|
||||
return myProvider;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
*/
|
||||
// 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.ide;
|
||||
|
||||
import com.intellij.openapi.actionSystem.ActionUpdateThread;
|
||||
@@ -43,15 +29,13 @@ public interface OccurenceNavigator extends ActionUpdateThreadAware {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getNextOccurenceActionName() {
|
||||
public @NotNull String getNextOccurenceActionName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getPreviousOccurenceActionName() {
|
||||
public @NotNull String getPreviousOccurenceActionName() {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
*/
|
||||
// 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.ide;
|
||||
|
||||
import com.intellij.pom.Navigatable;
|
||||
@@ -33,8 +19,7 @@ public abstract class OccurenceNavigatorSupport implements OccurenceNavigator {
|
||||
myTree = tree;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected abstract Navigatable createDescriptorForNode(@NotNull DefaultMutableTreeNode node);
|
||||
protected abstract @Nullable Navigatable createDescriptorForNode(@NotNull DefaultMutableTreeNode node);
|
||||
|
||||
/**
|
||||
* @return true if this node is an actual occurrence, i.e. the "next/prev occurrence" actions should show this node (as opposed to groups or other nodes which should be skipped)
|
||||
@@ -68,8 +53,7 @@ public abstract class OccurenceNavigatorSupport implements OccurenceNavigator {
|
||||
return new OccurenceInfo(editSourceDescriptor, counters.myFoundOccurenceNumber, counters.myOccurencesCount);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Counters calculatePosition(@NotNull DefaultMutableTreeNode foundNode) {
|
||||
private @NotNull Counters calculatePosition(@NotNull DefaultMutableTreeNode foundNode) {
|
||||
Counters counters = new Counters();
|
||||
@SuppressWarnings("unchecked")
|
||||
Enumeration<TreeNode> enumeration = ((DefaultMutableTreeNode)foundNode.getRoot()).preorderEnumeration();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide;
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
@@ -17,8 +17,7 @@ public interface SearchTopHitProvider {
|
||||
|
||||
void consumeTopHits(@NotNull String pattern, @NotNull Consumer<Object> collector, @Nullable Project project);
|
||||
|
||||
@NlsSafe
|
||||
static String getTopHitAccelerator() {
|
||||
static @NlsSafe String getTopHitAccelerator() {
|
||||
return "/";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// 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.ide;
|
||||
|
||||
import com.intellij.openapi.components.Service;
|
||||
@@ -21,8 +21,7 @@ public final class SelectInManager {
|
||||
/**
|
||||
* @deprecated Use {@link #getProject()} instead
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
@NonNls public static final String PROJECT = getProject();
|
||||
@Deprecated(forRemoval = true) public static final @NonNls String PROJECT = getProject();
|
||||
|
||||
public SelectInManager(@NotNull Project project) {
|
||||
myProject = project;
|
||||
@@ -33,8 +32,7 @@ public final class SelectInManager {
|
||||
myTargets.removeExplicitExtension(target);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<SelectInTarget> getTargetList() {
|
||||
public @NotNull List<SelectInTarget> getTargetList() {
|
||||
List<SelectInTarget> targets = new ArrayList<>(myTargets.getExtensions());
|
||||
if (DumbService.getInstance(myProject).isDumb()) {
|
||||
targets.removeIf(target -> !DumbService.isDumbAware(target));
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
*/
|
||||
// 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.ide;
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
@@ -34,16 +20,12 @@ public interface SelectInTarget {
|
||||
void selectIn(SelectInContext context, final boolean requestFocus);
|
||||
|
||||
/** Tool window this target is supposed to select in */
|
||||
@Nullable
|
||||
@NonNls
|
||||
default String getToolWindowId() {
|
||||
default @Nullable @NonNls String getToolWindowId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** aux view id specific for tool window, e.g. Project/Packages/J2EE tab inside project View */
|
||||
@Nullable
|
||||
@NonNls
|
||||
default String getMinorViewId() {
|
||||
default @Nullable @NonNls String getMinorViewId() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide;
|
||||
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -37,7 +37,7 @@ public class SmartSelectInContext extends FileSelectInContext {
|
||||
return pointer.getElement();
|
||||
}
|
||||
|
||||
@Nullable public PsiFile getPsiFile() {
|
||||
public @Nullable PsiFile getPsiFile() {
|
||||
Object selector = pointer.getElement();
|
||||
return selector instanceof PsiFile ? (PsiFile)selector : null;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
@@ -22,8 +22,7 @@ public abstract class TextCopyProvider implements CopyProvider {
|
||||
*
|
||||
* @return collection of text blocks or null
|
||||
*/
|
||||
@Nullable
|
||||
public abstract Collection<String> getTextLinesToCopy();
|
||||
public abstract @Nullable Collection<String> getTextLinesToCopy();
|
||||
|
||||
@Override
|
||||
public void performCopy(@NotNull DataContext dataContext) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide;
|
||||
|
||||
import com.intellij.openapi.util.NlsContext;
|
||||
@@ -8,7 +8,6 @@ import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@NlsContext(prefix = "tooltip.title")
|
||||
@Nls(capitalization = Nls.Capitalization.Sentence)
|
||||
@Target({ElementType.TYPE_USE, ElementType.PARAMETER, ElementType.METHOD})
|
||||
public @interface TooltipTitle {
|
||||
public @Nls(capitalization = Nls.Capitalization.Sentence) @interface TooltipTitle {
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// 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.ide;
|
||||
|
||||
import com.intellij.BundleBase;
|
||||
@@ -32,9 +32,7 @@ public final class TypeNameEP implements PluginAware {
|
||||
/**
|
||||
* Use {@link #resourceKey} for i18n.
|
||||
*/
|
||||
@Attribute("name")
|
||||
@Nls(capitalization = Nls.Capitalization.Title)
|
||||
public String name;
|
||||
@Attribute("name") public @Nls(capitalization = Nls.Capitalization.Title) String name;
|
||||
|
||||
/**
|
||||
* If unspecified, plugin's {@code <resource-bundle>} will be used.
|
||||
@@ -42,9 +40,7 @@ public final class TypeNameEP implements PluginAware {
|
||||
@Attribute("resourceBundle")
|
||||
public String resourceBundle;
|
||||
|
||||
@Attribute("resourceKey")
|
||||
@Nls(capitalization = Nls.Capitalization.Title)
|
||||
public String resourceKey;
|
||||
@Attribute("resourceKey") public @Nls(capitalization = Nls.Capitalization.Title) String resourceKey;
|
||||
|
||||
private final NullableLazyValue<String> myName = new NullableLazyValue<>() {
|
||||
@Override
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
*/
|
||||
// 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.ide.actions;
|
||||
|
||||
import com.intellij.CommonBundle;
|
||||
@@ -46,8 +32,7 @@ public class ContextHelpAction extends AnAction implements DumbAware, ActionRemo
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected String getHelpId(DataContext dataContext) {
|
||||
protected @Nullable String getHelpId(DataContext dataContext) {
|
||||
return myHelpID != null ? myHelpID : PlatformCoreDataKeys.HELP_ID.getData(dataContext);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import javax.swing.*;
|
||||
|
||||
public abstract class QuickSwitchSchemeAction extends AnAction implements DumbAware {
|
||||
private final static Condition<? super AnAction> DEFAULT_PRESELECT_ACTION = a -> {
|
||||
private static final Condition<? super AnAction> DEFAULT_PRESELECT_ACTION = a -> {
|
||||
return a.getTemplatePresentation().getIcon() != AllIcons.Actions.Forward;
|
||||
};
|
||||
|
||||
@@ -63,8 +63,7 @@ public abstract class QuickSwitchSchemeAction extends AnAction implements DumbAw
|
||||
showPopup(e, popup);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected Condition<? super AnAction> preselectAction() {
|
||||
protected @Nullable Condition<? super AnAction> preselectAction() {
|
||||
return DEFAULT_PRESELECT_ACTION;
|
||||
}
|
||||
|
||||
@@ -82,8 +81,7 @@ public abstract class QuickSwitchSchemeAction extends AnAction implements DumbAw
|
||||
return JBPopupFactory.ActionSelectionAid.NUMBERING;
|
||||
}
|
||||
|
||||
@Nls(capitalization = Nls.Capitalization.Title)
|
||||
protected String getPopupTitle(@NotNull AnActionEvent e) {
|
||||
protected @Nls(capitalization = Nls.Capitalization.Title) String getPopupTitle(@NotNull AnActionEvent e) {
|
||||
return e.getPresentation().getText();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.actions.exclusion;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
@@ -16,7 +16,7 @@ import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
abstract class TreeNodeExclusionAction<T extends TreeNode> extends AnAction {
|
||||
private final static Logger LOG = Logger.getInstance(TreeNodeExclusionAction.class);
|
||||
private static final Logger LOG = Logger.getInstance(TreeNodeExclusionAction.class);
|
||||
|
||||
private final boolean myIsExclude;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.browsers;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -46,13 +46,11 @@ public enum BrowserFamily implements Iconable {
|
||||
myIcon = icon;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public BrowserSpecificSettings createBrowserSpecificSettings() {
|
||||
public @Nullable BrowserSpecificSettings createBrowserSpecificSettings() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getExecutionPath() {
|
||||
public @Nullable String getExecutionPath() {
|
||||
if (SystemInfo.isWindows) {
|
||||
return myWindowsPath;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
*/
|
||||
// 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.ide.browsers;
|
||||
|
||||
import com.intellij.openapi.options.Configurable;
|
||||
@@ -23,16 +9,13 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class BrowserSpecificSettings implements Cloneable {
|
||||
@NotNull
|
||||
public abstract Configurable createConfigurable();
|
||||
public abstract @NotNull Configurable createConfigurable();
|
||||
|
||||
@NotNull
|
||||
public List<String> getAdditionalParameters() {
|
||||
public @NotNull List<String> getAdditionalParameters() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Map<String, String> getEnvironmentVariables() {
|
||||
public @NotNull Map<String, String> getEnvironmentVariables() {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// 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.ide.browsers;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
@@ -9,26 +10,19 @@ import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public abstract class WebBrowser {
|
||||
@NotNull
|
||||
public abstract @NlsSafe String getName();
|
||||
public abstract @NotNull @NlsSafe String getName();
|
||||
|
||||
@NotNull
|
||||
public abstract UUID getId();
|
||||
public abstract @NotNull UUID getId();
|
||||
|
||||
@NotNull
|
||||
public abstract BrowserFamily getFamily();
|
||||
public abstract @NotNull BrowserFamily getFamily();
|
||||
|
||||
@NotNull
|
||||
public abstract Icon getIcon();
|
||||
public abstract @NotNull Icon getIcon();
|
||||
|
||||
@Nullable
|
||||
public abstract @NlsSafe String getPath();
|
||||
public abstract @Nullable @NlsSafe String getPath();
|
||||
|
||||
@NotNull
|
||||
public abstract String getBrowserNotFoundMessage();
|
||||
public abstract @NotNull String getBrowserNotFoundMessage();
|
||||
|
||||
@Nullable
|
||||
public abstract BrowserSpecificSettings getSpecificSettings();
|
||||
public abstract @Nullable BrowserSpecificSettings getSpecificSettings();
|
||||
|
||||
public void addOpenUrlParameter(@NotNull List<? super String> command, @NotNull String url) {
|
||||
command.add(url);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.browsers;
|
||||
|
||||
import com.intellij.lang.Language;
|
||||
@@ -13,8 +13,7 @@ public abstract class WebBrowserService {
|
||||
return ApplicationManager.getApplication().getService(WebBrowserService.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public abstract Collection<Url> getUrlsToOpen(@NotNull OpenInBrowserRequest request, boolean preferLocalUrl) throws WebBrowserUrlProvider.BrowserException;
|
||||
public abstract @NotNull Collection<Url> getUrlsToOpen(@NotNull OpenInBrowserRequest request, boolean preferLocalUrl) throws WebBrowserUrlProvider.BrowserException;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static boolean isHtmlOrXmlLanguage(@NotNull Language language) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.browsers.chrome;
|
||||
|
||||
import com.intellij.ide.browsers.BrowserSpecificSettings;
|
||||
@@ -26,9 +26,8 @@ public final class ChromeSettings extends BrowserSpecificSettings {
|
||||
public ChromeSettings() {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Tag("user-data-dir")
|
||||
public String getUserDataDirectoryPath() {
|
||||
public @Nullable String getUserDataDirectoryPath() {
|
||||
return myUserDataDirectoryPath;
|
||||
}
|
||||
|
||||
@@ -37,9 +36,8 @@ public final class ChromeSettings extends BrowserSpecificSettings {
|
||||
return myUseCustomProfile;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Tag("command-line-options")
|
||||
public String getCommandLineOptions() {
|
||||
public @Nullable String getCommandLineOptions() {
|
||||
return myCommandLineOptions;
|
||||
}
|
||||
|
||||
@@ -55,9 +53,8 @@ public final class ChromeSettings extends BrowserSpecificSettings {
|
||||
myUseCustomProfile = useCustomProfile;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<String> getAdditionalParameters() {
|
||||
public @NotNull List<String> getAdditionalParameters() {
|
||||
if (myCommandLineOptions == null) {
|
||||
if (myUseCustomProfile && myUserDataDirectoryPath != null) {
|
||||
return Collections.singletonList(USER_DATA_DIR_ARG + FileUtilRt.toSystemDependentName(myUserDataDirectoryPath));
|
||||
@@ -75,19 +72,17 @@ public final class ChromeSettings extends BrowserSpecificSettings {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
@XMap(propertyElementName = "environment-variables")
|
||||
public Map<String, String> getEnvironmentVariables() {
|
||||
public @NotNull Map<String, String> getEnvironmentVariables() {
|
||||
return myEnvironmentVariables;
|
||||
}
|
||||
|
||||
public void setEnvironmentVariables(@NotNull final Map<String, String> environmentVariables) {
|
||||
public void setEnvironmentVariables(final @NotNull Map<String, String> environmentVariables) {
|
||||
myEnvironmentVariables = environmentVariables;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ChromeSettingsConfigurable createConfigurable() {
|
||||
public @NotNull ChromeSettingsConfigurable createConfigurable() {
|
||||
return new ChromeSettingsConfigurable(this);
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.browsers.chrome;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
@@ -106,9 +106,8 @@ public class ChromeSettingsConfigurable implements Configurable {
|
||||
}
|
||||
}
|
||||
|
||||
@Nls
|
||||
@Override
|
||||
public String getDisplayName() {
|
||||
public @Nls String getDisplayName() {
|
||||
return IdeBundle.message("configurable.ChromeSettingsConfigurable.display.name");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.browsers.firefox;
|
||||
|
||||
import com.intellij.ide.browsers.BrowserSpecificSettings;
|
||||
@@ -29,9 +29,8 @@ public final class FirefoxSettings extends BrowserSpecificSettings {
|
||||
myProfile = StringUtil.nullize(profile);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Tag("profiles-ini-path")
|
||||
public String getProfilesIniPath() {
|
||||
public @Nullable String getProfilesIniPath() {
|
||||
return myProfilesIniPath;
|
||||
}
|
||||
|
||||
@@ -39,9 +38,8 @@ public final class FirefoxSettings extends BrowserSpecificSettings {
|
||||
myProfilesIniPath = PathUtil.toSystemIndependentName(StringUtil.nullize(value));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Tag("profile")
|
||||
public @NlsSafe String getProfile() {
|
||||
public @Nullable @NlsSafe String getProfile() {
|
||||
return myProfile;
|
||||
}
|
||||
|
||||
@@ -49,23 +47,20 @@ public final class FirefoxSettings extends BrowserSpecificSettings {
|
||||
myProfile = StringUtil.nullize(value);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Configurable createConfigurable() {
|
||||
public @NotNull Configurable createConfigurable() {
|
||||
return new FirefoxSettingsConfigurable(this);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public File getProfilesIniFile() {
|
||||
public @Nullable File getProfilesIniFile() {
|
||||
if (myProfilesIniPath != null) {
|
||||
return new File(FileUtil.toSystemDependentName(myProfilesIniPath));
|
||||
}
|
||||
return FirefoxUtil.getDefaultProfileIniPath();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<String> getAdditionalParameters() {
|
||||
public @NotNull List<String> getAdditionalParameters() {
|
||||
List<FirefoxProfile> profiles = FirefoxUtil.computeProfiles(getProfilesIniFile());
|
||||
if (profiles.size() >= 2) {
|
||||
FirefoxProfile profile = FirefoxUtil.findProfileByNameOrDefault(myProfile, profiles);
|
||||
|
||||
+5
-9
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.browsers.firefox;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
@@ -65,14 +65,12 @@ public class FirefoxSettingsConfigurable implements Configurable {
|
||||
!Objects.equals(mySettings.getProfilesIniPath(), getConfiguredProfileIniPath());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getConfiguredProfileIniPath() {
|
||||
private @Nullable String getConfiguredProfileIniPath() {
|
||||
String path = PathUtil.toSystemIndependentName(StringUtil.nullize(myProfilesIniPathField.getText()));
|
||||
return myDefaultProfilesIniPath.equals(path) ? null : path;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getConfiguredProfileName() {
|
||||
private @Nullable String getConfiguredProfileName() {
|
||||
String selected = (String)myProfileCombobox.getSelectedItem();
|
||||
return Objects.equals(defaultProfile, selected) ? null : selected;
|
||||
}
|
||||
@@ -117,14 +115,12 @@ public class FirefoxSettingsConfigurable implements Configurable {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nls
|
||||
public String getDisplayName() {
|
||||
public @Nls String getDisplayName() {
|
||||
return IdeBundle.message("display.name.firefox.settings");
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getHelpTopic() {
|
||||
public @Nullable String getHelpTopic() {
|
||||
return "reference.settings.ide.settings.web.browsers.edit";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.browsers.firefox;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -19,13 +19,12 @@ import java.util.List;
|
||||
|
||||
public final class FirefoxUtil {
|
||||
private static final Logger LOG = Logger.getInstance(FirefoxUtil.class);
|
||||
@NonNls public static final String PROFILES_INI_FILE = "profiles.ini";
|
||||
public static final @NonNls String PROFILES_INI_FILE = "profiles.ini";
|
||||
|
||||
private FirefoxUtil() {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static File getDefaultProfileIniPath() {
|
||||
public static @Nullable File getDefaultProfileIniPath() {
|
||||
File[] roots = getProfilesDirs();
|
||||
for (File profilesDir : roots) {
|
||||
File profilesFile = new File(profilesDir, PROFILES_INI_FILE);
|
||||
@@ -36,8 +35,7 @@ public final class FirefoxUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static File getFirefoxExtensionsDir(FirefoxSettings settings) {
|
||||
public static @Nullable File getFirefoxExtensionsDir(FirefoxSettings settings) {
|
||||
File profilesFile = settings.getProfilesIniFile();
|
||||
if (profilesFile != null && profilesFile.exists()) {
|
||||
List<FirefoxProfile> profiles = computeProfiles(profilesFile);
|
||||
@@ -52,8 +50,7 @@ public final class FirefoxUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static FirefoxProfile findProfileByNameOrDefault(@Nullable String name, @NotNull List<? extends FirefoxProfile> profiles) {
|
||||
public static @Nullable FirefoxProfile findProfileByNameOrDefault(@Nullable String name, @NotNull List<? extends FirefoxProfile> profiles) {
|
||||
for (FirefoxProfile profile : profiles) {
|
||||
if (profile.getName().equals(name)) {
|
||||
return profile;
|
||||
@@ -62,8 +59,7 @@ public final class FirefoxUtil {
|
||||
return getDefaultProfile(profiles);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static FirefoxProfile getDefaultProfile(List<? extends FirefoxProfile> profiles) {
|
||||
public static @Nullable FirefoxProfile getDefaultProfile(List<? extends FirefoxProfile> profiles) {
|
||||
if (profiles.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
@@ -76,8 +72,7 @@ public final class FirefoxUtil {
|
||||
return profiles.get(0);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static List<FirefoxProfile> computeProfiles(@Nullable File profilesFile) {
|
||||
public static @NotNull List<FirefoxProfile> computeProfiles(@Nullable File profilesFile) {
|
||||
if (profilesFile == null || !profilesFile.isFile()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.dnd;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -30,6 +30,5 @@ public abstract class DnDManager {
|
||||
|
||||
public abstract void unregisterTarget(DnDTarget target, JComponent component);
|
||||
|
||||
@Nullable
|
||||
public abstract Component getLastDropHandler();
|
||||
public abstract @Nullable Component getLastDropHandler();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.dnd;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -30,8 +30,7 @@ public interface DnDNativeTarget extends DnDTarget {
|
||||
return myFlavors;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getTextForFlavor(DataFlavor flavor) {
|
||||
public @Nullable String getTextForFlavor(DataFlavor flavor) {
|
||||
if (myTexts.containsKey(flavor)) {
|
||||
return myTexts.get(flavor);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.dnd;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -131,7 +131,7 @@ public final class DnDSupport implements DnDTarget, DnDSource, DnDDropHandler.Wi
|
||||
}
|
||||
|
||||
private static final class DnDNativeTargetWrapper implements DnDNativeTarget, DnDDropHandler.WithResult {
|
||||
@NotNull private final DnDSupport myTarget;
|
||||
private final @NotNull DnDSupport myTarget;
|
||||
|
||||
private DnDNativeTargetWrapper(@NotNull DnDSupport target) {
|
||||
myTarget = target;
|
||||
@@ -158,8 +158,7 @@ public final class DnDSupport implements DnDTarget, DnDSource, DnDDropHandler.Wi
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static DnDSupportBuilder createBuilder(@NotNull JComponent component) {
|
||||
public static @NotNull DnDSupportBuilder createBuilder(@NotNull JComponent component) {
|
||||
final JComponent myComponent = component;
|
||||
final Ref<Boolean> asTarget = Ref.create(true);
|
||||
final Ref<Boolean> asSource = Ref.create(true);
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
*/
|
||||
// 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.ide.errorTreeView;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -53,13 +39,11 @@ public enum ErrorTreeElementKind {
|
||||
return myPresentableText;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Icon getIcon() {
|
||||
public @Nullable Icon getIcon() {
|
||||
return myIcon;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static ErrorTreeElementKind convertMessageFromCompilerErrorType(int type) {
|
||||
public static @NotNull ErrorTreeElementKind convertMessageFromCompilerErrorType(int type) {
|
||||
return switch (type) {
|
||||
case MessageCategory.ERROR -> ERROR;
|
||||
case MessageCategory.WARNING -> WARNING;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.errorTreeView;
|
||||
|
||||
import com.intellij.util.Consumer;
|
||||
@@ -11,8 +11,8 @@ public class HotfixData {
|
||||
private final @Nls String myFixComment;
|
||||
private final Consumer<? super HotfixGate> myFix;
|
||||
|
||||
public HotfixData(@NotNull final String id,
|
||||
@NotNull final String errorText,
|
||||
public HotfixData(final @NotNull String id,
|
||||
final @NotNull String errorText,
|
||||
@NotNull @Nls String fixComment,
|
||||
final Consumer<? super HotfixGate> fix) {
|
||||
myErrorText = errorText;
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
*/
|
||||
// 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.ide.errorTreeView;
|
||||
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
@@ -29,8 +15,7 @@ public class SimpleErrorData {
|
||||
myVf = vf;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ErrorTreeElementKind getKind() {
|
||||
public @NotNull ErrorTreeElementKind getKind() {
|
||||
return myKind;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.plugins;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
@@ -29,9 +29,7 @@ public abstract class PluginReplacement implements PluginAware {
|
||||
myNewPluginId = newPluginId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Nls
|
||||
public String getReplacementMessage(@NotNull IdeaPluginDescriptor oldPlugin, @NotNull IdeaPluginDescriptor newPlugin) {
|
||||
public @NotNull @Nls String getReplacementMessage(@NotNull IdeaPluginDescriptor oldPlugin, @NotNull IdeaPluginDescriptor newPlugin) {
|
||||
return IdeBundle.message("plugin.manager.replace.plugin.0.by.plugin.1", oldPlugin.getName(), newPlugin.getName());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// 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.ide.ui;
|
||||
|
||||
import com.intellij.ide.ui.laf.UIThemeLookAndFeelInfo;
|
||||
@@ -133,9 +133,7 @@ public abstract class LafManager {
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public abstract UIThemeLookAndFeelInfo getDefaultLightLaf();
|
||||
public abstract @Nullable UIThemeLookAndFeelInfo getDefaultLightLaf();
|
||||
|
||||
@Nullable
|
||||
public abstract UIThemeLookAndFeelInfo getDefaultDarkLaf();
|
||||
public abstract @Nullable UIThemeLookAndFeelInfo getDefaultDarkLaf();
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.ui;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -10,8 +10,7 @@ import javax.swing.*;
|
||||
* Provides icons which can be used to represent this IDE in different contexts.
|
||||
*/
|
||||
public interface ProductIcons {
|
||||
@NotNull
|
||||
static ProductIcons getInstance() {
|
||||
static @NotNull ProductIcons getInstance() {
|
||||
return ApplicationManager.getApplication().getService(ProductIcons.class);
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.ui;
|
||||
|
||||
import com.intellij.ide.ui.search.BooleanOptionDescription;
|
||||
@@ -18,8 +18,7 @@ public abstract class PublicFieldBasedOptionDescription extends BooleanOptionDes
|
||||
myFieldName = fieldName;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public abstract Object getInstance();
|
||||
public abstract @NotNull Object getInstance();
|
||||
|
||||
protected void fireUpdated() {
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.ui;
|
||||
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
@@ -8,19 +8,19 @@ import com.intellij.util.SmartList;
|
||||
import com.intellij.util.text.StringTokenizer;
|
||||
import com.intellij.util.xmlb.Converter;
|
||||
import com.intellij.util.xmlb.annotations.Tag;
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Tag("splitter-proportions")
|
||||
public class SplitterProportionsDataImpl implements SplitterProportionsData {
|
||||
private static final String DATA_VERSION = "1";
|
||||
@NonNls private static final String ATTRIBUTE_PROPORTIONS = "proportions";
|
||||
@NonNls private static final String ATTRIBUTE_VERSION = "version";
|
||||
private static final @NonNls String ATTRIBUTE_PROPORTIONS = "proportions";
|
||||
private static final @NonNls String ATTRIBUTE_VERSION = "version";
|
||||
|
||||
private List<Float> proportions = new SmartList<>();
|
||||
|
||||
@@ -108,9 +108,8 @@ public class SplitterProportionsDataImpl implements SplitterProportionsData {
|
||||
}
|
||||
|
||||
public static final class SplitterProportionsConverter extends Converter<SplitterProportionsDataImpl> {
|
||||
@NotNull
|
||||
@Override
|
||||
public SplitterProportionsDataImpl fromString(@NotNull String value) {
|
||||
public @NotNull SplitterProportionsDataImpl fromString(@NotNull String value) {
|
||||
SplitterProportionsDataImpl data = new SplitterProportionsDataImpl();
|
||||
StringTokenizer tokenizer = new StringTokenizer(value, ",");
|
||||
while (tokenizer.hasMoreTokens()) {
|
||||
@@ -119,9 +118,8 @@ public class SplitterProportionsDataImpl implements SplitterProportionsData {
|
||||
return data;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String toString(@NotNull SplitterProportionsDataImpl data) {
|
||||
public @NotNull String toString(@NotNull SplitterProportionsDataImpl data) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
String sep = "";
|
||||
for (Float proportion : data.proportions) {
|
||||
|
||||
+2
-17
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2014 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.
|
||||
*/
|
||||
// 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.ide.ui.search;
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
@@ -27,6 +13,5 @@ public abstract class ActionFromOptionDescriptorProvider {
|
||||
public static final ExtensionPointName<ActionFromOptionDescriptorProvider> EP =
|
||||
new ExtensionPointName<>("com.intellij.actionFromOptionDescriptorProvider");
|
||||
|
||||
@Nullable
|
||||
public abstract AnAction provide(@NotNull OptionDescription description);
|
||||
public abstract @Nullable AnAction provide(@NotNull OptionDescription description);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.ui.search;
|
||||
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
@@ -40,34 +40,27 @@ public class OptionDescription implements Comparable<OptionDescription> {
|
||||
myGroupName = groupName;
|
||||
}
|
||||
|
||||
@Nls
|
||||
public String getOption() {
|
||||
public @Nls String getOption() {
|
||||
return myOption;
|
||||
}
|
||||
|
||||
@NlsSafe
|
||||
@Nullable
|
||||
public final String getHit() {
|
||||
public final @NlsSafe @Nullable String getHit() {
|
||||
return myHit;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public final String getPath() {
|
||||
public final @Nullable String getPath() {
|
||||
return myPath;
|
||||
}
|
||||
|
||||
@NonNls
|
||||
public final String getConfigurableId() {
|
||||
public final @NonNls String getConfigurableId() {
|
||||
return myConfigurableId;
|
||||
}
|
||||
|
||||
@Nls
|
||||
public final String getGroupName() {
|
||||
public final @Nls String getGroupName() {
|
||||
return myGroupName;
|
||||
}
|
||||
|
||||
@NlsSafe
|
||||
public String getValue() {
|
||||
public @NlsSafe String getValue() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.ui.search;
|
||||
|
||||
import com.intellij.openapi.options.SearchableConfigurable;
|
||||
@@ -25,7 +25,7 @@ public abstract class SearchableOptionProcessor {
|
||||
public abstract void addOptions(@NotNull String text,
|
||||
@Nullable String path,
|
||||
@Nullable String hit,
|
||||
@NonNls @NotNull final String configurableId,
|
||||
@Nullable final String configurableDisplayName,
|
||||
final @NonNls @NotNull String configurableId,
|
||||
final @Nullable String configurableDisplayName,
|
||||
boolean applyStemming);
|
||||
}
|
||||
|
||||
@@ -1,27 +1,13 @@
|
||||
/*
|
||||
* Copyright 2000-2012 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.
|
||||
*/
|
||||
// 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.ide.util;
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooser;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -52,8 +38,7 @@ public class BrowseFilesListener implements ActionListener {
|
||||
myChooserDescriptor = chooserDescriptor;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected VirtualFile getFileToSelect() {
|
||||
protected @Nullable VirtualFile getFileToSelect() {
|
||||
final String path = myTextField.getText().trim().replace(File.separatorChar, '/');
|
||||
if (path.length() > 0) {
|
||||
File file = new File(path);
|
||||
@@ -67,7 +52,7 @@ public class BrowseFilesListener implements ActionListener {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void doSetText(@NotNull final String path) {
|
||||
protected void doSetText(final @NotNull String path) {
|
||||
myTextField.setText(path);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.util;
|
||||
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
@@ -110,8 +110,7 @@ public class DelegatingProgressIndicator implements WrappedProgressIndicator, St
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ModalityState getModalityState() {
|
||||
public @NotNull ModalityState getModalityState() {
|
||||
return myIndicator.getModalityState();
|
||||
}
|
||||
|
||||
@@ -139,9 +138,8 @@ public class DelegatingProgressIndicator implements WrappedProgressIndicator, St
|
||||
return myIndicator;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public ProgressIndicator getOriginalProgressIndicator() {
|
||||
public @NotNull ProgressIndicator getOriginalProgressIndicator() {
|
||||
return myIndicator;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.util.treeView;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
@@ -24,7 +24,10 @@ import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.ui.tree.TreeUtil;
|
||||
import com.intellij.util.ui.update.Activatable;
|
||||
import com.intellij.util.ui.update.UiNotifyConnector;
|
||||
import org.jetbrains.annotations.*;
|
||||
import org.jetbrains.annotations.Nls;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.concurrency.AsyncPromise;
|
||||
import org.jetbrains.concurrency.Promise;
|
||||
import org.jetbrains.concurrency.Promises;
|
||||
@@ -196,7 +199,7 @@ public class AbstractTreeUi {
|
||||
private final Set<Runnable> myUserRunnables = new HashSet<>();
|
||||
|
||||
private UiActivityMonitor myActivityMonitor;
|
||||
@NonNls private UiActivity myActivityId;
|
||||
private @NonNls UiActivity myActivityId;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@@ -501,8 +504,7 @@ public class AbstractTreeUi {
|
||||
return myTree;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static NodeDescriptor<?> getDescriptorFrom(Object node) {
|
||||
private static @Nullable NodeDescriptor<?> getDescriptorFrom(Object node) {
|
||||
if (node instanceof DefaultMutableTreeNode) {
|
||||
Object userObject = ((DefaultMutableTreeNode)node).getUserObject();
|
||||
if (userObject instanceof NodeDescriptor) {
|
||||
@@ -513,8 +515,7 @@ public class AbstractTreeUi {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public final DefaultMutableTreeNode getNodeForElement(@NotNull Object element, boolean validateAgainstStructure) {
|
||||
public final @Nullable DefaultMutableTreeNode getNodeForElement(@NotNull Object element, boolean validateAgainstStructure) {
|
||||
DefaultMutableTreeNode result = null;
|
||||
if (validateAgainstStructure) {
|
||||
int index = 0;
|
||||
@@ -589,8 +590,7 @@ public class AbstractTreeUi {
|
||||
return valid;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public final DefaultMutableTreeNode getNodeForPath(Object @NotNull [] path) {
|
||||
public final @Nullable DefaultMutableTreeNode getNodeForPath(Object @NotNull [] path) {
|
||||
DefaultMutableTreeNode node = null;
|
||||
for (Object pathElement : path) {
|
||||
node = node == null ? getFirstNode(pathElement) : findNodeForChildElement(node, pathElement);
|
||||
@@ -640,8 +640,7 @@ public class AbstractTreeUi {
|
||||
getBuilder().queueUpdateFrom(getTreeStructure().getRootElement(), true);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected AbstractTreeBuilder getBuilder() {
|
||||
protected @NotNull AbstractTreeBuilder getBuilder() {
|
||||
return myBuilder;
|
||||
}
|
||||
|
||||
@@ -833,8 +832,7 @@ public class AbstractTreeUi {
|
||||
return myTree instanceof AlwaysExpandedTree && ((AlwaysExpandedTree)myTree).isAlwaysExpanded();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Promise<Boolean> update(@NotNull NodeDescriptor<?> nodeDescriptor, boolean now) {
|
||||
private @NotNull Promise<Boolean> update(@NotNull NodeDescriptor<?> nodeDescriptor, boolean now) {
|
||||
Promise<Boolean> promise;
|
||||
if (now || isPassthroughMode()) {
|
||||
promise = Promises.resolvedPromise(update(nodeDescriptor));
|
||||
@@ -974,13 +972,11 @@ public class AbstractTreeUi {
|
||||
}
|
||||
|
||||
//todo: to make real callback
|
||||
@NotNull
|
||||
public ActionCallback queueUpdate(Object element) {
|
||||
public @NotNull ActionCallback queueUpdate(Object element) {
|
||||
return queueUpdate(element, true);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ActionCallback queueUpdate(Object fromElement, boolean updateStructure) {
|
||||
public @NotNull ActionCallback queueUpdate(Object fromElement, boolean updateStructure) {
|
||||
assertIsDispatchThread();
|
||||
|
||||
try {
|
||||
@@ -1096,8 +1092,7 @@ public class AbstractTreeUi {
|
||||
return isToBuildChildrenInBackground(getElementFromDescriptor(descriptor));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private UpdaterTreeState setUpdaterState(@NotNull UpdaterTreeState state) {
|
||||
private @NotNull UpdaterTreeState setUpdaterState(@NotNull UpdaterTreeState state) {
|
||||
if (state.equals(myUpdaterState)) return state;
|
||||
|
||||
UpdaterTreeState oldState = myUpdaterState;
|
||||
@@ -1135,15 +1130,14 @@ public class AbstractTreeUi {
|
||||
return getBuilder().getTreeStructureElement(descriptor);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private ActionCallback updateNodeChildren(@NotNull DefaultMutableTreeNode node,
|
||||
@NotNull TreeUpdatePass pass,
|
||||
@Nullable LoadedChildren loadedChildren,
|
||||
boolean forcedNow,
|
||||
boolean toSmartExpand,
|
||||
boolean forceUpdate,
|
||||
boolean descriptorIsUpToDate,
|
||||
boolean updateChildren) {
|
||||
private @NotNull ActionCallback updateNodeChildren(@NotNull DefaultMutableTreeNode node,
|
||||
@NotNull TreeUpdatePass pass,
|
||||
@Nullable LoadedChildren loadedChildren,
|
||||
boolean forcedNow,
|
||||
boolean toSmartExpand,
|
||||
boolean forceUpdate,
|
||||
boolean descriptorIsUpToDate,
|
||||
boolean updateChildren) {
|
||||
AbstractTreeStructure treeStructure = getTreeStructure();
|
||||
ActionCallback result = treeStructure.asyncCommit();
|
||||
result.doWhenDone(new TreeRunnable("AbstractTreeUi.updateNodeChildren: on done") {
|
||||
@@ -1629,11 +1623,10 @@ public class AbstractTreeUi {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private ActionCallback updateNodesToInsert(@NotNull List<? extends TreeNode> nodesToInsert,
|
||||
@NotNull TreeUpdatePass pass,
|
||||
boolean canSmartExpand,
|
||||
boolean forceUpdate) {
|
||||
private @NotNull ActionCallback updateNodesToInsert(@NotNull List<? extends TreeNode> nodesToInsert,
|
||||
@NotNull TreeUpdatePass pass,
|
||||
boolean canSmartExpand,
|
||||
boolean forceUpdate) {
|
||||
ActionCallback.Chunk chunk = new ActionCallback.Chunk();
|
||||
for (TreeNode node : nodesToInsert) {
|
||||
DefaultMutableTreeNode childNode = (DefaultMutableTreeNode)node;
|
||||
@@ -1645,14 +1638,13 @@ public class AbstractTreeUi {
|
||||
return chunk.getWhenProcessed();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Promise<?> processExistingNodes(@NotNull DefaultMutableTreeNode node,
|
||||
@NotNull MutualMap<Object, Integer> elementToIndexMap,
|
||||
@NotNull TreeUpdatePass pass,
|
||||
boolean canSmartExpand,
|
||||
boolean forceUpdate,
|
||||
boolean wasExpanded,
|
||||
@Nullable LoadedChildren preloaded) {
|
||||
private @NotNull Promise<?> processExistingNodes(@NotNull DefaultMutableTreeNode node,
|
||||
@NotNull MutualMap<Object, Integer> elementToIndexMap,
|
||||
@NotNull TreeUpdatePass pass,
|
||||
boolean canSmartExpand,
|
||||
boolean forceUpdate,
|
||||
boolean wasExpanded,
|
||||
@Nullable LoadedChildren preloaded) {
|
||||
List<TreeNode> childNodes = TreeUtil.listChildren(node);
|
||||
return maybeYield(() -> {
|
||||
if (pass.isExpired()) return Promises.<Void>rejectedPromise();
|
||||
@@ -1731,8 +1723,7 @@ public class AbstractTreeUi {
|
||||
Promise<?> run();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Promise<?> maybeYield(@NotNull AsyncRunnable processRunnable, @NotNull TreeUpdatePass pass, DefaultMutableTreeNode node) {
|
||||
private @NotNull Promise<?> maybeYield(@NotNull AsyncRunnable processRunnable, @NotNull TreeUpdatePass pass, DefaultMutableTreeNode node) {
|
||||
if (isRerunNeeded(pass)) {
|
||||
getUpdater().requeue(pass);
|
||||
return Promises.<Void>rejectedPromise();
|
||||
@@ -1790,8 +1781,7 @@ public class AbstractTreeUi {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Promise<?> execute(@NotNull AsyncRunnable runnable) throws ProcessCanceledException {
|
||||
private @NotNull Promise<?> execute(@NotNull AsyncRunnable runnable) throws ProcessCanceledException {
|
||||
try {
|
||||
if (!canInitiateNewActivity()) {
|
||||
throw new ProcessCanceledException();
|
||||
@@ -1867,8 +1857,7 @@ public class AbstractTreeUi {
|
||||
});
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private ActionCallback resetToReadyNow() {
|
||||
private @NotNull ActionCallback resetToReadyNow() {
|
||||
if (isReleased()) return ActionCallback.REJECTED;
|
||||
|
||||
assertIsDispatchThread();
|
||||
@@ -2002,9 +1991,7 @@ public class AbstractTreeUi {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@NonNls
|
||||
public String getStatus() {
|
||||
public @NotNull @NonNls String getStatus() {
|
||||
return "isReady=" + isReady() + "\n" +
|
||||
" isIdle=" + isIdle() + "\n" +
|
||||
" isYeildingNow=" + isYieldingNow() + "\n" +
|
||||
@@ -2148,9 +2135,8 @@ public class AbstractTreeUi {
|
||||
getBuilder().yieldToEDT(runnable);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private MutualMap<Object, Integer> loadElementsFromStructure(NodeDescriptor<?> descriptor,
|
||||
@Nullable LoadedChildren preloadedChildren) {
|
||||
private @NotNull MutualMap<Object, Integer> loadElementsFromStructure(NodeDescriptor<?> descriptor,
|
||||
@Nullable LoadedChildren preloadedChildren) {
|
||||
MutualMap<Object, Integer> elementToIndexMap = new MutualMap<>(true);
|
||||
Object element = getElementFromDescriptor(descriptor);
|
||||
if (!isValid(element)) return elementToIndexMap;
|
||||
@@ -2172,12 +2158,11 @@ public class AbstractTreeUi {
|
||||
return node instanceof LoadingNode;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private AsyncResult<List<TreeNode>> collectNodesToInsert(NodeDescriptor<?> descriptor,
|
||||
@NotNull MutualMap<Object, Integer> elementToIndexMap,
|
||||
DefaultMutableTreeNode parent,
|
||||
boolean addLoadingNode,
|
||||
@NotNull LoadedChildren loadedChildren) {
|
||||
private @NotNull AsyncResult<List<TreeNode>> collectNodesToInsert(NodeDescriptor<?> descriptor,
|
||||
@NotNull MutualMap<Object, Integer> elementToIndexMap,
|
||||
DefaultMutableTreeNode parent,
|
||||
boolean addLoadingNode,
|
||||
@NotNull LoadedChildren loadedChildren) {
|
||||
AsyncResult<List<TreeNode>> result = new AsyncResult<>();
|
||||
|
||||
List<TreeNode> nodesToInsert = new ArrayList<>();
|
||||
@@ -2250,8 +2235,7 @@ public class AbstractTreeUi {
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected DefaultMutableTreeNode createChildNode(NodeDescriptor<?> descriptor) {
|
||||
protected @NotNull DefaultMutableTreeNode createChildNode(NodeDescriptor<?> descriptor) {
|
||||
return new ElementNode(this, descriptor);
|
||||
}
|
||||
|
||||
@@ -2263,8 +2247,7 @@ public class AbstractTreeUi {
|
||||
return myClearOnHideDelay;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ActionCallback getInitialized() {
|
||||
public @NotNull ActionCallback getInitialized() {
|
||||
return myInitialized;
|
||||
}
|
||||
|
||||
@@ -2339,8 +2322,7 @@ public class AbstractTreeUi {
|
||||
return getUpdater().hasNodesToUpdate();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<Object> getExpandedElements() {
|
||||
public @NotNull List<Object> getExpandedElements() {
|
||||
List<Object> result = new ArrayList<>();
|
||||
if (isReleased()) return result;
|
||||
|
||||
@@ -2358,8 +2340,7 @@ public class AbstractTreeUi {
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ActionCallback cancelUpdate() {
|
||||
public @NotNull ActionCallback cancelUpdate() {
|
||||
if (isReleased()) return ActionCallback.REJECTED;
|
||||
|
||||
setCancelRequested(true);
|
||||
@@ -2407,18 +2388,15 @@ public class AbstractTreeUi {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private LockToken attemptLock() throws InterruptedException {
|
||||
private @Nullable LockToken attemptLock() throws InterruptedException {
|
||||
return LockToken.attemptLock(myStateLock, Registry.intValue("ide.tree.uiLockAttempt"));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private LockToken acquireLock() {
|
||||
private @NotNull LockToken acquireLock() {
|
||||
return LockToken.acquireLock(myStateLock);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ActionCallback batch(@NotNull Progressive progressive) {
|
||||
public @NotNull ActionCallback batch(@NotNull Progressive progressive) {
|
||||
assertIsDispatchThread();
|
||||
|
||||
EmptyProgressIndicator indicator = new EmptyProgressIndicator();
|
||||
@@ -2532,8 +2510,7 @@ public class AbstractTreeUi {
|
||||
return getUpdatingParent(kid) != null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private DefaultMutableTreeNode getUpdatingParent(DefaultMutableTreeNode kid) {
|
||||
private @Nullable DefaultMutableTreeNode getUpdatingParent(DefaultMutableTreeNode kid) {
|
||||
DefaultMutableTreeNode eachParent = kid;
|
||||
while (eachParent != null) {
|
||||
if (isUpdatingChildrenNow(eachParent)) return eachParent;
|
||||
@@ -2672,10 +2649,8 @@ public class AbstractTreeUi {
|
||||
children.set(loaded);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@NonNls
|
||||
@Override
|
||||
public String toString() {
|
||||
public @NotNull @NonNls String toString() {
|
||||
return "runnable=" + oldElementFromDescriptor;
|
||||
}
|
||||
};
|
||||
@@ -2858,8 +2833,7 @@ public class AbstractTreeUi {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static TreeNode getChildForSmartExpand(@NotNull DefaultMutableTreeNode node) {
|
||||
private static @Nullable TreeNode getChildForSmartExpand(@NotNull DefaultMutableTreeNode node) {
|
||||
int realChildCount = 0;
|
||||
TreeNode nodeToExpand = null;
|
||||
|
||||
@@ -2899,8 +2873,7 @@ public class AbstractTreeUi {
|
||||
return getParentLoadingInBackground(nodeObject) != null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private DefaultMutableTreeNode getParentLoadingInBackground(@NotNull Object nodeObject) {
|
||||
private @Nullable DefaultMutableTreeNode getParentLoadingInBackground(@NotNull Object nodeObject) {
|
||||
if (!(nodeObject instanceof DefaultMutableTreeNode node)) return null;
|
||||
|
||||
TreeNode eachParent = node.getParent();
|
||||
@@ -2920,15 +2893,14 @@ public class AbstractTreeUi {
|
||||
return IdeBundle.message("progress.searching");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Promise<?> processExistingNode(@NotNull DefaultMutableTreeNode childNode,
|
||||
NodeDescriptor<?> childDescriptor,
|
||||
@NotNull DefaultMutableTreeNode parentNode,
|
||||
@NotNull MutualMap<Object, Integer> elementToIndexMap,
|
||||
@NotNull TreeUpdatePass pass,
|
||||
boolean canSmartExpand,
|
||||
boolean forceUpdate,
|
||||
@Nullable LoadedChildren parentPreloadedChildren) {
|
||||
private @NotNull Promise<?> processExistingNode(@NotNull DefaultMutableTreeNode childNode,
|
||||
NodeDescriptor<?> childDescriptor,
|
||||
@NotNull DefaultMutableTreeNode parentNode,
|
||||
@NotNull MutualMap<Object, Integer> elementToIndexMap,
|
||||
@NotNull TreeUpdatePass pass,
|
||||
boolean canSmartExpand,
|
||||
boolean forceUpdate,
|
||||
@Nullable LoadedChildren parentPreloadedChildren) {
|
||||
if (pass.isExpired()) {
|
||||
return Promises.<Void>rejectedPromise();
|
||||
}
|
||||
@@ -3114,8 +3086,7 @@ public class AbstractTreeUi {
|
||||
return parentElementInTree.equals(parentElement);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Condition<?> getExpiredElementCondition(Object element) {
|
||||
private @NotNull Condition<?> getExpiredElementCondition(Object element) {
|
||||
return __ -> isInStructure(element);
|
||||
}
|
||||
|
||||
@@ -3152,8 +3123,7 @@ public class AbstractTreeUi {
|
||||
});
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static TreePath getPathFor(@NotNull TreeNode node) {
|
||||
private static @NotNull TreePath getPathFor(@NotNull TreeNode node) {
|
||||
if (node instanceof DefaultMutableTreeNode) {
|
||||
return new TreePath(((DefaultMutableTreeNode)node).getPath());
|
||||
}
|
||||
@@ -3288,8 +3258,7 @@ public class AbstractTreeUi {
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
private Promise<Void> queueToBackground(@NotNull Runnable bgBuildAction, @Nullable Runnable edtPostRunnable) {
|
||||
private @NotNull Promise<Void> queueToBackground(@NotNull Runnable bgBuildAction, @Nullable Runnable edtPostRunnable) {
|
||||
if (!canInitiateNewActivity()) return Promises.rejectedPromise();
|
||||
AsyncPromise<Void> result = new AsyncPromise<>();
|
||||
AtomicReference<ProcessCanceledException> fail = new AtomicReference<>();
|
||||
@@ -3809,8 +3778,7 @@ public class AbstractTreeUi {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
final Set<Object> getSelectedElements() {
|
||||
final @NotNull Set<Object> getSelectedElements() {
|
||||
TreePath[] paths = myTree.getSelectionPaths();
|
||||
|
||||
Set<Object> result = new LinkedHashSet<>();
|
||||
@@ -3963,8 +3931,7 @@ public class AbstractTreeUi {
|
||||
return myTree.isRootVisible() || node != getRootNode() ? node : null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Runnable wrapDone(Runnable onDone, @NotNull String name) {
|
||||
private @NotNull Runnable wrapDone(Runnable onDone, @NotNull String name) {
|
||||
return new TreeRunnable(name) {
|
||||
@Override
|
||||
public void perform() {
|
||||
@@ -3973,13 +3940,12 @@ public class AbstractTreeUi {
|
||||
};
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Runnable wrapScrollTo(Runnable onDone,
|
||||
@NotNull Object element,
|
||||
@NotNull DefaultMutableTreeNode node,
|
||||
boolean addToSelection,
|
||||
boolean canBeCentered,
|
||||
boolean scroll) {
|
||||
private @NotNull Runnable wrapScrollTo(Runnable onDone,
|
||||
@NotNull Object element,
|
||||
@NotNull DefaultMutableTreeNode node,
|
||||
boolean addToSelection,
|
||||
boolean canBeCentered,
|
||||
boolean scroll) {
|
||||
return new TreeRunnable("AbstractTreeUi.wrapScrollTo") {
|
||||
@Override
|
||||
public void perform() {
|
||||
@@ -4347,8 +4313,7 @@ public class AbstractTreeUi {
|
||||
return getUpdater().isEnqueuedToUpdate(node) || isUpdatingParent(node) || myCancelledBuild.containsKey(node);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Object getElementFor(Object node) {
|
||||
public @Nullable Object getElementFor(Object node) {
|
||||
NodeDescriptor<?> descriptor = getDescriptorFrom(node);
|
||||
return descriptor == null ? null : getElementFromDescriptor(descriptor);
|
||||
}
|
||||
@@ -4361,8 +4326,7 @@ public class AbstractTreeUi {
|
||||
return getParentBuiltNode(node) != null || myRootNode == node && !wasRootNodeInitialized();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private DefaultMutableTreeNode getParentBuiltNode(@NotNull Object node) {
|
||||
private @Nullable DefaultMutableTreeNode getParentBuiltNode(@NotNull Object node) {
|
||||
DefaultMutableTreeNode parent = getParentLoadingInBackground(node);
|
||||
if (parent != null) return parent;
|
||||
|
||||
@@ -4490,13 +4454,11 @@ public class AbstractTreeUi {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private DefaultMutableTreeNode getFirstNode(@NotNull Object element) {
|
||||
private @Nullable DefaultMutableTreeNode getFirstNode(@NotNull Object element) {
|
||||
return findNode(element, 0);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private DefaultMutableTreeNode findNode(@NotNull Object element, int startIndex) {
|
||||
private @Nullable DefaultMutableTreeNode findNode(@NotNull Object element, int startIndex) {
|
||||
Object value = getBuilder().findNodeByElement(element);
|
||||
if (value == null) {
|
||||
return null;
|
||||
@@ -4526,8 +4488,7 @@ public class AbstractTreeUi {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private DefaultMutableTreeNode findNodeForChildElement(@NotNull DefaultMutableTreeNode parentNode, Object element) {
|
||||
private @Nullable DefaultMutableTreeNode findNodeForChildElement(@NotNull DefaultMutableTreeNode parentNode, Object element) {
|
||||
Object anchor = TreeAnchorizer.getService().createAnchor(element);
|
||||
Object value = isNodeNull(anchor) ? null : myElementToNodeMap.get(anchor);
|
||||
TreeAnchorizer.getService().freeAnchor(anchor);
|
||||
@@ -4782,7 +4743,7 @@ public class AbstractTreeUi {
|
||||
}
|
||||
|
||||
private static class LoadedChildren {
|
||||
@NotNull private final List<Object> myElements;
|
||||
private final @NotNull List<Object> myElements;
|
||||
private final Map<Object, NodeDescriptor<?>> myDescriptors = new HashMap<>();
|
||||
private final Map<NodeDescriptor<?>, Boolean> myChanges = new HashMap<>();
|
||||
|
||||
@@ -4807,9 +4768,8 @@ public class AbstractTreeUi {
|
||||
return myDescriptors.get(element);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String toString() {
|
||||
public @NotNull String toString() {
|
||||
return myElements + "->" + myChanges;
|
||||
}
|
||||
|
||||
@@ -4901,9 +4861,7 @@ public class AbstractTreeUi {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
@NonNls
|
||||
public synchronized String toString() {
|
||||
public synchronized @NotNull @NonNls String toString() {
|
||||
return "UpdateInfo: desc=" +
|
||||
myDescriptor +
|
||||
" pass=" +
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.util.treeView;
|
||||
|
||||
@@ -321,9 +321,8 @@ public class AbstractTreeUpdater implements Disposable, Activatable {
|
||||
myUpdateQueue.hideNotify();
|
||||
}
|
||||
|
||||
@NonNls
|
||||
@Override
|
||||
public synchronized String toString() {
|
||||
public synchronized @NonNls String toString() {
|
||||
return "AbstractTreeUpdater updateCount=" + myUpdateCount + " queue=[" + myUpdateQueue + "] " + " nodeQueue=" + myNodeQueue + " builder=" + myTreeBuilder;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.util.treeView;
|
||||
|
||||
import com.intellij.ide.projectView.PresentationData;
|
||||
@@ -111,20 +111,17 @@ public class NodeRenderer extends ColoredTreeCellRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected ItemPresentation getPresentation(Object node) {
|
||||
protected @Nullable ItemPresentation getPresentation(Object node) {
|
||||
return node instanceof PresentableNodeDescriptor ? ((PresentableNodeDescriptor<?>)node).getPresentation() :
|
||||
node instanceof NavigationItem ? ((NavigationItem)node).getPresentation() :
|
||||
null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static EditorColorsScheme getScheme() {
|
||||
private static @NotNull EditorColorsScheme getScheme() {
|
||||
return EditorColorsManager.getInstance().getSchemeForCurrentUITheme();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected SimpleTextAttributes getSimpleTextAttributes(@NotNull PresentationData presentation, Color color, @NotNull Object node) {
|
||||
protected @NotNull SimpleTextAttributes getSimpleTextAttributes(@NotNull PresentationData presentation, Color color, @NotNull Object node) {
|
||||
SimpleTextAttributes simpleTextAttributes = getSimpleTextAttributes(presentation, getScheme());
|
||||
|
||||
return addColorToSimpleTextAttributes(simpleTextAttributes, color);
|
||||
@@ -139,11 +136,11 @@ public class NodeRenderer extends ColoredTreeCellRenderer {
|
||||
return simpleTextAttributes;
|
||||
}
|
||||
|
||||
public static SimpleTextAttributes getSimpleTextAttributes(@Nullable final ItemPresentation presentation) {
|
||||
public static SimpleTextAttributes getSimpleTextAttributes(final @Nullable ItemPresentation presentation) {
|
||||
return getSimpleTextAttributes(presentation, getScheme());
|
||||
}
|
||||
|
||||
private static SimpleTextAttributes getSimpleTextAttributes(@Nullable final ItemPresentation presentation,
|
||||
private static SimpleTextAttributes getSimpleTextAttributes(final @Nullable ItemPresentation presentation,
|
||||
@NotNull EditorColorsScheme colorsScheme)
|
||||
{
|
||||
if (presentation instanceof ColoredItemPresentation) {
|
||||
|
||||
@@ -64,7 +64,7 @@ public final class TreeState implements JDOMExternalizable {
|
||||
String id;
|
||||
String type;
|
||||
transient Object userObject;
|
||||
transient final int index;
|
||||
final transient int index;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
PathElement() {
|
||||
@@ -156,31 +156,26 @@ public final class TreeState implements JDOMExternalizable {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static TreeState createOn(@NotNull JTree tree, @NotNull DefaultMutableTreeNode treeNode) {
|
||||
public static @NotNull TreeState createOn(@NotNull JTree tree, @NotNull DefaultMutableTreeNode treeNode) {
|
||||
return createOn(tree, new TreePath(treeNode.getPath()));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static TreeState createOn(@NotNull JTree tree, @NotNull TreePath rootPath) {
|
||||
public static @NotNull TreeState createOn(@NotNull JTree tree, @NotNull TreePath rootPath) {
|
||||
return new TreeState(createPaths(tree, TreeUtil.collectExpandedPaths(tree, rootPath)),
|
||||
createPaths(tree, TreeUtil.collectSelectedPaths(tree, rootPath)));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static TreeState createOn(@NotNull JTree tree) {
|
||||
public static @NotNull TreeState createOn(@NotNull JTree tree) {
|
||||
return createOn(tree, true, false);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static TreeState createOn(@NotNull JTree tree, boolean persistExpand, boolean persistSelect) {
|
||||
public static @NotNull TreeState createOn(@NotNull JTree tree, boolean persistExpand, boolean persistSelect) {
|
||||
List<TreePath> expanded = persistExpand ? TreeUtil.collectExpandedPaths(tree) : Collections.emptyList();
|
||||
List<TreePath> selected = persistSelect ? TreeUtil.collectSelectedPaths(tree) : Collections.emptyList();
|
||||
return createOn(tree, expanded, selected);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static TreeState createOn(@NotNull JTree tree, @NotNull List<TreePath> expandedPaths, @NotNull List<TreePath> selectedPaths) {
|
||||
public static @NotNull TreeState createOn(@NotNull JTree tree, @NotNull List<TreePath> expandedPaths, @NotNull List<TreePath> selectedPaths) {
|
||||
List<PathElement[]> expandedPathElements = !expandedPaths.isEmpty()
|
||||
? createPaths(tree, expandedPaths)
|
||||
: new ArrayList<>();
|
||||
@@ -190,8 +185,7 @@ public final class TreeState implements JDOMExternalizable {
|
||||
return new TreeState(expandedPathElements, selectedPathElements);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static TreeState createFrom(@Nullable Element element) {
|
||||
public static @NotNull TreeState createFrom(@Nullable Element element) {
|
||||
TreeState state = new TreeState(new ArrayList<>(), new ArrayList<>());
|
||||
try {
|
||||
if (element != null) {
|
||||
@@ -244,8 +238,7 @@ public final class TreeState implements JDOMExternalizable {
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String calcId(@Nullable Object userObject) {
|
||||
private static @NotNull String calcId(@Nullable Object userObject) {
|
||||
if (userObject == null) return "";
|
||||
// The easiest case: the node provides an ID explicitly.
|
||||
if (userObject instanceof PathElementIdProvider userObjectWithPathId) {
|
||||
@@ -258,8 +251,7 @@ public final class TreeState implements JDOMExternalizable {
|
||||
return StringUtil.notNullize(userObject.toString());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String calcType(@Nullable Object userObject) {
|
||||
private static @NotNull String calcType(@Nullable Object userObject) {
|
||||
if (userObject == null) return "";
|
||||
String name = userObject.getClass().getName();
|
||||
return Integer.toHexString(StringHash.murmur(name, 31)) + ":" + StringUtil.getShortName(name);
|
||||
@@ -321,8 +313,7 @@ public final class TreeState implements JDOMExternalizable {
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
private static TreePath findMatchedChild(@NotNull TreeModel model, @NotNull TreePath treePath, @NotNull PathElement pathElement) {
|
||||
private static @Nullable TreePath findMatchedChild(@NotNull TreeModel model, @NotNull TreePath treePath, @NotNull PathElement pathElement) {
|
||||
Object parent = treePath.getLastPathComponent();
|
||||
int childCount = model.getChildCount(parent);
|
||||
if (childCount <= 0) return null;
|
||||
@@ -524,9 +515,8 @@ public final class TreeState implements JDOMExternalizable {
|
||||
return VisitThread.BGT;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Action visit(@NotNull TreePath path) {
|
||||
public @NotNull Action visit(@NotNull TreePath path) {
|
||||
int count = path.getPathCount();
|
||||
if (count > elements.length) return Action.SKIP_CHILDREN;
|
||||
boolean matches = elements[count - 1].isMatchTo(path.getLastPathComponent());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.ide.util.treeView;
|
||||
|
||||
import com.intellij.openapi.util.ActionCallback;
|
||||
@@ -341,9 +341,8 @@ public class UpdaterTreeState {
|
||||
}
|
||||
}
|
||||
|
||||
@NonNls
|
||||
@Override
|
||||
public String toString() {
|
||||
public @NonNls String toString() {
|
||||
return "UpdaterState toSelect " +
|
||||
myToSelect + " toExpand=" +
|
||||
myToExpand + " processingNow=" + isProcessingNow() + " canRun=" + myCanRunRestore;
|
||||
|
||||
@@ -40,7 +40,7 @@ import java.util.*;
|
||||
public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
private static final Logger LOG = Logger.getInstance(AbstractWizard.class);
|
||||
|
||||
public final static Key<AbstractWizard<?>> KEY = Key.create("AbstractWizard");
|
||||
public static final Key<AbstractWizard<?>> KEY = Key.create("AbstractWizard");
|
||||
|
||||
protected int myCurrentStep;
|
||||
protected final ArrayList<T> mySteps;
|
||||
@@ -66,7 +66,7 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
initWizard(title);
|
||||
}
|
||||
|
||||
public AbstractWizard(@NlsContexts.DialogTitle String title, @Nullable final Project project) {
|
||||
public AbstractWizard(@NlsContexts.DialogTitle String title, final @Nullable Project project) {
|
||||
super(project, true);
|
||||
mySteps = new ArrayList<>();
|
||||
initWizard(title);
|
||||
@@ -253,7 +253,7 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
|
||||
private static void add(final GroupLayout.Group hGroup,
|
||||
final GroupLayout.Group vGroup,
|
||||
@Nullable final Collection<? super Component> collection,
|
||||
final @Nullable Collection<? super Component> collection,
|
||||
final Component... components) {
|
||||
for (Component component : components) {
|
||||
hGroup.addComponent(component);
|
||||
@@ -335,11 +335,11 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
return mySteps.get(myCurrentStep);
|
||||
}
|
||||
|
||||
public void addStep(@NotNull final T step) {
|
||||
public void addStep(final @NotNull T step) {
|
||||
addStep(step, mySteps.size());
|
||||
}
|
||||
|
||||
public void addStep(@NotNull final T step, int index) {
|
||||
public void addStep(final @NotNull T step, int index) {
|
||||
mySteps.add(index, step);
|
||||
|
||||
if (step instanceof StepAdapter) {
|
||||
@@ -610,7 +610,5 @@ public abstract class AbstractWizard<T extends Step> extends DialogWrapper {
|
||||
return mySteps.size();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@NonNls
|
||||
protected abstract String getHelpID();
|
||||
protected abstract @Nullable @NonNls String getHelpID();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.idea;
|
||||
|
||||
import com.intellij.DynamicBundle;
|
||||
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.PropertyKey;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public final class ActionsBundle {
|
||||
@NonNls public static final String IDEA_ACTIONS_BUNDLE = "messages.ActionsBundle";
|
||||
public static final @NonNls String IDEA_ACTIONS_BUNDLE = "messages.ActionsBundle";
|
||||
|
||||
private static final DynamicBundle ourInstance = new DynamicBundle(ActionsBundle.class, IDEA_ACTIONS_BUNDLE);
|
||||
|
||||
@@ -22,8 +22,7 @@ public final class ActionsBundle {
|
||||
return ourInstance.containsKey(key) ? ourInstance.getMessage(key, params) : ActionsDeprecatedMessagesBundle.message(key, params);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Supplier<@Nls String> messagePointer(@NotNull @PropertyKey(resourceBundle = IDEA_ACTIONS_BUNDLE) String key, Object @NotNull ... params) {
|
||||
public static @NotNull Supplier<@Nls String> messagePointer(@NotNull @PropertyKey(resourceBundle = IDEA_ACTIONS_BUNDLE) String key, Object @NotNull ... params) {
|
||||
return ourInstance.containsKey(key) ? ourInstance.getLazyMessage(key, params) : ActionsDeprecatedMessagesBundle.messagePointer(key, params);
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -19,13 +19,11 @@ import java.util.function.Supplier;
|
||||
*/
|
||||
public interface ProjectInitializationDiagnosticService {
|
||||
|
||||
@NotNull
|
||||
static ProjectInitializationDiagnosticService getInstance(@NotNull Project project) {
|
||||
static @NotNull ProjectInitializationDiagnosticService getInstance(@NotNull Project project) {
|
||||
return project.getService(ProjectInitializationDiagnosticService.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
static ActivityTracker registerTracker(@NotNull Project project, @NotNull @NlsSafe String debugActivityName) {
|
||||
static @NotNull ActivityTracker registerTracker(@NotNull Project project, @NotNull @NlsSafe String debugActivityName) {
|
||||
return getInstance(project).registerBeginningOfInitializationActivity(() -> debugActivityName);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// 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.openapi;
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
@@ -24,8 +24,7 @@ public interface GitRepositoryInitializer {
|
||||
@RequiresBackgroundThread
|
||||
void initRepository(@NotNull Project project, @NotNull VirtualFile root, boolean addFilesToVcs);
|
||||
|
||||
@Nullable
|
||||
static GitRepositoryInitializer getInstance() {
|
||||
static @Nullable GitRepositoryInitializer getInstance() {
|
||||
return EP_NAME.getExtensionList().stream().findFirst().orElse(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// 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.openapi;
|
||||
|
||||
import com.intellij.openapi.extensions.ProjectExtensionPointName;
|
||||
@@ -21,8 +21,7 @@ public interface GitSilentFileAdderProvider {
|
||||
@NotNull
|
||||
GitSilentFileAdder create();
|
||||
|
||||
@NotNull
|
||||
static GitSilentFileAdder create(@NotNull Project project) {
|
||||
static @NotNull GitSilentFileAdder create(@NotNull Project project) {
|
||||
return EP_NAME.getExtensions(project).stream().findFirst().map(it -> it.create()).orElse(new GitSilentFileAdder.Empty());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ abstract class MnemonicWrapper<T extends JComponent> implements Runnable, Proper
|
||||
}
|
||||
}
|
||||
|
||||
private static abstract class AbstractButtonWrapper extends MnemonicWrapper<AbstractButton> {
|
||||
private abstract static class AbstractButtonWrapper extends MnemonicWrapper<AbstractButton> {
|
||||
private AbstractButtonWrapper(AbstractButton component) {
|
||||
super(component, "text", "mnemonic", "displayedMnemonicIndex");
|
||||
}
|
||||
|
||||
+4
-7
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.actionSystem;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -18,14 +18,11 @@ public abstract class AbbreviationManager {
|
||||
return ApplicationManager.getApplication().getService(AbbreviationManager.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public abstract Set<String> getAbbreviations();
|
||||
public abstract @NotNull Set<String> getAbbreviations();
|
||||
|
||||
@NotNull
|
||||
public abstract Set<String> getAbbreviations(@NotNull String actionId);
|
||||
public abstract @NotNull Set<String> getAbbreviations(@NotNull String actionId);
|
||||
|
||||
@NotNull
|
||||
public abstract List<String> findActions(@NotNull String abbreviation);
|
||||
public abstract @NotNull List<String> findActions(@NotNull String abbreviation);
|
||||
|
||||
public abstract void register(@NotNull String abbreviation, @NotNull String actionId);
|
||||
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
*/
|
||||
// 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.openapi.actionSystem;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -26,14 +12,12 @@ public class ActionInGroup {
|
||||
myAction = action;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ActionInGroup setAsSecondary(boolean isSecondary) {
|
||||
public @NotNull ActionInGroup setAsSecondary(boolean isSecondary) {
|
||||
myGroup.setAsPrimary(myAction, !isSecondary);
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ActionGroup getGroup() {
|
||||
public @NotNull ActionGroup getGroup() {
|
||||
return myGroup;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ import org.jetbrains.annotations.NonNls;
|
||||
* @see DefaultActionGroup
|
||||
*/
|
||||
public final class Constraints implements Cloneable {
|
||||
public final static Constraints FIRST = new Constraints(Anchor.FIRST, null);
|
||||
public final static Constraints LAST = new Constraints(Anchor.LAST, null);
|
||||
public static final Constraints FIRST = new Constraints(Anchor.FIRST, null);
|
||||
public static final Constraints LAST = new Constraints(Anchor.LAST, null);
|
||||
/**
|
||||
* Anchor.
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// 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.openapi.actionSystem;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -6,7 +6,6 @@ import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.util.NlsActions;
|
||||
import com.intellij.openapi.util.NlsActions.ActionText;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -496,8 +495,7 @@ public class DefaultActionGroup extends ActionGroup {
|
||||
add(Separator.create(separatorText));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public synchronized Constraints getConstraints(@NotNull AnAction action) {
|
||||
public synchronized @Nullable Constraints getConstraints(@NotNull AnAction action) {
|
||||
return myConstraints.get(action);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,8 +70,7 @@ public final class EmptyAction extends AnAction {
|
||||
* ActionManager.getInstance().getAction(id).registerCustomShortcutSet(shortcutSet, component) shouldn't be used directly,
|
||||
* because it will erase shortcuts, assigned to this action in keymap.
|
||||
*/
|
||||
@NotNull
|
||||
public static AnAction registerWithShortcutSet(@NotNull String id, @NotNull ShortcutSet shortcutSet, @NotNull JComponent component) {
|
||||
public static @NotNull AnAction registerWithShortcutSet(@NotNull String id, @NotNull ShortcutSet shortcutSet, @NotNull JComponent component) {
|
||||
AnAction newAction = wrap(ActionManager.getInstance().getAction(id));
|
||||
newAction.registerCustomShortcutSet(shortcutSet, component);
|
||||
return newAction;
|
||||
|
||||
+3
-18
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 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.
|
||||
*/
|
||||
// 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.openapi.actionSystem;
|
||||
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
@@ -25,8 +11,7 @@ public class KeyboardModifierGestureShortcut extends Shortcut {
|
||||
private final KeyStroke myStroke;
|
||||
private final KeyboardGestureAction.ModifierType myType;
|
||||
|
||||
@NotNull
|
||||
public static Shortcut newInstance(KeyboardGestureAction.ModifierType type, KeyStroke stroke) {
|
||||
public static @NotNull Shortcut newInstance(KeyboardGestureAction.ModifierType type, KeyStroke stroke) {
|
||||
return switch (type) {
|
||||
case dblClick -> new DblClick(stroke);
|
||||
case hold -> new Hold(stroke);
|
||||
@@ -52,7 +37,7 @@ public class KeyboardModifierGestureShortcut extends Shortcut {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startsWith(@NotNull final Shortcut sc) {
|
||||
public boolean startsWith(final @NotNull Shortcut sc) {
|
||||
if (!(sc instanceof KeyboardModifierGestureShortcut other)) return false;
|
||||
|
||||
if (myType.equals(other.myType)) {
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
*/
|
||||
// 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.openapi.actionSystem;
|
||||
|
||||
import com.intellij.util.BitUtil;
|
||||
@@ -119,7 +105,7 @@ public class MouseShortcut extends Shortcut {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startsWith(@NotNull final Shortcut sc) {
|
||||
public boolean startsWith(final @NotNull Shortcut sc) {
|
||||
return equals(sc);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
*/
|
||||
// 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.openapi.actionSystem;
|
||||
|
||||
import org.intellij.lang.annotations.JdkConstants;
|
||||
@@ -63,7 +49,7 @@ public class PressureShortcut extends MouseShortcut {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startsWith(@NotNull final Shortcut sc) {
|
||||
public boolean startsWith(final @NotNull Shortcut sc) {
|
||||
return equals(sc);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,18 +19,15 @@ public final class Separator extends DecorativeElement implements DumbAware, Lig
|
||||
private static final Separator ourInstance = new Separator();
|
||||
private final Supplier<@NlsContexts.Separator String> myDynamicText;
|
||||
|
||||
@NotNull
|
||||
public static Separator getInstance() {
|
||||
public static @NotNull Separator getInstance() {
|
||||
return ourInstance;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Separator create() {
|
||||
public static @NotNull Separator create() {
|
||||
return create(null);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Separator create(@Nullable @NlsContexts.Separator String text) {
|
||||
public static @NotNull Separator create(@Nullable @NlsContexts.Separator String text) {
|
||||
return StringUtil.isEmptyOrSpaces(text)? ourInstance : new Separator(text);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.actionSystem;
|
||||
|
||||
import com.intellij.openapi.util.NlsActions.ActionDescription;
|
||||
@@ -18,7 +18,7 @@ public abstract class ToggleAction extends AnAction implements Toggleable {
|
||||
public ToggleAction() {
|
||||
}
|
||||
|
||||
public ToggleAction(@Nullable @ActionText final String text) {
|
||||
public ToggleAction(final @Nullable @ActionText String text) {
|
||||
super(() -> text);
|
||||
}
|
||||
|
||||
@@ -26,24 +26,24 @@ public abstract class ToggleAction extends AnAction implements Toggleable {
|
||||
super(text);
|
||||
}
|
||||
|
||||
public ToggleAction(@Nullable @ActionText final String text,
|
||||
@Nullable @ActionDescription final String description,
|
||||
@Nullable final Icon icon) {
|
||||
public ToggleAction(final @Nullable @ActionText String text,
|
||||
final @Nullable @ActionDescription String description,
|
||||
final @Nullable Icon icon) {
|
||||
super(text, description, icon);
|
||||
}
|
||||
|
||||
public ToggleAction(@NotNull Supplier<@ActionText String> text,
|
||||
@NotNull Supplier<@ActionDescription String> description,
|
||||
@Nullable final Icon icon) {
|
||||
final @Nullable Icon icon) {
|
||||
super(text, description, icon);
|
||||
}
|
||||
|
||||
public ToggleAction(@NotNull Supplier<@ActionText String> text, @Nullable final Icon icon) {
|
||||
public ToggleAction(@NotNull Supplier<@ActionText String> text, final @Nullable Icon icon) {
|
||||
super(text, Presentation.NULL_STRING, icon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(@NotNull final AnActionEvent e) {
|
||||
public void actionPerformed(final @NotNull AnActionEvent e) {
|
||||
final boolean state = !isSelected(e);
|
||||
setSelected(e, state);
|
||||
final Presentation presentation = e.getPresentation();
|
||||
@@ -67,7 +67,7 @@ public abstract class ToggleAction extends AnAction implements Toggleable {
|
||||
public abstract void setSelected(@NotNull AnActionEvent e, boolean state);
|
||||
|
||||
@Override
|
||||
public void update(@NotNull final AnActionEvent e) {
|
||||
public void update(final @NotNull AnActionEvent e) {
|
||||
boolean selected = isSelected(e);
|
||||
final Presentation presentation = e.getPresentation();
|
||||
Toggleable.setSelected(presentation, selected);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.actionSystem;
|
||||
|
||||
import com.intellij.openapi.util.NlsActions.ActionDescription;
|
||||
@@ -71,18 +71,14 @@ public class ToggleOptionAction extends ToggleAction {
|
||||
/**
|
||||
* @return a string to override an action name
|
||||
*/
|
||||
@Nullable
|
||||
@ActionText
|
||||
default String getName() {
|
||||
default @Nullable @ActionText String getName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a string to override an action description
|
||||
*/
|
||||
@Nullable
|
||||
@ActionDescription
|
||||
default String getDescription() {
|
||||
default @Nullable @ActionDescription String getDescription() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.actionSystem.ex;
|
||||
|
||||
@@ -37,9 +37,8 @@ public abstract class CheckboxAction extends ToggleAction implements CustomCompo
|
||||
super(dynamicText, dynamicDescription, icon);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public JComponent createCustomComponent(@NotNull Presentation presentation, @NotNull String place) {
|
||||
public @NotNull JComponent createCustomComponent(@NotNull Presentation presentation, @NotNull String place) {
|
||||
JBCheckBox checkBox = new JBCheckBox();
|
||||
checkBox.setFocusable(false);
|
||||
return createCheckboxComponent(checkBox, this, place);
|
||||
@@ -67,8 +66,7 @@ public abstract class CheckboxAction extends ToggleAction implements CustomCompo
|
||||
checkBox.setVisible(presentation.isVisible());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
static JComponent createCheckboxComponent(@NotNull JCheckBox checkBox, @NotNull AnAction action, @NotNull String place) {
|
||||
static @NotNull JComponent createCheckboxComponent(@NotNull JCheckBox checkBox, @NotNull AnAction action, @NotNull String place) {
|
||||
// this component cannot be stored right in AnAction because of action system architecture:
|
||||
// one action can be shown on multiple toolbars simultaneously
|
||||
checkBox.setOpaque(false);
|
||||
|
||||
+3
-4
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.actionSystem.ex;
|
||||
|
||||
import com.intellij.ide.lightEdit.LightEditCompatible;
|
||||
@@ -11,7 +11,7 @@ import javax.swing.*;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class DefaultCustomComponentAction extends AnAction implements CustomComponentAction, LightEditCompatible {
|
||||
@NotNull private final Supplier<? extends JComponent> myProducer;
|
||||
private final @NotNull Supplier<? extends JComponent> myProducer;
|
||||
|
||||
public DefaultCustomComponentAction(@NotNull Supplier<? extends JComponent> producer) {
|
||||
myProducer = producer;
|
||||
@@ -22,9 +22,8 @@ public class DefaultCustomComponentAction extends AnAction implements CustomComp
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public JComponent createCustomComponent(@NotNull Presentation presentation, @NotNull String place) {
|
||||
public @NotNull JComponent createCustomComponent(@NotNull Presentation presentation, @NotNull String place) {
|
||||
return myProducer.get();
|
||||
}
|
||||
}
|
||||
|
||||
+6
-8
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.actionSystem.ex;
|
||||
|
||||
@@ -16,7 +16,7 @@ import javax.swing.*;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public abstract class ThreeStateCheckboxAction extends AnAction implements CustomComponentAction {
|
||||
@NonNls public static final Key<ThreeStateCheckBox.State> STATE_PROPERTY = Key.create("three_state_selected");
|
||||
public static final @NonNls Key<ThreeStateCheckBox.State> STATE_PROPERTY = Key.create("three_state_selected");
|
||||
|
||||
protected ThreeStateCheckboxAction() {}
|
||||
|
||||
@@ -37,14 +37,13 @@ public abstract class ThreeStateCheckboxAction extends AnAction implements Custo
|
||||
super(dynamicText, dynamicDescription, icon);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public abstract ThreeStateCheckBox.State isSelected(AnActionEvent e);
|
||||
public abstract @NotNull ThreeStateCheckBox.State isSelected(AnActionEvent e);
|
||||
|
||||
public abstract void setSelected(AnActionEvent e, @NotNull ThreeStateCheckBox.State state);
|
||||
|
||||
|
||||
@Override
|
||||
public final void actionPerformed(@NotNull final AnActionEvent e) {
|
||||
public final void actionPerformed(final @NotNull AnActionEvent e) {
|
||||
ThreeStateCheckBox.State state = isSelected(e);
|
||||
|
||||
Presentation presentation = e.getPresentation();
|
||||
@@ -54,16 +53,15 @@ public abstract class ThreeStateCheckboxAction extends AnAction implements Custo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull final AnActionEvent e) {
|
||||
public void update(final @NotNull AnActionEvent e) {
|
||||
ThreeStateCheckBox.State state = isSelected(e);
|
||||
|
||||
Presentation presentation = e.getPresentation();
|
||||
presentation.putClientProperty(STATE_PROPERTY, state);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public JComponent createCustomComponent(@NotNull Presentation presentation, @NotNull String place) {
|
||||
public @NotNull JComponent createCustomComponent(@NotNull Presentation presentation, @NotNull String place) {
|
||||
// this component cannot be stored right here because of the action system architecture:
|
||||
// one action can be shown on multiple toolbars simultaneously
|
||||
ThreeStateCheckBox checkBox = new ThreeStateCheckBox();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.diagnostic;
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -34,8 +34,7 @@ public class IdeaLoggingEvent {
|
||||
return myThrowable != null ? StringUtil.getThrowableText(myThrowable) : "";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Object getData() {
|
||||
public @Nullable Object getData() {
|
||||
return myData;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.editor;
|
||||
|
||||
import com.intellij.codeInsight.hint.HintManager;
|
||||
@@ -37,8 +37,7 @@ public final class EditorModificationUtil extends EditorModificationUtilEx {
|
||||
editor.getSelectionModel().setBlockSelection(new LogicalPosition(startLine, caretColumn), new LogicalPosition(endLine, caretColumn));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Transferable getContentsToPasteToEditor(@Nullable Producer<? extends Transferable> producer) {
|
||||
public static @Nullable Transferable getContentsToPasteToEditor(@Nullable Producer<? extends Transferable> producer) {
|
||||
if (producer == null) {
|
||||
CopyPasteManager manager = CopyPasteManager.getInstance();
|
||||
return manager.areDataFlavorsAvailable(DataFlavor.stringFlavor) ? manager.getContents() : null;
|
||||
@@ -48,8 +47,7 @@ public final class EditorModificationUtil extends EditorModificationUtilEx {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String getStringContent(@NotNull Transferable content) {
|
||||
public static @Nullable String getStringContent(@NotNull Transferable content) {
|
||||
RawText raw = RawText.fromTransferable(content);
|
||||
if (raw != null) return raw.rawText;
|
||||
|
||||
@@ -91,9 +89,8 @@ public final class EditorModificationUtil extends EditorModificationUtilEx {
|
||||
caretModel.moveToOffset(caretModel.getOffset() + caretShift);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static List<CaretState> calcBlockSelectionState(@NotNull Editor editor,
|
||||
@NotNull LogicalPosition blockStart, @NotNull LogicalPosition blockEnd) {
|
||||
public static @NotNull List<CaretState> calcBlockSelectionState(@NotNull Editor editor,
|
||||
@NotNull LogicalPosition blockStart, @NotNull LogicalPosition blockEnd) {
|
||||
int startLine = Math.max(Math.min(blockStart.line, editor.getDocument().getLineCount() - 1), 0);
|
||||
int endLine = Math.max(Math.min(blockEnd.line, editor.getDocument().getLineCount() - 1), 0);
|
||||
int step = endLine < startLine ? -1 : 1;
|
||||
|
||||
+2
-17
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
// 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.openapi.editor;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
@@ -20,9 +6,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class EditorNavigationDelegateAdapter implements EditorNavigationDelegate {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Result navigateToLineEnd(@NotNull Editor editor, @NotNull DataContext dataContext) {
|
||||
public @NotNull Result navigateToLineEnd(@NotNull Editor editor, @NotNull DataContext dataContext) {
|
||||
return Result.CONTINUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.editor;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -41,8 +41,7 @@ public class RawText implements Cloneable, Serializable {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static RawText fromTransferable(Transferable content) {
|
||||
public static @Nullable RawText fromTransferable(Transferable content) {
|
||||
DataFlavor flavor = getDataFlavor();
|
||||
|
||||
if (flavor != null) {
|
||||
|
||||
+4
-5
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.editor.actionSystem;
|
||||
|
||||
import com.intellij.ide.lightEdit.LightEditCompatible;
|
||||
@@ -36,7 +36,7 @@ public abstract class EditorAction extends AnAction implements DumbAware, LightE
|
||||
return ActionUpdateThread.BGT;
|
||||
}
|
||||
|
||||
public synchronized final EditorActionHandler setupHandler(@NotNull EditorActionHandler newHandler) {
|
||||
public final synchronized EditorActionHandler setupHandler(@NotNull EditorActionHandler newHandler) {
|
||||
EditorActionHandler tmp = getHandler();
|
||||
doSetupHandler(newHandler);
|
||||
return tmp;
|
||||
@@ -77,12 +77,11 @@ public abstract class EditorAction extends AnAction implements DumbAware, LightE
|
||||
actionPerformed(editor, dataContext);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected Editor getEditor(@NotNull DataContext dataContext) {
|
||||
protected @Nullable Editor getEditor(@NotNull DataContext dataContext) {
|
||||
return EDITOR.getData(dataContext);
|
||||
}
|
||||
|
||||
public final void actionPerformed(final Editor editor, @NotNull final DataContext dataContext) {
|
||||
public final void actionPerformed(final Editor editor, final @NotNull DataContext dataContext) {
|
||||
if (editor == null) return;
|
||||
if (editor.isDisposed()) {
|
||||
VirtualFile file = FileDocumentManager.getInstance().getFile(editor.getDocument());
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.editor.actionSystem;
|
||||
|
||||
import com.intellij.lang.injection.InjectedLanguageManager;
|
||||
@@ -180,7 +180,7 @@ public abstract class EditorActionHandler {
|
||||
* @param editor the editor in which the action is invoked.
|
||||
* @param dataContext the data context for the action.
|
||||
*/
|
||||
public final void execute(@NotNull Editor editor, @Nullable final Caret contextCaret, final DataContext dataContext) {
|
||||
public final void execute(@NotNull Editor editor, final @Nullable Caret contextCaret, final DataContext dataContext) {
|
||||
Editor hostEditor = dataContext == null ? null : CommonDataKeys.HOST_EDITOR.getData(dataContext);
|
||||
if (hostEditor == null) {
|
||||
hostEditor = editor;
|
||||
@@ -222,7 +222,7 @@ public abstract class EditorActionHandler {
|
||||
void perform(@NotNull Caret caret, @Nullable DataContext dataContext);
|
||||
}
|
||||
|
||||
public static abstract class ForEachCaret extends EditorActionHandler {
|
||||
public abstract static class ForEachCaret extends EditorActionHandler {
|
||||
protected ForEachCaret() {
|
||||
super(true);
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.editor.actionSystem;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -44,8 +44,7 @@ public abstract class EditorActionManager {
|
||||
* @deprecated Use {@link TypedAction#getInstance()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
@NotNull
|
||||
public abstract TypedAction getTypedAction();
|
||||
public abstract @NotNull TypedAction getTypedAction();
|
||||
|
||||
/**
|
||||
* Gets the default handler which is invoked on attempt to modify a read-only fragment in the editor.
|
||||
|
||||
+3
-17
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2014 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.
|
||||
*/
|
||||
// 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.openapi.editor.actionSystem;
|
||||
|
||||
import com.intellij.codeInsight.intention.preview.IntentionPreviewUtils;
|
||||
@@ -39,7 +25,7 @@ public abstract class EditorWriteActionHandler extends EditorActionHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doExecute(@NotNull final Editor editor, @Nullable final Caret caret, final DataContext dataContext) {
|
||||
public void doExecute(final @NotNull Editor editor, final @Nullable Caret caret, final DataContext dataContext) {
|
||||
boolean preview = IntentionPreviewUtils.getPreviewEditor() == editor;
|
||||
if (!preview) {
|
||||
if (!EditorModificationUtil.checkModificationAllowed(editor)) return;
|
||||
@@ -92,7 +78,7 @@ public abstract class EditorWriteActionHandler extends EditorActionHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public static abstract class ForEachCaret extends EditorWriteActionHandler {
|
||||
public abstract static class ForEachCaret extends EditorWriteActionHandler {
|
||||
protected ForEachCaret() {
|
||||
super(true);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.editor.actionSystem;
|
||||
|
||||
import com.intellij.diagnostic.PluginException;
|
||||
@@ -131,8 +131,7 @@ public abstract class TypedAction {
|
||||
*
|
||||
* @return the current typing handler.
|
||||
*/
|
||||
@NotNull
|
||||
public TypedActionHandler getHandler() {
|
||||
public @NotNull TypedActionHandler getHandler() {
|
||||
ensureHandlersLoaded();
|
||||
return myHandler;
|
||||
}
|
||||
@@ -146,8 +145,7 @@ public abstract class TypedAction {
|
||||
* @deprecated Use <typedHandler> extension point for registering typing handlers
|
||||
*/
|
||||
@Deprecated
|
||||
@NotNull
|
||||
public TypedActionHandler setupHandler(@NotNull TypedActionHandler handler) {
|
||||
public @NotNull TypedActionHandler setupHandler(@NotNull TypedActionHandler handler) {
|
||||
ensureHandlersLoaded();
|
||||
TypedActionHandler tmp = myHandler;
|
||||
myHandler = handler;
|
||||
@@ -159,8 +157,7 @@ public abstract class TypedAction {
|
||||
*
|
||||
* @see #setupRawHandler(TypedActionHandler)
|
||||
*/
|
||||
@NotNull
|
||||
public TypedActionHandler getRawHandler() {
|
||||
public @NotNull TypedActionHandler getRawHandler() {
|
||||
return myRawHandler;
|
||||
}
|
||||
|
||||
@@ -194,7 +191,7 @@ public abstract class TypedAction {
|
||||
}
|
||||
}
|
||||
|
||||
public final void actionPerformed(@NotNull final Editor editor, final char charTyped, @NotNull DataContext dataContext) {
|
||||
public final void actionPerformed(final @NotNull Editor editor, final char charTyped, @NotNull DataContext dataContext) {
|
||||
Project project = CommonDataKeys.PROJECT.getData(dataContext);
|
||||
try (var ignored = SlowOperations.startSection(SlowOperations.ACTION_PERFORM)) {
|
||||
FreezeLogger.getInstance().runUnderPerformanceMonitor(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.editor.event;
|
||||
|
||||
import com.intellij.openapi.editor.Document;
|
||||
@@ -30,14 +30,12 @@ public class MockDocumentEvent extends DocumentEvent {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public CharSequence getOldFragment() {
|
||||
public @NotNull CharSequence getOldFragment() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public CharSequence getNewFragment() {
|
||||
public @NotNull CharSequence getNewFragment() {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.editor.highlighter;
|
||||
|
||||
import com.intellij.openapi.editor.Document;
|
||||
@@ -92,9 +92,8 @@ public class FragmentedEditorHighlighter implements EditorHighlighter {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HighlighterIterator createIterator(int startOffset) {
|
||||
public @NotNull HighlighterIterator createIterator(int startOffset) {
|
||||
int index = Collections.binarySearch(myPieces, new Element(startOffset, 0, null, null), Comparator.comparingInt(Element::getStart));
|
||||
// index: (-insertion point - 1), where insertionPoint is the index of the first element greater than the key
|
||||
// and we need index of the first element that is less or equal (floorElement)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.fileChooser;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
@@ -32,32 +32,30 @@ public final class FileChooser {
|
||||
|
||||
private FileChooser() { }
|
||||
|
||||
public static VirtualFile @NotNull [] chooseFiles(@NotNull final FileChooserDescriptor descriptor,
|
||||
@Nullable final Project project,
|
||||
@Nullable final VirtualFile toSelect) {
|
||||
public static VirtualFile @NotNull [] chooseFiles(final @NotNull FileChooserDescriptor descriptor,
|
||||
final @Nullable Project project,
|
||||
final @Nullable VirtualFile toSelect) {
|
||||
return chooseFiles(descriptor, null, project, toSelect);
|
||||
}
|
||||
|
||||
public static VirtualFile @NotNull [] chooseFiles(@NotNull final FileChooserDescriptor descriptor,
|
||||
@Nullable final Component parent,
|
||||
@Nullable final Project project,
|
||||
@Nullable final VirtualFile toSelect) {
|
||||
public static VirtualFile @NotNull [] chooseFiles(final @NotNull FileChooserDescriptor descriptor,
|
||||
final @Nullable Component parent,
|
||||
final @Nullable Project project,
|
||||
final @Nullable VirtualFile toSelect) {
|
||||
final FileChooserDialog chooser = FileChooserFactory.getInstance().createFileChooser(descriptor, project, parent);
|
||||
return chooser.choose(project, toSelect);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static VirtualFile chooseFile(@NotNull final FileChooserDescriptor descriptor,
|
||||
@Nullable final Project project,
|
||||
@Nullable final VirtualFile toSelect) {
|
||||
public static @Nullable VirtualFile chooseFile(final @NotNull FileChooserDescriptor descriptor,
|
||||
final @Nullable Project project,
|
||||
final @Nullable VirtualFile toSelect) {
|
||||
return chooseFile(descriptor, null, project, toSelect);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static VirtualFile chooseFile(@NotNull final FileChooserDescriptor descriptor,
|
||||
@Nullable final Component parent,
|
||||
@Nullable final Project project,
|
||||
@Nullable final VirtualFile toSelect) {
|
||||
public static @Nullable VirtualFile chooseFile(final @NotNull FileChooserDescriptor descriptor,
|
||||
final @Nullable Component parent,
|
||||
final @Nullable Project project,
|
||||
final @Nullable VirtualFile toSelect) {
|
||||
Component parentComponent = parent == null ? KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow() : parent;
|
||||
LOG.assertTrue(!descriptor.isChooseMultiple());
|
||||
return ArrayUtil.getFirstElement(chooseFiles(descriptor, parentComponent, project, toSelect));
|
||||
@@ -73,10 +71,10 @@ public final class FileChooser {
|
||||
* @param callback invoked after user closes dialog, and only if there are selected files
|
||||
* @see FileChooserConsumer
|
||||
*/
|
||||
public static void chooseFiles(@NotNull final FileChooserDescriptor descriptor,
|
||||
@Nullable final Project project,
|
||||
@Nullable final VirtualFile toSelect,
|
||||
@NotNull final Consumer<? super List<VirtualFile>> callback) {
|
||||
public static void chooseFiles(final @NotNull FileChooserDescriptor descriptor,
|
||||
final @Nullable Project project,
|
||||
final @Nullable VirtualFile toSelect,
|
||||
final @NotNull Consumer<? super List<VirtualFile>> callback) {
|
||||
chooseFiles(descriptor, project, null, toSelect, callback);
|
||||
}
|
||||
|
||||
@@ -91,11 +89,11 @@ public final class FileChooser {
|
||||
* @param callback invoked after user closes dialog, and only if there are selected files
|
||||
* @see FileChooserConsumer
|
||||
*/
|
||||
public static void chooseFiles(@NotNull final FileChooserDescriptor descriptor,
|
||||
@Nullable final Project project,
|
||||
@Nullable final Component parent,
|
||||
@Nullable final VirtualFile toSelect,
|
||||
@NotNull final Consumer<? super List<VirtualFile>> callback) {
|
||||
public static void chooseFiles(final @NotNull FileChooserDescriptor descriptor,
|
||||
final @Nullable Project project,
|
||||
final @Nullable Component parent,
|
||||
final @Nullable VirtualFile toSelect,
|
||||
final @NotNull Consumer<? super List<VirtualFile>> callback) {
|
||||
Component parentComponent = parent == null ? WindowManager.getInstance().suggestParentWindow(project) : parent;
|
||||
final FileChooserFactory factory = FileChooserFactory.getInstance();
|
||||
final PathChooserDialog pathChooser = factory.createPathChooser(descriptor, project, parentComponent);
|
||||
@@ -111,10 +109,10 @@ public final class FileChooser {
|
||||
* @param toSelect file to preselect
|
||||
* @param callback invoked after user closes dialog, and only if there is selected file
|
||||
*/
|
||||
public static void chooseFile(@NotNull final FileChooserDescriptor descriptor,
|
||||
@Nullable final Project project,
|
||||
@Nullable final VirtualFile toSelect,
|
||||
@NotNull final Consumer<? super VirtualFile> callback) {
|
||||
public static void chooseFile(final @NotNull FileChooserDescriptor descriptor,
|
||||
final @Nullable Project project,
|
||||
final @Nullable VirtualFile toSelect,
|
||||
final @NotNull Consumer<? super VirtualFile> callback) {
|
||||
chooseFile(descriptor, project, null, toSelect, callback);
|
||||
}
|
||||
|
||||
@@ -128,11 +126,11 @@ public final class FileChooser {
|
||||
* @param toSelect file to preselect
|
||||
* @param callback invoked after user closes dialog, and only if there is selected file
|
||||
*/
|
||||
public static void chooseFile(@NotNull final FileChooserDescriptor descriptor,
|
||||
@Nullable final Project project,
|
||||
@Nullable final Component parent,
|
||||
@Nullable final VirtualFile toSelect,
|
||||
@NotNull final Consumer<? super VirtualFile> callback) {
|
||||
public static void chooseFile(final @NotNull FileChooserDescriptor descriptor,
|
||||
final @Nullable Project project,
|
||||
final @Nullable Component parent,
|
||||
final @Nullable VirtualFile toSelect,
|
||||
final @NotNull Consumer<? super VirtualFile> callback) {
|
||||
LOG.assertTrue(!descriptor.isChooseMultiple());
|
||||
chooseFiles(descriptor, project, parent, toSelect, files -> callback.consume(files.get(0)));
|
||||
}
|
||||
|
||||
+11
-17
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.fileChooser;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -15,15 +15,13 @@ public abstract class FileChooserFactory {
|
||||
return ApplicationManager.getApplication().getService(FileChooserFactory.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public abstract FileChooserDialog createFileChooser(@NotNull FileChooserDescriptor descriptor,
|
||||
@Nullable Project project,
|
||||
@Nullable Component parent);
|
||||
public abstract @NotNull FileChooserDialog createFileChooser(@NotNull FileChooserDescriptor descriptor,
|
||||
@Nullable Project project,
|
||||
@Nullable Component parent);
|
||||
|
||||
@NotNull
|
||||
public abstract PathChooserDialog createPathChooser(@NotNull FileChooserDescriptor descriptor,
|
||||
@Nullable Project project,
|
||||
@Nullable Component parent);
|
||||
public abstract @NotNull PathChooserDialog createPathChooser(@NotNull FileChooserDescriptor descriptor,
|
||||
@Nullable Project project,
|
||||
@Nullable Component parent);
|
||||
|
||||
/**
|
||||
* Creates Save File dialog.
|
||||
@@ -32,17 +30,13 @@ public abstract class FileChooserFactory {
|
||||
* @param project chooser options
|
||||
* @return Save File dialog
|
||||
*/
|
||||
@NotNull
|
||||
public abstract FileSaverDialog createSaveFileDialog(@NotNull FileSaverDescriptor descriptor, @Nullable Project project);
|
||||
public abstract @NotNull FileSaverDialog createSaveFileDialog(@NotNull FileSaverDescriptor descriptor, @Nullable Project project);
|
||||
|
||||
@NotNull
|
||||
public abstract FileSaverDialog createSaveFileDialog(@NotNull FileSaverDescriptor descriptor, @NotNull Component parent);
|
||||
public abstract @NotNull FileSaverDialog createSaveFileDialog(@NotNull FileSaverDescriptor descriptor, @NotNull Component parent);
|
||||
|
||||
@NotNull
|
||||
public abstract FileTextField createFileTextField(@NotNull FileChooserDescriptor descriptor, boolean showHidden, @Nullable Disposable parent);
|
||||
public abstract @NotNull FileTextField createFileTextField(@NotNull FileChooserDescriptor descriptor, boolean showHidden, @Nullable Disposable parent);
|
||||
|
||||
@NotNull
|
||||
public FileTextField createFileTextField(@NotNull FileChooserDescriptor descriptor, @Nullable Disposable parent) {
|
||||
public @NotNull FileTextField createFileTextField(@NotNull FileChooserDescriptor descriptor, @Nullable Disposable parent) {
|
||||
return createFileTextField(descriptor, true, parent);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2015 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.
|
||||
*/
|
||||
// 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.openapi.fileChooser;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataKey;
|
||||
@@ -29,5 +15,5 @@ import java.util.List;
|
||||
public interface PathChooserDialog {
|
||||
DataKey<Boolean> PREFER_LAST_OVER_EXPLICIT = DataKey.create("prefer.last.over.explicit");
|
||||
|
||||
void choose(@Nullable VirtualFile toSelect, @NotNull final Consumer<? super List<VirtualFile>> callback);
|
||||
void choose(@Nullable VirtualFile toSelect, final @NotNull Consumer<? super List<VirtualFile>> callback);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.help;
|
||||
|
||||
import com.intellij.openapi.extensions.PluginAware;
|
||||
@@ -24,16 +24,14 @@ public abstract class WebHelpProvider implements PluginAware {
|
||||
*
|
||||
* @param helpTopicId full ID of help topic including {@code '<plugin ID>.'} prefix
|
||||
*/
|
||||
@Nullable
|
||||
public abstract String getHelpPageUrl(@NotNull String helpTopicId);
|
||||
public abstract @Nullable String getHelpPageUrl(@NotNull String helpTopicId);
|
||||
|
||||
@Override
|
||||
public final void setPluginDescriptor(@NotNull PluginDescriptor pluginDescriptor) {
|
||||
myHelpTopicPrefix = pluginDescriptor.getPluginId().getIdString() + ".";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getHelpTopicPrefix() {
|
||||
public @NotNull String getHelpTopicPrefix() {
|
||||
return myHelpTopicPrefix;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
// 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.openapi.ide;
|
||||
|
||||
import com.intellij.openapi.editor.Document;
|
||||
@@ -87,8 +73,7 @@ public class KillRingTransferable implements Transferable {
|
||||
return myData;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Document getDocument() {
|
||||
public @Nullable Document getDocument() {
|
||||
return myDocument.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.keymap;
|
||||
|
||||
import com.intellij.diagnostic.LoadingState;
|
||||
@@ -16,11 +16,9 @@ public abstract class KeymapManager {
|
||||
public static final String KDE_KEYMAP = "Default for KDE";
|
||||
public static final String GNOME_KEYMAP = "Default for GNOME";
|
||||
|
||||
@NotNull
|
||||
public abstract Keymap getActiveKeymap();
|
||||
public abstract @NotNull Keymap getActiveKeymap();
|
||||
|
||||
@Nullable
|
||||
public abstract Keymap getKeymap(@NotNull String name);
|
||||
public abstract @Nullable Keymap getKeymap(@NotNull String name);
|
||||
|
||||
private static volatile KeymapManager INSTANCE;
|
||||
|
||||
|
||||
@@ -16,26 +16,23 @@ import java.awt.event.KeyEvent;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class KeymapTextContext {
|
||||
@NonNls private static final String CANCEL_KEY_TEXT = "Cancel";
|
||||
@NonNls private static final String BREAK_KEY_TEXT = "Break";
|
||||
@NonNls private static final String SHIFT = "shift";
|
||||
@NonNls private static final String CONTROL = "control";
|
||||
@NonNls private static final String CTRL = "ctrl";
|
||||
@NonNls private static final String META = "meta";
|
||||
@NonNls private static final String ALT = "alt";
|
||||
@NonNls private static final String ALT_GRAPH = "altGraph";
|
||||
@NonNls private static final String DOUBLE_CLICK = "doubleClick";
|
||||
private static final @NonNls String CANCEL_KEY_TEXT = "Cancel";
|
||||
private static final @NonNls String BREAK_KEY_TEXT = "Break";
|
||||
private static final @NonNls String SHIFT = "shift";
|
||||
private static final @NonNls String CONTROL = "control";
|
||||
private static final @NonNls String CTRL = "ctrl";
|
||||
private static final @NonNls String META = "meta";
|
||||
private static final @NonNls String ALT = "alt";
|
||||
private static final @NonNls String ALT_GRAPH = "altGraph";
|
||||
private static final @NonNls String DOUBLE_CLICK = "doubleClick";
|
||||
|
||||
@NlsSafe
|
||||
@NotNull
|
||||
public String getShortcutText(@NotNull @NonNls String actionId) {
|
||||
public @NlsSafe @NotNull String getShortcutText(@NotNull @NonNls String actionId) {
|
||||
KeyboardShortcut shortcut = ActionManager.getInstance().getKeyboardShortcut(actionId);
|
||||
if (shortcut == null) return "<no shortcut>";
|
||||
return getShortcutText(shortcut);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public @NlsSafe String getShortcutText(@NotNull Shortcut shortcut) {
|
||||
public @NotNull @NlsSafe String getShortcutText(@NotNull Shortcut shortcut) {
|
||||
String s = "";
|
||||
|
||||
if (shortcut instanceof KeyboardShortcut keyboardShortcut) {
|
||||
@@ -63,8 +60,7 @@ public class KeymapTextContext {
|
||||
return s;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getMouseShortcutText(@NotNull MouseShortcut shortcut) {
|
||||
public @NotNull String getMouseShortcutText(@NotNull MouseShortcut shortcut) {
|
||||
if (shortcut instanceof PressureShortcut) return shortcut.toString();
|
||||
return getMouseShortcutText(shortcut.getButton(), shortcut.getModifiers(), shortcut.getClickCount());
|
||||
}
|
||||
@@ -75,8 +71,7 @@ public class KeymapTextContext {
|
||||
* @param clickCount target clicks count
|
||||
* @return string representation of passed mouse shortcut.
|
||||
*/
|
||||
@NotNull
|
||||
private String getMouseShortcutText(int button, @JdkConstants.InputEventMask int modifiers, int clickCount) {
|
||||
private @NotNull String getMouseShortcutText(int button, @JdkConstants.InputEventMask int modifiers, int clickCount) {
|
||||
String resource;
|
||||
if (button == MouseShortcut.BUTTON_WHEEL_UP) {
|
||||
resource = "mouse.wheel.rotate.up.shortcut.text";
|
||||
@@ -117,8 +112,7 @@ public class KeymapTextContext {
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public @NlsSafe String getKeystrokeText(KeyStroke accelerator) {
|
||||
public @NotNull @NlsSafe String getKeystrokeText(KeyStroke accelerator) {
|
||||
if (accelerator == null) return "";
|
||||
if (isNativeMacShortcuts()) {
|
||||
return MacKeymapUtil.getKeyStrokeText(accelerator);
|
||||
@@ -134,8 +128,7 @@ public class KeymapTextContext {
|
||||
return acceleratorText.trim();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getKeyText(int code) {
|
||||
public @NotNull String getKeyText(int code) {
|
||||
return switch (code) {
|
||||
case KeyEvent.VK_BACK_QUOTE -> "`";
|
||||
case KeyEvent.VK_SEPARATOR -> ",";
|
||||
@@ -163,8 +156,7 @@ public class KeymapTextContext {
|
||||
return SystemInfo.isMac && AdvancedSettings.getInstanceIfCreated() != null && AdvancedSettings.getBoolean("ide.macos.disable.native.shortcut.symbols");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getModifiersText(@JdkConstants.InputEventMask int modifiers) {
|
||||
private @NotNull String getModifiersText(@JdkConstants.InputEventMask int modifiers) {
|
||||
if (isNativeMacShortcuts()) {
|
||||
//try {
|
||||
// Class appleLaf = Class.forName(APPLE_LAF_AQUA_LOOK_AND_FEEL_CLASS_NAME);
|
||||
@@ -285,8 +277,7 @@ public class KeymapTextContext {
|
||||
* @return shortcut for the given keystroke
|
||||
* @throws InvalidDataException if {@code keystrokeString} doesn't represent valid {@code MouseShortcut}.
|
||||
*/
|
||||
@NotNull
|
||||
public MouseShortcut parseMouseShortcut(@NotNull String keystrokeString) throws InvalidDataException {
|
||||
public @NotNull MouseShortcut parseMouseShortcut(@NotNull String keystrokeString) throws InvalidDataException {
|
||||
if (keystrokeString.startsWith("Force touch")) {
|
||||
return new PressureShortcut(2);
|
||||
}
|
||||
@@ -333,8 +324,7 @@ public class KeymapTextContext {
|
||||
* @return string representation of passed mouse shortcut. This method should
|
||||
* be used only for serializing of the {@code MouseShortcut}
|
||||
*/
|
||||
@NotNull
|
||||
public String getMouseShortcutString(@NotNull MouseShortcut shortcut) {
|
||||
public @NotNull String getMouseShortcutString(@NotNull MouseShortcut shortcut) {
|
||||
if (shortcut instanceof PressureShortcut) {
|
||||
return "Force touch";
|
||||
}
|
||||
|
||||
@@ -38,37 +38,29 @@ public final class KeymapUtil {
|
||||
private KeymapUtil() {
|
||||
}
|
||||
|
||||
@NlsSafe
|
||||
@NotNull
|
||||
public static String getShortcutText(@NotNull @NonNls String actionId) {
|
||||
public static @NlsSafe @NotNull String getShortcutText(@NotNull @NonNls String actionId) {
|
||||
return defaultKeymapTextContext.getShortcutText(actionId);
|
||||
}
|
||||
|
||||
@NlsSafe
|
||||
@Nullable
|
||||
public static String getShortcutTextOrNull(@NotNull @NonNls String actionId) {
|
||||
public static @NlsSafe @Nullable String getShortcutTextOrNull(@NotNull @NonNls String actionId) {
|
||||
KeyboardShortcut shortcut = ActionManager.getInstance().getKeyboardShortcut(actionId);
|
||||
if (shortcut == null) return null;
|
||||
return getShortcutText(shortcut);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static @NlsSafe String getShortcutText(@NotNull Shortcut shortcut) {
|
||||
public static @NotNull @NlsSafe String getShortcutText(@NotNull Shortcut shortcut) {
|
||||
return defaultKeymapTextContext.getShortcutText(shortcut);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String getMouseShortcutText(@NotNull MouseShortcut shortcut) {
|
||||
public static @NotNull String getMouseShortcutText(@NotNull MouseShortcut shortcut) {
|
||||
return defaultKeymapTextContext.getMouseShortcutText(shortcut);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static @NlsSafe String getKeystrokeText(KeyStroke accelerator) {
|
||||
public static @NotNull @NlsSafe String getKeystrokeText(KeyStroke accelerator) {
|
||||
return defaultKeymapTextContext.getKeystrokeText(accelerator);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String getKeyText(int code) {
|
||||
public static @NotNull String getKeyText(int code) {
|
||||
return defaultKeymapTextContext.getKeyText(code);
|
||||
}
|
||||
|
||||
@@ -76,8 +68,7 @@ public final class KeymapUtil {
|
||||
return defaultKeymapTextContext.isSimplifiedMacShortcuts();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static ShortcutSet getActiveKeymapShortcuts(@Nullable @NonNls String actionId) {
|
||||
public static @NotNull ShortcutSet getActiveKeymapShortcuts(@Nullable @NonNls String actionId) {
|
||||
KeymapManager keymapManager = KeymapManager.getInstance();
|
||||
if (keymapManager == null || actionId == null) {
|
||||
return new CustomShortcutSet(Shortcut.EMPTY_ARRAY);
|
||||
@@ -89,15 +80,13 @@ public final class KeymapUtil {
|
||||
* @param actionId action to find the shortcut for
|
||||
* @return first keyboard shortcut that activates given action in active keymap; null if not found
|
||||
*/
|
||||
@Nullable
|
||||
public static Shortcut getPrimaryShortcut(@Nullable @NonNls String actionId) {
|
||||
public static @Nullable Shortcut getPrimaryShortcut(@Nullable @NonNls String actionId) {
|
||||
KeymapManager keymapManager = KeymapManager.getInstance();
|
||||
if (keymapManager == null || actionId == null) return null;
|
||||
return ArrayUtil.getFirstElement(keymapManager.getActiveKeymap().getShortcuts(actionId));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static @NlsSafe String getFirstKeyboardShortcutText(@NotNull @NonNls String actionId) {
|
||||
public static @NotNull @NlsSafe String getFirstKeyboardShortcutText(@NotNull @NonNls String actionId) {
|
||||
for (Shortcut shortcut : getActiveKeymapShortcuts(actionId).getShortcuts()) {
|
||||
if (shortcut instanceof KeyboardShortcut) {
|
||||
return getShortcutText(shortcut);
|
||||
@@ -106,8 +95,7 @@ public final class KeymapUtil {
|
||||
return "";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static @NlsSafe String getFirstMouseShortcutText(@NotNull @NonNls String actionId) {
|
||||
public static @NotNull @NlsSafe String getFirstMouseShortcutText(@NotNull @NonNls String actionId) {
|
||||
for (Shortcut shortcut : getActiveKeymapShortcuts(actionId).getShortcuts()) {
|
||||
if (shortcut instanceof MouseShortcut) {
|
||||
return getShortcutText(shortcut);
|
||||
@@ -125,27 +113,23 @@ public final class KeymapUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static @NlsSafe String getFirstKeyboardShortcutText(@NotNull AnAction action) {
|
||||
public static @NotNull @NlsSafe String getFirstKeyboardShortcutText(@NotNull AnAction action) {
|
||||
return getFirstKeyboardShortcutText(action.getShortcutSet());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static @NlsSafe String getFirstKeyboardShortcutText(@NotNull ShortcutSet set) {
|
||||
public static @NotNull @NlsSafe String getFirstKeyboardShortcutText(@NotNull ShortcutSet set) {
|
||||
Shortcut[] shortcuts = set.getShortcuts();
|
||||
KeyboardShortcut shortcut = ContainerUtil.findInstance(shortcuts, KeyboardShortcut.class);
|
||||
return shortcut == null ? "" : getShortcutText(shortcut);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static @NlsSafe String getPreferredShortcutText(Shortcut @NotNull [] shortcuts) {
|
||||
public static @NotNull @NlsSafe String getPreferredShortcutText(Shortcut @NotNull [] shortcuts) {
|
||||
KeyboardShortcut shortcut = ContainerUtil.findInstance(shortcuts, KeyboardShortcut.class);
|
||||
return shortcut != null ? getShortcutText(shortcut) :
|
||||
shortcuts.length > 0 ? getShortcutText(shortcuts[0]) : "";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static @NlsSafe String getShortcutsText(Shortcut @NotNull [] shortcuts) {
|
||||
public static @NotNull @NlsSafe String getShortcutsText(Shortcut @NotNull [] shortcuts) {
|
||||
if (shortcuts.length == 0) {
|
||||
return "";
|
||||
}
|
||||
@@ -159,8 +143,7 @@ public final class KeymapUtil {
|
||||
* @return shortcut for the given keystroke
|
||||
* @throws InvalidDataException if {@code keystrokeString} doesn't represent valid {@code MouseShortcut}.
|
||||
*/
|
||||
@NotNull
|
||||
public static MouseShortcut parseMouseShortcut(@NotNull String keystrokeString) throws InvalidDataException {
|
||||
public static @NotNull MouseShortcut parseMouseShortcut(@NotNull String keystrokeString) throws InvalidDataException {
|
||||
return defaultKeymapTextContext.parseMouseShortcut(keystrokeString);
|
||||
}
|
||||
|
||||
@@ -168,8 +151,7 @@ public final class KeymapUtil {
|
||||
* @return string representation of passed mouse shortcut. This method should
|
||||
* be used only for serializing of the {@code MouseShortcut}
|
||||
*/
|
||||
@NotNull
|
||||
public static String getMouseShortcutString(@NotNull MouseShortcut shortcut) {
|
||||
public static @NotNull String getMouseShortcutString(@NotNull MouseShortcut shortcut) {
|
||||
return defaultKeymapTextContext.getMouseShortcutString(shortcut);
|
||||
}
|
||||
|
||||
@@ -235,8 +217,7 @@ public final class KeymapUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static KeyStroke getKeyStroke(@NotNull final ShortcutSet shortcutSet) {
|
||||
public static @Nullable KeyStroke getKeyStroke(final @NotNull ShortcutSet shortcutSet) {
|
||||
final Shortcut[] shortcuts = shortcutSet.getShortcuts();
|
||||
if (shortcuts.length == 0 || !(shortcuts[0] instanceof KeyboardShortcut shortcut)) return null;
|
||||
if (shortcut.getSecondKeyStroke() != null) {
|
||||
@@ -245,8 +226,7 @@ public final class KeymapUtil {
|
||||
return shortcut.getFirstKeyStroke();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Collection<KeyStroke> getKeyStrokes(@NotNull ShortcutSet shortcutSet) {
|
||||
public static @NotNull Collection<KeyStroke> getKeyStrokes(@NotNull ShortcutSet shortcutSet) {
|
||||
Shortcut[] shortcuts = shortcutSet.getShortcuts();
|
||||
if (shortcuts.length == 0) {
|
||||
return Collections.emptySet();
|
||||
@@ -264,14 +244,12 @@ public final class KeymapUtil {
|
||||
return result.isEmpty() ? Collections.emptySet() : result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static @NlsContexts.Tooltip String createTooltipText(@NotNull @NlsContexts.Tooltip String name, @NotNull @NonNls String actionId) {
|
||||
public static @NotNull @NlsContexts.Tooltip String createTooltipText(@NotNull @NlsContexts.Tooltip String name, @NotNull @NonNls String actionId) {
|
||||
String text = getFirstKeyboardShortcutText(actionId);
|
||||
return text.isEmpty() ? name : name + " (" + text + ")";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static @NlsSafe String createTooltipText(@Nullable String name, @NotNull AnAction action) {
|
||||
public static @NotNull @NlsSafe String createTooltipText(@Nullable String name, @NotNull AnAction action) {
|
||||
String toolTipText = name == null ? "" : name;
|
||||
while (StringUtil.endsWithChar(toolTipText, '.')) {
|
||||
toolTipText = toolTipText.substring(0, toolTipText.length() - 1);
|
||||
@@ -303,8 +281,7 @@ public final class KeymapUtil {
|
||||
/**
|
||||
* Creates shortcut corresponding to a single-click event
|
||||
*/
|
||||
@NotNull
|
||||
public static MouseShortcut createMouseShortcut(@NotNull MouseEvent e) {
|
||||
public static @NotNull MouseShortcut createMouseShortcut(@NotNull MouseEvent e) {
|
||||
int button = MouseShortcut.getButton(e);
|
||||
int modifiers = e.getModifiersEx();
|
||||
if (button == MouseEvent.NOBUTTON && e.getID() == MouseEvent.MOUSE_DRAGGED) {
|
||||
@@ -388,8 +365,7 @@ public final class KeymapUtil {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ShortcutSet filterKeyStrokes(@NotNull ShortcutSet source, KeyStroke...toLeaveOut) {
|
||||
public static @Nullable ShortcutSet filterKeyStrokes(@NotNull ShortcutSet source, KeyStroke...toLeaveOut) {
|
||||
List<Shortcut> filtered = new ArrayList<>(Arrays.asList(source.getShortcuts()));
|
||||
for (Shortcut shortcut : source.getShortcuts()) {
|
||||
if (shortcut instanceof KeyboardShortcut) {
|
||||
@@ -405,8 +381,7 @@ public final class KeymapUtil {
|
||||
* @deprecated use {@link #getShortcutsForMnemonicChar} or {@link #getShortcutsForMnemonicCode} instead
|
||||
*/
|
||||
@Deprecated
|
||||
@Nullable
|
||||
public static CustomShortcutSet getMnemonicAsShortcut(int mnemonic) {
|
||||
public static @Nullable CustomShortcutSet getMnemonicAsShortcut(int mnemonic) {
|
||||
return getShortcutsForMnemonicCode(mnemonic);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// 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.openapi.keymap;
|
||||
|
||||
import com.intellij.openapi.options.advanced.AdvancedSettings;
|
||||
@@ -47,8 +47,7 @@ public final class MacKeymapUtil {
|
||||
public static final String POWER3 = "\u233D";
|
||||
public static final String NUM_PAD = "\u2328";
|
||||
|
||||
@NotNull
|
||||
public static String getModifiersText(@JdkConstants.InputEventMask int modifiers, String delimiter) {
|
||||
public static @NotNull String getModifiersText(@JdkConstants.InputEventMask int modifiers, String delimiter) {
|
||||
StringJoiner buf = new StringJoiner(delimiter != null ? delimiter : "");
|
||||
if ((modifiers & InputEvent.CTRL_MASK) != 0) buf.add(get(CONTROL, "Ctrl+"));
|
||||
if ((modifiers & InputEvent.ALT_MASK) != 0) buf.add(get(OPTION, "Alt+"));
|
||||
@@ -61,13 +60,11 @@ public final class MacKeymapUtil {
|
||||
|
||||
}
|
||||
|
||||
@NotNull
|
||||
static String getModifiersText(@JdkConstants.InputEventMask int modifiers) {
|
||||
static @NotNull String getModifiersText(@JdkConstants.InputEventMask int modifiers) {
|
||||
return getModifiersText(modifiers, null);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String getKeyText(int code) {
|
||||
public static @NotNull String getKeyText(int code) {
|
||||
if (!isNativeShortcutSymbolsDisabled()) {
|
||||
return switch (code) {
|
||||
case KeyEvent.VK_BACK_SPACE -> get(BACKSPACE, "Backspace");
|
||||
@@ -108,8 +105,7 @@ public final class MacKeymapUtil {
|
||||
return KeyEvent.getKeyText(code);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String getKeyStrokeText(@NotNull KeyStroke keyStroke, String delimiter, boolean onlyDelimIntoModifiersAndKey) {
|
||||
public static @NotNull String getKeyStrokeText(@NotNull KeyStroke keyStroke, String delimiter, boolean onlyDelimIntoModifiersAndKey) {
|
||||
String modifiers = getModifiersText(keyStroke.getModifiers());
|
||||
final String key = KeymapUtil.getKeyText(keyStroke.getKeyCode());
|
||||
|
||||
@@ -124,13 +120,11 @@ public final class MacKeymapUtil {
|
||||
return modifiers + key;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String getKeyStrokeText(@NotNull KeyStroke keyStroke) {
|
||||
public static @NotNull String getKeyStrokeText(@NotNull KeyStroke keyStroke) {
|
||||
return getKeyStrokeText(keyStroke, null, true);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String get(@NotNull String value, @NotNull String replacement) {
|
||||
private static @NotNull String get(@NotNull String value, @NotNull String replacement) {
|
||||
if (isNativeShortcutSymbolsDisabled()) {
|
||||
return replacement;
|
||||
}
|
||||
@@ -141,8 +135,7 @@ public final class MacKeymapUtil {
|
||||
return AdvancedSettings.getInstanceIfCreated() != null && AdvancedSettings.getBoolean("ide.macos.disable.native.shortcut.symbols");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static String getKeyModifiersTextForMacOSLeopard(@JdkConstants.InputEventMask int modifiers) {
|
||||
public static @NotNull String getKeyModifiersTextForMacOSLeopard(@JdkConstants.InputEventMask int modifiers) {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
if ((modifiers & InputEvent.META_MASK) != 0) {
|
||||
buf.append("\u2318");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// 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.openapi.keymap;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -61,14 +61,12 @@ public final class NationalKeyboardSupport implements PersistentStateComponent<N
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
public static String getLanguageForComponent(@NotNull Component component) {
|
||||
public static @Nullable String getLanguageForComponent(@NotNull Component component) {
|
||||
final Locale locale = getLocaleForComponent(component);
|
||||
return locale == null ? null : locale.getLanguage();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static Locale getLocaleForComponent(@NotNull Component component) {
|
||||
private static @Nullable Locale getLocaleForComponent(@NotNull Component component) {
|
||||
final InputContext context = component.getInputContext();
|
||||
return context == null ? null : context.getLocale();
|
||||
}
|
||||
@@ -88,9 +86,8 @@ public final class NationalKeyboardSupport implements PersistentStateComponent<N
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public OptionSet getState() {
|
||||
public @Nullable OptionSet getState() {
|
||||
return myOptions;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user