1 | package org.greenstone.admin.guiext;
|
---|
2 |
|
---|
3 | import java.awt.Insets;
|
---|
4 | import java.io.File;
|
---|
5 |
|
---|
6 | import javax.swing.JPanel;
|
---|
7 | import javax.swing.JScrollPane;
|
---|
8 | import javax.swing.JTextArea;
|
---|
9 | import javax.xml.parsers.DocumentBuilder;
|
---|
10 | import javax.xml.parsers.DocumentBuilderFactory;
|
---|
11 |
|
---|
12 | import org.greenstone.gsdl3.util.GSPath;
|
---|
13 | import org.greenstone.gsdl3.util.GlobalProperties;
|
---|
14 | import org.w3c.dom.*;
|
---|
15 |
|
---|
16 | import org.greenstone.admin.GAI;
|
---|
17 |
|
---|
18 | public abstract class BaseExt {
|
---|
19 |
|
---|
20 | static protected JScrollPane description_pane;
|
---|
21 | static protected JPanel main_pane;
|
---|
22 | static protected JPanel control_pane;
|
---|
23 | static protected JTextArea descriptionTextArea;
|
---|
24 | static protected String description;
|
---|
25 |
|
---|
26 | public JPanel button_pane;
|
---|
27 | public String extension_name;
|
---|
28 | public String destination_folder;
|
---|
29 | public String url;
|
---|
30 | public String group;
|
---|
31 | public String download_type;
|
---|
32 | public Boolean configurable;
|
---|
33 |
|
---|
34 | GlobalProperties globalProperty = null;
|
---|
35 | static String fileSeparator = File.separator;
|
---|
36 | GSPath gspath = null;
|
---|
37 |
|
---|
38 | public BaseExt(){
|
---|
39 | }
|
---|
40 |
|
---|
41 | protected abstract JPanel getControlPane();
|
---|
42 |
|
---|
43 | protected abstract JPanel getDescriptionPane();
|
---|
44 |
|
---|
45 | protected abstract boolean getCommandStatus(String Command);
|
---|
46 |
|
---|
47 | public boolean doCallback(String methodName)
|
---|
48 | {
|
---|
49 | return false;
|
---|
50 | }
|
---|
51 |
|
---|
52 | public boolean doCommand(String cmd)
|
---|
53 | {
|
---|
54 | return false;
|
---|
55 | }
|
---|
56 |
|
---|
57 | public static Element getRootElement(String url){
|
---|
58 |
|
---|
59 | Element rootNode = null;
|
---|
60 | try{
|
---|
61 | DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
|
---|
62 | DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
|
---|
63 | Document doc = docBuilder.newDocument();
|
---|
64 | doc = docBuilder.parse (new File(url));
|
---|
65 | rootNode = doc.getDocumentElement();
|
---|
66 | return rootNode;
|
---|
67 | }catch (Exception e) {
|
---|
68 | e.printStackTrace();
|
---|
69 | return null;
|
---|
70 | }
|
---|
71 | }
|
---|
72 |
|
---|
73 | protected abstract Object[][] getConfigureContent();
|
---|
74 |
|
---|
75 | //protected abstract Boolean isConfigurable();
|
---|
76 |
|
---|
77 | protected abstract JPanel getButtonPane();
|
---|
78 | }
|
---|