source: main/trunk/greenstone3/src/java/org/greenstone/admin/guiext/BaseExt.java@ 22085

Last change on this file since 22085 was 22085, checked in by sjm84, 14 years ago

Created a util package from classes that could be useful outside of their original packages

File size: 2.0 KB
Line 
1package org.greenstone.admin.guiext;
2
3import java.awt.Insets;
4import java.io.File;
5
6import javax.swing.JPanel;
7import javax.swing.JScrollPane;
8import javax.swing.JTextArea;
9import javax.xml.parsers.DocumentBuilder;
10import javax.xml.parsers.DocumentBuilderFactory;
11
12import org.greenstone.gsdl3.util.GSPath;
13import org.greenstone.util.GlobalProperties;
14import org.w3c.dom.*;
15
16import org.greenstone.admin.GAI;
17
18public 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}
Note: See TracBrowser for help on using the repository browser.