Home
Content of source file org.apache.log4j.lf5.viewer.LogFactor5InputDialog.java.res Press <TAB> to move from one error to the next
package org.apache.log4j.lf5.viewer;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
public 
class LogFactor5InputDialog
 extends LogFactor5Dialog 
{
   
   public static final 
   int SIZE
   //QC   Intervals :     (int) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.SIZE : Interval   0 :           30 : 30          
   =30
   ;
   
   private 
   JTextField _textField
   //QC   Intervals :(JTextField) org.apache.log4j.lf5.viewer.LogFactor5InputDialog._textField: Interval   0 :         null null        
   //QC             :                                                                           Interval   1 :          new new         
   
   ;
   
   public 
   LogFactor5InputDialog
   (
      JFrame jframe
      ,
      String title
      ,
      String label
   )
   //QC   Intervals :  (JFrame) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.jframe: Interval   0 :         null null        
   //QC             :                                                                                           Interval   1 :          new new         
   //QC   Intervals :  (String) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.title: Interval   0 :         null null        
   //QC             :                                                                                          Interval   1 :          new new         
   //QC   Intervals :  (String) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.label: Interval   0 :         null null        
   //QC             :                                                                                          Interval   1 :          new new         
   
   {
      
      this(jframe,title,label,SIZE);
      //type of the function/method : LogFactor5InputDialog
      //QC-CWE252 or QCerrorRTF return type of function is not tested (see http://cwe.mitre.org/data/definitions/252.html)
   }
   
   public 
   LogFactor5InputDialog
   (
      JFrame jframe
      ,
      String title
      ,
      String label
      ,
      int size
   )
   //QC   Intervals :  (JFrame) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.jframe: Interval   0 :         null null        
   //QC             :                                                                                           Interval   1 :          new new         
   //QC   Intervals :  (String) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.title: Interval   0 :         null null        
   //QC             :                                                                                          Interval   1 :          new new         
   //QC   Intervals :  (String) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.label: Interval   0 :         null null        
   //QC             :                                                                                          Interval   1 :          new new         
   //QC   Intervals :     (int) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.size: Interval   0 :  -2147483647 : 2147483647  
   
   {
      
      super(jframe,title,true);
      //type of the function/method : LogFactor5Dialog
      JPanel bottom=new JPanel();
      //QC   Intervals :  (JPanel) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.bottom: Interval   0 :          new new         
      
      bottom.setLayout(new FlowLayout());
      //QC   Intervals :(LayoutManager) java.awt.Container.setLayout
1                         : Interval   0 :          new new         
      //type of the function/method : void
      JPanel main=new JPanel();
      //QC   Intervals :  (JPanel) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.main: Interval   0 :          new new         
      
      main.setLayout(new FlowLayout());
      //QC   Intervals :(LayoutManager) java.awt.Container.setLayout
1                         : Interval   0 :          new new         
      //type of the function/method : void
      
      main.add(new JLabel(label));
      //QC   Intervals :(PopupMenu) java.awt.Component.add
1                               : Interval   0 :          new new         
      //type of the function/method : void
      
      _textField=(new JTextField(size));
      //QC   Intervals :(JTextField) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog
: Interval   0 :          new new         
      //assignation
      
      main.add(_textField);
      //type of the function/method : void
      
      addKeyListener(new KeyAdapter(){public void keyPressed(KeyEvent e){if (e.getKeyCode()==KeyEvent.VK_ENTER){hide();}}});
      //QC   Intervals :(KeyListener) java.awt.Component.addKeyListener
1                    : Interval   0 :          new new         
      {
         
         public 
         void  keyPressed
         (
            KeyEvent e
         )
         //QC   Intervals :(KeyEvent) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.addKeyListener.KeyAdapter.keyPressed.e: Interval   0 :         null null        
         //QC             :                                                                                                                           Interval   1 :          new new         
         
         {
            
            if (e.getKeyCode()==KeyEvent.VK_ENTER)
               //QC-CWE476 or QCerrorNPE null pointer reference on e (see http://cwe.mitre.org/data/definitions/476.html)
               //QC   Intervals :     (int) java.awt.event.KeyEvent.getKeyCode
                    : Interval   0 :            n : n           
               //QC   Intervals :     (int) java.awt.event.KeyEvent.VK_ENTER
                      : Interval   0 :            n : n           
               {
                  
                  hide();
                  //type of the function/method : void
               }
         }
         
      }
      {
         
         public 
         void  keyPressed
         (
            KeyEvent e
         )
         //QC   Intervals :(KeyEvent) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.addKeyListener.KeyAdapter.keyPressed.e: Interval   0 :         null null        
         //QC             :                                                                                                                           Interval   1 :          new new         
         
         {
            
            if (e.getKeyCode()==KeyEvent.VK_ENTER)
               //QC-CWE476 or QCerrorNPE null pointer reference on e (see http://cwe.mitre.org/data/definitions/476.html)
               //QC   Intervals :     (int) java.awt.event.KeyEvent.getKeyCode
                    : Interval   0 :            n : n           
               //QC   Intervals :     (int) java.awt.event.KeyEvent.VK_ENTER
                      : Interval   0 :            n : n           
               {
                  
                  hide();
                  //type of the function/method : void
               }
         }
         
      }
      //type of the function/method : void
      JButton ok=new JButton("Ok");
      //QC   Intervals : (JButton) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.ok: Interval   0 :          new new         
      
      ok.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){hide();}});
      //QC   Intervals :(ActionListener) javax.swing.AbstractButton.addActionListener
