Skip to content

Commit

Permalink
Provide command set for Mate. Closes #34.
Browse files Browse the repository at this point in the history
  • Loading branch information
basti1302 committed Sep 14, 2013
1 parent f8a4f3a commit 982ecda
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugin/src/de/bastiankrol/startexplorer/PluginContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ private IRuntimeExecCalls chooseRuntimeExecCalls(
return RuntimeExecCallsFactory.linuxXfce();
case LINUX_LXDE:
return RuntimeExecCallsFactory.linuxLxde();
case LINUX_MATE:
return RuntimeExecCallsFactory.linuxMate();
case MAC_OS:
return RuntimeExecCallsFactory.macOs();
case LINUX_UNKNOWN:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public enum DesktopEnvironment
LINUX_KDE(OperatingSystem.LINUX, "KDE"), //
LINUX_XFCE(OperatingSystem.LINUX, "Xfce"), //
LINUX_LXDE(OperatingSystem.LINUX, "LXDE"), //
LINUX_MATE(OperatingSystem.LINUX, "MATE"), //
LINUX_UNKNOWN(OperatingSystem.LINUX, "Unknown"), //
MAC_OS(OperatingSystem.MAC_OS), //
UNKNOWN(OperatingSystem.UNKNOWN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public static RuntimeExecCallsLxde linuxLxde()
return new RuntimeExecCallsLxde();
}

public static RuntimeExecCallsMate linuxMate()
{
return new RuntimeExecCallsMate();
}

public static RuntimeExecCallsMacOs macOs()
{
return new RuntimeExecCallsMacOs();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package de.bastiankrol.startexplorer.crossplatform;

import java.io.File;

/**
* Runtime exec calls for Mate.
*
* @author Bastian Krol
*/
class RuntimeExecCallsMate extends AbstractRuntimeExecCalls
{
/**
* Creates a new instance and initializes the {@link RuntimeExecDelegate}.
*/
RuntimeExecCallsMate()
{
super();
}

/**
* Creates a new instance with the given {@link RuntimeExecDelegate}.
*
* @param delegate the RuntimeExecDelegate to use
*/
RuntimeExecCallsMate(RuntimeExecDelegate delegate)
{
super(delegate);
}

@Override
String[] getCommandForStartFileManager(File file, boolean selectFile)
{
return new String[] { "caja", getPath(file) };
}

@Override
File getWorkingDirectoryForStartFileManager(File file)
{
return file;
}

@Override
String[] getCommandForStartShell(File file)
{
return new String[] { "mate-terminal" };
}

@Override
File getWorkingDirectoryForForStartShell(File file)
{
return file;
}

@Override
String[] getCommandForStartSystemApplication(File file)
{
return new String[] { "mate-terminal", getPath(file) };
}

@Override
File getWorkingDirectoryForForStartSystemApplication(File file)
{
return null;
}

@Override
File getWorkingDirectoryForCustomCommand(File file)
{
return null;
}

public boolean isFileSelectionSupportedByFileManager()
{
return false;
}

@Override
boolean doFilePartsWantWrapping()
{
return true;
}

@Override
boolean doFilePartsWantEscaping()
{
// TODO doFilePartsWantEscaping()
return false;
}

@Override
boolean isWindows()
{
return false;
}
}

0 comments on commit 982ecda

Please sign in to comment.