Examples of GUIConfiguration


Examples of com.qspin.qtaste.config.GUIConfiguration

                }
            });

            JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, mTreeTabsPanel, mRightPanels);
            splitPane.setDividerSize(4);
            GUIConfiguration guiConfiguration = GUIConfiguration.getInstance();
            int mainHorizontalSplitDividerLocation= guiConfiguration.getInt(MAIN_HORIZONTAL_SPLIT_DIVIDER_LOCATION_PROPERTY, 285);
            splitPane.setDividerLocation(mainHorizontalSplitDividerLocation);
           
            splitPane.addPropertyChangeListener(new PropertyChangeListener() {
                public void propertyChange(PropertyChangeEvent evt) {
                    if (evt.getPropertyName().equals("dividerLocation")) {
                        GUIConfiguration guiConfiguration = GUIConfiguration.getInstance();
                        if (evt.getSource() instanceof JSplitPane) {
                            JSplitPane splitPane= (JSplitPane)evt.getSource();
                            guiConfiguration.setProperty(MAIN_HORIZONTAL_SPLIT_DIVIDER_LOCATION_PROPERTY, splitPane.getDividerLocation());
                            try {
                                guiConfiguration.save();
                            } catch (ConfigurationException ex) {
                                logger.error("Error while saving GUI configuration: " + ex.getMessage());
                            }
                        }
                    }
View Full Code Here

Examples of com.qspin.qtaste.config.GUIConfiguration

            // handle optional config file name
            if ((pArgs.length != 0) && (pArgs.length != 2) && (pArgs.length != 4) && (pArgs.length != 6) && (pArgs.length != 8)) {
                showUsage();
            }

            GUIConfiguration guiConfiguration = GUIConfiguration.getInstance();

            boolean testBedArgumentPresent = false;
            String testSuiteDir = null;
            int numberLoops = 1;
            boolean loopsInHours = false;
//            String sutVersion = null;

            for (int i = 0; i < pArgs.length; i = i + 2) {
                if (pArgs[i].equals("-testsuite")) {
                  LOGGER.info("Using " + pArgs[i + 1] + " as test suite directory");
                    testSuiteDir = pArgs[i + 1];
                } else if (pArgs[i].equals("-testbed")) {
                    String testbedFileName = pArgs[i + 1];
                    LOGGER.info("Using " + testbedFileName + " as testbed configuration file");
                    TestBedConfiguration.setConfigFile(testbedFileName);
                    // save testbed
                    testbedFileName = new File(testbedFileName).getName();
                    String testbed = testbedFileName.substring(0, testbedFileName.lastIndexOf('.'));
                    guiConfiguration.setProperty(StaticConfiguration.LAST_SELECTED_TESTBED_PROPERTY, testbed);
                    testBedArgumentPresent = true;
                } else if (pArgs[i].equals("-engine")) {
                  LOGGER.info("Using " + pArgs[i + 1] + " as engine configuration file");
                    TestEngineConfiguration.setConfigFile(pArgs[i + 1]);
                } else if (pArgs[i].equals("-loop")) {
//                    String message = "Running test suite in loop";
                    numberLoops = -1;
                    if ((i + 1 < pArgs.length)) {
                        // more arguments, check if next argument is a loop argument
                        if (pArgs[i + 1].startsWith("-")) {
                            i++;
                        } else {
                            String countOrHoursStr;
                            if (pArgs[i + 1].endsWith("h")) {
                                loopsInHours = true;
                                countOrHoursStr = pArgs[i + 1].substring(0, pArgs[i + 1].length() - 1);
                            } else {
                                loopsInHours = false;
                                countOrHoursStr = pArgs[i + 1];
                            }
                            try {
                                numberLoops = Integer.parseInt(countOrHoursStr);
                                if (numberLoops <= 0) {
                                    throw new NumberFormatException();
                                }
//                                message += (loopsInHours ? " during " : " ") + numberLoops + " " + (loopsInHours ? "hour" : "time") + (numberLoops > 1 ? "s" : "");
                                i += 2;
                            } catch (NumberFormatException e) {
                                showUsage();
                            }
                        }
                    }
                } else if (pArgs[i].equals("-sutversion") && (i + 1 < pArgs.length)) {
                  LOGGER.info("Using " + pArgs[i + 1] + " as sutversion");
                    TestBedConfiguration.setSUTVersion(pArgs[i + 1]);
                    i += 2;
                } else {
                    // no more arguments
                    i++;
                }
            }
            if (!testBedArgumentPresent) {
                String lastSelectedTestbed = guiConfiguration.getString(StaticConfiguration.LAST_SELECTED_TESTBED_PROPERTY, "default");
                String testbedConfigFileName = StaticConfiguration.TESTBED_CONFIG_DIRECTORY + "/" + lastSelectedTestbed + "." + StaticConfiguration.TESTBED_CONFIG_FILE_EXTENSION;
                if (!new File(testbedConfigFileName).exists()) {
                    // if last selected testbed doesn't exist use the first one found
                    File[] testbedConfigFiles = FileUtilities.listSortedFiles(new File(StaticConfiguration.TESTBED_CONFIG_DIRECTORY),new FileFilter() {

                        public boolean accept(File pathname) {
                            return pathname.getName().toLowerCase().endsWith(".xml");
                        }
                    });
                    if (testbedConfigFiles == null) {
                        throw new RuntimeException("Testbed configuration directory (" + StaticConfiguration.TESTBED_CONFIG_DIRECTORY + ") not found.");
                    }
                    if (testbedConfigFiles.length > 0) {
                        testbedConfigFileName = testbedConfigFiles[0].getCanonicalPath();
                        // save testbed
                        final String testbedFileName = testbedConfigFiles[0].getName();
                        guiConfiguration.setProperty(StaticConfiguration.LAST_SELECTED_TESTBED_PROPERTY, testbedFileName.substring(0, testbedFileName.lastIndexOf('.')));
                    } else {
                        throw new RuntimeException("No testbed config file available.");
                    }
                }
                TestBedConfiguration.setConfigFile(testbedConfigFileName);
View Full Code Here

Examples of com.qspin.qtaste.config.GUIConfiguration

            }
        };
        tcTable.setColumnSelectionAllowed(false);

        int tcWidth, tcStatusWidth, tcDetailsWidth, tcResultWidth;
        GUIConfiguration guiConfiguration = GUIConfiguration.getInstance();
        List<?> list = guiConfiguration.configurationsAt(tableLayoutProperty);
        if (!list.isEmpty()) {
            tcWidth = guiConfiguration.getInt(testCaseColumnProperty);
            tcStatusWidth = guiConfiguration.getInt(statusColumnProperty);
            tcDetailsWidth = guiConfiguration.getInt(detailsColumnProperty);
            if (interactive) {
                tcResultWidth = guiConfiguration.getInt(resultColumnProperty);
            }
        } else {
            tcWidth = interactive ? 360 : 480;
            tcStatusWidth = 40;
            tcDetailsWidth = 360;
            tcResultWidth = 150;
            guiConfiguration.setProperty(testCaseColumnProperty, tcWidth);
            guiConfiguration.setProperty(statusColumnProperty, tcStatusWidth);
            guiConfiguration.setProperty(detailsColumnProperty, tcDetailsWidth);
            if (interactive) {
                guiConfiguration.setProperty(resultColumnProperty, tcResultWidth);
            }
            try {
                guiConfiguration.save();
            } catch (ConfigurationException ex) {
                logger.error("Error while saving GUI configuration: " + ex.getMessage());
            }
        }

        TableColumnModel tcTableColumnModel = tcTable.getColumnModel();
        tcTableColumnModel.getColumn(TEST_CASE).setPreferredWidth(tcWidth);
        tcTableColumnModel.getColumn(STATUS).setPreferredWidth(tcStatusWidth);
        tcTableColumnModel.getColumn(STATUS).setMaxWidth(40);
        tcTableColumnModel.getColumn(DETAILS).setPreferredWidth(tcDetailsWidth);
        tcTableColumnModel.getColumn(EXEC_TIME).setPreferredWidth(80);
        tcTableColumnModel.getColumn(EXEC_TIME).setMinWidth(80);
        tcTableColumnModel.getColumn(EXEC_TIME).setMaxWidth(80);
        tcTableColumnModel.removeColumn(tcTableColumnModel.getColumn(TC));
        if (!interactive) {
            tcTable.getSelectionModel().addListSelectionListener(new TCResultsSelectionListeners());
        }
        tcTable.setName("tcTable");
        tcTableColumnModel.addColumnModelListener(new TableColumnModelListener() {

            public void columnAdded(TableColumnModelEvent e) {
            }

            public void columnRemoved(TableColumnModelEvent e) {
            }

            public void columnMoved(TableColumnModelEvent e) {
            }

            public void columnMarginChanged(ChangeEvent e) {
                try {
                    // save the current layout
                    int tcWidth = tcTable.getColumnModel().getColumn(TEST_CASE).getWidth();
                    int tcStatusWidth = tcTable.getColumnModel().getColumn(STATUS).getWidth();
                    int tcDetailsWidth = tcTable.getColumnModel().getColumn(DETAILS).getWidth();
                    int tcResultWidth = tcTable.getColumnModel().getColumn(RESULT).getWidth();
                    // save it into the settings
                    GUIConfiguration guiConfiguration = GUIConfiguration.getInstance();
                    guiConfiguration.setProperty(testCaseColumnProperty, tcWidth);
                    guiConfiguration.setProperty(statusColumnProperty, tcStatusWidth);
                    guiConfiguration.setProperty(detailsColumnProperty, tcDetailsWidth);
                    if (interactive) {
                        guiConfiguration.setProperty(resultColumnProperty, tcResultWidth);
                    }
                    guiConfiguration.save();
                } catch (ConfigurationException ex) {
                    logger.error("Error while saving GUI configuration: " + ex.getMessage());
                }
            }
View Full Code Here

Examples of com.qspin.qtaste.config.GUIConfiguration

    protected static final HTMLDocument EMPTY_DOC = new HTMLDocument();

    public TestCasePane(MainPanel parent) {
        super(new BorderLayout());
       
        GUIConfiguration guiConfiguration = GUIConfiguration.getInstance();
        boolean showLogsTab = guiConfiguration.getBoolean(SHOW_LOGS_TAB, true);
        if (showLogsTab) {
           tcLogsPane = new Log4jPanel();          
        }
       
        this.parent = parent;
View Full Code Here

Examples of com.qspin.qtaste.config.GUIConfiguration

                if (mTestbedList.getSelectedItem() != null) {
                    String selectedTestbed = (String) mTestbedList.getSelectedItem();
                    String configFile = StaticConfiguration.TESTBED_CONFIG_DIRECTORY + "/" + selectedTestbed + "." + StaticConfiguration.TESTBED_CONFIG_FILE_EXTENSION;
                    TestBedConfiguration.setConfigFile(configFile);

                    GUIConfiguration guiConfiguration = GUIConfiguration.getInstance();
                    guiConfiguration.setProperty(StaticConfiguration.LAST_SELECTED_TESTBED_PROPERTY, selectedTestbed);
                    try {
                        guiConfiguration.save();
                    } catch (ConfigurationException ex) {
                        logger.error("Error while saving GUI configuration: " + ex.getMessage());
                    }
                }
                refreshData();
View Full Code Here

Examples of com.qspin.qtaste.config.GUIConfiguration

                }
            }
        });

        // get last selected campaign
        GUIConfiguration guiConfiguration = GUIConfiguration.getInstance();
        String lastSelectedCampaign = guiConfiguration.getString(LAST_SELECTED_CAMPAIGN_PROPERTY);

        // add campaigns found in the list
        MetaCampaignFile[] campaigns = populateCampaignList();
        topPanel.add(label);
        topPanel.add(metaCampaignComboBox);

        metaCampaignComboBox.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                MetaCampaignFile currentSelectedCampaign = (MetaCampaignFile) metaCampaignComboBox.getSelectedItem();
                if (currentSelectedCampaign != selectedCampaign) {
                    selectedCampaign = currentSelectedCampaign;
                  if (selectedCampaign != null) {
                      treeTable.removeAll();
                      if (new File(selectedCampaign.getFileName()).exists()) {
                          treeTable.load(selectedCampaign.getFileName());
                      }
                     
                      GUIConfiguration guiConfiguration = GUIConfiguration.getInstance();
                      guiConfiguration.setProperty(LAST_SELECTED_CAMPAIGN_PROPERTY, selectedCampaign.getCampaignName());
                      try {
                          guiConfiguration.save();
                      } catch (ConfigurationException ex) {
                          logger.error("Error while saving GUI configuration: " + ex.getMessage(), ex);
                      }
                  }
                }
View Full Code Here

Examples of com.qspin.qtaste.config.GUIConfiguration

                }
                else
                  // update the screen with the doc of the selected test script
                  setTestCaseDoc(script.getTestcaseDoc(), false);
                // Get the user preferences to display the testcase tab
                GUIConfiguration guiConfiguration = GUIConfiguration.getInstance();
                String testCaseTabOnSelect = "none"; // default
                if (guiConfiguration.containsKey(TEST_CASE_TAB_ON_SELECT_PROPERTY)) {
                    testCaseTabOnSelect = guiConfiguration.getString(TEST_CASE_TAB_ON_SELECT_PROPERTY).toLowerCase();
                } else {
                    guiConfiguration.setProperty(TEST_CASE_TAB_ON_SELECT_PROPERTY, testCaseTabOnSelect);
                    try {
                        guiConfiguration.save();
                    } catch (ConfigurationException ex) {
                        logger.error("Error while saving GUI configuration: " + ex.getMessage());
                    }
                }
                if (testCaseTabOnSelect.equals("doc")) {
                    testCasePane.getTabbedPane().setSelectedIndex(TestCasePane.DOC_INDEX);
                } else if (testCaseTabOnSelect.equals("source")) {
                    testCasePane.getTabbedPane().setSelectedIndex(TestCasePane.SOURCE_INDEX);
                } else if (testCaseTabOnSelect.equals("results")) {
                    testCasePane.getTabbedPane().setSelectedIndex(TestCasePane.RESULTS_INDEX);
                } else if (testCaseTabOnSelect.equals("logs")) {
                    testCasePane.getTabbedPane().setSelectedIndex(TestCasePane.LOGS_INDEX);
                } else if (!testCaseTabOnSelect.equals("none")) {
                    logger.warn("Invalid value for GUI configuration property " + TEST_CASE_TAB_ON_SELECT_PROPERTY + " (" + guiConfiguration.getString(TEST_CASE_TAB_ON_SELECT_PROPERTY) + ")");
                }
            }
        }
    }
View Full Code Here

Examples of mekanism.client.gui.GuiConfiguration

      case 7:
        return new GuiRotaryCondensentrator(player.inventory, (TileEntityRotaryCondensentrator)tileEntity);
      case 8:
        return new GuiEnergyCube(player.inventory, (TileEntityEnergyCube)tileEntity);
      case 9:
        return new GuiConfiguration(player, (IInvConfiguration)tileEntity);
      case 10:
        return new GuiGasTank(player.inventory, (TileEntityGasTank)tileEntity);
      case 11:
        return new GuiFactory(player.inventory, (TileEntityFactory)tileEntity);
      case 12:
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.