Changeset 22035 for gs3-extensions/mat/trunk
- Timestamp:
- 2010-05-05T13:34:01+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/mat/trunk/src/org/greenstone/admin/guiext/ControlPanel.java
r22004 r22035 21 21 import java.awt.event.ItemListener; 22 22 23 import java.util.Properties; 24 25 import java.io.FileInputStream; 26 27 import org.greenstone.server.BrowserLauncher; 28 23 29 import org.greenstone.admin.guiext.BasePanel; 24 30 … … 28 34 { 29 35 JPanel _controlPanel = null; 36 JCheckBox _localAnalysis = null; 30 37 31 38 public ControlPanel() … … 70 77 web_tool_checkbox.setVisible(false); 71 78 72 JCheckBox java_tool_checkbox = new JCheckBox("Local Collection Analysis"); 73 java_tool_checkbox.addItemListener(new checkBoxStatus(mat)); 74 java_tool_checkbox.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); 79 _localAnalysis = new JCheckBox("Local Collection Analysis"); 80 _localAnalysis.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); 75 81 76 82 GridLayout gridLayout3 = new GridLayout(3,3); … … 92 98 control_pane.setLayout(new BoxLayout(control_pane, BoxLayout.Y_AXIS)); 93 99 94 control_content_pane.add( java_tool_checkbox);100 control_content_pane.add(_localAnalysis); 95 101 control_content_pane.add(Box.createRigidArea(new Dimension(10,5))); 96 102 control_content_pane.add(Box.createRigidArea(new Dimension(10,5))); … … 130 136 } 131 137 132 class checkBoxStatus implements ItemListener{133 134 private Mat adaptee;135 136 public checkBoxStatus(Mat adaptee){137 138 this.adaptee = adaptee;139 }140 141 public void itemStateChanged(ItemEvent e) {142 143 JCheckBox source = (JCheckBox)e.getItemSelectable();144 145 if (source == adaptee.java_tool_checkbox) {146 if(source.isSelected()){147 adaptee.start_button.setEnabled(true);148 }149 else{150 adaptee.start_button.setEnabled(false);151 }152 }153 else{154 }155 }156 }157 158 138 class aListener implements ActionListener { 159 139 … … 169 149 170 150 if(button.getName().equalsIgnoreCase("Analyse")){ 171 execute_application(); 151 if(_localAnalysis.isSelected()){ 152 execute_application(); 153 } 154 else{ 155 try{ 156 Properties properties = new Properties(); 157 FileInputStream fis = new FileInputStream(GAI.getGSDL3Home() + System.getProperty("file.separator") + "build.properties"); 158 properties.load(fis); 159 fis.close(); 160 Thread bl = new BrowserLauncher("", "http://" + properties.getProperty("tomcat.server") + ":" + properties.getProperty("tomcat.port") + "/mat/analyse"); 161 bl.run(); 162 } 163 catch(Exception ex){ 164 ex.printStackTrace(); 165 } 166 } 172 167 } 173 168 }
Note:
See TracChangeset
for help on using the changeset viewer.