001 /** 002 * Copyright (c) 2003 Daffodil Software Ltd all rights reserved, 003 * Modifications Copyright (c) 2008 Regiscope Digital Imaging Co, LLC, All rights reserved. 004 * This program is free software; you can redistribute it and/or modify 005 * it under the terms of version 2 of the GNU General Public License as 006 * published by the Free Software Foundation. 007 * There are special exceptions to the terms and conditions of the GPL 008 * as it is applied to this software. See the GNU General Public License for more details. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU General Public License for more details. 014 * 015 * You should have received a copy of the GNU General Public License 016 * along with this program; if not, write to the Free Software 017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 018 */ 019 020 package org.dbreplicator.repconsole; 021 022 import java.util.*; 023 024 import java.awt.*; 025 import java.awt.event.*; 026 import javax.swing.*; 027 import javax.swing.border.*; 028 import javax.swing.tree.*; 029 030 import org.dbreplicator.replication.*; 031 import java.sql.Timestamp; 032 033 /** 034 * <p>Title: </p> 035 * <p>Description: </p> 036 * <p>Copyright: Copyright (c) 2003</p> 037 * <p>Company: </p> 038 * @author not attributable 039 * @version 1.0 040 */ 041 042 public class AddSchedule 043 extends JDialog 044 implements FocusListener, KeyListener { 045 JPanel panel1 = new JPanel(); 046 JEditorPane help = new JEditorPane(); 047 048 JLabel jLabelAddSchedule = new JLabel(); 049 JLabel jLabelScheduleName = new JLabel(); 050 JLabel jLabelSubName = new JLabel(); 051 JLabel jLabelRemoteServerName = new JLabel(); 052 JLabel jLabelRemoteRepPortNo = new JLabel(); 053 JLabel jLabelStartDate = new JLabel(); 054 JLabel jLabelStartHour = new JLabel(); 055 JLabel jLabelStartMin = new JLabel(); 056 JLabel jLabelCountValue = new JLabel(); 057 JLabel jLabelRecurrenceType = new JLabel(); 058 JLabel jLabelRepType = new JLabel(); 059 JLabel jLabel1 = new JLabel(); 060 061 JComboBox startHour = new JComboBox(); 062 JComboBox startMin = new JComboBox(); 063 JComboBox RecurrenceType = new JComboBox(); 064 JComboBox repType = new JComboBox(); 065 JComboBox countValue = new JComboBox(); 066 067 JTextField jTextScheduleName = new JTextField(); 068 JTextField jTextSubName = new JTextField(); 069 JTextField jTextRemoteServerName = new JTextField(); 070 JTextField jTextRemoteRepPortNo = new JTextField(); 071 JTextField jTextStartDate = new JTextField(); 072 073 JCheckBox jCheckBoxschType = new JCheckBox(); 074 JPanel jPanelSchedule = new JPanel(); 075 076 JButton jButtonSchedule = new JButton(); 077 JButton jButtonCancel = new JButton(); 078 079 _ReplicationServer repServer; 080 _Subscription sub; 081 String subName; 082 boolean able = true; 083 084 Border border1; 085 086 public AddSchedule(Frame frame, String title, boolean modal) { 087 super(frame, title, modal); 088 try { 089 jbInit(); 090 pack(); 091 } 092 catch (Exception ex) { 093 JOptionPane.showMessageDialog(this, ex, "Error Message", 094 JOptionPane.ERROR_MESSAGE); 095 return; 096 } 097 } 098 099 public AddSchedule(_ReplicationServer repServer0, 100 DefaultMutableTreeNode subRootNode0, 101 DefaultTreeModel defaultTreeModel0, boolean able0) { 102 this(StartRepServer.getMainFrame(), "Add Schedule", true); 103 repServer = repServer0; 104 able = able0; 105 } 106 107 public AddSchedule(_ReplicationServer repServer0, 108 DefaultMutableTreeNode subRootNode0, 109 DefaultTreeModel defaultTreeModel0, String subName0, 110 boolean able0) { 111 this(null, "Add Schedule", true); 112 repServer = repServer0; 113 subName = subName0; 114 able = able0; 115 init(); 116 } 117 118 private void init() { 119 try { 120 _Subscription sub = repServer.getSubscription(subName); 121 jTextSubName.setText(subName); 122 jTextSubName.setEnabled(able); 123 } 124 catch (RepException ex) { 125 JOptionPane.showMessageDialog(this, ex, "Error Message", 126 JOptionPane.ERROR_MESSAGE); 127 return; 128 } 129 } 130 131 private void jbInit() throws Exception { 132 border1 = new EtchedBorder(EtchedBorder.RAISED, Color.white, 133 new Color(148, 145, 140)); 134 panel1.setLayout(null); 135 panel1.setAlignmentY( (float) 0.5); 136 panel1.setDebugGraphicsOptions(0); 137 138 jLabelAddSchedule.setEnabled(true); 139 jLabelAddSchedule.setFont(new java.awt.Font("Serif", 3, 25)); 140 jLabelAddSchedule.setForeground(SystemColor.infoText); 141 jLabelAddSchedule.setText("Add Schedule"); 142 int center = jLabelAddSchedule.CENTER; 143 jLabelAddSchedule.setHorizontalAlignment(center); 144 jLabelAddSchedule.setBounds(new Rectangle(92, 5, 193, 35)); 145 146 jLabelScheduleName.setFont(new java.awt.Font("Dialog", 1, 13)); 147 jLabelScheduleName.setMaximumSize(new Dimension(136, 16)); 148 jLabelScheduleName.setMinimumSize(new Dimension(136, 16)); 149 jLabelScheduleName.setPreferredSize(new Dimension(136, 16)); 150 jLabelScheduleName.setHorizontalAlignment(SwingConstants.LEFT); 151 jLabelScheduleName.setHorizontalTextPosition(SwingConstants.LEFT); 152 jLabelScheduleName.setText("Schedule Name"); 153 jLabelScheduleName.setBounds(new Rectangle(19, 84, 174, 23)); 154 155 jLabelSubName.setFont(new java.awt.Font("Dialog", 1, 13)); 156 jLabelSubName.setHorizontalAlignment(SwingConstants.LEFT); 157 jLabelSubName.setHorizontalTextPosition(SwingConstants.LEFT); 158 jLabelSubName.setText("Subscription Name"); 159 jLabelSubName.setBounds(new Rectangle(19, 115, 174, 15)); 160 161 jLabelRemoteServerName.setFont(new java.awt.Font("Dialog", 1, 13)); 162 jLabelRemoteServerName.setMaximumSize(new Dimension(136, 16)); 163 jLabelRemoteServerName.setMinimumSize(new Dimension(136, 16)); 164 jLabelRemoteServerName.setPreferredSize(new Dimension(136, 16)); 165 jLabelRemoteServerName.setHorizontalAlignment(SwingConstants.LEFT); 166 jLabelRemoteServerName.setHorizontalTextPosition(SwingConstants.LEFT); 167 jLabelRemoteServerName.setText("Remote Server Name"); 168 jLabelRemoteServerName.setBounds(new Rectangle(19, 142, 174, 15)); 169 170 jLabelRemoteRepPortNo.setFont(new java.awt.Font("Dialog", 1, 13)); 171 jLabelRemoteRepPortNo.setMaximumSize(new Dimension(136, 16)); 172 jLabelRemoteRepPortNo.setMinimumSize(new Dimension(136, 16)); 173 jLabelRemoteRepPortNo.setPreferredSize(new Dimension(136, 16)); 174 jLabelRemoteRepPortNo.setHorizontalAlignment(SwingConstants.LEFT); 175 jLabelRemoteRepPortNo.setHorizontalTextPosition(SwingConstants.LEFT); 176 jLabelRemoteRepPortNo.setText("Remote Port No."); 177 jLabelRemoteRepPortNo.setBounds(new Rectangle(19, 173, 174, 15)); 178 179 jLabelRepType.setFont(new java.awt.Font("Dialog", 1, 13)); 180 jLabelRepType.setMinimumSize(new Dimension(136, 16)); 181 jLabelRepType.setRequestFocusEnabled(true); 182 jLabelRepType.setHorizontalAlignment(SwingConstants.LEFT); 183 jLabelRepType.setHorizontalTextPosition(SwingConstants.LEFT); 184 jLabelRepType.setText("Replication Type"); 185 jLabelRepType.setBounds(new Rectangle(19, 204, 174, 15)); 186 187 jCheckBoxschType.setFont(new java.awt.Font("Dialog", 1, 13)); 188 jCheckBoxschType.setText("Non RealTime Scheduling"); 189 jCheckBoxschType.setBounds(new Rectangle(19, 235, 200, 23)); 190 191 jPanelSchedule.setEnabled(false); 192 jPanelSchedule.setBorder(border1); 193 jPanelSchedule.setDoubleBuffered(true); 194 jPanelSchedule.setBounds(new Rectangle(15, 260, 338, 150)); 195 jPanelSchedule.setLayout(null); 196 197 jLabelRecurrenceType.setFont(new java.awt.Font("Dialog", 1, 13)); 198 jLabelRecurrenceType.setMinimumSize(new Dimension(136, 16)); 199 jLabelRecurrenceType.setRequestFocusEnabled(true); 200 jLabelRecurrenceType.setEnabled(false); 201 jLabelRecurrenceType.setHorizontalAlignment(SwingConstants.LEFT); 202 jLabelRecurrenceType.setHorizontalTextPosition(SwingConstants.LEFT); 203 jLabelRecurrenceType.setText("Recurrence Type"); 204 jLabelRecurrenceType.setBounds(new Rectangle(10,10, 174, 15)); 205 206 jLabelCountValue.setFont(new java.awt.Font("Dialog", 1, 13)); 207 jLabelCountValue.setMinimumSize(new Dimension(136, 16)); 208 jLabelCountValue.setRequestFocusEnabled(true); 209 jLabelCountValue.setEnabled(false); 210 jLabelCountValue.setHorizontalAlignment(SwingConstants.LEFT); 211 jLabelCountValue.setHorizontalTextPosition(SwingConstants.LEFT); 212 jLabelCountValue.setText("Counter Value"); 213 jLabelCountValue.setBounds(new Rectangle(10, 45, 174, 15)); 214 215 jLabelStartDate.setFont(new java.awt.Font("Dialog", 1, 13)); 216 jLabelStartDate.setMinimumSize(new Dimension(136, 16)); 217 jLabelStartDate.setRequestFocusEnabled(true); 218 jLabelStartDate.setEnabled(false); 219 jLabelStartDate.setHorizontalAlignment(SwingConstants.LEFT); 220 jLabelStartDate.setHorizontalTextPosition(SwingConstants.LEFT); 221 jLabelStartDate.setText("Start Date (yyyy-mm-dd)"); 222 jLabelStartDate.setBounds(new Rectangle(10, 80, 174, 15)); 223 224 jLabelStartHour.setFont(new java.awt.Font("Dialog", 1, 13)); 225 jLabelStartHour.setMinimumSize(new Dimension(136, 16)); 226 jLabelStartHour.setRequestFocusEnabled(true); 227 jLabelStartHour.setEnabled(false); 228 jLabelStartHour.setHorizontalAlignment(SwingConstants.LEFT); 229 jLabelStartHour.setHorizontalTextPosition(SwingConstants.LEFT); 230 jLabelStartHour.setText("Starting time (hh:mm)"); 231 jLabelStartHour.setBounds(new Rectangle(10, 115, 184, 15)); 232 233 jLabel1.setBounds(new Rectangle(239, 115, 10, 21)); 234 jLabel1.setFont(new java.awt.Font("Dialog", 0, 12)); 235 jLabel1.setText(" : "); 236 jLabel1.setEnabled(false); 237 238 jTextScheduleName.setFont(new java.awt.Font("Dialog", 0, 12)); 239 jTextScheduleName.setPreferredSize(new Dimension(6, 22)); 240 jTextScheduleName.setRequestFocusEnabled(true); 241 jTextScheduleName.setFocusAccelerator('1'); 242 jTextScheduleName.setText(""); 243 jTextScheduleName.setBounds(new Rectangle(188, 82, 158, 23)); 244 245 jTextSubName.setFont(new java.awt.Font("Dialog", 0, 12)); 246 jTextSubName.setPreferredSize(new Dimension(6, 22)); 247 jTextSubName.setText(""); 248 jTextSubName.setBounds(new Rectangle(188, 112, 158, 23)); 249 250 jTextRemoteServerName.setFont(new java.awt.Font("Dialog", 0, 12)); 251 jTextRemoteServerName.setPreferredSize(new Dimension(6, 22)); 252 jTextRemoteServerName.setText(""); 253 jTextRemoteServerName.setBounds(new Rectangle(188, 142, 158, 23)); 254 255 jTextRemoteRepPortNo.setFont(new java.awt.Font("Dialog", 0, 12)); 256 jTextRemoteRepPortNo.setPreferredSize(new Dimension(6, 22)); 257 jTextRemoteRepPortNo.setText(""); 258 jTextRemoteRepPortNo.setBounds(new Rectangle(188, 172, 158, 23)); 259 jTextRemoteRepPortNo.setDocument(new NumericDocument()); 260 261 repType.addItem(RepConstants.replication_snapshotType); 262 repType.addItem(RepConstants.replication_synchronizeType); 263 repType.addItem(RepConstants.replication_pullType); 264 repType.addItem(RepConstants.replication_pushType); 265 repType.setBounds(new Rectangle(188, 202, 100, 23)); 266 267 RecurrenceType.addItem(RepConstants.recurrence_yearType); 268 RecurrenceType.addItem(RepConstants.recurrence_monthType); 269 RecurrenceType.addItem(RepConstants.recurrence_dayType); 270 RecurrenceType.addItem(RepConstants.recurrence_hourType); 271 RecurrenceType.addItem(RepConstants.recurrence_minuteType); 272 RecurrenceType.setBounds(new Rectangle(188,10, 70, 23)); 273 RecurrenceType.setEnabled(false); 274 275 countValue.setBounds(new Rectangle(188, 45, 70, 23)); 276 countValue.setEnabled(false); 277 278 jTextStartDate.setFont(new java.awt.Font("Dialog", 0, 12)); 279 jTextStartDate.setPreferredSize(new Dimension(6, 22)); 280 jTextStartDate.setText(""); 281 jTextStartDate.setEnabled(false); 282 jTextStartDate.setBounds(new Rectangle(188, 80, 100, 23)); 283 284 Vector hour = new Vector(); 285 for (int i = 0; i <= 23; i++) { 286 hour.add(i, new Integer(i)); 287 } 288 289 startHour = new JComboBox(hour); 290 startHour.setEnabled(false); 291 startHour.setBounds(new Rectangle(188, 115, 50, 23)); 292 293 Vector min = new Vector(); 294 for (int i = 0; i <= 59; i++) { 295 min.add(i, new Integer(i)); 296 } 297 298 startMin = new JComboBox(min); 299 startMin.setEnabled(false); 300 startMin.setBounds(new Rectangle(251, 115, 50, 23)); 301 302 help.setBackground(UIManager.getColor("Button.background")); 303 help.setEnabled(false); 304 help.setFont(new java.awt.Font("Dialog", 2, 12)); 305 help.setRequestFocusEnabled(false); 306 help.setToolTipText(""); 307 help.setDisabledTextColor(Color.black); 308 help.setEditable(false); 309 help.setText("Add Schedule "); 310 help.setBounds(new Rectangle(12, 420, 341, 23)); 311 312 jButtonSchedule.setBounds(new Rectangle(113, 454, 117, 25)); 313 jButtonSchedule.setEnabled(false); 314 jButtonSchedule.setFont(new java.awt.Font("Dialog", 1, 12)); 315 jButtonSchedule.setText("Add Schedule"); 316 jButtonSchedule.addActionListener(new 317 AddSchedule_jButtonSchedule_actionAdapter(this)); 318 jButtonCancel.setBounds(new Rectangle(240, 454, 117, 25)); 319 jButtonCancel.setFont(new java.awt.Font("Dialog", 1, 12)); 320 jButtonCancel.setToolTipText(""); 321 jButtonCancel.setText("Cancel"); 322 jButtonCancel.addActionListener(new AddSchedule_jButtonCancle_actionAdapter(this)); 323 324 jTextScheduleName.addKeyListener(this); 325 jTextSubName.addKeyListener(this); 326 jTextStartDate.addKeyListener(this); 327 jTextScheduleName.addFocusListener(this); 328 jTextSubName.addFocusListener(this); 329 jTextStartDate.addFocusListener(this); 330 jTextSubName.grabFocus(); 331 repType.addActionListener(new 332 AddSchedule_jComboRepType_actionAdapter(this)); 333 RecurrenceType.addActionListener(new 334 AddSchedule_jComboRecurrenceType_actionAdapter(this)); 335 jCheckBoxschType.addActionListener(new 336 AddSchedule_jCheckBoxschType_actionAdapter(this)); 337 panel1.add(help); 338 panel1.add(jLabelAddSchedule); 339 panel1.add(jLabelScheduleName); 340 panel1.add(jLabelSubName); 341 panel1.add(jLabelRemoteServerName); 342 panel1.add(jLabelRemoteRepPortNo); 343 panel1.add(jLabelRepType); 344 panel1.add(jCheckBoxschType, null); 345 346 panel1.add(jTextScheduleName); 347 panel1.add(jTextSubName); 348 panel1.add(jTextRemoteServerName); 349 panel1.add(jTextRemoteRepPortNo); 350 panel1.add(repType); 351 jPanelSchedule.add(jLabelRecurrenceType); 352 jPanelSchedule.add(jLabelStartDate); 353 jPanelSchedule.add(jLabelStartHour); 354 jPanelSchedule.add(jLabelStartMin); 355 jPanelSchedule.add(jLabelCountValue); 356 357 jPanelSchedule.add(RecurrenceType); 358 jPanelSchedule.add(jTextStartDate); 359 jPanelSchedule.add(startHour); 360 jPanelSchedule.add(jLabel1); 361 jPanelSchedule.add(startMin); 362 jPanelSchedule.add(countValue); 363 364 panel1.add(jButtonSchedule, null); 365 panel1.add(jButtonCancel, null); 366 367 //For border purpose. 368 JLabel p1 = new JLabel(); 369 p1.setText(""); 370 p1.setBounds(new Rectangle(9, 66, 350, 350)); 371 p1.setBorder(border1); 372 373 panel1.add(p1); 374 getContentPane().add(panel1); 375 panel1.add(jPanelSchedule); 376 } 377 378 void jButtonCancle_actionPerformed(ActionEvent e) { 379 dispose(); 380 hide(); 381 } 382 383 void jButtonSchedule_actionPerformed(ActionEvent e) { 384 try { 385 String subName = jTextSubName.getText().trim(); 386 if (subName.equalsIgnoreCase("")) { 387 throw new RepException("REP093", new Object[] {null}); 388 } 389 String port = jTextRemoteRepPortNo.getText().trim(); 390 if (port.equalsIgnoreCase("")) { 391 throw new RepException("REP094", new Object[] {null}); 392 } 393 int remoteRepPortNo = 0; 394 remoteRepPortNo = Integer.valueOf(port).intValue(); 395 396 if (remoteRepPortNo <= 0) { 397 throw new RepException("REP220", new Object[] {null}); 398 } 399 String remoteServerName = jTextRemoteServerName.getText().trim(); 400 if (remoteServerName.equalsIgnoreCase("")) { 401 throw new RepException("REP095", new Object[] {null}); 402 } 403 sub = repServer.getSubscription(subName); 404 if (sub == null) { 405 throw new RepException("REP037", new Object[] {subName}); 406 } 407 408 sub.setRemoteServerPortNo(remoteRepPortNo); 409 sub.setRemoteServerUrl(remoteServerName); 410 411 if(jCheckBoxschType.isSelected()) 412 { 413 if (countValue.getSelectedItem() == null) { 414 throw new RepException("REP217", null); 415 } 416 String date = jTextStartDate.getText(); 417 String hour = startHour.getSelectedItem().toString(); 418 String min = startMin.getSelectedItem().toString(); 419 420 Timestamp startTimeStamp = null; 421 String time = date + " " + hour + ":" + min + ":" + "00.000"; 422 try { 423 startTimeStamp = startTimeStamp.valueOf(time); 424 } 425 catch (NumberFormatException ex1) { 426 throw new RepException("REP211", null); 427 } 428 catch (IllegalArgumentException ex2) { 429 throw new RepException("REP211", null); 430 } 431 sub.addSchedule(jTextScheduleName.getText().toString(), 432 jTextSubName.getText().toString(), "nonRealTime", 433 jTextRemoteServerName.getText(), 434 jTextRemoteRepPortNo.getText(), 435 RecurrenceType.getSelectedItem().toString(), 436 repType.getSelectedItem().toString(), startTimeStamp, 437 Integer.parseInt(countValue.getSelectedItem().toString())); 438 }else{ 439 sub.addSchedule(jTextScheduleName.getText().toString(), 440 jTextSubName.getText().toString(), "realTime", 441 jTextRemoteServerName.getText(), 442 jTextRemoteRepPortNo.getText(), 443 "",repType.getSelectedItem().toString(),null,0); 444 } 445 JOptionPane.showMessageDialog(this, "Schedule added successfully", 446 "Success", JOptionPane.INFORMATION_MESSAGE); 447 hide(); 448 } 449 catch (RepException ex) { 450 RepConstants.writeERROR_FILE(ex); 451 JOptionPane.showMessageDialog(this, ex, "Error Message", 452 JOptionPane.ERROR_MESSAGE); 453 return; 454 } 455 catch (Exception ex1) { 456 RepConstants.writeERROR_FILE(ex1); 457 return; 458 } 459 } 460 461 public void keyTyped(KeyEvent keyEvent) { 462 } 463 464 public void keyPressed(KeyEvent keyEvent) { 465 } 466 467 public void keyReleased(KeyEvent keyEvent) { 468 469 } 470 471 public void jComboRecurrenceType_actionPerformed(ActionEvent e) { 472 countValue.removeAllItems(); 473 if (RecurrenceType.getSelectedIndex() == 0) { //Year 474 for (int i = 0; i < 6; i++) { 475 countValue.addItem(new Integer(i)); 476 } 477 } 478 else if (RecurrenceType.getSelectedIndex() == 1) { //Month 479 for (int i = 0; i < 12; i++) { 480 countValue.addItem(new Integer(i)); 481 } 482 } 483 else if (RecurrenceType.getSelectedIndex() == 2) { //Day 484 485 for (int i = 0; i < 31; i++) { 486 countValue.addItem(new Integer(i)); 487 } 488 } 489 else if (RecurrenceType.getSelectedIndex() == 3) { //Hour 490 for (int i = 0; i < 24; i++) { 491 countValue.addItem(new Integer(i)); 492 } 493 } 494 else if (RecurrenceType.getSelectedIndex() == 4) { //minute 495 countValue.addItem(new Integer(5)); 496 countValue.addItem(new Integer(10)); 497 countValue.addItem(new Integer(15)); 498 countValue.addItem(new Integer(20)); 499 countValue.addItem(new Integer(25)); 500 countValue.addItem(new Integer(30)); 501 countValue.addItem(new Integer(35)); 502 countValue.addItem(new Integer(40)); 503 countValue.addItem(new Integer(45)); 504 505 } 506 507 } 508 void jComboRepType_actionPerformed(ActionEvent e){ 509 jButtonSchedule.setEnabled(true); 510 } 511 /** 512 * will enable all the components in Schedule section if user selects the Non realTime schedule option. 513 * @param e 514 */ 515 void jCheckBoxschType_actionPerformed(ActionEvent e) { 516 if (jCheckBoxschType.isSelected()) { 517 for (int i = 0; i < jPanelSchedule.getComponentCount(); i++) { 518 Component com = jPanelSchedule.getComponent(i); 519 com.setEnabled(true); 520 } 521 } 522 else { 523 for (int i = 0; i < jPanelSchedule.getComponentCount(); i++) { 524 jPanelSchedule.getComponent(i).setEnabled(false); 525 } 526 } 527 } 528 529 public void focusGained(FocusEvent fe) { 530 if ( ( (JTextField) fe.getSource()).equals(jTextScheduleName)) { 531 help.setText("Enter Schedule Name in this box"); 532 } 533 else if ( ( (JTextField) fe.getSource()).equals(jTextSubName)) { 534 help.setText("Enter Subscription Name in this box"); 535 } 536 else if ( ( (JTextField) fe.getSource()).equals(jTextStartDate)) { 537 help.setText("Enter Start Date in this box"); 538 539 } 540 } 541 542 public void focusLost(FocusEvent fe) { 543 jButtonSchedule.setEnabled(true); 544 if ( (jTextScheduleName.getText().trim().equalsIgnoreCase("") || 545 jTextStartDate.getText().trim().equalsIgnoreCase("") || 546 jTextSubName.getText().trim().equalsIgnoreCase(""))) { 547 jButtonSchedule.setEnabled(false); 548 } 549 } 550 /* public static void main(String[] args) { 551 JFrame f= new JFrame(); 552 AddSchedule addSchedule = new AddSchedule(f,"",true); 553 addSchedule.setBounds(new Rectangle(375,515)); 554 addSchedule.show(); 555 }*/ 556 } 557 558 class AddSchedule_jButtonCancle_actionAdapter 559 implements java.awt.event.ActionListener { 560 AddSchedule adaptee; 561 562 AddSchedule_jButtonCancle_actionAdapter(AddSchedule adaptee) { 563 this.adaptee = adaptee; 564 } 565 566 public void actionPerformed(ActionEvent e) { 567 adaptee.jButtonCancle_actionPerformed(e); 568 } 569 } 570 571 class AddSchedule_jButtonSchedule_actionAdapter 572 implements java.awt.event.ActionListener { 573 AddSchedule adaptee; 574 575 AddSchedule_jButtonSchedule_actionAdapter(AddSchedule adaptee) { 576 this.adaptee = adaptee; 577 } 578 579 public void actionPerformed(ActionEvent e) { 580 adaptee.jButtonSchedule_actionPerformed(e); 581 } 582 } 583 584 class AddSchedule_jComboRecurrenceType_actionAdapter 585 implements java.awt.event.ActionListener { 586 AddSchedule adaptee; 587 588 AddSchedule_jComboRecurrenceType_actionAdapter(AddSchedule adaptee) { 589 this.adaptee = adaptee; 590 } 591 592 public void actionPerformed(ActionEvent e) { 593 adaptee.jComboRecurrenceType_actionPerformed(e); 594 } 595 } 596 597 class AddSchedule_jCheckBoxschType_actionAdapter 598 implements java.awt.event.ActionListener { 599 AddSchedule adaptee; 600 AddSchedule_jCheckBoxschType_actionAdapter(AddSchedule adaptee) { 601 this.adaptee = adaptee; 602 } 603 604 public void actionPerformed(ActionEvent e) { 605 adaptee.jCheckBoxschType_actionPerformed(e); 606 } 607 } 608 class AddSchedule_jComboRepType_actionAdapter 609 implements java.awt.event.ActionListener { 610 AddSchedule adaptee; 611 612 AddSchedule_jComboRepType_actionAdapter(AddSchedule adaptee) { 613 this.adaptee = adaptee; 614 } 615 616 public void actionPerformed(ActionEvent e) { 617 adaptee.jComboRepType_actionPerformed(e); 618 } 619 }

