1 7 package org.enhydra.base.tool; 8 9 import javax.swing.JPanel ; 10 11 import javax.swing.JLabel ; 12 import javax.swing.JOptionPane ; 13 import javax.swing.JTextField ; 14 import javax.swing.JCheckBox ; 15 21 public class ServicesConfigurationPanel extends JPanel { 22 23 private JCheckBox registryCheck = null; 24 private JCheckBox jmxCheck = null; 25 private JCheckBox securityCheck = null; 26 private JCheckBox jtmCheck = null; 27 private JCheckBox dbCheck = null; 28 private JCheckBox mailCheck = null; 29 private JCheckBox dbmCheck = null; 30 private JCheckBox resourceCheck = null; 31 private JCheckBox jmsCheck = null; 32 private JCheckBox ejbCheck = null; 33 private JCheckBox wsCheck = null; 34 private JCheckBox webCheck = null; 35 private JCheckBox earCheck = null; 36 private JCheckBox discoveryCheck = null; 37 private JLabel jLabel = null; 38 41 public ServicesConfigurationPanel() { 42 super(); 43 initialize(); 44 } 45 50 private void initialize() { 51 this.setPreferredSize(new java.awt.Dimension (300,150)); 52 jLabel = new JLabel (); 53 jLabel.setText(""); 54 jLabel.setPreferredSize(new java.awt.Dimension (80,20)); 55 this.add(getRegistryCheck(), null); 56 this.add(getJmxCheck(), null); 57 this.add(getSecurityCheck(), null); 58 this.add(getJtmCheck(), null); 59 this.add(getDbCheck(), null); 60 this.add(getMailCheck(), null); 61 this.add(getDbmCheck(), null); 62 this.add(getResourceCheck(), null); 63 this.add(getJmsCheck(), null); 64 this.add(getEjbCheck(), null); 65 this.add(getWsCheck(), null); 66 this.add(getWebCheck(), null); 67 this.add(getEarCheck(), null); 68 this.add(getDiscoveryCheck(), null); 69 this.add(jLabel, null); 70 jLabel = new JLabel (); 71 this.setSize(300, 150); 72 } 73 74 public boolean checkEntries() { 75 boolean valid = true; 76 77 return valid; 78 } 79 80 private void displayErrorMessage(String field) { 81 JOptionPane.showMessageDialog(null, "Check '" + field 82 + "' Field Setting!", 83 "Enhydra Configuration Tool - Houston, we have a problem!", 84 JOptionPane.ERROR_MESSAGE); 85 } 86 91 private JCheckBox getRegistryCheck() { 92 if (registryCheck == null) { 93 registryCheck = new JCheckBox (); 94 registryCheck.setName("registryCheck"); 95 registryCheck.setText("registry"); 96 registryCheck.setToolTipText("registry"); 97 registryCheck.setPreferredSize(new java.awt.Dimension (80,20)); 98 registryCheck.setEnabled(false); 99 registryCheck.setSelected(true); 100 } 101 return registryCheck; 102 } 103 108 private JCheckBox getJmxCheck() { 109 if (jmxCheck == null) { 110 jmxCheck = new JCheckBox (); 111 jmxCheck.setText("jmx"); 112 jmxCheck.setToolTipText("jmx"); 113 jmxCheck.setName("jmxCheck"); 114 jmxCheck.setPreferredSize(new java.awt.Dimension (80,20)); 115 jmxCheck.setSelected(true); 116 jmxCheck.setEnabled(false); 117 } 118 return jmxCheck; 119 } 120 125 private JCheckBox getSecurityCheck() { 126 if (securityCheck == null) { 127 securityCheck = new JCheckBox (); 128 securityCheck.setName("securityCheck"); 129 securityCheck.setText("security"); 130 securityCheck.setToolTipText("security"); 131 securityCheck.setPreferredSize(new java.awt.Dimension (80,20)); 132 securityCheck.setEnabled(true); 133 securityCheck.setSelected(true); 134 } 135 return securityCheck; 136 } 137 142 private JCheckBox getJtmCheck() { 143 if (jtmCheck == null) { 144 jtmCheck = new JCheckBox (); 145 jtmCheck.setToolTipText("jtm"); 146 jtmCheck.setText("jtm"); 147 jtmCheck.setName("jtmCheck"); 148 jtmCheck.setPreferredSize(new java.awt.Dimension (80,20)); 149 jtmCheck.setSelected(true); 150 jtmCheck.setEnabled(false); 151 } 152 return jtmCheck; 153 } 154 159 private JCheckBox getDbCheck() { 160 if (dbCheck == null) { 161 dbCheck = new JCheckBox (); 162 dbCheck.setToolTipText("db"); 163 dbCheck.setText("db"); 164 dbCheck.setName("dbCheck"); 165 dbCheck.setPreferredSize(new java.awt.Dimension (80,20)); 166 } 167 return dbCheck; 168 } 169 174 private JCheckBox getMailCheck() { 175 if (mailCheck == null) { 176 mailCheck = new JCheckBox (); 177 mailCheck.setToolTipText("mail"); 178 mailCheck.setText("mail"); 179 mailCheck.setName("mailCheck"); 180 mailCheck.setPreferredSize(new java.awt.Dimension (80,20)); 181 } 182 return mailCheck; 183 } 184 189 private JCheckBox getDbmCheck() { 190 if (dbmCheck == null) { 191 dbmCheck = new JCheckBox (); 192 dbmCheck.setText("dbm"); 193 dbmCheck.setToolTipText("dbm"); 194 dbmCheck.setName("dbmCheck"); 195 dbmCheck.setPreferredSize(new java.awt.Dimension (80,20)); 196 dbmCheck.setSelected(true); 197 } 198 return dbmCheck; 199 } 200 205 private JCheckBox getResourceCheck() { 206 if (resourceCheck == null) { 207 resourceCheck = new JCheckBox (); 208 resourceCheck.setToolTipText("resource"); 209 resourceCheck.setText("resource"); 210 resourceCheck.setName("resourceCheck"); 211 resourceCheck.setPreferredSize(new java.awt.Dimension (80,20)); 212 } 213 return resourceCheck; 214 } 215 220 private JCheckBox getJmsCheck() { 221 if (jmsCheck == null) { 222 jmsCheck = new JCheckBox (); 223 jmsCheck.setText("jms"); 224 jmsCheck.setToolTipText("jms"); 225 jmsCheck.setName("jmsCheck"); 226 jmsCheck.setPreferredSize(new java.awt.Dimension (80,20)); 227 } 228 return jmsCheck; 229 } 230 235 private JCheckBox getEjbCheck() { 236 if (ejbCheck == null) { 237 ejbCheck = new JCheckBox (); 238 ejbCheck.setText("ejb"); 239 ejbCheck.setToolTipText("ejb"); 240 ejbCheck.setName("ejbCheck"); 241 ejbCheck.setPreferredSize(new java.awt.Dimension (80,20)); 242 ejbCheck.setEnabled(false); 243 ejbCheck.setSelected(true); 244 } 245 return ejbCheck; 246 } 247 252 private JCheckBox getWsCheck() { 253 if (wsCheck == null) { 254 wsCheck = new JCheckBox (); 255 wsCheck.setText("ws"); 256 wsCheck.setToolTipText("ws"); 257 wsCheck.setName("wsCheck"); 258 wsCheck.setPreferredSize(new java.awt.Dimension (80,20)); 259 wsCheck.setSelected(true); 260 } 261 return wsCheck; 262 } 263 268 private JCheckBox getWebCheck() { 269 if (webCheck == null) { 270 webCheck = new JCheckBox (); 271 webCheck.setToolTipText("web"); 272 webCheck.setText("web"); 273 webCheck.setName("webCheck"); 274 webCheck.setPreferredSize(new java.awt.Dimension (80,20)); 275 } 276 return webCheck; 277 } 278 283 private JCheckBox getEarCheck() { 284 if (earCheck == null) { 285 earCheck = new JCheckBox (); 286 earCheck.setToolTipText("ear"); 287 earCheck.setText("ear"); 288 earCheck.setName("earCheck"); 289 earCheck.setPreferredSize(new java.awt.Dimension (80,20)); 290 } 291 return earCheck; 292 } 293 298 private JCheckBox getDiscoveryCheck() { 299 if (discoveryCheck == null) { 300 discoveryCheck = new JCheckBox (); 301 discoveryCheck.setToolTipText("discovery"); 302 discoveryCheck.setText("discovery"); 303 discoveryCheck.setName("discoveryCheck"); 304 discoveryCheck.setPreferredSize(new java.awt.Dimension (80,20)); 305 } 306 return discoveryCheck; 307 } 308 309 public void setRegistryChecked (boolean selected){ 310 getRegistryCheck().setSelected(selected); 311 } 312 313 public boolean getRegistryChecked (){ 314 return getRegistryCheck().isSelected(); 315 } 316 317 public void setJmxChecked (boolean selected){ 318 getJmxCheck().setSelected(selected); 319 } 320 321 public boolean getJmxChecked (){ 322 return getJmxCheck().isSelected(); 323 } 324 325 public void setSecurityChecked (boolean selected){ 326 getSecurityCheck().setSelected(selected); 327 } 328 329 public boolean getSecurityChecked (){ 330 return getSecurityCheck().isSelected(); 331 } 332 333 public void setJtmChecked (boolean selected){ 334 getJtmCheck().setSelected(selected); 335 } 336 337 public boolean getJtmChecked (){ 338 return getJtmCheck().isSelected(); 339 } 340 341 public void setDbChecked (boolean selected){ 342 getDbCheck().setSelected(selected); 343 } 344 345 public boolean getDbChecked (){ 346 return getDbCheck().isSelected(); 347 } 348 349 public void setMailChecked (boolean selected){ 350 getMailCheck().setSelected(selected); 351 } 352 353 public boolean getMailChecked (){ 354 return getMailCheck().isSelected(); 355 } 356 357 public void setDbmChecked (boolean selected){ 358 getDbmCheck().setSelected(selected); 359 } 360 361 public boolean getDbmChecked (){ 362 return getDbmCheck().isSelected(); 363 } 364 365 public void setResourceChecked (boolean selected){ 366 getResourceCheck().setSelected(selected); 367 } 368 369 public boolean getResourceChecked (){ 370 return getResourceCheck().isSelected(); 371 } 372 373 public void setJmsChecked (boolean selected){ 374 getJmsCheck().setSelected(selected); 375 } 376 377 public boolean getJmsChecked (){ 378 return getJmsCheck().isSelected(); 379 } 380 381 public void setEjbChecked (boolean selected){ 382 getEjbCheck().setSelected(selected); 383 } 384 385 public boolean getEjbChecked (){ 386 return getEjbCheck().isSelected(); 387 } 388 389 public void setWsChecked (boolean selected){ 390 getWsCheck().setSelected(selected); 391 } 392 393 public boolean getWsChecked (){ 394 return getWsCheck().isSelected(); 395 } 396 397 public void setWebChecked (boolean selected){ 398 getWebCheck().setSelected(selected); 399 } 400 401 public boolean getWebChecked (){ 402 return getWebCheck().isSelected(); 403 } 404 405 public void setEarChecked (boolean selected){ 406 getEarCheck().setSelected(selected); 407 } 408 409 public boolean getEarChecked (){ 410 return getEarCheck().isSelected(); 411 } 412 413 public void setDiscoveryChecked (boolean selected){ 414 getDiscoveryCheck().setSelected(selected); 415 } 416 417 public boolean getDiscoveryChecked (){ 418 return getDiscoveryCheck().isSelected(); 419 } 420 421 public String getSelectedServices(){ 422 String services = ""; 423 if (getRegistryChecked()){ 424 services += "registry,"; 425 } 426 if (getJmxChecked()){ 427 services += "jmx,"; 428 } 429 if (getSecurityChecked()){ 430 services += "security,"; 431 } 432 if (getJtmChecked()){ 433 services += "jtm,"; 434 } 435 if (getDbChecked()){ 436 services += "db,"; 437 } 438 if (getMailChecked()){ 439 services += "mail,"; 440 } 441 if (getDbmChecked()){ 442 services += "dbm,"; 443 } 444 if (getResourceChecked()){ 445 services += "resource,"; 446 } 447 if (getJmsChecked()){ 448 services += "jms,"; 449 } 450 if (getEjbChecked()){ 451 services += "ejb,"; 452 } 453 if (getWsChecked()){ 454 services += "ws,"; 455 } 456 if (getWebChecked()){ 457 services += "web,"; 458 } 459 if (getEarChecked()){ 460 services += "ear,"; 461 } 462 if (getDiscoveryChecked()){ 463 services += "discovery,"; 464 } 465 466 return services.substring(0,services.length()-1); 467 } 468 } 469 | Popular Tags |