1         : Interval   0 :          new new         
      {
         
         public 
         void  actionPerformed
         (
            ActionEvent e
         )
         //QC   Intervals :(ActionEvent) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.ok.ActionListener.actionPerformed.e: Interval   0 :         null null        
         //QC             :                                                                                                                           Interval   1 :          new new         
         
         {
            
            hide();
            //type of the function/method : void
         }
         
      }
      {
         
         public 
         void  actionPerformed
         (
            ActionEvent e
         )
         //QC   Intervals :(ActionEvent) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.ok.ActionListener.actionPerformed.e: Interval   0 :         null null        
         //QC             :                                                                                                                           Interval   1 :          new new         
         
         {
            
            hide();
            //type of the function/method : void
         }
         
      }
      //type of the function/method : void
      JButton cancel=new JButton("Cancel");
      //QC   Intervals : (JButton) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.cancel: Interval   0 :          new new         
      
      cancel.addActionListener(new ActionListener(){public void actionPerformed(ActionEvent e){hide();_textField.setText("");}});
      //QC   Intervals :(ActionListener) javax.swing.AbstractButton.addActionListener
1         : Interval   0 :          new new         
      {
         
         public 
         void  actionPerformed
         (
            ActionEvent e
         )
         //QC   Intervals :(ActionEvent) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.cancel.ActionListener.actionPerformed.e: Interval   0 :         null null        
         //QC             :                                                                                                                               Interval   1 :          new new         
         
         {
            
            hide();
            //type of the function/method : void
            
            _textField.setText("");
            //QC   Intervals :  (String) javax.swing.text.JTextComponent.setText
1              : Interval   0 :              :             
            //type of the function/method : void
         }
         
      }
      {
         
         public 
         void  actionPerformed
         (
            ActionEvent e
         )
         //QC   Intervals :(ActionEvent) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.LogFactor5InputDialog.cancel.ActionListener.actionPerformed.e: Interval   0 :         null null        
         //QC             :                                                                                                                               Interval   1 :          new new         
         
         {
            
            hide();
            //type of the function/method : void
            
            _textField.setText("");
            //QC   Intervals :  (String) javax.swing.text.JTextComponent.setText
1              : Interval   0 :              :             
            //type of the function/method : void
         }
         
      }
      //type of the function/method : void
      
      bottom.add(ok);
      //QC   Intervals :(PopupMenu) java.awt.Component.add
1                               : Interval   0 :          new new         
      //type of the function/method : void
      
      bottom.add(cancel);
      //type of the function/method : void
      
      getContentPane().add(main,BorderLayout.CENTER);
      //type of the function/method : void;Component;Object
      //QC-CWE252 or QCerrorRTF return type of function is not tested (see http://cwe.mitre.org/data/definitions/252.html)
      
      getContentPane().add(bottom,BorderLayout.SOUTH);
      //type of the function/method : void;Component;Object
      //QC-CWE252 or QCerrorRTF return type of function is not tested (see http://cwe.mitre.org/data/definitions/252.html)
      
      pack();
      //type of the function/method : void
      
      centerWindow(this);
      //QC   Intervals :  (Window) org.apache.log4j.lf5.viewer.LogFactor5Dialog.centerWindow
1: Interval   0 :          new new         
      //type of the function/method : void
      
      show();
      //type of the function/method : void;boolean
      //QC-CWE252 or QCerrorRTF return type of function is not tested (see http://cwe.mitre.org/data/definitions/252.html)
   }
   
   public 
   String getText
   //QC   Intervals :  (String) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.getText: Interval   0 :         null null        
   //QC             :                                                                      Interval   1 :          new new         
   (
   )
   
   {
      String s=_textField.getText();
      //QC   Intervals :  (String) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.getText.s: Interval   0 :         null null        
      //QC             :                                                                        Interval   1 :          new new         
      
      if ((s!=null )&&(s.trim().length()==0))
         //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
         //QC   Intervals :  (String) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.getText.s: Interval   0 :          new new         
         //QC   Intervals :  (String) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.getText.s
: Interval   0 :         null null        
         //QC             :                                                                         Interval   1 :          new new         
         {
            
            return null ;
            //QC   Intervals :  (String) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.getText.return: Interval   0 :         null null        
         }
      //QC-CWE476 or QCerrorNPE null pointer reference on s (see http://cwe.mitre.org/data/definitions/476.html)
      //QC   Intervals :  (String) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.getText.s: Interval   0 :         null null        
      //QC   Intervals :  (String) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.getText.s
: Interval   0 :         null null        
      //QC             :                                                                         Interval   1 :          new new         
      
      return s;
      //QC   Intervals :  (String) org.apache.log4j.lf5.viewer.LogFactor5InputDialog.getText.return: Interval   0 :         null null        
      //QC             :                                                                             Interval   1 :          new new         
   }
   
}