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:
13: package com.eviware.soapui.impl.wsdl.actions.support;
14:
15: import com.eviware.soapui.impl.wsdl.support.HelpUrls;
16: import com.eviware.soapui.model.ModelItem;
17: import com.eviware.soapui.support.HelpActionMarker;
18: import com.eviware.soapui.support.Tools;
19: import com.eviware.soapui.support.UISupport;
20: import com.eviware.soapui.support.action.support.AbstractSoapUIAction;
21:
22: /**
23: * Shows an online help page
24: *
25: * @author Ole.Matzura
26: */
27:
28: public class ShowOnlineSoapUIHelp extends AbstractSoapUIAction
29: implements HelpActionMarker {
30: public static final String SOAPUI_ACTION_ID = "ShowOnlineSoapUIHelp";
31: private String url;
32:
33: public ShowOnlineSoapUIHelp() {
34: super ("Online Help", "Show Online Help");
35: }
36:
37: public ShowOnlineSoapUIHelp(String name, String url) {
38: super (name, url);
39: this .url = url;
40: }
41:
42: public void perform(ModelItem target, Object param) {
43: if (param == null && url == null) {
44: UISupport.showErrorMessage("Missing help URL");
45: return;
46: }
47:
48: String url = param == null ? this .url : param.toString();
49: if (!url.startsWith("http://"))
50: url = HelpUrls.HELP_URL_ROOT + url;
51:
52: Tools.openURL(url);
53: }
54: }
|