Examples of JCheckListItem


Examples of com.commander4j.gui.JCheckListItem

    String fieldsSQL = "";
    int x = listDictionary.getModel().getSize();
    if (x > 0)
    {
      JCheckListItem tempItem;
      for (int sel = 0; sel < x; sel++)
      {
        tempItem = (JCheckListItem) listDictionary.getModel().getElementAt(sel);
        if (tempItem.isSelected())
        {
          JDBQMDictionary dictItem = (JDBQMDictionary) tempItem.getValue();
          String testID = dictItem.getTestID();
          String description = dictItem.getDescription();
          String tempField = ",MAX(CASE TEST_ID WHEN '" + testID + "' THEN RESULT ELSE NULL END) AS '" + description + "'";
          if (fieldsSQL.equals(""))
          {
            fieldsSQL = tempField;
          } else
          {
            fieldsSQL = fieldsSQL + tempField;
          }
        }
      }
    }

    String joinSQL = "FROM VIEW_QM_RESULTS WHERE 1 = 1";

    String whereSQL = "";

    if (textFieldProcessOrder.getText().equals("") == false)
    {
      whereSQL = whereSQL + " AND PROCESS_ORDER = '" + textFieldProcessOrder.getText() + "'";
    }

    if (textFieldMaterial.getText().equals("") == false)
    {
      whereSQL = whereSQL + " AND MATERIAL = '" + textFieldMaterial.getText() + "'";
    }

    if (textFieldInspectionID.getText().equals("") == false)
    {
      whereSQL = whereSQL + " AND INSPECTION_ID = '" + textFieldInspectionID.getText() + "'";
    }

    if (textFieldUserData1.getText().equals("") == false)
    {
      whereSQL = whereSQL + " AND USER_DATA_1 = '" + textFieldUserData1.getText() + "'";
    }

    if (textFieldUserData2.getText().equals("") == false)
    {
      whereSQL = whereSQL + " AND USER_DATA_2 = '" + textFieldUserData2.getText() + "'";
    }

    int dateParams = 0;

    if (checkBoxSampleFrom.isSelected())
    {
      dateParams++;
    }
    if (checkBoxSampleTo.isSelected())
    {
      dateParams++;
    }

    if (dateParams > 0)
    {
      if (dateParams == 1)
      {
        if (checkBoxSampleFrom.isSelected())
        {
          whereSQL = whereSQL + " AND SAMPLE_DATE >= ? ";
        }
        if (checkBoxSampleTo.isSelected())
        {
          whereSQL = whereSQL + " AND SAMPLE_DATE <= ? ";
        }
      } else
      {
        if (dateParams == 2)
        {
          whereSQL = whereSQL + " AND SAMPLE_DATE >= ? AND SAMPLE_DATE <= ? ";
        }
      }
    }

    String groupSQL = "GROUP BY SAMPLE_ID,SAMPLE_DATE,Inspection_ID,Activity_ID,MATERIAL,PROCESS_ORDER,USER_DATA_1,USER_DATA_2";

    String sqlHaving = "";
   
    if (x > 0)
    {
      int count = 0;
      String limit = Common.hostList.getHost(Common.selectedHostID).getDatabaseParameters().getjdbcDatabaseSelectLimit();
      String fieldDelim1 = "";
      String fieldDelim2 = "";
      if (limit.equals("top"))
      {
        fieldDelim1 = "'";
        fieldDelim2 = "'";
      }
      if (limit.equals("rownum"))
      {
        fieldDelim1 = "\"";
        fieldDelim2 = "\"";
      }
      if (limit.equals("limit"))
      {
        fieldDelim1 = "`";
        fieldDelim2 = "`";
      }     
      JCheckListItem tempItem;
      for (int sel = 0; sel < x; sel++)
      {
        tempItem = (JCheckListItem) listDictionary.getModel().getElementAt(sel);
        if (tempItem.isSelected())
        {
          JDBQMDictionary dictItem = (JDBQMDictionary) tempItem.getValue();
          String description = dictItem.getDescription();

          if (count == 0)
          {
             sqlHaving = " HAVING ("+fieldDelim1+description+fieldDelim2+" IS NOT NULL) ";
View Full Code Here

Examples of com.commander4j.gui.JCheckListItem

        JList4j list = (JList4j) event.getSource();

        // Get index of item clicked

        int index = list.locationToIndex(event.getPoint());
        JCheckListItem item = (JCheckListItem) list.getModel().getElementAt(index);

        // Toggle selected state

        item.setSelected(!item.isSelected());

        // Repaint cell

        list.repaint(list.getCellBounds(index, index));
      }
View Full Code Here

Examples of com.commander4j.gui.JCheckListItem

      rs = stmt.executeQuery();

      while (rs.next()) {
        JDBQMDictionary mt = new JDBQMDictionary(getHostID(), getSessionID());
        mt.getValuesFromResultSet(rs);
        JCheckListItem ci = new JCheckListItem(mt);
        testList.add(ci);
      }
      rs.close();
      stmt.close();
View Full Code Here

Examples of com.commander4j.gui.JCheckListItem

        JList4j<?> list = (JList4j<?>) event.getSource();

        // Get index of item clicked

        int index = list.locationToIndex(event.getPoint());
        JCheckListItem item = (JCheckListItem) list.getModel().getElementAt(index);

        // Toggle selected state

        item.setSelected(!item.isSelected());

        // Repaint cell

        list.repaint(list.getCellBounds(index, index));
      }
View Full Code Here

Examples of com.commander4j.gui.JCheckListItem

    String fieldsSQL = "";
    int x = listDictionary.getModel().getSize();
    if (x > 0)
    {
      JCheckListItem tempItem;
      for (int sel = 0; sel < x; sel++)
      {
        tempItem = (JCheckListItem) listDictionary.getModel().getElementAt(sel);
        if (tempItem.isSelected())
        {
          JDBQMDictionary dictItem = (JDBQMDictionary) tempItem.getValue();
          String testID = dictItem.getTestID();
          String description = dictItem.getDescription();
          String tempField = ",MAX(CASE TEST_ID WHEN '" + testID + "' THEN RESULT ELSE NULL END) AS '" + description + "'";
          if (fieldsSQL.equals(""))
          {
            fieldsSQL = tempField;
          } else
          {
            fieldsSQL = fieldsSQL + tempField;
          }
        }
      }
    }

    String joinSQL = "FROM VIEW_QM_RESULTS WHERE 1 = 1";

    String whereSQL = "";

    if (textFieldProcessOrder.getText().equals("") == false)
    {
      whereSQL = whereSQL + " AND PROCESS_ORDER = '" + textFieldProcessOrder.getText() + "'";
    }

    if (textFieldMaterial.getText().equals("") == false)
    {
      whereSQL = whereSQL + " AND MATERIAL = '" + textFieldMaterial.getText() + "'";
    }

    if (textFieldInspectionID.getText().equals("") == false)
    {
      whereSQL = whereSQL + " AND INSPECTION_ID = '" + textFieldInspectionID.getText() + "'";
    }

    if (textFieldUserData1.getText().equals("") == false)
    {
      whereSQL = whereSQL + " AND USER_DATA_1 = '" + textFieldUserData1.getText() + "'";
    }

    if (textFieldUserData2.getText().equals("") == false)
    {
      whereSQL = whereSQL + " AND USER_DATA_2 = '" + textFieldUserData2.getText() + "'";
    }

    int dateParams = 0;

    if (checkBoxSampleFrom.isSelected())
    {
      dateParams++;
    }
    if (checkBoxSampleTo.isSelected())
    {
      dateParams++;
    }

    if (dateParams > 0)
    {
      if (dateParams == 1)
      {
        if (checkBoxSampleFrom.isSelected())
        {
          whereSQL = whereSQL + " AND SAMPLE_DATE >= ? ";
        }
        if (checkBoxSampleTo.isSelected())
        {
          whereSQL = whereSQL + " AND SAMPLE_DATE <= ? ";
        }
      } else
      {
        if (dateParams == 2)
        {
          whereSQL = whereSQL + " AND SAMPLE_DATE >= ? AND SAMPLE_DATE <= ? ";
        }
      }
    }

    String groupSQL = "GROUP BY SAMPLE_ID,SAMPLE_DATE,Inspection_ID,Activity_ID,MATERIAL,PROCESS_ORDER,USER_DATA_1,USER_DATA_2";

    String sqlHaving = "";
   
    if (x > 0)
    {
      int count = 0;
      String limit = Common.hostList.getHost(Common.selectedHostID).getDatabaseParameters().getjdbcDatabaseSelectLimit();
      String fieldDelim1 = "";
      String fieldDelim2 = "";
      if (limit.equals("top"))
      {
        fieldDelim1 = "'";
        fieldDelim2 = "'";
      }
      if (limit.equals("rownum"))
      {
        fieldDelim1 = "\"";
        fieldDelim2 = "\"";
      }
      if (limit.equals("limit"))
      {
        fieldDelim1 = "`";
        fieldDelim2 = "`";
      }     
      JCheckListItem tempItem;
      for (int sel = 0; sel < x; sel++)
      {
        tempItem = (JCheckListItem) listDictionary.getModel().getElementAt(sel);
        if (tempItem.isSelected())
        {
          JDBQMDictionary dictItem = (JDBQMDictionary) tempItem.getValue();
          String description = dictItem.getDescription();

          if (count == 0)
          {
             sqlHaving = " HAVING ("+fieldDelim1+description+fieldDelim2+" IS NOT NULL) ";
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.