cleanup & use java 8

This commit is contained in:
Egor.Ushakov
2016-10-04 20:03:01 +03:00
parent 61d2bfb2f0
commit 23fab9ba74
5 changed files with 8 additions and 35 deletions
@@ -34,8 +34,6 @@ import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
@@ -101,19 +99,11 @@ public final class UserRenderersConfigurable extends JPanel implements Configura
private void setupRenderersList() {
myRendererChooser.getEmptyText().setText(DebuggerBundle.message("text.user.renderers.configurable.no.renderers"));
myRendererChooser.addElementsMarkListener(new ElementsChooser.ElementsMarkListener<NodeRenderer>() {
@Override
public void elementMarkChanged(final NodeRenderer element, final boolean isMarked) {
element.setEnabled(isMarked);
}
});
myRendererChooser.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(@NotNull ListSelectionEvent e) {
myRendererChooser.addElementsMarkListener((ElementsChooser.ElementsMarkListener<NodeRenderer>)NodeRenderer::setEnabled);
myRendererChooser.addListSelectionListener(e -> {
if (!e.getValueIsAdjusting()) {
updateCurrentRenderer(myRendererChooser.getSelectedElements());
}
}
});
}
@@ -47,7 +47,6 @@ import com.intellij.openapi.util.Key;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.psi.PsiField;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.xdebugger.XDebuggerManager;
import com.intellij.xdebugger.XDebuggerUtil;
@@ -494,12 +493,8 @@ public class BreakpointManager {
@NotNull
public List<Breakpoint> getBreakpoints() {
return ApplicationManager.getApplication().runReadAction((Computable<List<Breakpoint>>)() -> ContainerUtil.mapNotNull(getXBreakpointManager().getAllBreakpoints(), new Function<XBreakpoint<?>, Breakpoint>() {
@Override
public Breakpoint fun(XBreakpoint<?> xBreakpoint) {
return getJavaBreakpoint(xBreakpoint);
}
}));
return ApplicationManager.getApplication().runReadAction((Computable<List<Breakpoint>>)() ->
ContainerUtil.mapNotNull(getXBreakpointManager().getAllBreakpoints(), BreakpointManager::getJavaBreakpoint));
}
@Nullable
@@ -921,7 +921,7 @@ public class XDebugSessionImpl implements XDebugSession {
@Override
public void reportMessage(@NotNull final String message, @NotNull final MessageType type, @Nullable final HyperlinkListener listener) {
NotificationListener notificationListener = listener == null ? null : (NotificationListener)(notification, event) -> listener.hyperlinkUpdate(event);
NotificationListener notificationListener = listener == null ? null : (notification, event) -> listener.hyperlinkUpdate(event);
NOTIFICATION_GROUP.createNotification("", message, type.toNotificationType(), notificationListener).notify(myProject);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* 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.
@@ -17,9 +17,7 @@ package com.intellij.xdebugger.impl.ui.tree.actions;
import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.project.Project;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.xdebugger.XExpression;
import com.intellij.xdebugger.impl.frame.actions.XWatchesTreeActionBase;
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
import com.intellij.xdebugger.impl.ui.tree.nodes.WatchNode;
@@ -40,13 +38,7 @@ public class XCopyValueAction extends XFetchValueActionBase {
}
else {
CopyPasteManager.getInstance().setContents(
new XWatchTransferable(value, ContainerUtil.map(watchNodes,
new Function<WatchNode, XExpression>() {
@Override
public XExpression fun(WatchNode node) {
return node.getExpression();
}
})));
new XWatchTransferable(value, ContainerUtil.map(watchNodes, WatchNode::getExpression)));
}
}
}
@@ -468,11 +468,7 @@ public class XDebuggerTestUtil {
}
public static XBreakpoint<?>[] getBreakpoints(final XBreakpointManager breakpointManager) {
return ApplicationManager.getApplication().runReadAction(new Computable<XBreakpoint<?>[]>() {
public XBreakpoint<?>[] compute() {
return breakpointManager.getAllBreakpoints();
}
});
return ApplicationManager.getApplication().runReadAction((Computable<XBreakpoint<?>[]>)breakpointManager::getAllBreakpoints);
}
public static <B extends XBreakpoint<?>>