Changeset 10793


Ignore:
Timestamp:
2005-10-31T12:19:10+13:00 (18 years ago)
Author:
chi
Message:

The latest development when Chi leave on 31/10/2005.

Location:
branches/ant-install-branch/gsdl3/src/java/org/greenstone/admin/gui
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/ant-install-branch/gsdl3/src/java/org/greenstone/admin/gui/ConfPane.java

    r9972 r10793  
    4343import java.util.List;
    4444import java.util.ArrayList;
     45import java.util.Hashtable;
     46import java.util.Enumeration;
    4547import java.lang.Object;
    4648import javax.swing.*;
     
    5557import org.greenstone.admin.GAIManager;
    5658import org.greenstone.admin.gui.ThreadControl;
     59//import org.greenstone.admin.gui.ConfSettingTableModel;
     60import org.greenstone.admin.gui.SiteConfSetting;
    5761import org.greenstone.core.Configuration;
    5862import org.greenstone.core.Dictionary;
     
    6771    extends JPanel
    6872    implements ActionListener {
    69    
     73
    7074    /* The pane to demonstrate Configuration information, including the build property file
    7175     * being monitored and their content, and control functions */
     
    7377   
    7478    protected JPanel main_contentPane = null;
     79    public Hashtable conf_table;
    7580   
    7681    /** The panel that contains a Conf_list */
     
    8085    private JPanel confContent_pane =  null;
    8186    private JScrollPane conf_table_pane = null;
    82 
     87   
    8388    /** The List showing all the Configuration files concerned. */
    8489    private JList conf_list=null;
    8590    private JTree conf_tree = null;
    86 
    87     /** The pane area into which the Configuration content is placed. */
    88     //private JScrollPane conf_content = null;
    8991
    9092    /** The label at the top of the confList_pane. */
     
    9496
    9597    // The control buttons used to manipulate Configuration Pane
    96     protected JPanel outter_button_pane = null;
    97     protected JPanel outter_control_pane = null;
    9898    protected JPanel inner_button_pane = null;
    9999    protected JPanel inner_control_pane = null;
     
    109109    private JButton shutdown_mysql_button = null;
    110110    private JButton restart_mysql_button = null;
    111      
     111
    112112    private JButton save_button = null;
    113 
    114     /** Buttons in outter button pane*/
    115     //private JButton reload_button = null;
    116     //private JButton delete_button = null;
    117     //private JButton exit_button = null;
    118113
    119114    private JLabel conf_label = null;
    120115    private JLabel conf_setting_label = null;
    121     private JTextField conf_field = null;
     116   
     117    /* ConfPane empty AREA to show XML configuration file*/
     118    //private JTextArea conf_xml_area = null;
    122119
    123120    //control tomcat and mysql server running status
     
    127124    private String mysql_server;
    128125    private String mysql_port;
     126    private String conf_pane_name;
     127 
    129128    private boolean tomcat_server_up = false;
    130129    private boolean mysql_server_up = false;
    131130
    132     protected JTextArea text_area = null;
    133      
     131    /** The scrollable area into which the configuration content is placed. */
     132    //private JScrollPane conf_xml_content = null;
     133   
     134    public SiteConfSetting site_conf = null;
     135    public SiteConfSetting interface_conf = null;
     136
    134137    /** The various sizes for the screen layout*/
    135138    static private Dimension MIN_SIZE = new Dimension( 90,  90);
     
    137140    static private Dimension CONTENT_SIZE = new Dimension (600,450);
    138141    static private Dimension TABLE_SIZE = new Dimension(500,200);
     142    static private int MINIMUM_TABLE_HEADER_SIZE = 15;
    139143   
    140144    private JTable conf_setting_table = null;
    141145
    142146    private int num_of_setting;
    143     private int num_of_change = 0;
    144147
    145148    //The details display in the table
     149    int display_row_count = 5;
    146150    int rowLength = 20;
    147151    int colLength = 3;
     
    152156    private ArrayList conf_array;
    153157   
    154     // all the relevant details from the build.properties
    155     private static boolean valueChanged =false;
    156    
    157     ConfTableModel conf_table_model;
     158    //Site configuration
     159    public File site_conf_file = GAI.site_conf;
     160    public File interface_conf_file = GAI.interface_conf;
     161    public boolean  project_conf_changed = false;
     162
     163    ConfSettingTableModel conf_table_model = null;
    158164    DefaultMutableTreeNode top = new DefaultMutableTreeNode("Configuration Files");
    159 
    160165    //Constructor
    161166    public ConfPane() {
     167    conf_table = new Hashtable();
    162168    // create all the control button panes
    163169    inner_control_pane = new JPanel();
     
    165171    tomcat_button_pane = new JPanel();
    166172    mysql_button_pane = new JPanel();
    167     outter_control_pane = new JPanel();
    168     outter_button_pane = new JPanel();
     173   
     174    /*the class for showing the site configurations including
     175     * siteConfig.xml and interfaceConfig.xml
     176     */
     177    site_conf = new SiteConfSetting("siteConfig", site_conf_file);
     178    interface_conf =  new SiteConfSetting("interfaceConfig", interface_conf_file);
    169179   
    170180    // Main Configuration Pane
    171181    main_conf_pane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    172        
    173     // Main pane for Configuration Content Pane
     182        // Main pane for Configuration Content Pane
    174183    main_contentPane = new JPanel();
    175184   
    176185    //Create a tree for a list Configuration files we are interested
    177     DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("Build");
     186    //DefaultMutableTreeNode child1 = new DefaultMutableTreeNode();
     187    DefaultMutableTreeNode child1 = new DefaultMutableTreeNode("Project Configuration");
     188    //Dictionary.get(child1,"Tree.ProjectConf");
     189
    178190    DefaultMutableTreeNode compile = new DefaultMutableTreeNode("Compile");
    179191    DefaultMutableTreeNode tomcat = new DefaultMutableTreeNode("Tomcat");
    180192    DefaultMutableTreeNode proxy = new DefaultMutableTreeNode("Proxy");
    181     DefaultMutableTreeNode mysql = new DefaultMutableTreeNode("Mysql");
     193    DefaultMutableTreeNode mysql = new DefaultMutableTreeNode("MySQL");
    182194    DefaultMutableTreeNode gsdl = new DefaultMutableTreeNode("GSDL");
    183195    child1.add(compile);
     
    187199    child1.add(gsdl);
    188200
    189     DefaultMutableTreeNode child2 =
    190         new DefaultMutableTreeNode("Conf 2");
    191     DefaultMutableTreeNode child3 =
    192         new DefaultMutableTreeNode("Conf 3");
     201    DefaultMutableTreeNode child2 = new DefaultMutableTreeNode("Site Configuration");
     202    //DefaultMutableTreeNode child2 = new DefaultMutableTreeNode();
     203    //Dictionary.registerText(child2,"Tree.SiteConf");
     204    DefaultMutableTreeNode siteConf = new DefaultMutableTreeNode("SiteConfig");
     205    DefaultMutableTreeNode interfaceConf = new DefaultMutableTreeNode("InterfaceConfig");
     206    child2.add(siteConf);
     207    child2.add(interfaceConf);
     208
     209    //DefaultMutableTreeNode child3 = new DefaultMutableTreeNode("Conf 3");
    193210    top.add(child1);
    194211    top.add(child2);
    195     top.add(child3);
     212    //top.add(child3);
    196213    conf_tree = new JTree(top);
    197214    conf_tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
     
    206223    ShutdownMysqlButtonListener smdbl = new ShutdownMysqlButtonListener();
    207224    RestartMysqlButtonListener rmbl = new RestartMysqlButtonListener();
    208    
    209     //save button
    210     SaveButtonListener sabl = new SaveButtonListener();
    211    
    212     //outter button_pane Buttons
    213     //ReloadButtonListener rbl = new ReloadButtonListener();
    214     //DeleteButtonListener dbl = new DeleteButtonListener();
    215     //ExitButtonListener ebl = new ExitButtonListener();
    216     //ImageIcon reloadButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/Refresh16.gif");
    217     //ImageIcon deleteButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/Delete16.gif");
    218     //ImageIcon exitButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/exit16.gif");
    219 
    220     ImageIcon startupTomcatButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/redo16.gif");
    221     ImageIcon shutdownTomcatButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/stop16.gif");
    222     ImageIcon restartTomcatButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/stop16.gif");
    223    
    224     ImageIcon startupMysqlButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/redo16.gif");
    225     ImageIcon shutdownMysqlButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/stop16.gif");
    226     ImageIcon restartMysqlButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/stop16.gif");
    227     ImageIcon saveButtonIcon = new ImageIcon(GAI.admin_path  + "images/toolbarButtonGraphics/general/Save16.gif");
    228 
    229     startup_tomcat_button = new JButton("Startup Tomcat", startupTomcatButtonIcon);
     225       
     226    ImageIcon startupTomcatButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/redo16.gif");
     227    ImageIcon shutdownTomcatButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/stop16.gif");
     228    ImageIcon restartTomcatButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/stop16.gif");
     229   
     230    ImageIcon startupMysqlButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/redo16.gif");
     231    ImageIcon shutdownMysqlButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/stop16.gif");
     232    ImageIcon restartMysqlButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/stop16.gif");
     233    ImageIcon saveButtonIcon = new ImageIcon(GAI.images_path  + "toolbarButtonGraphics/general/Save16.gif");
     234
     235    startup_tomcat_button = new JButton(); 
    230236    startup_tomcat_button.addActionListener(stbl);
    231237    startup_tomcat_button.setMnemonic(KeyEvent.VK_S);
    232     startup_tomcat_button.setToolTipText("Click this button to startup the Tomcat server");
    233238    startup_tomcat_button.setEnabled(false);
    234 
    235     shutdown_tomcat_button = new JButton("Shutdown Tomcat", shutdownTomcatButtonIcon);
     239    Dictionary.registerBoth(startup_tomcat_button,"ConfPane.Tomcat_Startup", "ConfPane.Tomcat_Startup_Tooltip");
     240
     241    shutdown_tomcat_button = new JButton();
    236242    shutdown_tomcat_button.addActionListener(stdbl);
    237243    shutdown_tomcat_button.setEnabled(false);
    238     //shutdown_button.setMnemonic(KeyEvent.VK_h);
    239     shutdown_tomcat_button.setToolTipText("Click this button to shutdown the Tomcat server");
    240    
    241     restart_tomcat_button = new JButton("Restart Tomcat",restartTomcatButtonIcon);
     244    Dictionary.registerBoth(shutdown_tomcat_button,"ConfPane.Tomcat_Shutdown", "ConfPane.Tomcat_Shutdown_Tooltip");
     245       
     246    restart_tomcat_button = new JButton();
    242247    restart_tomcat_button.addActionListener(rtbl);
    243248    restart_tomcat_button.setEnabled(false);
    244     //shutdown_button.setMnemonic(KeyEvent.VK_h);
    245     restart_tomcat_button.setToolTipText("Click this button to restart the Tomcat server(which will shutdown Tomcat server and restart it again");
    246    
    247     startup_mysql_button = new JButton("Startup MYSQL", startupMysqlButtonIcon);
     249    Dictionary.registerBoth(restart_tomcat_button,"ConfPane.Tomcat_Restart", "ConfPane.Tomcat_Restart_Tooltip");
     250
     251    startup_mysql_button = new JButton();
    248252    startup_mysql_button.addActionListener(smbl);
    249253    startup_mysql_button.setMnemonic(KeyEvent.VK_S);
    250     startup_mysql_button.setToolTipText("Click this button to startup the MYSQL server");
    251254    startup_mysql_button.setEnabled(false);
    252 
    253     shutdown_mysql_button = new JButton("Shutdown MYSQL", shutdownMysqlButtonIcon);
     255    Dictionary.registerBoth(startup_mysql_button,"ConfPane.MySQL_Startup", "ConfPane.MySQL_Startup_Tooltip");
     256
     257    shutdown_mysql_button = new JButton();
    254258    shutdown_mysql_button.addActionListener(smdbl);
    255259    shutdown_mysql_button.setEnabled(false);
    256     //shutdown_button.setMnemonic(KeyEvent.VK_h);
    257     shutdown_mysql_button.setToolTipText("Click this button to shutdown the MYSQL server");
    258    
    259     restart_mysql_button = new JButton("Restart MYSQL",restartMysqlButtonIcon);
     260    Dictionary.registerBoth(shutdown_mysql_button,"ConfPane.MySQL_Shutdown", "ConfPane.MySQL_Shutdown_Tooltip");
     261   
     262    restart_mysql_button = new JButton();
    260263    restart_mysql_button.addActionListener(rmbl);
    261264    restart_mysql_button.setEnabled(false);
    262     //shutdown_button.setMnemonic(KeyEvent.VK_h);
    263     restart_tomcat_button.setToolTipText("Click this button to restart the MYSQL server(which will shutdown MYSQL server and restart it again");
    264 
    265     save_button = new JButton("Save Change", saveButtonIcon);
    266     save_button.addActionListener(sabl);
    267     //save_button.setMnemonic(KeyEvent.VK_a);
    268     save_button.setEnabled(false);
    269     save_button.setToolTipText("Click this button to save the change of build property file");
    270    
    271     /*reload_button = new JButton("Reload", reloadButtonIcon);
    272     reload_button.addActionListener(rbl);
    273     reload_button.setMnemonic(KeyEvent.VK_R);
    274     reload_button.setToolTipText("Click this button to reload the build properties file");*/
    275     //Dictionary.registerBoth(build_button, "CreatePane.Build_Collection", "CreatePane.Build_Collection_Tooltip");
    276 
    277     /*delete_button = new JButton("Delete", deleteButtonIcon);
    278      delete_button.addActionListener(dbl);
    279     delete_button.setEnabled(false);
    280     delete_button.setMnemonic(KeyEvent.VK_D);
    281     delete_button.setToolTipText("Click this button to delete the Configuration file");*/
    282     //Dictionary.registerBoth(cancel_button, "CreatePane.Cancel_Build", "CreatePane.Cancel_Build_Tooltip");*/
    283 
    284     /*exit_button = new JButton("Exit", exitButtonIcon);
    285     exit_button.setToolTipText("Click this button to exit the viewing");   
    286     exit_button.addActionListener(ebl);
    287     exit_button.setEnabled(true);
    288     exit_button.setMnemonic(KeyEvent.VK_E);*/
    289 
    290     //tomcat buttons
     265    Dictionary.registerBoth(restart_mysql_button,"ConfPane.MySQL_Restart", "ConfPane.MySQL_Restart_Tooltip");
     266
     267    //tomcat control buttons
    291268    stbl = null;
    292269    stdbl = null;
    293270    rtbl = null;
    294 
    295     //restart mysql button
     271   
     272    //mysql control button
    296273    smbl = null;
    297274    smdbl = null;
    298275    rmbl = null;
    299 
    300     //rbl = null;
    301     //dbl = null;
    302     //ebl = null;
    303276   
    304277    //read in build properties
     
    308281    /** Any implementation of ActionListener requires this method so that when an
    309282     **action is performed the appropriate effect can occur.*/
    310 
    311283    public void actionPerformed(ActionEvent event) {
    312284    }
    313 
    314     /** This method is callsed to actually layout the components.*/
     285   
     286   
     287    /** This method is called to actually layout the components.*/
    315288    public void display() {
    316289    //Create Components.
     
    318291    //MouseListenerImpl mouse_listener = new MouseListenerImpl();
    319292    //this.addKeyListener(key_listener);
    320 
    321     // confList_Pane
     293   
     294    //confList_Pane
    322295    confList_pane = new JPanel();
    323296    confList_pane.setBorder(BorderFactory.createLoweredBevelBorder());
    324297    confList_pane.setPreferredSize(LIST_SIZE);
    325298    confList_pane.setSize(LIST_SIZE);
    326     confList_label = new JLabel("Configuration Files");
     299    confList_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background", false));
     300    confList_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground", false));
     301   
     302    confList_label = new JLabel();
    327303    confList_label.setOpaque(true);
    328     confList_label.setBackground(Configuration.getColor("coloring.workspace_heading_background", false));
    329     confList_label.setForeground(Configuration.getColor("coloring.workspace_heading_foreground", false));
    330     //Dictionary.registerText(logList_label, "Log.List");
     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");
    331307
    332308    // confContent_Pane
    333309    confContent_pane = new JPanel();
    334     //confContent_pane.setBorder(BorderFactory.createLoweredBevelBorder());
    335310    confContent_pane.setBorder(BorderFactory.createEmptyBorder(10,20,10,20));
    336311    confContent_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background", false));
    337312    confContent_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground", false));
    338313
    339     confContent_label = new JLabel("Configuration Content");
     314    confContent_label = new JLabel();
    340315    confContent_label.setOpaque(true);
    341     confContent_label.setBackground(Configuration.getColor("coloring.workspace_heading_background", false));
    342     confContent_label.setForeground(Configuration.getColor("coloring.workspace_heading_foreground", false));
    343     //Dictionary.registerText(logContent_label, "Log.Content");
    344    
    345     conf_table_model = new ConfTableModel();
     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   
     320    conf_table_model = new ConfSettingTableModel();
    346321    conf_setting_table = new JTable(conf_table_model){
    347322        public String getToolTipText(MouseEvent e){
     
    352327            int realColumnIndex = convertColumnIndexToModel(colIndex);
    353328            if (realColumnIndex == 0){
    354             tip = conf_display[rowIndex][0].toString();
     329            tip = conf_display[rowIndex][realColumnIndex].toString();
    355330            } else {
    356331            tip = super.getToolTipText(e);
     
    358333            return tip;
    359334        }
     335        public Component prepareRenderer (TableCellRenderer renderer,
     336                          int rowIndex, int colIndex){
     337            Component c = super.prepareRenderer(renderer, rowIndex, colIndex);
     338            if (colIndex == 0) {
     339            c.setBackground(Configuration.getColor("coloring.table_noneditable_background",false));
     340            } else {
     341            c.setBackground(Configuration.getColor("coloring.table_editable_background",false));
     342            }
     343            return c;
     344        }
    360345        };
    361            
     346   
     347    //When the MySQL and TOMCAT servers are still running and detect double-clicking occuring (editing mode)
     348    conf_setting_table.addMouseListener(new MouseAdapter(){
     349        public void mouseClicked(MouseEvent e){
     350            if (e.getClickCount() == 2){
     351            if (conf_pane_name.matches("MYSQL")){
     352                mysql_server_up = false;
     353                mysql_server_up = checkMysqlServer();
     354                if (mysql_server_up) {
     355                JOptionPane.showMessageDialog((Component) null,"MySQL is running, shutdown the MySQL server before making any changes");
     356                }
     357            }
     358            if (conf_pane_name.matches("TOMCAT")){
     359                tomcat_server_up = false;
     360                tomcat_server_up = checkTomcatServer();
     361                if (tomcat_server_up) {
     362                JOptionPane.showMessageDialog((Component) null,"TOMCAT is running, shutdown the TOMCAT server before making any changes");
     363                }
     364            }   
     365            }
     366        }
     367        });
     368    conf_setting_table.addKeyListener(new KeyAdapter(){
     369        public void keyPressed(KeyEvent ke){
     370            if (ke.getKeyCode() == KeyEvent.VK_F2){
     371            if (conf_pane_name.matches("MYSQL")){
     372                mysql_server_up = checkMysqlServer();
     373                if (mysql_server_up) {
     374                JOptionPane.showMessageDialog((Component) null,"MySQL is running, shutdown the MySQL server before making any changes");
     375                }
     376            }
     377            if (conf_pane_name.matches("TOMCAT")){
     378                tomcat_server_up = checkTomcatServer();
     379                if (tomcat_server_up) {
     380                JOptionPane.showMessageDialog((Component) null,"TOMCAT is running, shutdown the TOMCAT server before making any changes");
     381                }
     382            }
     383            }
     384        }
     385        });
     386   
    362387    //Set up tableHeader
    363     JTableHeader header = conf_setting_table.getTableHeader();
    364     header.setFont(new Font("Arial", Font.BOLD, 14));
    365    
     388    JTableHeader table_header = conf_setting_table.getTableHeader();
     389    Dimension table_header_preferred_size = table_header.getPreferredSize();
     390    if (table_header_preferred_size.height < MINIMUM_TABLE_HEADER_SIZE) {
     391        table_header_preferred_size.setSize(table_header_preferred_size.width, MINIMUM_TABLE_HEADER_SIZE);
     392        table_header.setPreferredSize(table_header_preferred_size);
     393    }
     394
     395    table_header.setFont(new Font("Arial", Font.BOLD, 13));
    366396    conf_setting_table.setRowHeight(30);
    367397    conf_table_pane = new JScrollPane(conf_setting_table);
    368 
     398    conf_table_pane.setVisible(false);
     399    conf_table_pane.getViewport().setBackground(Configuration.getColor("coloring.collection_tree_background", false));
     400   
    369401    // Layout Components
    370402    confList_pane.setLayout(new BorderLayout());
     
    372404    confList_pane.add(conf_treeView, BorderLayout.CENTER);
    373405    confList_pane.add(confList_label, BorderLayout.NORTH);
    374    
    375406    confContent_pane.setLayout(new BorderLayout());
    376407    confContent_pane.add(conf_table_pane, BorderLayout.CENTER);
    377408   
     409    inner_button_pane.setLayout(new GridLayout(1,2));
    378410    inner_control_pane.setLayout (new BorderLayout());
    379411    inner_control_pane.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));
     
    382414    inner_control_pane.add (inner_button_pane, BorderLayout.CENTER);
    383415   
    384     // Outter Button Layout
    385     //outter_button_pane.setLayout (new GridLayout(1,2));
    386     //outter_button_pane.add(reload_button);
    387     //outter_button_pane.add(delete_button);
    388     //outter_button_pane.add(exit_button);
    389    
    390     /*outter_control_pane.setLayout (new BorderLayout());
    391     outter_control_pane.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    392     outter_control_pane.setPreferredSize(new Dimension(50,50));
    393     outter_control_pane.setSize(new Dimension(50,50));
    394     outter_control_pane.add (outter_button_pane, BorderLayout.CENTER);*/
    395 
    396416    main_contentPane.setLayout (new BorderLayout());
    397417    main_contentPane.add(confContent_label, BorderLayout.NORTH);
     
    400420    main_conf_pane.add(confList_pane, JSplitPane.LEFT);
    401421    main_conf_pane.add(main_contentPane, JSplitPane.RIGHT);
    402     main_conf_pane.setDividerLocation(LIST_SIZE.width - 10);   
     422    main_conf_pane.setDividerLocation(LIST_SIZE.width - 10);
    403423   
    404424    this.setLayout(new BorderLayout());
     
    406426    }
    407427   
    408     /*private class ExitButtonListener
    409     implements ActionListener {
    410     // Exit the Adminstration tool
    411     public void actionPerformed(ActionEvent event) {
    412         if (valueChanged) {
    413         int result = JOptionPane.showConfirmDialog((Component) null, "The value of configuration has been changed,do you really want to exit?", "Exit Confirmation", JOptionPane.YES_NO_OPTION);
    414         if ( result == JOptionPane.YES_OPTION) {
    415             System.exit(1);
    416         } else if (result == JOptionPane.NO_OPTION) {
    417             JOptionPane.showMessageDialog((Component) null,"Press Save Change button to save the change!");
    418         }
    419         } else {
    420         System.exit(1);
    421         }
    422     }
    423     }*/
    424 
    425428    private class StartupTomcatButtonListener
    426429    implements ActionListener {
    427430    public void actionPerformed(ActionEvent event) {
     431        /*before startup Tomcat server, we want to make sure project and Site configuration
     432         * files are saved*/
     433        if (project_conf_changed) {
     434        saveProjectConf(GAI.build_file);
     435        }
     436        /*boolean site_conf_changed = site_conf.confChanged();
     437        boolean interface_conf_changed=interface_conf.confChanged();
     438        if (site_conf_changed) {
     439        site_conf.saveFile(site_conf_file);
     440        }
     441        if (interface_conf_changed) {
     442        interface_conf.saveFile(interface_conf_file);
     443        }*/
    428444        tomcat_server_up = checkTomcatServer();
    429445        if (!tomcat_server_up) {
    430         //ParsingProgress progressBar = new ParsingProgress("Startup Tomcat Server", "Starting up the Tomcat Server", 10);
    431446        ThreadControl threadControl = new ThreadControl();
    432447        Runnable startupTomcatThread = threadControl.new startupTomcatServer("start-tomcat");
    433448        new Thread(startupTomcatThread).start();
    434         //if over two seconds
    435         // activae progress bar
    436         /*progressBar.dispose();
    437         progressBar.destroy();
    438         progressBar = null;*/
    439449        threadControl.destroy();
    440450        tomcat_server_up = true;
    441         JOptionPane.showMessageDialog((Component) null,"The Tomcat server has been Startup successfully!"); 
     451        JOptionPane.showMessageDialog((Component) null,"Tomcat server has been Startup successfully!"); 
    442452        } else {
    443453        JOptionPane.showMessageDialog((Component) null,"Tomcat server is running");
     
    452462        tomcat_server_up = checkTomcatServer();
    453463        if (tomcat_server_up){
    454         int result = JOptionPane.showConfirmDialog((Component) null, "Are you sure that you want to shutdown the Tomcat server?", "Shutdown Confirmation", JOptionPane.YES_NO_OPTION);
    455         if (result == JOptionPane.YES_OPTION) {
    456             // ParsingProgress progressBar = new ParsingProgress("Shutdown Tomcat Server", "Shutting down the Tomcat Server", 10);
    457             ThreadControl threadControl = new ThreadControl();
    458             Runnable shutdownTomcatThread = threadControl.new shutdownTomcatServer("stop-tomcat");
    459             new Thread(shutdownTomcatThread).start();
    460             /*progressBar.dispose();
    461             progressBar.destroy();
    462             progressBar = null;*/
    463             threadControl.destroy();
    464             tomcat_server_up = false;               
    465             JOptionPane.showMessageDialog((Component) null,"The Tomcat server has been Shutdown successfully !");
    466         } else if (result == JOptionPane.NO_OPTION) {
    467             JOptionPane.showMessageDialog((Component) null,"Cancel to Shutdown the Tomcat server!");
    468         }   
     464        ThreadControl threadControl = new ThreadControl();
     465        Runnable shutdownTomcatThread = threadControl.new shutdownTomcatServer("stop-tomcat");
     466        new Thread(shutdownTomcatThread).start();
     467        threadControl.destroy();
     468        tomcat_server_up = false;
     469        JOptionPane.showMessageDialog((Component) null, "Tomcat server has been shutted down !");
    469470        } else {
    470         JOptionPane.showMessageDialog((Component) null,"The Tomcat server was not running!");
     471        JOptionPane.showMessageDialog((Component) null,"Tomcat server was not running!");
    471472        }
    472473        changeTomcatButtonPane2();
     
    477478    implements ActionListener {
    478479    public void actionPerformed(ActionEvent event) {
     480        //before we restart Tomcat server, we want to make sure the conf_pane settings are saved
     481        if (project_conf_changed) {
     482        saveProjectConf(GAI.build_file);
     483        }
     484        /*boolean site_conf_changed = site_conf.confChanged();
     485        boolean interface_conf_changed=interface_conf.confChanged();
     486        if (site_conf_changed) {
     487        site_conf.saveFile(site_conf_file);
     488        }
     489        if (interface_conf_changed) {
     490        interface_conf.saveFile(interface_conf_file);
     491        }*/
    479492        tomcat_server_up = checkTomcatServer();
    480493        if (tomcat_server_up) {
    481494        ThreadControl threadControl = new ThreadControl();
    482495        Runnable restartTomcatThread = threadControl.new restartTomcatServer("restart-tomcat");
    483         new Thread(restartTomcatThread).start();
     496        new Thread(restartTomcatThread).start();
    484497        threadControl.destroy();
    485498        tomcat_server_up = true;
    486         JOptionPane.showMessageDialog((Component) null,"The Tomcat server has been Restarted successfully!");
     499        JOptionPane.showMessageDialog((Component) null,"Tomcat server has been Restarted successfully!");
    487500        } else {
    488501        JOptionPane.showMessageDialog((Component) null,"Tomcat server was not running!");
     
    490503    }
    491504    }
    492 
    493 
     505   
    494506    private class StartupMysqlButtonListener
    495507    implements ActionListener {
    496508    public void actionPerformed(ActionEvent event) {
     509        //before we startup the MySQL server, we want to make sure the Conf_pane settings are saved
     510        saveProjectConf(GAI.build_file);
    497511        mysql_server_up = checkMysqlServer();
    498512        if (!mysql_server_up) {
     
    501515        new Thread(startupMysqlThread).start();
    502516        threadControl.destroy();
    503         JOptionPane.showMessageDialog((Component) null,"The MYSQL server has been Startup successfully!"); 
    504517        mysql_server_up = true;
     518        JOptionPane.showMessageDialog((Component) null,"MYSQL server has been Startup successfully!"); 
    505519        } else {
    506520        JOptionPane.showMessageDialog((Component) null,"MYSQL server has been running");   
     
    515529        mysql_server_up = checkMysqlServer();
    516530        if (mysql_server_up){
    517         int result = JOptionPane.showConfirmDialog((Component) null, "Are you sure that you want to shutdown the MYSQL server?", "Shutdown Confirmation", JOptionPane.YES_NO_OPTION);
    518         if (result == JOptionPane.YES_OPTION) {
    519             ThreadControl threadControl = new ThreadControl();
    520             Runnable shutdownMysqlThread = threadControl.new shutdownMysqlServer("stop-mysql");
    521             new Thread(shutdownMysqlThread).start();
    522             threadControl.destroy();
    523             JOptionPane.showMessageDialog((Component) null,"The MYSQL server has been Shutdown successfully !");
    524             mysql_server_up = false;
    525         } else if (result == JOptionPane.NO_OPTION) {
    526             JOptionPane.showMessageDialog((Component) null,"Cancel to Shutdown the MYSQL server!");
    527         }   
     531        ThreadControl threadControl = new ThreadControl();
     532        Runnable shutdownMysqlThread = threadControl.new shutdownMysqlServer("stop-mysql");
     533        new Thread(shutdownMysqlThread).start();
     534        threadControl.destroy();
     535        JOptionPane.showMessageDialog((Component) null,"MYSQL server has been Shutdown successfully !");
     536        mysql_server_up = false;
    528537        } else {
    529         JOptionPane.showMessageDialog((Component) null,"The MYSQL server was not running!");
     538        JOptionPane.showMessageDialog((Component) null,"MYSQL server was not running!");
    530539        }
    531540        changeMysqlButtonPane2();
    532541    }
    533542    }
    534 
     543   
    535544    private class RestartMysqlButtonListener
    536545    implements ActionListener {
    537546    public void actionPerformed(ActionEvent event) {
     547        saveProjectConf(GAI.build_file);
    538548        mysql_server_up = checkMysqlServer();
    539549        if (mysql_server_up) {
     
    545555        mysql_server_up = true;
    546556        } else {
    547         JOptionPane.showMessageDialog((Component) null,"MYSQL server was not running, use startup button to start the MYSQL server!");
    548         }
    549     }
    550     }
    551 
    552     private class SaveButtonListener
    553     implements ActionListener {
    554     public void actionPerformed(ActionEvent event) {
    555        
    556         if (!valueChanged) {
    557         JOptionPane.showMessageDialog((Component) null,"The configuration value has not been changed!");
    558         } else {
    559         int result = JOptionPane.showConfirmDialog((Component) null, "Do you really want to save the change", "Save Confirmation", JOptionPane.YES_NO_OPTION);
    560         if ( result == JOptionPane.YES_OPTION) {
    561             saveNewConfSetting();
    562             writeConfFile(GAI.build_file);
    563             valueChanged = false;
    564         } else if (result == JOptionPane.NO_OPTION) {
    565             valueChanged = true;
    566         }
    567         }
    568        
    569     }
    570     }
    571    
    572     public void saveNewConfSetting(){
    573     String new_string;
    574     for (int i=0; i < conf_display.length; i++){
    575         if (!conf_display[i][1].toString().matches("^\\s*$")){
    576         for (int j=0; j < conf_array.size(); j++){
    577             if (((String)conf_array.get(j)).startsWith(conf_display[i][1].toString().toLowerCase())){
    578             new_string = conf_display[i][1].toString()+"="+conf_display[i][2].toString();
    579             conf_array.set(j, new_string.toLowerCase());
    580             }
    581         }
    582         }
    583     }
    584    
    585     }
    586    
    587 
    588     public void writeConfFile(File file){
     557        JOptionPane.showMessageDialog((Component) null,"MYSQL server was not running!");
     558        }
     559    }
     560    }
     561
     562    // Save the configuration file globally,when click File->Save or restart (or startup) Tomcat and MySQl server
     563    public void saveProjectConf(File file){
     564        String new_string;
     565    Enumeration keys = conf_table.keys();
     566    String key;
     567    String value;
    589568    String filename = file.getPath();
     569    while (keys.hasMoreElements()) {
     570        key = (String) keys.nextElement();
     571        value = (String) conf_table.get(key);
     572        for (int j=0 ; j < conf_array.size(); j++){
     573        if (((String)conf_array.get(j)).startsWith(key.toLowerCase())){
     574            new_string = key+"="+value;
     575            conf_array.set(j, new_string.toLowerCase());
     576        }
     577        }
     578    }
     579
    590580    try {
    591581        BufferedWriter conf_out = new BufferedWriter(new FileWriter(filename));
     
    596586        conf_out.close();
    597587        getConfContent();
     588        project_conf_changed = false;
    598589    } catch (Exception e) {
    599590        e.printStackTrace();
     
    601592    }
    602593
     594    public boolean ProjectConfChanged() {
     595    return project_conf_changed;
     596    }
    603597
    604598    public void getConfContent(){
    605     System.err.println("GAI Build file:" + GAI.build_file);
    606 
    607599    String filename = GAI.build_file.getPath();
    608 
    609600    if (!GAI.build_file.exists()){
    610601        JOptionPane.showMessageDialog((Component) null,"Build property file does not exist"); 
    611         //reload_button.setEnabled(false);
    612602    } else {
    613         readFile(filename);
    614     }
    615     save_button.setEnabled(true);
    616     }
    617    
    618     public void readFile (String filename) {
     603        readProjectConf(filename);
     604    }
     605    }
     606   
     607    /* Read build.properties file
     608     * @param
     609     */
     610    public void readProjectConf (String filename) {
    619611    String fileLine;
    620612    /*inside the array will store, the conf_setting[i][0]:Comment,
    621      *conf_setting[i][1]:Para and conf_setting[i][2]:Value
     613     * conf_setting[i][1]:Para and conf_setting[i][2]:Value
    622614     * conf_array[] store all the details from the build.properties*/
    623615    conf_array = new ArrayList();
     
    626618        BufferedReader conf_in = new BufferedReader(new FileReader(filename));
    627619        int i = 0;
    628         int j = 0;
    629620        while ((fileLine = conf_in.readLine()) != null) {
    630621        // This is an empty line
     
    642633            int end_index = fileLine.indexOf("=");
    643634            conf_setting[i][1] = fileLine.substring(0,end_index).toUpperCase();
    644             conf_setting[i][2] = fileLine.substring(end_index+1);
     635            conf_setting[i][2] = fileLine.substring(end_index+1);
     636            conf_table.put(conf_setting[i][1], conf_setting[i][2]);
    645637            i++; //calculat the number of settings
    646638            conf_array.add(fileLine);
     
    650642        }
    651643        num_of_setting = i;
     644        for (int j=0; j<num_of_setting; j++){
     645        if (conf_setting[j][1].toString().matches("TOMCAT.SERVER")){
     646            tomcat_server = conf_setting[j][2].toString();
     647        }
     648        if (conf_setting[j][1].toString().matches("TOMCAT.PORT")){
     649            tomcat_port = conf_setting[j][2].toString();
     650        }
     651        if (conf_setting[j][1].toString().matches("MYSQL.ADMIN.USER")){
     652            mysql_adminuser = conf_setting[j][2].toString();
     653        }
     654        if (conf_setting[j][1].toString().matches("MYSQL.SERVER")){
     655            mysql_server = conf_setting[j][2].toString();
     656        }
     657        if (conf_setting[j][1].toString().matches("MYSQL.PORT")){
     658            mysql_port = conf_setting[j][2].toString();
     659        }   
     660        }
    652661        conf_in.close();
    653662    } catch (Exception e) {
     
    656665    }
    657666   
    658     public void showConfSetting(String conf_param) {
    659     clearTable();
    660     int j=0;
    661     for (int i=0; i< num_of_setting; i++){
    662         if (conf_setting[i][1].toString().matches("^("+ conf_param +").+")) {
    663         if (conf_setting[i][1].toString().matches("TOMCAT.SERVER")){
    664             tomcat_server = conf_setting[i][2].toString();
    665         }
    666         if (conf_setting[i][1].toString().matches("TOMCAT.PORT")){
    667             tomcat_port = conf_setting[i][2].toString();
    668         }
    669         if (conf_setting[i][1].toString().matches("MYSQL.ADMIN.USER")){
    670             mysql_adminuser = conf_setting[i][2].toString();
    671         }
    672         if (conf_setting[i][1].toString().matches("MYSQL.SERVER")){
    673             mysql_server = conf_setting[i][2].toString();
    674         }
    675         if (conf_setting[i][1].toString().matches("MYSQL.PORT")){
    676             mysql_port = conf_setting[i][2].toString();
    677         }   
    678         conf_display[j][0] = conf_setting[i][0];
    679             conf_display[j][1] = conf_setting[i][1];
    680         conf_display[j][2] = conf_setting[i][2];
    681         j++;
    682         }
    683     }
    684     }
    685    
     667
    686668    public void clearTable (){
    687669    for (int i=0; i< rowLength; i++){
     
    709691        } 
    710692        } else {
    711         System.err.println("Etiher tomcat server or tomcat port was not set properly");
     693        System.err.println("Either Tomcat server or Tomcat port was not set properly");
    712694        }
    713695    } catch (Exception ex) {
     696        tomcat_server_up = false;
    714697        System.err.println(ex.getMessage());
    715698    }
     
    723706        String mysql_password = "";
    724707        String mysql_url ="jdbc:mysql://"+mysql_server+":"+mysql_port+"/localsite_gs3mgdemo";
    725         System.err.println("what is Mysql_URL:" + mysql_url);
     708        //System.err.println("what is Mysql_URL:" + mysql_url);
    726709        Class.forName("com.mysql.jdbc.Driver").newInstance();
    727710        conn = DriverManager.getConnection(mysql_url, mysql_userName, mysql_password);
    728         System.err.println("MYSQL Server connection:" + conn);
    729711        if (conn == null) {
    730         //System.err.println("Connection is failed");
    731712        mysql_server_up =false;
    732713        } else {
     
    734715        }
    735716    } catch (Exception e) {
     717        mysql_server_up = false;
    736718        System.err.println("Cannot connect to database server");
    737719    }
    738720    return mysql_server_up;
    739721    }
    740    
    741     class ConfTableModel extends AbstractTableModel {
     722   
     723    public class ConfSettingTableModel
     724    extends AbstractTableModel
     725    {
    742726    String[] columnNames = {"Configuration Parameter",
    743                 "Configuration Value"};
     727    "Configuration Value"};
    744728   
    745729    public int getColumnCount(){
    746         return columnNames.length;
    747     }
    748 
     730    return columnNames.length;
     731    }
     732   
    749733    public int getRowCount() {
    750         return conf_display.length;
     734    return display_row_count;
    751735    }
    752736   
    753737    public String getColumnName(int col){
     738       
    754739        return columnNames[col];
    755740    }
    756 
     741   
    757742    public Object getValueAt(int row,int col){
    758743        return conf_display[row][col+1];
     
    760745   
    761746    public boolean isCellEditable(int row, int col){
    762         if (col == 0){
     747        if (col==0){
    763748        return false;
    764         } else {
    765         return true;
    766         }
    767     }
    768 
     749        } else if (conf_display[row][col].toString().matches("MYSQL.+")){
     750        mysql_server_up = checkMysqlServer();
     751        if (mysql_server_up) {
     752            return false;
     753        }
     754        } else if (conf_display[row][col].toString().matches("TOMCAT.+")){
     755        tomcat_server_up = checkTomcatServer();
     756        if (tomcat_server_up) {
     757           return false;
     758        }
     759        }
     760        return true;
     761    }
     762   
    769763    public void setValueAt(Object value, int row, int col){
     764        if (!isCellEditable(row, col))
     765        return;
    770766        conf_display[row][col+1] = value;
     767        project_conf_changed = true;
     768        //System.err.println("**ConfDisplay:" + conf_display[row][col].toString());
     769        conf_table.put(conf_display[row][col].toString(), value);
    771770        fireTableCellUpdated(row,col+1);
    772         valueChanged = true;
    773     }
    774     }
    775 
     771        updateUI();
     772    }
     773    }
     774
     775    public int showProjectConf(String conf_param) {
     776    conf_table_pane.setVisible(true);
     777    clearPrevConfPane();
     778    confContent_pane.add(conf_table_pane, BorderLayout.CENTER);
     779    confContent_pane.revalidate(); 
     780    clearTable();
     781    int j=0;
     782    int row_count = 0;
     783    for (int i=0; i< num_of_setting; i++){
     784        if (conf_setting[i][1].toString().matches("^("+ conf_param +").+")) {
     785        row_count = row_count +1;
     786        conf_display[j][0] = conf_setting[i][0];
     787            conf_display[j][1] = conf_setting[i][1];
     788        conf_display[j][2] = conf_table.get(conf_setting[i][1]);
     789        j++;
     790        }
     791    }
     792    return row_count;
     793    }
     794     
     795    public void displaySiteConf(SiteConfSetting site_conf_tmp){
     796    clearPrevConfPane();
     797    confContent_pane.add(site_conf_tmp, BorderLayout.CENTER);
     798    try {
     799        site_conf_tmp.showText();
     800        site_conf_tmp.goTop();
     801        confContent_pane.revalidate();
     802    } catch (Exception e) {
     803        e.printStackTrace();
     804    }   
     805     }
     806   
     807    public void clearPrevConfPane() {
     808    confContent_pane.remove(conf_table_pane);
     809    confContent_pane.remove(site_conf);
     810    confContent_pane.remove(interface_conf);
     811    }
     812   
     813   
    776814    private class ConfTreeListener implements TreeSelectionListener{
    777     String conf_param;
    778815    public void valueChanged (TreeSelectionEvent e){
    779816        String option = conf_tree.getLastSelectedPathComponent().toString();
     817        conf_table_pane.setVisible(true);
    780818        if (option == "Compile"){
    781         if (valueChanged){
    782             JOptionPane.showMessageDialog((Component) null,"The configuration setting has been changed, please save the change");
     819        conf_pane_name = "COMPILE";
     820        display_row_count = showProjectConf(conf_pane_name);
     821        inner_button_pane.removeAll();
     822        inner_button_pane.setLayout(new GridLayout(1,3));
     823        } else if (option == "Tomcat"){
     824        conf_pane_name ="TOMCAT";
     825        display_row_count = showProjectConf(conf_pane_name);
     826        //Setup Tomcat button control pane
     827        inner_button_pane.removeAll();
     828        inner_button_pane.setLayout(new GridLayout(1,3));
     829        if (checkTomcatServer()) {
     830            changeTomcatButtonPane1();
    783831        } else {
    784             conf_param = "COMPILE";
    785             //conf_tree.setToolTipText("The Configuration Setting for the Compilation ");
    786             inner_button_pane.removeAll();
    787             inner_button_pane.setLayout(new GridLayout(1,3));
    788             inner_button_pane.add(save_button);
    789             save_button.setEnabled(true);
    790             showConfSetting(conf_param);
    791             updateUI();
    792         }
    793         } else if (option == "Tomcat"){
    794         if (valueChanged) {
    795             JOptionPane.showMessageDialog((Component) null,"The configuration setting has been changed, please save the change");
     832            changeTomcatButtonPane2();
     833        }
     834        } else if (option =="Proxy"){
     835        conf_pane_name="PROXY";
     836        display_row_count = showProjectConf(conf_pane_name);
     837        //Setup Proxy button control pane
     838        inner_button_pane.removeAll();
     839        inner_button_pane.setLayout(new GridLayout(1,3));
     840        } else if (option == "MySQL"){
     841        conf_pane_name="MYSQL";
     842        display_row_count = showProjectConf(conf_pane_name);
     843        // Setup MySQL button control pane
     844        inner_button_pane.removeAll();
     845        inner_button_pane.setLayout(new GridLayout(1,3));
     846        if (checkMysqlServer()) {
     847            changeMysqlButtonPane1();
    796848        } else {
    797             conf_param ="TOMCAT";
    798             showConfSetting(conf_param);
    799             //Setup Tomcat button control pane
    800             inner_button_pane.removeAll();
    801             inner_button_pane.setLayout(new GridLayout(1,3));
    802             if (checkTomcatServer()) {
    803             changeTomcatButtonPane1();
    804             } else {
    805             changeTomcatButtonPane2();
    806             }
    807             updateUI();
    808         }
    809         } else if (option =="Proxy"){
    810         if (valueChanged) {
    811             JOptionPane.showMessageDialog((Component) null,"The configuration setting has been changed, please save the change");
    812         } else {   
    813             conf_param="PROXY";
    814             showConfSetting(conf_param);
    815             //conf_tree.setToolTipText("The Configuration Setting for the Proxy Server");
    816             inner_button_pane.removeAll();
    817             inner_button_pane.setLayout(new GridLayout(1,3));
    818             inner_button_pane.add(save_button);
    819             save_button.setEnabled(true);
    820             updateUI();
    821         }
    822         } else if (option == "Mysql"){
    823         if (valueChanged) {
    824             JOptionPane.showMessageDialog((Component) null,"The configuration setting has been changed, please save the change");
    825         } else {
    826             conf_param="MYSQL";
    827             showConfSetting(conf_param);
    828             //conf_tree.setToolTipText("The Configuration Setting for the MYSQL Server");
    829             // Setup MySQL button control pane
    830             inner_button_pane.removeAll();
    831             inner_button_pane.setLayout(new GridLayout(1,3));
    832             if (checkMysqlServer()) {
    833             changeMysqlButtonPane1();
    834             } else {
    835             changeMysqlButtonPane2();
    836             }
    837             updateUI();
     849            changeMysqlButtonPane2();
    838850        }
    839851        } else if (option == "GSDL"){
    840         if (valueChanged) {
    841             JOptionPane.showMessageDialog((Component) null,"The configuration setting has been changed, please save the change");
    842         } else {
    843             showConfSetting(conf_param);
    844             //conf_tree.setToolTipText("The Configuration Setting for the GSDL");
    845             inner_button_pane.removeAll();
    846             inner_button_pane.setLayout(new GridLayout(1,3));
    847             inner_button_pane.add(save_button);
    848             save_button.setEnabled(true);       
    849             conf_param ="GSDL";
    850             updateUI();
    851         }
    852         } else if (option == "Conf 2"){
    853         //MysqlInstall mysql =
    854         JOptionPane.showMessageDialog((Component) null,"This has not been defined yet!");       
    855         } else if (option == "Conf 3") {
    856         clearTable();
    857         JOptionPane.showMessageDialog((Component) null,"This has not been defined yet!");
    858         }
    859     }
    860     }
     852        conf_pane_name ="GSDL";
     853        display_row_count = showProjectConf(conf_pane_name);
     854        inner_button_pane.removeAll();
     855        } else if (option == "SiteConfig"){
     856        conf_pane_name = "SiteConfig";
     857        inner_button_pane.removeAll();
     858        displaySiteConf(site_conf);
     859        } else if (option == "InterfaceConfig") {
     860        conf_pane_name = "InterfaceConfig";
     861        inner_button_pane.removeAll();
     862        displaySiteConf(interface_conf);
     863        }
     864        updateUI();
     865    }
     866    }
     867
    861868    public void modeChanged (int mode){
    862869    return;
     
    869876    public void changeTomcatButtonPane1 (){
    870877    inner_button_pane.removeAll();
    871     inner_button_pane.setLayout(new GridLayout(1,3));
     878    inner_button_pane.setLayout(new GridLayout(1,2));
    872879    inner_button_pane.add(restart_tomcat_button);
    873880    inner_button_pane.add(shutdown_tomcat_button);
    874     inner_button_pane.add(save_button);
    875881    restart_tomcat_button.setEnabled (true);
    876882    shutdown_tomcat_button.setEnabled (true);
    877     save_button.setEnabled (true); 
    878883    updateUI();
    879884    }
    880885    public void changeTomcatButtonPane2 (){
    881886    inner_button_pane.removeAll();
    882     inner_button_pane.setLayout(new GridLayout(1,3));
     887    inner_button_pane.setLayout(new GridLayout(1,2));
    883888    inner_button_pane.add(startup_tomcat_button);
    884889    inner_button_pane.add(shutdown_tomcat_button);
    885     inner_button_pane.add(save_button);
    886     shutdown_tomcat_button.setEnabled (true);
    887890    startup_tomcat_button.setEnabled (true);
    888     save_button.setEnabled (true);
     891    shutdown_tomcat_button.setEnabled (false);
    889892    updateUI();
    890893    }   
    891894    public void changeMysqlButtonPane1 (){
    892895    inner_button_pane.removeAll();
    893     inner_button_pane.setLayout(new GridLayout(1,3));
     896    inner_button_pane.setLayout(new GridLayout(1,2));
    894897    inner_button_pane.add(restart_mysql_button);
    895898    inner_button_pane.add(shutdown_mysql_button);
    896     inner_button_pane.add(save_button);
    897899    restart_mysql_button.setEnabled (true);
    898900    shutdown_mysql_button.setEnabled (true);
    899     save_button.setEnabled (true); 
    900901    updateUI();
    901902    }
    902903    public void changeMysqlButtonPane2 (){
    903904    inner_button_pane.removeAll();
    904     inner_button_pane.setLayout(new GridLayout(1,3));
     905    inner_button_pane.setLayout(new GridLayout(1,2));
    905906    inner_button_pane.add(startup_mysql_button);
    906907    inner_button_pane.add(shutdown_mysql_button);
    907     inner_button_pane.add(save_button);
    908     shutdown_mysql_button.setEnabled (true);
    909908    startup_mysql_button.setEnabled (true);
    910     save_button.setEnabled (true);
     909    shutdown_mysql_button.setEnabled (false);
    911910    updateUI();
    912911    }   
    913 }
    914        
    915 
     912    public void afterDisplay(){
     913    return;
     914    }
     915}
     916
  • branches/ant-install-branch/gsdl3/src/java/org/greenstone/admin/gui/LogPane.java

    r9972 r10793  
    4646import javax.swing.tree.*;
    4747
     48import org.greenstone.admin.GAIManager;
     49import org.greenstone.admin.GAI;
    4850import org.greenstone.core.Configuration;
    4951import org.greenstone.core.Dictionary;
    5052import org.greenstone.core.util.Utility;
    51 import org.greenstone.admin.GAIManager;
    52 import org.greenstone.admin.GAI;
    5353
    5454/** The Log pane is to view the status of relevant log files in GSIII
     
    6060    implements ActionListener {
    6161
    62     // Main Pane
    63     //protected JSplitPane main_pane = null;
    64 
    6562    /* The pane to demonstrate log information, including  the log files being
    6663     *monitored and their content*/
     
    9390    /** Buttons */
    9491    private JButton reload_button = null;
    95     private JButton delete_button = null;
    96     private JButton exit_button = null;
     92    private JButton clear_button = null;
    9793
    9894    /*The pane which contains the controls for log files */
     
    108104    //Constructor
    109105    public LogPane() {
    110 
     106   
    111107    // create all the necessary panes
    112108    control_pane = new JPanel();
     
    134130    // Buttons
    135131    ReloadButtonListener rbl = new ReloadButtonListener();
    136     DeleteButtonListener dbl = new DeleteButtonListener();
    137     //ExitButtonListener ebl = new ExitButtonListener();
    138     ImageIcon reloadButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/Refresh16.gif");
    139     ImageIcon deleteButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/Delete16.gif");
    140     ImageIcon exitButtonIcon = new ImageIcon(GAI.admin_path + "images/exit16.gif");
    141    
    142     reload_button = new JButton("Reload", reloadButtonIcon);
     132    ClearButtonListener dbl = new ClearButtonListener();
     133    ImageIcon reloadButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/Refresh16.gif");
     134    ImageIcon clearButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/Delete16.gif");
     135
     136    //reload_button = new JButton("Reload", reloadButtonIcon);
     137    reload_button = new JButton();
    143138    reload_button.addActionListener(rbl);
     139    reload_button.setEnabled(false);
    144140    reload_button.setMnemonic(KeyEvent.VK_R);
    145     reload_button.setToolTipText("Click this button to reload the log file");
    146     //Dictionary.registerBoth(build_button, "CreatePane.Build_Collection", "CreatePane.Build_Collection_Tooltip");
    147 
    148     delete_button = new JButton("Delete", deleteButtonIcon);
    149     delete_button.addActionListener(dbl);
    150     delete_button.setEnabled(false);
    151     delete_button.setMnemonic(KeyEvent.VK_D);
    152     delete_button.setToolTipText("Click this button to delete the log file");
    153     //Dictionary.registerBoth(cancel_button, "CreatePane.Cancel_Build", "CreatePane.Cancel_Build_Tooltip");*/
    154 
    155     /*exit_button = new JButton("Exit", exitButtonIcon);
    156     exit_button.setToolTipText("Click this button to exit the viewing");   
    157     exit_button.addActionListener(ebl);
    158     exit_button.setEnabled(true);
    159     exit_button.setMnemonic(KeyEvent.VK_E);*/
     141    Dictionary.registerBoth(reload_button, "LogPane.Reload_Log", "LogPane.Reload_Log_Tooltip");
     142
     143    clear_button = new JButton();
     144    clear_button.addActionListener(dbl);
     145    clear_button.setEnabled(false);
     146    clear_button.setMnemonic(KeyEvent.VK_C);
     147    Dictionary.registerBoth(clear_button, "LogPane.Clear_Log", "LogPane.Clear_Log_Tooltip");
    160148
    161149    rbl = null;
    162150    dbl = null;
    163     //ebl = null;   
    164151    }
    165152
     
    181168    logList_pane = new JPanel();
    182169    logList_pane.setBorder(BorderFactory.createLoweredBevelBorder());
    183     logList_label = new JLabel("Log Files");
     170    logList_label = new JLabel();
    184171    logList_label.setOpaque(true);
    185172    logList_label.setBackground(Configuration.getColor("coloring.workspace_heading_background", false));
    186173    logList_label.setForeground(Configuration.getColor("coloring.workspace_heading_foreground", false));
    187     //Dictionary.registerText(logList_label, "Log.List");
     174    Dictionary.registerText(logList_label, "LogPane.Log_List");
    188175
    189176    // logContent_Pane
     
    192179    logContent_pane.setBackground(Configuration.getColor("coloring.workspace_selection_background", false));
    193180    logContent_pane.setForeground(Configuration.getColor("coloring.workspace_selection_foreground", false));
    194     logContent_label = new JLabel("Log Content");
     181    logContent_label = new JLabel();
    195182    logContent_label.setOpaque(true);
    196     logContent_label.setBackground(Configuration.getColor("coloring.workspace_heading_background", false));
    197     logContent_label.setForeground(Configuration.getColor("coloring.workspace_heading_foreground", false));
    198     //Dictionary.registerText(logContent_label, "Log.Content");
     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");
    199186
    200187    // TEXTAREA Layout
     
    204191    button_pane.setLayout (new GridLayout(1,3));
    205192    button_pane.add(reload_button);
    206     button_pane.add(delete_button);
    207     //button_pane.add(exit_button);
     193    button_pane.add(clear_button);
    208194   
    209195    control_pane.setLayout (new BorderLayout());
     
    251237    repaint();
    252238    }*/
    253 
     239   
    254240    /** Implementation side-effect, not used in any way.
    255241     * @param event A <strong>FocusEvent</strong> containing details about the focus action performed.
     
    257243    /*public void focusLost(FocusEvent event) {
    258244      }*/
    259 
     245   
    260246    /** Called to inform this control panel that it has just gained focus as an effect of the user clicking on its tab.
    261247     */
     
    273259    workspace_filter.setEditable(mode > Configuration.LIBRARIAN_MODE);
    274260    }*/
    275 
    276 
    277     /** Refresh this pane, depending on what has just happened (refresh_reason). */
    278     /*public void refresh(int refresh_reason, boolean collection_loaded)
    279     {
    280     if (collection_loaded) {
    281         // Update collection label
    282         Dictionary.registerText(collection_label, "Collection.Collection");
    283         collection_label.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
    284         collection_label.setForeground(Configuration.getColor("coloring.collection_heading_foreground", false));
    285 
    286         // Update collection tree
    287         if (refresh_reason == Gatherer.COLLECTION_OPENED) {
    288         collection_tree.setModel(Gatherer.c_man.getCollectionTreeModel());
    289         }
    290         // Update collection filter
    291         collection_filter.setBackground(Configuration.getColor("coloring.collection_heading_background", false));
    292     }
    293     else {
    294         // Update collection label
    295         String[] args = new String[1];
    296         args[0] = Dictionary.get("Collection.No_Collection");
    297         Dictionary.registerText(collection_label, "Collection.Collection", args);
    298         collection_label.setBackground(Color.lightGray);
    299         collection_label.setForeground(Color.black);
    300 
    301         // Update collection tree
    302         collection_tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode("Error")));
    303 
    304         // Update collection filter
    305         collection_filter.setBackground(Color.lightGray);
    306     }
    307 
    308     // Enable or disable the controls
    309     workspace_tree.setEnabled(true);
    310     collection_tree.setEnabled(collection_loaded);
    311     collection_filter.setEnabled(collection_loaded);
    312     bin_button.setEnabled(collection_loaded);
    313     new_folder.setEnabled(collection_loaded);
    314    
    315     // Ensure that this collection tree view is synchronized with all others
    316     collection_tree_sync.add(collection_tree);
    317     }*/
    318261   
    319262    private class KeyListenerImpl
     
    322265    public void keyReleased(KeyEvent event) {
    323266    }
    324    
    325267    // we need to watch for left clicks on an unopened folder - should shift the focus to the
    326268    //parent folder. But because there is some other mysterious key listener that does opening and
    327269    //closing folders on right and left clicks, we must detect the situation before the other handler
    328270    //has done its job, and process it after.*/
    329    
    330271    public void keyPressed(KeyEvent event) {
    331272        if (event.getKeyCode() == KeyEvent.VK_LEFT) {
     
    343284     *registered components, and start an external application if someone double clicks on a certain
    344285     *file record. */
    345    
    346     /*public void mouseReleased(MouseEvent e) {}
    347       public void mouseExited(MouseEvent e) {}
     286    public void mouseReleased(MouseEvent e) {}
     287    public void mouseExited(MouseEvent e) {}
    348288    public void mousePressed(MouseEvent e) {}
    349     public void mouseEntered(MouseEvent e) {}*/
     289    public void mouseEntered(MouseEvent e) {}
    350290   
    351291    }
     
    359299        // Remember that for lower thresholds the above doesn't work, so try this instead
    360300        reload_button.setEnabled(true);
    361         delete_button.setEnabled(true);
     301        clear_button.setEnabled(true);
    362302        updateLogsContent(log_file.getPath());
    363303    }
    364304    }
    365305   
    366     private class DeleteButtonListener
     306    private class ClearButtonListener
    367307    implements ActionListener {
    368308    public void actionPerformed(ActionEvent event) {
    369         //log_file.
    370309        if (!log_file.exists()){
    371310        JOptionPane.showMessageDialog((Component) null,log_file.getPath() + " log file does not exist");
    372311        return;
    373312        } else {
    374         DeleteLogFilePrompt dfp  = new DeleteLogFilePrompt();
    375         boolean file_deleted = dfp.display(log_file);
    376         if (file_deleted) {
     313        ClearLogFilePrompt cfp  = new ClearLogFilePrompt();
     314        boolean file_cleared = cfp.display(log_file);
     315        if (file_cleared) {
    377316            log_textarea.setText("");
    378317        }
    379318        }
    380         delete_button.setEnabled(true);
    381     }
    382     }
    383    
    384     /*    private class ExitButtonListener
    385     implements ActionListener {
    386     // Exit the Adminstration tool
    387     public void actionPerformed(ActionEvent event) {
    388         System.exit(1);
    389     }
    390     }*/
    391 
     319        clear_button.setEnabled(false);
     320    }
     321    }
     322   
    392323    public void updateLogsContent(String filename){
    393324    if (!log_file.exists()){
    394325        log_textarea.setText("");
    395326        JOptionPane.showMessageDialog((Component) null, filename+" log file does not exist"); 
    396         delete_button.setEnabled(false);
     327        clear_button.setEnabled(false);
    397328    } else {
    398329        readFile(filename);
     
    403334    log_textarea.setText("");
    404335    String fileLine;
    405     int line_number = 0;
    406336    try {
    407337        BufferedReader in = new BufferedReader(new FileReader(filename));
     
    409339        log_textarea.append(fileLine);
    410340        log_textarea.append("\n");
    411         line_number =line_number + 1;
    412341        }
    413342    } catch (Exception e) {
     
    426355            updateLogsContent(filename);
    427356            reload_button.setEnabled(true);
    428             delete_button.setEnabled(true);
     357            clear_button.setEnabled(true);
    429358        } else if (log_list.getSelectedIndex () == 1) {
    430             /*log_file = new File (GAI.gsdl3_path+"/ant_out.log");
    431             String filename = log_file.getPath();
    432             updateLogsContent(filename);
    433             delete_button.setEnabled(true);*/
    434359            log_textarea.setText("");
    435360            JOptionPane.showMessageDialog((Component) null,"This file has not been defined yet");   
    436             delete_button.setEnabled(false);
     361            clear_button.setEnabled(false);
    437362            reload_button.setEnabled(false);
    438363        } else if (log_list.getSelectedIndex () == 2) {
    439364            log_textarea.setText("");
    440365            JOptionPane.showMessageDialog((Component) null,"This file has not been defined yet");   
    441             delete_button.setEnabled(false);
     366            clear_button.setEnabled(false);
    442367            reload_button.setEnabled(false);
    443368        }
     
    448373    return;
    449374    }
     375    public void afterDisplay() {
     376    return;
     377    }
    450378}
  • branches/ant-install-branch/gsdl3/src/java/org/greenstone/admin/gui/MenuBar.java

    r9972 r10793  
    22 *#########################################################################
    33 *
    4  * A component of the Gatherer application, part of the Greenstone digital
     4 * A component of the GAI application, part of the Greenstone digital
    55 * library suite from the New Zealand Digital Library Project at the
    66 * University of Waikato, New Zealand.
     
    4343
    4444import org.greenstone.admin.GAI;
     45import org.greenstone.core.Configuration;
     46import org.greenstone.core.Dictionary;
    4547import org.greenstone.core.util.Utility;
    4648
     
    4951 * @version
    5052 */
    51 
    5253public class MenuBar
    5354    extends JMenuBar {
     
    5859    private JMenu edit = null;
    5960    public JMenu help  = null;
    60     //public JMenuItem file_associations;
    6161    // public JMenuItem file_cdimage    = null;
    6262    // public JMenuItem file_close      = null;
    6363    //public JMenuItem file_delete     = null;
    64     public JMenuItem file_exit       = null;
    65     // public JMenuItem file_exportas   = null;
    66     // public JMenuItem file_new        = null;
    67     //public JMenuItem file_open       = null;
    68     //public JMenuItem file_options    = null;
    69     // public JMenuItem file_save       = null;
    70     // public JMenuItem edit_copy;
    71     //public JMenuItem edit_cut;
    72     // public JMenuItem edit_paste;
     64    public JMenuItem file_exit = null;
     65    public JMenuItem file_save = null;
     66    public JMenuItem help_general;
    7367    public JMenuItem help_conf;
    7468    public JMenuItem help_ext;
    7569    public JMenuItem help_monitor;
    7670    public JMenuItem help_log;
    77     //public JMenuItem help_gather;
    78     //public JMenuItem help_enrich;
    79     //public JMenuItem help_design;
    80     //public JMenuItem help_create;
    8171    public JMenuItem help_about;
    8272
    83     //public static String imagePath = "/research/chi/gsdl3/src/java/org/greenstone/admin/images/";
    84     public static String imagePath = "/research/chi/gsdl3-test/gsdl3/src/java/org/greenstone/admin/images/";
    85    
    8673    static public ImageIcon HELP_ICON = null;
    8774
    8875    //    public MenuBar(MenuListener Menu_listener)
    89     public MenuBar()
     76    public MenuBar(MenuListener menu_listener)
    9077    {
    91     HELP_ICON = new ImageIcon("images/help.gif");
    92     file = new JMenu("File");
     78    HELP_ICON = new ImageIcon(GAI.images_path +"help.gif");
     79    //file = new JMenu("File");
     80    file = new JMenu();
    9381    file.setMnemonic(KeyEvent.VK_F);
    94     //Dictionary.registerText(file, "Menu.File");
    95 
    96     /*file_associations = new JMenuItem();
    97     file_associations.addActionListener(Gatherer.g_man);     
    98     file_associations.setMnemonic(KeyEvent.VK_A);
    99     Dictionary.registerText(file_associations, "Menu.File_Associations");
    100 
    101     file_cdimage = new JMenuItem();
    102     file_cdimage.addActionListener(Gatherer.g_man);
    103     file_cdimage.setMnemonic(KeyEvent.VK_I);
    104     Dictionary.registerText(file_cdimage, "Menu.File_CDimage");
    105 
    106     file_close = new JMenuItem();
    107     file_close.addActionListener(Gatherer.g_man);
    108     file_close.setEnabled(false);
    109     file_close.setMnemonic(KeyEvent.VK_C);
    110     Dictionary.registerText(file_close, "Menu.File_Close");
    111 
    112     file_delete = new JMenuItem();
    113     file_delete.addActionListener(Gatherer.g_man);
    114     file_delete.setMnemonic(KeyEvent.VK_D);
    115     Dictionary.registerText(file_delete, "Menu.File_Delete");*/
    116 
    117     file_exit = new JMenuItem("Exit");
     82    Dictionary.registerText(file, "Menu.File");
     83   
     84    //file_save = new JMenuItem("Save");
     85    file_save = new JMenuItem();
     86    file_save.addActionListener(GAI.ga_man);
     87    file_save.setMnemonic(KeyEvent.VK_S);
     88    Dictionary.registerText(file_save, "Menu.File_Save");
     89
     90    //file_exit = new JMenuItem("Exit");
     91    file_exit = new JMenuItem();
    11892    file_exit.addActionListener(GAI.ga_man);
    11993    file_exit.setMnemonic(KeyEvent.VK_X);
    120     //Dictionary.registerText(file_exit, "Menu.File_Exit");
    121 
    122     /*file_exportas = new JMenuItem();
    123     file_exportas.addActionListener(Gatherer.g_man);
    124     file_exportas.setMnemonic(KeyEvent.VK_E);
    125     Dictionary.registerText(file_exportas, "Menu.File_ExportAs");*/
    126 
    127     /*file_new = new JMenuItem();
    128     file_new.addActionListener(Gatherer.g_man);
    129     file_new.setMnemonic(KeyEvent.VK_N);
    130     Dictionary.registerText(file_new, "Menu.File_New");
    131 
    132     file_open = new JMenuItem();
    133     file_open.addActionListener(Gatherer.g_man);
    134     file_open.setMnemonic(KeyEvent.VK_O);
    135     Dictionary.registerText(file_open, "Menu.File_Open");
    136 
    137     file_options = new JMenuItem();
    138     file_options.addActionListener(Gatherer.g_man);
    139     file_options.setMnemonic(KeyEvent.VK_P);
    140     Dictionary.registerText(file_options, "Menu.File_Options");
    141 
    142     file_save = new JMenuItem();
    143     file_save.addActionListener(Gatherer.g_man);
    144     file_save.setEnabled(false);
    145     file_save.setMnemonic(KeyEvent.VK_S);
    146     Dictionary.registerText(file_save, "Menu.File_Save");*/
    147 
    148     // Layout (file menu)
    149     /*file.add(file_new);
    150     file.add(file_open);
     94    Dictionary.registerText(file_exit, "Menu.File_Exit");
     95    //Layout (File menu)
    15196    file.add(file_save);
    152     file.add(file_close);*/
    15397    file.add(new JSeparator());
    154     /*file.add(file_delete);
    155     file.add(file_exportas);
    156     file.add(file_cdimage);
    157     file.add(new JSeparator());
    158     file.add(file_associations);
    159     file.add(file_options);
    160     file.add(new JSeparator());*/
    16198    file.add(file_exit);
    16299
    163100    // Edit menu
    164     edit = new JMenu("Edit");
     101    //edit = new JMenu("Edit");
     102    edit = new JMenu();
    165103    edit.setMnemonic(KeyEvent.VK_E);
    166     //Dictionary.registerText(edit, "Menu.Edit");
     104    Dictionary.registerText(edit, "Menu.Edit");
    167105         
    168     /*edit_cut = new JMenuItem();
    169     edit_cut.addActionListener(Gatherer.g_man);
    170     edit_cut.setMnemonic(KeyEvent.VK_X);
    171     Dictionary.registerText(edit_cut, "Menu.Edit_Cut");
    172 
    173     edit_copy = new JMenuItem();
    174     edit_copy.addActionListener(Gatherer.g_man);
    175     edit_copy.setMnemonic(KeyEvent.VK_C);
    176     Dictionary.registerText(edit_copy, "Menu.Edit_Copy");
    177 
    178     edit_paste = new JMenuItem();
    179     edit_paste.addActionListener(Gatherer.g_man);
    180     edit_paste.setMnemonic(KeyEvent.VK_V);
    181     Dictionary.registerText(edit_paste, "Menu.Edit_Paste");
    182 
    183     // Layout (edit menu)
    184     edit.add(edit_cut);
    185     edit.add(edit_copy);
    186     edit.add(edit_paste);*/
    187 
    188106    // Help menu
    189     help = new JMenu("Help");
     107    //help = new JMenu("Help");
     108    help = new JMenu();
    190109    help.setMnemonic(KeyEvent.VK_H);
    191110    help.setIcon(HELP_ICON);
    192     //Dictionary.setText(help, "Menu.Help");
    193 
    194     help_conf = new JMenuItem("Configuration");
    195     //help_log.addActionListener(Gatherer.g_man);
    196     //Dictionary.registerText(help_general, "Source.General");
    197 
    198     help_ext = new JMenuItem("Ext");
    199     help_monitor = new JMenuItem("Monitor");
    200     help_log = new JMenuItem("Log");
    201 
    202     /*help_gather = new JMenuItem(Utility.BLANK_ICON);
    203     help_gather.addActionListener(Gatherer.g_man);
    204     Dictionary.registerText(help_gather, "GUI.Gather");
    205 
    206     help_enrich = new JMenuItem(Utility.BLANK_ICON);
    207     help_enrich.addActionListener(Gatherer.g_man);
    208     Dictionary.registerText(help_enrich, "GUI.Enrich");
    209 
    210     help_design = new JMenuItem(Utility.BLANK_ICON);
    211     help_design.addActionListener(Gatherer.g_man);
    212     Dictionary.registerText(help_design, "GUI.Design");
    213 
    214     help_create = new JMenuItem(Utility.BLANK_ICON);
    215     help_create.addActionListener(Gatherer.g_man);
    216     Dictionary.registerText(help_create, "GUI.Create");*/
    217 
    218     help_about = new JMenuItem("About");
    219     //help_about.addActionListener(Gatherer.g_man);
    220     //Dictionary.registerText(help_about, "Menu.Help_About");
    221 
     111    Dictionary.setText(help, "Menu.Help");
     112
     113    help_general = new JMenuItem();
     114    help_general.addActionListener(GAI.ga_man);
     115    Dictionary.registerText(help_general,"Source.General");
     116   
     117    help_conf = new JMenuItem();
     118    help_conf.addActionListener(GAI.ga_man);
     119    Dictionary.registerText(help_conf,"GAI.Configuration");
     120   
     121    help_ext = new JMenuItem();
     122    help_ext.addActionListener(GAI.ga_man);
     123    Dictionary.registerText(help_ext,"GAI.Ext");
     124
     125    help_monitor = new JMenuItem();
     126    help_monitor.addActionListener(GAI.ga_man);
     127    Dictionary.registerText(help_monitor,"GAI.Monitor");
     128
     129    help_log = new JMenuItem();
     130    help_log.addActionListener(GAI.ga_man);
     131    Dictionary.registerText(help_log,"GAI.Log");
     132
     133    help_about = new JMenuItem();
     134    help_about.addActionListener(GAI.ga_man);
     135    Dictionary.registerText(help_about,"Menu.Help_About");
     136       
     137   
    222138    // Layout (help menu)
    223     help.add(help_conf);
    224     help.add(help_ext);
    225     help.add(help_monitor);
    226     help.add(help_log);
     139    help.add(help_general);
    227140    help.add(new JSeparator());
    228 
    229     /*if (Configuration.get("workflow.download", true)) {
    230         help.add(help_download);
    231     }
    232     if (Configuration.get("workflow.gather", true)) {
    233         help.add(help_gather);
    234     }
    235     if (Configuration.get("workflow.enrich", true)) {
    236         help.add(help_enrich);
    237     }
    238     if (Configuration.get("workflow.design", true)) {
    239         help.add(help_design);
    240     }
    241     if (Configuration.get("workflow.create", true)) {
    242         help.add(help_create);
    243         }*/
     141    if (Configuration.get("admin.conf", true)) {
     142        help.add(help_conf);
     143    }
     144    if (Configuration.get("admin.ext", true)) {
     145        help.add(help_ext);
     146    }
     147    if (Configuration.get("admin.monitor", true)) {
     148        help.add(help_monitor);
     149    }
     150    if (Configuration.get("admin.log", true)) {
     151        help.add(help_log);
     152    }
    244153   
    245154    help.add(new JSeparator());
  • branches/ant-install-branch/gsdl3/src/java/org/greenstone/admin/gui/SaveChangePrompt.java

    r9972 r10793  
    7979    /** This method causes the Save Change Confirmation Dialog to be displayed.
    8080     * returns true if it has save the change file that is currently open */
    81     public boolean display(File file) {
    82     int result = JOptionPane.showConfirmDialog((Component) null, "Do you really want to save the change", "Save Confirmation", JOptionPane.YES_NO_OPTION);
    83     if ( result == JOptionPane.YES_OPTION) {
    84         ConfPane confPane = new ConfPane();
    85         confPane.saveNewConfSetting();
    86         confPane.writeConfFile(file);
    87         current_change_saved = true;
    88     } else if (result == JOptionPane.NO_OPTION) {
     81    // public boolean display(File file) {
     82    /*int result = JOptionPane.showConfirmDialog((Component) null, "Do you really want to save the change", "Save Confirmation", JOptionPane.YES_NO_OPTION);
     83      if ( result == JOptionPane.YES_OPTION) {
     84      ConfPane confPane = new ConfPane();
     85      confPane.saveNewConfSetting();
     86      confPane.writeConfFile(file);
     87      current_change_saved = true;
     88      } else if (result == JOptionPane.NO_OPTION) {
    8989        current_change_saved = false;
    9090        prompt.dispose();
    91     }
    92     resultPrompt(current_change_saved);
    93     return current_change_saved;
    94     }
     91        }
     92        resultPrompt(current_change_saved);
     93        return current_change_saved;*/
     94    //}
    9595   
    9696    /** Shows a save complete prompt.
  • branches/ant-install-branch/gsdl3/src/java/org/greenstone/admin/gui/ThreadControl.java

    r9972 r10793  
    4545
    4646import org.greenstone.admin.GAI;
     47import org.greenstone.admin.GAIManager;
    4748import org.greenstone.admin.gui.LogPane;
    4849import org.greenstone.core.ParsingProgress;
     
    5152
    5253
     54
    5355public class ThreadControl
    5456    extends Thread {
    5557   
    56     //boolean ant_success = false;
     58    private GAIManager gai_man;
    5759
    5860    public ThreadControl(){
     
    159161   
    160162    public void run() {
    161         try { 
     163        try {
    162164        executeAntTarget(this.command_string);
    163165        } catch(Exception e) {
     
    210212        try {
    211213        executeAntTarget(this.command_string);
    212         // ant_success;
    213214        } catch(Exception e) {
    214215        System.out.println(e.getMessage());
     
    248249    }
    249250    }
     251
     252    public class installGS3
     253    implements Runnable {
     254    private String command_string = null;
     255
     256    /* Install GSDL3 through ant program*/
     257    public installGS3(String command_string) {
     258        this.command_string = command_string;
     259    }
     260    public void run() {
     261        try {
     262     
     263        executeAntTarget(this.command_string);
     264        // ant_success;
     265        } catch(Exception e) {
     266        System.out.println(e.getMessage());
     267        }
     268    }
     269    }
     270
    250271   
    251272    public void destroy(){
Note: See TracChangeset for help on using the changeset viewer.