root / branches / v2_0_0_prep / extensions / extHelp / src / org / gvsig / help / HelpExtension.java @ 29655
History | View | Annotate | Download (1.26 KB)
1 |
package org.gvsig.help; |
---|---|
2 |
|
3 |
import java.io.File; |
4 |
|
5 |
import org.gvsig.andami.PluginServices; |
6 |
import org.gvsig.andami.help.Help; |
7 |
import org.gvsig.andami.plugins.Extension; |
8 |
import org.slf4j.Logger; |
9 |
import org.slf4j.LoggerFactory; |
10 |
|
11 |
|
12 |
public class HelpExtension extends Extension { |
13 |
|
14 |
|
15 |
private Logger log() { |
16 |
return LoggerFactory.getLogger("org.gvsig"); |
17 |
} |
18 |
|
19 |
public void initialize() { |
20 |
// TODO Auto-generated method stub
|
21 |
|
22 |
} |
23 |
|
24 |
public void execute(String actionCommand) { |
25 |
|
26 |
// If the option pressed is help control the help panel is created.
|
27 |
if(actionCommand.equalsIgnoreCase("Help")){ |
28 |
|
29 |
Help help = Help.getHelp(); //My constructor.
|
30 |
help.show();//Launch help panel.
|
31 |
|
32 |
return;
|
33 |
} |
34 |
} |
35 |
|
36 |
public boolean isEnabled() { |
37 |
return true; |
38 |
} |
39 |
|
40 |
public boolean isVisible() { |
41 |
return true; |
42 |
} |
43 |
|
44 |
public static String getExtensionPath() { |
45 |
String pluginName = "org.gvsig.help"; |
46 |
PluginServices ps = PluginServices.getPluginServices(pluginName); |
47 |
return ps.getPluginDirectory().getAbsolutePath();
|
48 |
} |
49 |
|
50 |
@Override
|
51 |
public void postInitialize() { |
52 |
super.postInitialize();
|
53 |
Help help = Help.getHelp(); //My constructor.
|
54 |
help.addResource(HelpExtension.getExtensionPath()+File.separator+ "gvSIG"+File.separator+"manual-de-usuario.zip");//Documentation path. |
55 |
help.addHelp("manual-de-usuario");
|
56 |
|
57 |
} |
58 |
|
59 |
} |