public class SpreadsheetLauncher extends Object
Modifier and Type | Field and Description |
---|---|
protected static String |
LIN_PATH
Default path to spreadsheet (OpenOffice) on Linux computers.
|
protected static String |
MAC_PATH
Default path to spreadsheet (Excel) on Macintosh computers.
|
protected String |
path
Path to spreadsheet executable.
|
protected static String |
WIN_PATH
Default path to spreadsheet (Excel) on Windows computers.
|
Constructor and Description |
---|
SpreadsheetLauncher()
Constructs a spreadsheet launcher.
|
Modifier and Type | Method and Description |
---|---|
static String |
getDefaultApplicationPath()
Returns the default spreadsheet application path for the current OS.
|
protected static boolean |
isLinux()
Whether OS is Linux.
|
protected static boolean |
isMac()
Whether the OS is mac.
|
protected static boolean |
isWindows()
Whether the OS is windows.
|
void |
launchSpreadsheet(File file)
Tries to launch the appropriate spreadsheet application.
|
void |
launchSpreadsheet(File file,
String appPath)
Tries to launch the appropriate spreadsheet application.
|
protected static String |
makeCantIdentifyOSMessage()
Returns an error message indicating the OS could not be identified.
|
protected String |
makeCommandErrorMessage(String command)
Makes an error message from the given command.
|
protected String |
makeFileDoesNotExistMessage(File file)
Makes an error message from the given file.
|
protected static final String WIN_PATH
protected static final String LIN_PATH
protected static final String MAC_PATH
protected final String path
public SpreadsheetLauncher() throws SpreadsheetLaunchException
SpreadsheetLaunchException
public static String getDefaultApplicationPath() throws SpreadsheetLaunchException
SpreadsheetLaunchException
public void launchSpreadsheet(File file) throws SpreadsheetLaunchException
SpreadsheetLaunchException
public void launchSpreadsheet(File file, String appPath) throws SpreadsheetLaunchException
SpreadsheetLaunchException
protected static boolean isWindows()
protected static boolean isMac()
protected static boolean isLinux()
protected String makeCommandErrorMessage(String command)
protected String makeFileDoesNotExistMessage(File file)
protected static String makeCantIdentifyOSMessage()
Copyright © 2015–2022 SciJava. All rights reserved.