Changeset 10943
- Timestamp:
- 2005-11-24T17:29:41+13:00 (18 years ago)
- Location:
- trunk/gsdl3/src/java/org/greenstone/admin
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/admin/GAI.java
r10929 r10943 25 25 *######################################################################## 26 26 */ 27 // Graphical Adminstration Interface 27 28 28 package org.greenstone.admin; 29 29 … … 38 38 import javax.swing.text.*; 39 39 40 import org.greenstone.admin.GAIManager; 41 import org.greenstone.core.Configuration; 42 import org.greenstone.core.Dictionary; 40 import org.greenstone.gsdl3.util.Dictionary; 43 41 import org.greenstone.admin.gui.SetServerPane; 44 42 45 /** Containing the top-level "core" for the GAI(Gr aphical Administration43 /** Containing the top-level "core" for the GAI(Greenstone Administrator 46 44 * Interface) this class is the common core for the GAI application and 47 45 * applet. It first parses the command line arguments, preparing to update … … 55 53 { 56 54 public static Dimension screen_size = Toolkit.getDefaultToolkit().getScreenSize(); 57 public static String gsdl3_path; 55 public static String gsdl3_src_home; 56 public static String gsdl3_web_home; 57 58 public static File build_properties_file; 59 58 60 public static String admin_path; 59 61 public static String tomcat_file_path; … … 65 67 static public GAIManager ga_man; 66 68 67 public GAI() 69 /** a public reference to the Dictionary */ 70 static public Dictionary dictionary = null; 71 72 public GAI(String gsdl3_src_home, String gsdl3_web_home) 68 73 { 69 this.gsdl3_path = gsdl3_path; 70 this.admin_path = this.gsdl3_path + "/src/java/org/greenstone/admin/"; 71 this.tomcat_file_path = this.gsdl3_path + "/comms/jakarta/tomcat/logs/"; 72 this.images_path = this.admin_path + "images/"; 73 this.build_file = new File(gsdl3_path, "build.properties"); 74 this.site_conf = new File (gsdl3_path,"/web/sites/localsite/siteConfig.xml"); 75 this.interface_conf = new File (gsdl3_path, "/web/interfaces/default/interfaceConfig.xml"); 76 init(); 74 this.gsdl3_src_home = gsdl3_src_home; 75 this.gsdl3_web_home = gsdl3_web_home; 76 77 // set up the Configuration 78 new Configuration(); 79 80 // Read Dictionary 81 this.dictionary = new Dictionary("gai", Configuration.getLocale("general.locale")); 82 this.build_properties_file = new File(this.gsdl3_src_home, "build.properties"); 83 this.images_path = this.gsdl3_src_home+File.separatorChar+"resources"+File.separatorChar+"images"; 84 // start the GAIManager 85 ga_man = new GAIManager(screen_size); 86 ga_man.display(); 87 88 //this.admin_path = this.gsdl3_path + "/src/java/org/greenstone/admin/"; 89 //this.tomcat_file_path = this.gsdl3_path + "/comms/jakarta/tomcat/logs/"; 90 //this.images_path = this.admin_path + "images/"; 91 //this.build_file = new File(gsdl3_path, "build.properties"); 92 //this.site_conf = new File (gsdl3_path,"/web/sites/localsite/siteConfig.xml"); 93 //this.interface_conf = new File (gsdl3_path, "/web/interfaces/default/interfaceConfig.xml"); 94 //init(); 77 95 } 78 96 79 97 public static void main (String[] args){ 80 gsdl3_path = args[0]; 81 admin_path = gsdl3_path + "/src/java/org/greenstone/admin/"; 82 new Configuration (admin_path); 83 GAI gai = new GAI(); 98 // A serious hack, but its good enough to stop crappy 'Could not 99 // lock user prefs' error messages. Thanks to Walter Schatz from 100 // the java forums. 101 System.setProperty("java.util.prefs.syncInterval","2000000"); 102 103 if (args.length != 2) { 104 System.err.println("Usage: java org.greenstone.admin.GAI <gsdl3 src home> <gsdl3 web home>"); 105 System.exit(1); 106 } 84 107 85 ga_man = new GAIManager(screen_size); 86 ga_man.display(); 108 File gsdl3_src_dir = new File(args[0]); 109 File gsdl3_web_dir = new File(args[1]); 110 if (!gsdl3_src_dir.isDirectory() || !gsdl3_web_dir.isDirectory()) { 111 System.err.println("Usage: java org.greenstone.admin.GAI <gsdl3 src home> <gsdl3 web home>"); 112 System.err.println("src or web directory does not exist!"); 113 System.exit(1); 114 } 115 116 GAI gai = new GAI(args[0], args[1]); 117 118 // gsdl3_path = args[0]; 119 //admin_path = gsdl3_path + "/src/java/org/greenstone/admin/"; 120 //new Configuration (admin_path); 121 //GAI gai = new GAI(); 122 123 //ga_man = new GAIManager(screen_size); 124 //ga_man.display(); 87 125 } 88 126 89 public void init (){90 // Read Dictionary91 new Dictionary(Configuration.getLocale("general.locale", true), Configuration.getFont("general.font", true));92 93 }94 127 } 95 128 -
trunk/gsdl3/src/java/org/greenstone/admin/GAIFirstSettingFrame.java
r10929 r10943 49 49 import javax.swing.tree.*; 50 50 51 import org.greenstone.core.Configuration;52 import org.greenstone.core.Dictionary;53 51 import org.greenstone.core.ParsingProgress; 54 52 import org.greenstone.admin.gui.SetServerPane; … … 111 109 fset_yes_button.setToolTipText("Click this button to Set up the Tomcat/MYSQL server"); 112 110 fset_yes_button.setEnabled(false); 113 //Dictionary.registerBoth(build_button, "CreatePane.Build_Collection", "CreatePane.Build_Collection_Tooltip");114 111 fset_no_button = new JButton("No", setNoButtonIcon); 115 112 fset_no_button.addActionListener(fsnbl); … … 117 114 fset_no_button.setMnemonic(KeyEvent.VK_N); 118 115 fset_no_button.setToolTipText("Click this button to skip the First time Tomcat/MYSQL server setting"); 119 //Dictionary.registerBoth(build_button, "CreatePane.Build_Collection", "CreatePane.Build_Collection_Tooltip"); 120 116 121 117 //First time running setting buttons 122 118 fsybl = null; … … 175 171 main_pane.add(first_setting_pane,BorderLayout.CENTER); 176 172 main_pane.add(control_pane, BorderLayout.SOUTH); 177 main_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background" , false));178 main_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground" , false));173 main_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background")); 174 main_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground")); 179 175 180 176 // Center and display -
trunk/gsdl3/src/java/org/greenstone/admin/GAIManager.java
r10929 r10943 34 34 import org.greenstone.admin.gui.LogPane; 35 35 import org.greenstone.admin.gui.ConfPane; 36 37 import org.greenstone.core.Configuration;38 import org.greenstone.core.Dictionary;39 import org.greenstone.core.DebugStream;40 import org.greenstone.core.util.Utility;41 36 42 37 //import java AWT classes … … 121 116 122 117 //set up the Configuration Pane 123 if (Configuration.get("admin.conf" , true)){118 if (Configuration.get("admin.conf")){ 124 119 conf_pane = new ConfPane(); 125 120 conf_pane.display(); 126 121 tab_pane.addTab("Configuration", CONF_ICON, conf_pane); 127 tab_pane.setEnabledAt(tab_pane.indexOfComponent(conf_pane),Configuration.get("admin.conf" , false));122 tab_pane.setEnabledAt(tab_pane.indexOfComponent(conf_pane),Configuration.get("admin.conf")); 128 123 } 129 124 130 125 //set up the ext Pane 131 if (Configuration.get("admin.ext" , true)){126 if (Configuration.get("admin.ext")){ 132 127 ext_pane = new JPanel(); 133 128 //ext_pane.display(); 134 129 tab_pane.addTab("Exts", EXT_ICON, ext_pane); 135 tab_pane.setEnabledAt(tab_pane.indexOfComponent(ext_pane),Configuration.get("admin.ext" , false));130 tab_pane.setEnabledAt(tab_pane.indexOfComponent(ext_pane),Configuration.get("admin.ext")); 136 131 } 137 132 138 133 //set up the Monitor Pane 139 if (Configuration.get("admin.monitor" , true)){134 if (Configuration.get("admin.monitor")){ 140 135 monitor_pane = new JPanel(); 141 136 //monitor_pane.display(); 142 137 tab_pane.addTab("Monitor", MONITOR_ICON, monitor_pane); 143 tab_pane.setEnabledAt(tab_pane.indexOfComponent(monitor_pane),Configuration.get("admin.monitor" , false));138 tab_pane.setEnabledAt(tab_pane.indexOfComponent(monitor_pane),Configuration.get("admin.monitor")); 144 139 } 145 140 146 141 //set up the Log Pane 147 if (Configuration.get("admin.log" , true)){142 if (Configuration.get("admin.log")){ 148 143 log_pane = new LogPane(); 149 144 log_pane.display(); 150 145 tab_pane.addTab("Log", LOG_ICON, log_pane); 151 tab_pane.setEnabledAt(tab_pane.indexOfComponent(log_pane),Configuration.get("admin.log" , false));146 tab_pane.setEnabledAt(tab_pane.indexOfComponent(log_pane),Configuration.get("admin.log")); 152 147 } 153 148 content_pane.setLayout(new BorderLayout()); … … 156 151 setVisible(true); 157 152 } catch (Exception e){ 158 DebugStream.printStackTrace(e);159 153 e.printStackTrace(); 160 154 System.exit(1); … … 345 339 if (conf_pos != -1){ 346 340 if (ready) { 347 tab_pane.setEnabledAt (conf_pos,Configuration.get("admin.conf" , false));341 tab_pane.setEnabledAt (conf_pos,Configuration.get("admin.conf")); 348 342 } else { 349 tab_pane.setEnabledAt (conf_pos, Configuration.get("admin.conf",true));343 tab_pane.setEnabledAt (conf_pos,false); 350 344 } 351 345 } 352 346 if (ext_pos != -1){ 353 347 if (ready) { 354 tab_pane.setEnabledAt (ext_pos,Configuration.get("admin.ext" , false));348 tab_pane.setEnabledAt (ext_pos,Configuration.get("admin.ext")); 355 349 } else { 356 tab_pane.setEnabledAt (ext_pos, Configuration.get("admin.ext",true));350 tab_pane.setEnabledAt (ext_pos,false); 357 351 } 358 352 } 359 353 if (monitor_pos != -1){ 360 354 if (ready) { 361 tab_pane.setEnabledAt (monitor_pos,Configuration.get("admin.monitor" , false));355 tab_pane.setEnabledAt (monitor_pos,Configuration.get("admin.monitor")); 362 356 } else { 363 tab_pane.setEnabledAt (monitor_pos, Configuration.get("admin.monitor",true));357 tab_pane.setEnabledAt (monitor_pos,false); 364 358 } 365 359 } 366 360 if (log_pos != -1){ 367 361 if (ready) { 368 tab_pane.setEnabledAt (log_pos,Configuration.get("admin.log" , false));362 tab_pane.setEnabledAt (log_pos,Configuration.get("admin.log")); 369 363 } else { 370 tab_pane.setEnabledAt (log_pos, Configuration.get("admin.log",true));364 tab_pane.setEnabledAt (log_pos,false); 371 365 } 372 366 } -
trunk/gsdl3/src/java/org/greenstone/admin/gui/ClearLogFilePrompt.java
r10929 r10943 44 44 import javax.swing.*; 45 45 import javax.swing.event.*; 46 import org.greenstone.core.Configuration;47 import org.greenstone.core.DebugStream;48 46 49 47 /*import org.greenstone.gatherer.Dictionary; … … 55 53 import org.greenstone.gatherer.util.StaticStrings;*/ 56 54 57 //import org.greenstone.gatherer.core.Utility;58 55 59 56 /** This class provides the functionality to delete current collections from the -
trunk/gsdl3/src/java/org/greenstone/admin/gui/ConfPane.java
r10929 r10943 56 56 import org.greenstone.admin.GAI; 57 57 import org.greenstone.admin.GAIManager; 58 import org.greenstone.admin.Configuration; 58 59 import org.greenstone.admin.gui.ThreadControl; 59 60 //import org.greenstone.admin.gui.ConfSettingTableModel; 60 61 import org.greenstone.admin.gui.SiteConfSetting; 61 import org.greenstone.core.Configuration;62 import org.greenstone.core.Dictionary;63 import org.greenstone.core.util.Utility;64 62 import org.greenstone.core.ParsingProgress; 65 63 … … 186 184 //DefaultMutableTreeNode child1 = new DefaultMutableTreeNode(); 187 185 DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("Project Configuration"); 188 //Dictionary.get(child1,"Tree.ProjectConf");189 186 190 187 DefaultMutableTreeNode compile = new DefaultMutableTreeNode("Compile"); … … 201 198 DefaultMutableTreeNode child2 = new DefaultMutableTreeNode("Site Configuration"); 202 199 //DefaultMutableTreeNode child2 = new DefaultMutableTreeNode(); 203 //Dictionary.registerText(child2,"Tree.SiteConf");204 200 DefaultMutableTreeNode siteConf = new DefaultMutableTreeNode("SiteConfig"); 205 201 DefaultMutableTreeNode interfaceConf = new DefaultMutableTreeNode("InterfaceConfig"); … … 237 233 startup_tomcat_button.setMnemonic(KeyEvent.VK_S); 238 234 startup_tomcat_button.setEnabled(false); 239 Dictionary.registerBoth(startup_tomcat_button,"ConfPane.Tomcat_Startup", "ConfPane.Tomcat_Startup_Tooltip"); 235 startup_tomcat_button.setText(GAI.dictionary.get("ConfPane.Tomcat_Startup")); 236 startup_tomcat_button.setToolTipText(GAI.dictionary.get("ConfPane.Tomcat_Startup_Tooltip")); 240 237 241 238 shutdown_tomcat_button = new JButton(); 242 239 shutdown_tomcat_button.addActionListener(stdbl); 243 240 shutdown_tomcat_button.setEnabled(false); 244 Dictionary.registerBoth(shutdown_tomcat_button,"ConfPane.Tomcat_Shutdown", "ConfPane.Tomcat_Shutdown_Tooltip"); 245 241 shutdown_tomcat_button.setText(GAI.dictionary.get("ConfPane.Tomcat_Shutdown")); 242 shutdown_tomcat_button.setToolTipText(GAI.dictionary.get("ConfPane.Tomcat_Shutdown_Tooltip")); 243 246 244 restart_tomcat_button = new JButton(); 247 245 restart_tomcat_button.addActionListener(rtbl); 248 246 restart_tomcat_button.setEnabled(false); 249 Dictionary.registerBoth(restart_tomcat_button,"ConfPane.Tomcat_Restart", "ConfPane.Tomcat_Restart_Tooltip"); 247 restart_tomcat_button.setText(GAI.dictionary.get("ConfPane.Tomcat_Restart")); 248 restart_tomcat_button.setToolTipText(GAI.dictionary.get("ConfPane.Tomcat_Restart_Tooltip")); 250 249 251 250 startup_mysql_button = new JButton(); … … 253 252 startup_mysql_button.setMnemonic(KeyEvent.VK_S); 254 253 startup_mysql_button.setEnabled(false); 255 Dictionary.registerBoth(startup_mysql_button,"ConfPane.MySQL_Startup", "ConfPane.MySQL_Startup_Tooltip"); 254 startup_mysql_button.setText(GAI.dictionary.get("ConfPane.MySQL_Startup")); 255 startup_mysql_button.setToolTipText(GAI.dictionary.get("ConfPane.MySQL_Startup_Tooltip")); 256 256 257 257 shutdown_mysql_button = new JButton(); 258 258 shutdown_mysql_button.addActionListener(smdbl); 259 259 shutdown_mysql_button.setEnabled(false); 260 Dictionary.registerBoth(shutdown_mysql_button,"ConfPane.MySQL_Shutdown", "ConfPane.MySQL_Shutdown_Tooltip"); 260 shutdown_mysql_button.setText(GAI.dictionary.get("ConfPane.MySQL_Shutdown")); 261 shutdown_mysql_button.setToolTipText(GAI.dictionary.get("ConfPane.MySQL_Shutdown_Tooltip")); 261 262 262 263 restart_mysql_button = new JButton(); 263 264 restart_mysql_button.addActionListener(rmbl); 264 265 restart_mysql_button.setEnabled(false); 265 Dictionary.registerBoth(restart_mysql_button,"ConfPane.MySQL_Restart", "ConfPane.MySQL_Restart_Tooltip"); 266 restart_mysql_button.setText(GAI.dictionary.get("ConfPane.MySQL_Restart")); 267 restart_mysql_button.setToolTipText(GAI.dictionary.get("ConfPane.MySQL_Restart_Tooltip")); 266 268 267 269 //tomcat control buttons … … 297 299 confList_pane.setPreferredSize(LIST_SIZE); 298 300 confList_pane.setSize(LIST_SIZE); 299 confList_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background" , false));300 confList_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground" , false));301 confList_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background")); 302 confList_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground")); 301 303 302 304 confList_label = new JLabel(); 303 305 confList_label.setOpaque(true); 304 confList_label.setBackground(Configuration.getColor("coloring.workspace_selection_background" , false));305 confList_label.setForeground(Configuration.getColor("coloring.workspace_selection_foreground" , false));306 Dictionary.registerText(confList_label, "ConfPane.Conf_List");306 confList_label.setBackground(Configuration.getColor("coloring.workspace_selection_background")); 307 confList_label.setForeground(Configuration.getColor("coloring.workspace_selection_foreground")); 308 confList_label.setText(GAI.dictionary.get("ConfPane.Conf_List")); 307 309 308 310 // confContent_Pane 309 311 confContent_pane = new JPanel(); 310 312 confContent_pane.setBorder(BorderFactory.createEmptyBorder(10,20,10,20)); 311 confContent_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background" , false));312 confContent_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground" , false));313 confContent_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background")); 314 confContent_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground")); 313 315 314 316 confContent_label = new JLabel(); 315 317 confContent_label.setOpaque(true); 316 confContent_label.setBackground(Configuration.getColor("coloring.workspace_selection_background" , false));317 confContent_label.setForeground(Configuration.getColor("coloring.workspace_selection_foreground" , false));318 Dictionary.registerText(confContent_label, "ConfPane.Conf_Content");319 318 confContent_label.setBackground(Configuration.getColor("coloring.workspace_selection_background")); 319 confContent_label.setForeground(Configuration.getColor("coloring.workspace_selection_foreground")); 320 confContent_label.setText(GAI.dictionary.get("ConfPane.Conf_List")); 321 320 322 conf_table_model = new ConfSettingTableModel(); 321 323 conf_setting_table = new JTable(conf_table_model){ … … 337 339 Component c = super.prepareRenderer(renderer, rowIndex, colIndex); 338 340 if (colIndex == 0) { 339 c.setBackground(Configuration.getColor("coloring.table_noneditable_background" ,false));341 c.setBackground(Configuration.getColor("coloring.table_noneditable_background")); 340 342 } else { 341 c.setBackground(Configuration.getColor("coloring.table_editable_background" ,false));343 c.setBackground(Configuration.getColor("coloring.table_editable_background")); 342 344 } 343 345 return c; … … 397 399 conf_table_pane = new JScrollPane(conf_setting_table); 398 400 conf_table_pane.setVisible(false); 399 conf_table_pane.getViewport().setBackground(Configuration.getColor("coloring.collection_tree_background" , false));401 conf_table_pane.getViewport().setBackground(Configuration.getColor("coloring.collection_tree_background")); 400 402 401 403 // Layout Components … … 432 434 * files are saved*/ 433 435 if (project_conf_changed) { 434 saveProjectConf(GAI.build_ file);436 saveProjectConf(GAI.build_properties_file); 435 437 } 436 438 /*boolean site_conf_changed = site_conf.confChanged(); … … 480 482 //before we restart Tomcat server, we want to make sure the conf_pane settings are saved 481 483 if (project_conf_changed) { 482 saveProjectConf(GAI.build_ file);484 saveProjectConf(GAI.build_properties_file); 483 485 } 484 486 /*boolean site_conf_changed = site_conf.confChanged(); … … 508 510 public void actionPerformed(ActionEvent event) { 509 511 //before we startup the MySQL server, we want to make sure the Conf_pane settings are saved 510 saveProjectConf(GAI.build_ file);512 saveProjectConf(GAI.build_properties_file); 511 513 mysql_server_up = checkMysqlServer(); 512 514 if (!mysql_server_up) { … … 545 547 implements ActionListener { 546 548 public void actionPerformed(ActionEvent event) { 547 saveProjectConf(GAI.build_ file);549 saveProjectConf(GAI.build_properties_file); 548 550 mysql_server_up = checkMysqlServer(); 549 551 if (mysql_server_up) { … … 597 599 598 600 public void getConfContent(){ 599 String filename = GAI.build_ file.getPath();600 if (!GAI.build_ file.exists()){601 String filename = GAI.build_properties_file.getPath(); 602 if (!GAI.build_properties_file.exists()){ 601 603 JOptionPane.showMessageDialog((Component) null,"Build property file does not exist"); 602 604 } else { -
trunk/gsdl3/src/java/org/greenstone/admin/gui/DeleteLogFilePrompt.java
r10929 r10943 44 44 import javax.swing.*; 45 45 import javax.swing.event.*; 46 import org.greenstone.core.Configuration;47 import org.greenstone.core.DebugStream;48 46 49 /* import org.greenstone.gatherer.Dictionary;47 /* 50 48 import org.greenstone.gatherer.Gatherer; 51 49 import org.greenstone.gatherer.LocalLibraryServer; … … 55 53 import org.greenstone.gatherer.util.StaticStrings;*/ 56 54 57 //import org.greenstone.gatherer.core.Utility;58 55 59 56 /** This class provides the functionality to delete current collections from the -
trunk/gsdl3/src/java/org/greenstone/admin/gui/LogPane.java
r10929 r10943 48 48 import org.greenstone.admin.GAIManager; 49 49 import org.greenstone.admin.GAI; 50 import org.greenstone.core.Configuration; 51 import org.greenstone.core.Dictionary; 52 import org.greenstone.core.util.Utility; 50 import org.greenstone.admin.Configuration; 53 51 54 52 /** The Log pane is to view the status of relevant log files in GSIII … … 120 118 log_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 121 119 log_list.setVisibleRowCount(4); 122 log_list.setBackground (Configuration.getColor("coloring.workspace_tree_background" , false));123 log_list.setForeground (Configuration.getColor("coloring.workspace_tree_foreground" , false));120 log_list.setBackground (Configuration.getColor("coloring.workspace_tree_background")); 121 log_list.setForeground (Configuration.getColor("coloring.workspace_tree_foreground")); 124 122 log_list.addListSelectionListener(new LogListListener()); 125 123 … … 139 137 reload_button.setEnabled(false); 140 138 reload_button.setMnemonic(KeyEvent.VK_R); 141 Dictionary.registerBoth(reload_button, "LogPane.Reload_Log", "LogPane.Reload_Log_Tooltip"); 139 reload_button.setText(GAI.dictionary.get("LogPane.Reload_Log")); 140 reload_button.setToolTipText(GAI.dictionary.get("LogPane.Reload_Log_Tooltip")); 142 141 143 142 clear_button = new JButton(); … … 145 144 clear_button.setEnabled(false); 146 145 clear_button.setMnemonic(KeyEvent.VK_C); 147 Dictionary.registerBoth(clear_button, "LogPane.Clear_Log", "LogPane.Clear_Log_Tooltip"); 146 clear_button.setText(GAI.dictionary.get("LogPane.Clear_Log")); 147 clear_button.setToolTipText(GAI.dictionary.get("LogPane.Clear_Log_Tooltip")); 148 148 149 149 rbl = null; … … 170 170 logList_label = new JLabel(); 171 171 logList_label.setOpaque(true); 172 logList_label.setBackground(Configuration.getColor("coloring.workspace_heading_background" , false));173 logList_label.setForeground(Configuration.getColor("coloring.workspace_heading_foreground" , false));174 Dictionary.registerText(logList_label, "LogPane.Log_List");172 logList_label.setBackground(Configuration.getColor("coloring.workspace_heading_background")); 173 logList_label.setForeground(Configuration.getColor("coloring.workspace_heading_foreground")); 174 logList_label.setText(GAI.dictionary.get("LogPane.Log_List")); 175 175 176 176 // logContent_Pane 177 177 logContent_pane = new JPanel(); 178 178 logContent_pane.setBorder(BorderFactory.createLoweredBevelBorder()); 179 logContent_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background" , false));180 logContent_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground" , false));179 logContent_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background")); 180 logContent_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground")); 181 181 logContent_label = new JLabel(); 182 182 logContent_label.setOpaque(true); 183 logContent_label.setBackground(Configuration.getColor("coloring.workspace_selection_background" , false));184 logContent_label.setForeground(Configuration.getColor("coloring.workspace_selection_foreground" , false));185 Dictionary.registerText(logContent_label, "LogPane.Log_Content");186 183 logContent_label.setBackground(Configuration.getColor("coloring.workspace_selection_background")); 184 logContent_label.setForeground(Configuration.getColor("coloring.workspace_selection_foreground")); 185 logContent_label.setText(GAI.dictionary.get("LogPane.Log_Content")); 186 187 187 // TEXTAREA Layout 188 188 log_content = new JScrollPane(log_textarea); -
trunk/gsdl3/src/java/org/greenstone/admin/gui/MenuBar.java
r10929 r10943 43 43 44 44 import org.greenstone.admin.GAI; 45 import org.greenstone.core.Configuration; 46 import org.greenstone.core.Dictionary; 47 import org.greenstone.core.util.Utility; 45 import org.greenstone.admin.Configuration; 48 46 49 47 /** The menu bar for the Administration tools main GUI. … … 72 70 73 71 static public ImageIcon HELP_ICON = null; 74 72 static public ImageIcon BLANK_ICON = null; 73 75 74 // public MenuBar(MenuListener Menu_listener) 76 75 public MenuBar(MenuListener menu_listener) 77 76 { 78 77 HELP_ICON = new ImageIcon(GAI.images_path +"help.gif"); 78 BLANK_ICON = new ImageIcon(GAI.images_path+"blank.gif"); 79 79 80 //file = new JMenu("File"); 80 81 file = new JMenu(); 81 82 file.setMnemonic(KeyEvent.VK_F); 82 Dictionary.registerText(file, "Menu.File");83 file.setText(GAI.dictionary.get("Menu.File")); 83 84 84 85 //file_save = new JMenuItem("Save"); … … 86 87 file_save.addActionListener(GAI.ga_man); 87 88 file_save.setMnemonic(KeyEvent.VK_S); 88 Dictionary.registerText(file_save, "Menu.File_Save");89 89 file_save.setText(GAI.dictionary.get("Menu.File_Save")); 90 90 91 //file_exit = new JMenuItem("Exit"); 91 92 file_exit = new JMenuItem(); 92 93 file_exit.addActionListener(GAI.ga_man); 93 94 file_exit.setMnemonic(KeyEvent.VK_X); 94 Dictionary.registerText(file_exit, "Menu.File_Exit"); 95 file_exit.setText(GAI.dictionary.get("Menu.File_Exit")); 96 95 97 //Layout (File menu) 96 98 file.add(file_save); … … 102 104 edit = new JMenu(); 103 105 edit.setMnemonic(KeyEvent.VK_E); 104 Dictionary.registerText(edit, "Menu.Edit");105 106 edit.setText(GAI.dictionary.get("Menu.Edit")); 107 106 108 // Help menu 107 109 //help = new JMenu("Help"); … … 109 111 help.setMnemonic(KeyEvent.VK_H); 110 112 help.setIcon(HELP_ICON); 111 Dictionary.setText(help, "Menu.Help");112 113 help.setText(GAI.dictionary.get("Menu.Help")); 114 113 115 help_general = new JMenuItem(); 114 116 help_general.addActionListener(GAI.ga_man); 115 Dictionary.registerText(help_general,"Source.General");116 117 help_general.setText(GAI.dictionary.get("Source.General")); 118 117 119 help_conf = new JMenuItem(); 118 120 help_conf.addActionListener(GAI.ga_man); 119 Dictionary.registerText(help_conf,"GAI.Configuration");120 121 help_conf.setText(GAI.dictionary.get("GAI.Configuration")); 122 121 123 help_ext = new JMenuItem(); 122 124 help_ext.addActionListener(GAI.ga_man); 123 Dictionary.registerText(help_ext,"GAI.Ext");124 125 help_ext.setText(GAI.dictionary.get("GAI.Ext")); 126 125 127 help_monitor = new JMenuItem(); 126 128 help_monitor.addActionListener(GAI.ga_man); 127 Dictionary.registerText(help_monitor,"GAI.Monitor");128 129 help_monitor.setText(GAI.dictionary.get("GAI.Monitor")); 130 129 131 help_log = new JMenuItem(); 130 132 help_log.addActionListener(GAI.ga_man); 131 Dictionary.registerText(help_log,"GAI.Log");132 133 help_log.setText(GAI.dictionary.get("GAI.Log")); 134 133 135 help_about = new JMenuItem(); 134 136 help_about.addActionListener(GAI.ga_man); 135 Dictionary.registerText(help_about,"Menu.Help_About");136 137 help_about.setText(GAI.dictionary.get("Menu.Help_About")); 138 137 139 138 140 // Layout (help menu) 139 141 help.add(help_general); 140 142 help.add(new JSeparator()); 141 if (Configuration.get("admin.conf" , true)) {143 if (Configuration.get("admin.conf")) { 142 144 help.add(help_conf); 143 145 } 144 if (Configuration.get("admin.ext" , true)) {146 if (Configuration.get("admin.ext")) { 145 147 help.add(help_ext); 146 148 } 147 if (Configuration.get("admin.monitor" , true)) {149 if (Configuration.get("admin.monitor")) { 148 150 help.add(help_monitor); 149 151 } 150 if (Configuration.get("admin.log" , true)) {152 if (Configuration.get("admin.log")) { 151 153 help.add(help_log); 152 154 } … … 188 190 selected = help.getItem(current_tab); 189 191 if(selected != null) { 190 selected.setIcon( Utility.BLANK_ICON);192 selected.setIcon(BLANK_ICON); 191 193 } 192 194 } … … 194 196 selected = help.getItem(current_tab); 195 197 if(selected != null) { 196 //selected.setIcon(Utility.HELP_ICON);197 //198 selected.setIcon(HELP_ICON); 199 198 200 } 199 201 selected = null; -
trunk/gsdl3/src/java/org/greenstone/admin/gui/SaveChangePrompt.java
r10929 r10943 45 45 46 46 import org.greenstone.admin.gui.ConfPane; 47 48 import org.greenstone.core.Configuration;49 import org.greenstone.core.DebugStream;50 47 51 48 /** This class provides the functionality to show a prompt to save changed file -
trunk/gsdl3/src/java/org/greenstone/admin/gui/SetServerPane.java
r10929 r10943 55 55 import java.sql.*; 56 56 57 import org.greenstone.core.Configuration; 58 import org.greenstone.core.Dictionary; 57 import org.greenstone.admin.Configuration; 59 58 import org.greenstone.core.ParsingProgress; 60 59 import org.greenstone.admin.GAI; … … 122 121 save_button.setToolTipText("Click this button to save up the setting"); 123 122 save_button.setEnabled(false); 124 //Dictionary.registerBoth(build_button, "CreatePane.Build_Collection", "CreatePane.Build_Collection_Tooltip");125 123 126 124 install_button = new JButton("Install GSDL3", InstallButtonIcon); … … 129 127 install_button.setMnemonic(KeyEvent.VK_I); 130 128 install_button.setToolTipText("Click this button to Install Greenstone III"); 131 //Dictionary.registerBoth(build_button, "CreatePane.Build_Collection", "CreatePane.Build_Collection_Tooltip");132 129 133 130 exit_button = new JButton("Exit Setting and Installation", ExitButtonIcon); … … 136 133 install_button.setMnemonic(KeyEvent.VK_I); 137 134 install_button.setToolTipText("Click this button to Exit the Setting and Installation of Greenstone III"); 138 //Dictionary.registerBoth(build_button, "CreatePane.Build_Collection", "CreatePane.Build_Collection_Tooltip");139 135 140 136 //Setting&Installation buttons … … 211 207 main_pane.add(setting_table_pane, BorderLayout.CENTER); 212 208 main_pane.add(outter_control_pane, BorderLayout.SOUTH); 213 main_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background" , false));214 main_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground" , false));209 main_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background")); 210 main_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground")); 215 211 216 212 // Center and display … … 233 229 int result = JOptionPane.showConfirmDialog((Component) null, "Do you really want to save the setting?", "Save Confirmation", JOptionPane.YES_NO_OPTION); 234 230 if ( result == JOptionPane.YES_OPTION) { 235 updateSetting (GAI.build_ file);236 file_saved = writeFile (GAI.build_ file);231 updateSetting (GAI.build_properties_file); 232 file_saved = writeFile (GAI.build_properties_file); 237 233 if (file_saved) { 238 234 JOptionPane.showMessageDialog((Component) null,"Change has been saved succefully!"); … … 248 244 } 249 245 250 public void updateSetting(File build_ file) {251 readFile (GAI.build_ file);246 public void updateSetting(File build_properties_file) { 247 readFile (GAI.build_properties_file); 252 248 String new_string; 253 249 for (int i=0; i < server_setting_table_model.getRowCount(); i++){ … … 265 261 266 262 } 267 public void readFile (File build_ file) {268 String filename = build_ file.getPath();263 public void readFile (File build_properties_file) { 264 String filename = build_properties_file.getPath(); 269 265 String fileLine; 270 266 /*conf_array[] store all the details from the build.properties*/ … … 284 280 } 285 281 286 public boolean writeFile(File build_ file){287 String filename = build_ file.getPath();282 public boolean writeFile(File build_properties_file){ 283 String filename = build_properties_file.getPath(); 288 284 try { 289 285 BufferedWriter conf_out = new BufferedWriter(new FileWriter(filename)); -
trunk/gsdl3/src/java/org/greenstone/admin/gui/ThreadControl.java
r10929 r10943 67 67 public void executeAntTarget(String command_string) throws IOException { 68 68 Project ant = new Project(); 69 File buildFile = new File (GAI.gsdl3_ path+ File.separator + "build.xml");69 File buildFile = new File (GAI.gsdl3_src_home + File.separator + "build.xml"); 70 70 71 71 //Set up a PrintStream pointing at a file 72 72 //FileOutputStream ant_out = 73 // new FileOutputStream(GAI.gsdl3_ path+ File.separator + "ant_out.log");73 // new FileOutputStream(GAI.gsdl3_src_home + File.separator + "ant_out.log"); 74 74 //FileOutputStream ant_err = 75 // new FileOutputStream(GAI.gsdl3_ path+ File.separator + "ant_err.log");75 // new FileOutputStream(GAI.gsdl3_src_home + File.separator + "ant_err.log"); 76 76 77 77 // BufferedOutputStream ant_out_buffer = … … 130 130 /*public boolean checkAntResult(){ 131 131 try { 132 String filename = GAI.gsdl3_ path+ File.separator +"ant_out.log";132 String filename = GAI.gsdl3_src_home + File.separator +"ant_out.log"; 133 133 String fileLine; 134 134
Note:
See TracChangeset
for help on using the changeset viewer.