mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 21:41:24 +07:00
calcData notnull
This commit is contained in:
@@ -553,7 +553,7 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
|
||||
|
||||
private class MyDataProvider implements TypeSafeDataProvider {
|
||||
@Override
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
public void calcData(@NotNull DataKey key, @NotNull DataSink sink) {
|
||||
if (ARTIFACTS_EDITOR_KEY.equals(key)) {
|
||||
sink.put(ARTIFACTS_EDITOR_KEY, ArtifactEditorImpl.this);
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public class ClassGroupingRule extends SingleParentUsageGroupingRule implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (!isValid()) return;
|
||||
if (CommonDataKeys.PSI_ELEMENT == key) {
|
||||
sink.put(CommonDataKeys.PSI_ELEMENT, getPsiClass());
|
||||
|
||||
@@ -180,7 +180,7 @@ public class MethodGroupingRule extends SingleParentUsageGroupingRule {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (!isValid()) return;
|
||||
if (CommonDataKeys.PSI_ELEMENT == key) {
|
||||
sink.put(CommonDataKeys.PSI_ELEMENT, getMethod());
|
||||
|
||||
@@ -128,7 +128,7 @@ public class PackageGroupingRule extends DirectoryGroupingRule {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (!isValid()) return;
|
||||
if (CommonDataKeys.PSI_ELEMENT == key) {
|
||||
sink.put(CommonDataKeys.PSI_ELEMENT, myPackage);
|
||||
|
||||
@@ -99,7 +99,7 @@ public class CommitListPanel extends JPanel implements TypeSafeDataProvider {
|
||||
|
||||
// Make changes available for diff action
|
||||
@Override
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
public void calcData(@NotNull DataKey key, @NotNull DataSink sink) {
|
||||
if (VcsDataKeys.CHANGES.equals(key)) {
|
||||
int[] rows = myTable.getSelectedRows();
|
||||
if (rows.length != 1) return;
|
||||
|
||||
@@ -203,7 +203,7 @@ public class PsiElement2UsageTargetAdapter
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (key == UsageView.USAGE_INFO_KEY) {
|
||||
PsiElement element = getElement();
|
||||
if (element != null && element.getTextRange() != null) {
|
||||
|
||||
@@ -522,7 +522,7 @@ public class FindInProjectUtil {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
public void calcData(@NotNull DataKey key, @NotNull DataSink sink) {
|
||||
if (UsageView.USAGE_SCOPE.equals(key)) {
|
||||
SearchScope scope = getScopeFromModel(myProject, myFindModel);
|
||||
sink.put(UsageView.USAGE_SCOPE, scope);
|
||||
|
||||
@@ -669,7 +669,7 @@ public class MemberChooser<T extends ClassMember> extends DialogWrapper implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (key.equals(CommonDataKeys.PSI_ELEMENT)) {
|
||||
if (mySelectedElements != null && !mySelectedElements.isEmpty()) {
|
||||
T selectedElement = mySelectedElements.iterator().next();
|
||||
|
||||
@@ -1139,7 +1139,7 @@ public abstract class ChooseByNameBase implements ChooseByNameViewModel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, @NotNull final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (LangDataKeys.POSITION_ADJUSTER_POPUP.equals(key)) {
|
||||
if (myDropdownPopup != null && myDropdownPopup.isVisible()) {
|
||||
sink.put(key, myDropdownPopup);
|
||||
|
||||
@@ -158,7 +158,7 @@ public abstract class AbstractMemberSelectionTable<T extends PsiElement, M exten
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (key == CommonDataKeys.PSI_ELEMENT) {
|
||||
final Collection<M> memberInfos = getSelectedMemberInfos();
|
||||
if (memberInfos.size() > 0) {
|
||||
|
||||
@@ -310,7 +310,7 @@ public abstract class SlicePanel extends JPanel implements TypeSafeDataProvider,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
public void calcData(@NotNull DataKey key, @NotNull DataSink sink) {
|
||||
if (key == CommonDataKeys.NAVIGATABLE_ARRAY) {
|
||||
List<Navigatable> navigatables = getNavigatables();
|
||||
if (!navigatables.isEmpty()) {
|
||||
|
||||
@@ -16,11 +16,13 @@
|
||||
|
||||
package com.intellij.openapi.actionSystem;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @deprecated This API proved to be rather inconvenient
|
||||
* @see com.intellij.openapi.actionSystem.DataProvider
|
||||
* @see DataProvider
|
||||
*/
|
||||
@Deprecated
|
||||
public interface TypeSafeDataProvider {
|
||||
void calcData(DataKey key, DataSink sink);
|
||||
void calcData(@NotNull DataKey key, @NotNull DataSink sink);
|
||||
}
|
||||
@@ -424,7 +424,7 @@ public class UsageInfo2UsageAdapter implements UsageInModule,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (key == UsageView.USAGE_INFO_KEY) {
|
||||
sink.put(UsageView.USAGE_INFO_KEY, getUsageInfo());
|
||||
}
|
||||
|
||||
@@ -1862,7 +1862,7 @@ public class UsageViewImpl implements UsageViewEx {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (key == CommonDataKeys.PROJECT) {
|
||||
sink.put(CommonDataKeys.PROJECT, myProject);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ public class DirectoryGroupingRule extends SingleParentUsageGroupingRule impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (!isValid()) return;
|
||||
if (CommonDataKeys.VIRTUAL_FILE == key) {
|
||||
sink.put(CommonDataKeys.VIRTUAL_FILE, myDir);
|
||||
|
||||
@@ -143,7 +143,7 @@ public class FileGroupingRule extends SingleParentUsageGroupingRule implements D
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (!isValid()) return;
|
||||
if (key == CommonDataKeys.VIRTUAL_FILE) {
|
||||
sink.put(CommonDataKeys.VIRTUAL_FILE, myFile);
|
||||
|
||||
@@ -183,7 +183,7 @@ public class ModuleGroupingRule implements UsageGroupingRule, DumbAware {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (!isValid()) return;
|
||||
if (LangDataKeys.MODULE_CONTEXT == key) {
|
||||
sink.put(LangDataKeys.MODULE_CONTEXT, myModule);
|
||||
|
||||
@@ -298,7 +298,7 @@ public class CommittedChangesPanel extends JPanel implements TypeSafeDataProvide
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
public void calcData(@NotNull DataKey key, @NotNull DataSink sink) {
|
||||
if (key.equals(VcsDataKeys.REMOTE_HISTORY_CHANGED_LISTENER)) {
|
||||
sink.put(VcsDataKeys.REMOTE_HISTORY_CHANGED_LISTENER, myIfNotCachedReloader);
|
||||
} else if (VcsDataKeys.REMOTE_HISTORY_LOCATION.equals(key)) {
|
||||
|
||||
@@ -416,7 +416,7 @@ public class CommittedChangesTreeBrowser extends JPanel implements TypeSafeDataP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
public void calcData(@NotNull DataKey key, @NotNull DataSink sink) {
|
||||
if (key.equals(VcsDataKeys.CHANGES)) {
|
||||
final Collection<Change> changes = collectChanges(getSelectedChangeLists(), false);
|
||||
sink.put(VcsDataKeys.CHANGES, changes.toArray(new Change[0]));
|
||||
@@ -540,7 +540,7 @@ public class CommittedChangesTreeBrowser extends JPanel implements TypeSafeDataP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (key.equals(PlatformDataKeys.COPY_PROVIDER)) {
|
||||
sink.put(PlatformDataKeys.COPY_PROVIDER, myCopyProvider);
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public abstract class OldChangesBrowserBase extends JPanel implements TypeSafeDa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
public void calcData(@NotNull DataKey key, @NotNull DataSink sink) {
|
||||
if (key == VcsDataKeys.CHANGES) {
|
||||
List<Change> list = getSelectedChanges();
|
||||
if (list.isEmpty()) list = myViewer.getChanges();
|
||||
|
||||
@@ -383,7 +383,7 @@ public class MethodParameterPanel extends AbstractInjectionPanel<MethodParameter
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (CommonDataKeys.PSI_ELEMENT.equals(key)) {
|
||||
final Collection selection = getSelection();
|
||||
if (!selection.isEmpty()) {
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.intellij.util.EditSourceOnEnterKeyHandler;
|
||||
import com.intellij.util.text.DateFormatUtil;
|
||||
import com.intellij.util.ui.ColumnInfo;
|
||||
import com.intellij.util.ui.ListTableModel;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@@ -123,7 +124,7 @@ public class EditorsPanel extends JPanel implements TypeSafeDataProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
public void calcData(@NotNull DataKey key, @NotNull DataSink sink) {
|
||||
if (key.equals(CommonDataKeys.PROJECT)) {
|
||||
sink.put(CommonDataKeys.PROJECT, myProject);
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.ui.update.MergingUpdateQueue;
|
||||
import com.intellij.util.ui.update.UiNotifyConnector;
|
||||
import com.intellij.util.ui.update.Update;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -293,7 +294,7 @@ public abstract class SelectLocationStep extends WizardStep {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (key == FileSystemTree.DATA_KEY) {
|
||||
sink.put(FileSystemTree.DATA_KEY, myFileSystemTree);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.intellij.ui.PopupHandler;
|
||||
import com.intellij.ui.treeStructure.Tree;
|
||||
import org.intellij.plugins.xsltDebugger.ui.actions.CopyValueAction;
|
||||
import org.intellij.plugins.xsltDebugger.ui.actions.NavigateAction;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import javax.swing.tree.TreePath;
|
||||
@@ -41,7 +42,7 @@ public class StructureTree extends Tree implements TypeSafeDataProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
public void calcData(@NotNull DataKey key, @NotNull DataSink sink) {
|
||||
if (key.equals(CommonDataKeys.NAVIGATABLE)) {
|
||||
final TreePath selection = getSelectionPath();
|
||||
if (selection != null) {
|
||||
|
||||
@@ -226,7 +226,7 @@ public abstract class AbstractTableView<T> extends JPanel implements TypeSafeDat
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(DataKey key, DataSink sink) {
|
||||
public void calcData(@NotNull DataKey key, @NotNull DataSink sink) {
|
||||
if (PlatformDataKeys.HELP_ID.equals(key)) {
|
||||
sink.put(PlatformDataKeys.HELP_ID, getHelpId());
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class DomCollectionControl<T extends DomElement> extends DomUIControl imp
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
if (DOM_COLLECTION_CONTROL.equals(key)) {
|
||||
sink.put(DOM_COLLECTION_CONTROL, this);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class DomTableView extends AbstractTableView<DomElement> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcData(final DataKey key, final DataSink sink) {
|
||||
public void calcData(@NotNull final DataKey key, @NotNull final DataSink sink) {
|
||||
super.calcData(key, sink);
|
||||
for (final TypeSafeDataProvider customDataProvider : myCustomDataProviders) {
|
||||
customDataProvider.calcData(key, sink);
|
||||
|
||||
Reference in New Issue
Block a user