mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
lambda cleanup
This commit is contained in:
@@ -12,11 +12,9 @@ import com.intellij.util.ui.UIUtil;
|
||||
import javafx.application.Platform;
|
||||
import javafx.concurrent.Worker;
|
||||
import javafx.embed.swing.JFXPanel;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.scene.web.WebEngine;
|
||||
import javafx.scene.web.WebEvent;
|
||||
import javafx.scene.web.WebView;
|
||||
import netscape.javascript.JSException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -77,18 +75,11 @@ public class IpnbJfxUtils {
|
||||
|
||||
Platform.runLater(() -> {
|
||||
final WebView webView = new WebView();
|
||||
webView.setOnDragDetected(new EventHandler<javafx.scene.input.MouseEvent>() {
|
||||
@Override
|
||||
public void handle(javafx.scene.input.MouseEvent event) {
|
||||
}
|
||||
webView.setOnDragDetected(event -> {
|
||||
});
|
||||
final WebEngine engine = webView.getEngine();
|
||||
initHyperlinkListener(engine);
|
||||
engine.setOnStatusChanged(new EventHandler<WebEvent<String>>() {
|
||||
public void handle(WebEvent<String> status) {
|
||||
adjustHeight(webView, javafxPanel, source);
|
||||
}
|
||||
});
|
||||
engine.setOnStatusChanged(status -> adjustHeight(webView, javafxPanel, source));
|
||||
|
||||
final String prefix = String.format(ourPrefix, EditorColorsManager.getInstance().getGlobalScheme().getEditorFontSize());
|
||||
engine.loadContent(prefix + convertToHtml(source) + ourPostfix);
|
||||
@@ -218,13 +209,10 @@ public class IpnbJfxUtils {
|
||||
final int width = (int)(webView.getWidth() == 0 ? 1500 : webView.getWidth());
|
||||
final Dimension size = new Dimension(width, (int)height);
|
||||
|
||||
UIUtil.invokeLaterIfNeeded(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
javafxPanel.setPreferredSize(size);
|
||||
javafxPanel.revalidate();
|
||||
javafxPanel.repaint();
|
||||
}
|
||||
UIUtil.invokeLaterIfNeeded(() -> {
|
||||
javafxPanel.setPreferredSize(size);
|
||||
javafxPanel.revalidate();
|
||||
javafxPanel.repaint();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user