01: /*
02: * soapUI, copyright (C) 2004-2007 eviware.com
03: *
04: * soapUI is free software; you can redistribute it and/or modify it under the
05: * terms of version 2.1 of the GNU Lesser General Public License as published by
06: * the Free Software Foundation.
07: *
08: * soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
09: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: * See the GNU Lesser General Public License for more details at gnu.org.
11: */
12: package com.eviware.soapui.settings.impl;
13:
14: import com.eviware.soapui.SoapUI;
15: import com.eviware.soapui.settings.ToolLocator;
16: import com.eviware.soapui.settings.ToolsSettings;
17: import com.eviware.soapui.support.UISupport;
18:
19: /**
20: * Uses the soapUI Settings to locate the specified tools
21: *
22: * @author ole.matzura
23: */
24:
25: public class SettingsToolLocatorImpl implements ToolLocator {
26: public String getAntDir(boolean mandatory) {
27: String antDir = SoapUI.getSettings().getString(
28: ToolsSettings.ANT_LOCATION, null);
29: if (mandatory && antDir == null) {
30: UISupport
31: .showErrorMessage("ANT 1.6.5 (or later) directory must be set in global preferences");
32: }
33: return antDir;
34: }
35:
36: public String getJavacLocation(boolean mandatory) {
37: String javac = SoapUI.getSettings().getString(
38: ToolsSettings.JAVAC_LOCATION, null);
39: if (mandatory && javac == null) {
40: UISupport
41: .showErrorMessage("javac location must be set in global preferences");
42: }
43: return javac;
44: }
45: }
|