mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-10-04 03:53:59 +13:00
Fix null pointer in case no external program to launch has been set
This commit is contained in:
parent
6868f6567b
commit
43b2cde018
2 changed files with 13 additions and 0 deletions
|
@ -35,6 +35,12 @@ public class EditFileAction implements LeafAction {
|
||||||
return entries.stream().allMatch(entry -> entry.getRawFileEntry().getKind() == FileKind.FILE);
|
return entries.stream().allMatch(entry -> entry.getRawFileEntry().getKind() == FileKind.FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isActive(OpenFileSystemModel model, List<BrowserEntry> entries) {
|
||||||
|
var e = AppPrefs.get().externalEditor().getValue();
|
||||||
|
return e != null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName(OpenFileSystemModel model, List<BrowserEntry> entries) {
|
public String getName(OpenFileSystemModel model, List<BrowserEntry> entries) {
|
||||||
return "Edit with " + AppPrefs.get().externalEditor().getValue().toTranslatedString();
|
return "Edit with " + AppPrefs.get().externalEditor().getValue().toTranslatedString();
|
||||||
|
|
|
@ -3,6 +3,7 @@ package io.xpipe.ext.base.browser;
|
||||||
import io.xpipe.app.browser.BrowserEntry;
|
import io.xpipe.app.browser.BrowserEntry;
|
||||||
import io.xpipe.app.browser.OpenFileSystemModel;
|
import io.xpipe.app.browser.OpenFileSystemModel;
|
||||||
import io.xpipe.app.browser.action.LeafAction;
|
import io.xpipe.app.browser.action.LeafAction;
|
||||||
|
import io.xpipe.app.prefs.AppPrefs;
|
||||||
import io.xpipe.app.util.TerminalHelper;
|
import io.xpipe.app.util.TerminalHelper;
|
||||||
import io.xpipe.core.store.FileKind;
|
import io.xpipe.core.store.FileKind;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
|
@ -53,6 +54,12 @@ public class OpenTerminalAction implements LeafAction {
|
||||||
return entries.stream().allMatch(entry -> entry.getRawFileEntry().getKind() == FileKind.DIRECTORY);
|
return entries.stream().allMatch(entry -> entry.getRawFileEntry().getKind() == FileKind.DIRECTORY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isActive(OpenFileSystemModel model, List<BrowserEntry> entries) {
|
||||||
|
var t = AppPrefs.get().terminalType().getValue();
|
||||||
|
return t != null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public KeyCombination getShortcut() {
|
public KeyCombination getShortcut() {
|
||||||
return new KeyCodeCombination(KeyCode.T, KeyCombination.SHORTCUT_DOWN);
|
return new KeyCodeCombination(KeyCode.T, KeyCombination.SHORTCUT_DOWN);
|
||||||
|
|
Loading…
Reference in a new issue