eclipse plugin: Some cleanups

This commit is contained in:
Timotei Dolean 2011-08-01 18:52:57 +00:00
parent 2405faf600
commit cf073f820c
2 changed files with 9 additions and 5 deletions

View file

@ -22,18 +22,18 @@ public class Constants
Constants.class.getProtectionDomain().getCodeSource().getLocation().getPath() + "/"; //$NON-NLS-1$
public static final String PLUGIN_ID = "org.wesnoth"; //$NON-NLS-1$
public static final String MACHINE_OS =
System.getProperty("os.name").toLowerCase(Locale.ENGLISH); //$NON-NLS-1$
/**
* The boolean value whether this machine is running windows or not
*/
public static final boolean IS_WINDOWS_MACHINE =
System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows"); //$NON-NLS-1$ //$NON-NLS-2$
MACHINE_OS.contains("windows"); //$NON-NLS-1$ //$NON-NLS-2$
/**
* The boolean value whether this machine is running Machintosh or not
*/
public static final boolean IS_MAC_MACHINE =
System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("mac"); //$NON-NLS-1$ //$NON-NLS-2$
public static final String MACHINE_OS =
System.getProperty("os.name").toLowerCase(Locale.ENGLISH); //$NON-NLS-1$
MACHINE_OS.contains("mac"); //$NON-NLS-1$ //$NON-NLS-2$
/** Preferences Constants **/
public static final String P_WESNOTH_EXEC_PATH = "wesnoth_exec_path"; //$NON-NLS-1$

View file

@ -22,6 +22,7 @@ import org.wesnoth.Messages;
import org.wesnoth.preferences.Preferences;
import org.wesnoth.projects.ProjectUtils;
import org.wesnoth.utils.GUIUtils;
import org.wesnoth.utils.StringUtils;
import org.wesnoth.utils.WorkspaceUtils;
public class WesnothInstallsUtils
@ -79,6 +80,9 @@ public class WesnothInstallsUtils
*/
public static String getInstallNameForResource( String resourcePath )
{
if ( StringUtils.isNullOrEmpty( resourcePath ) )
return "";
return getInstallNameForResource( ResourcesPlugin.getWorkspace( ).getRoot( ).
findMember( resourcePath ) );
}
@ -90,7 +94,7 @@ public class WesnothInstallsUtils
*/
public static String getInstallNameForResource( IResource resource )
{
if ( resource == null )
if ( resource == null || ! resource.exists( ) )
return ""; //$NON-NLS-1$
return ProjectUtils.getCacheForProject( resource.getProject( ) ).getInstallName( );