< prev index next >

## src/com/sun/javatest/audit/OptionsDialog.java

Print this page

    *** 190,200 ****
          }

          private void updateTestSuiteChoices() {
              // get the paths of currently loaded test suites
              // could move this to TestSuite, and use the dirMap cache
    !         SortedSet s = new TreeSet();
              Desktop d = tool.getDesktop();
              Tool[] tools = d.getTools();
              if (tools != null) {
                  for (int i = 0; i < tools.length; i++) {
                      Tool t = tools[i];
    --- 190,200 ----
          }

          private void updateTestSuiteChoices() {
              // get the paths of currently loaded test suites
              // could move this to TestSuite, and use the dirMap cache
    !         SortedSet<String> s = new TreeSet<>();
              Desktop d = tool.getDesktop();
              Tool[] tools = d.getTools();
              if (tools != null) {
                  for (int i = 0; i < tools.length; i++) {
                      Tool t = tools[i];
    *** 235,245 ****
                  // ignore
              }

              // get the paths of currently loaded work directories
              // could move this to WorkDirectory and use the dirMap cache
    !         SortedSet s = new TreeSet();
              Desktop d = tool.getDesktop();
              Tool[] tools = d.getTools();
              if (tools != null) {
                  for (int i = 0; i < tools.length; i++) {
                      Tool t = tools[i];
    --- 235,245 ----
                  // ignore
              }

              // get the paths of currently loaded work directories
              // could move this to WorkDirectory and use the dirMap cache
    !         SortedSet<String> s = new TreeSet<>();
              Desktop d = tool.getDesktop();
              Tool[] tools = d.getTools();
              if (tools != null) {
                  for (int i = 0; i < tools.length; i++) {
                      Tool t = tools[i];
    *** 289,299 ****
              }
              cfField.setSelectedItem(cfp);
          }

          private void updateConfigFileChoices() {
    !         SortedSet s = new TreeSet();
              String wdp = (String) (wdField.getSelectedItem());
              try {
                  WorkDirectory wd = WorkDirectory.open(new File(wdp));
                  FileHistory history = FileHistory.getFileHistory(wd, "configHistory.jtl");
                  File[] entries = history.getRecentEntries(10);
    --- 289,299 ----
              }
              cfField.setSelectedItem(cfp);
          }

          private void updateConfigFileChoices() {
    !         SortedSet<String> s = new TreeSet<>();
              String wdp = (String) (wdField.getSelectedItem());
              try {
                  WorkDirectory wd = WorkDirectory.open(new File(wdp));
                  FileHistory history = FileHistory.getFileHistory(wd, "configHistory.jtl");
                  File[] entries = history.getRecentEntries(10);
    *** 304,317 ****
                  // ignore
              }
              setItems(cfField, s);
          }

    !     private void setItems(JComboBox field, SortedSet s) {
              // first, remove unwanted entries from field
              for (int i = field.getItemCount() - 1; i >= 0; i-- ) {
    !             String item = (String) (field.getItemAt(i));
                  if (s.contains(item)) {
                      // this item is required, so remove it from the
                      // set to be added later
                      s.remove(item);
                  }
    --- 304,317 ----
                  // ignore
              }
              setItems(cfField, s);
          }

    !     private void setItems(JComboBox<String> field, SortedSet<String> s) {
              // first, remove unwanted entries from field
              for (int i = field.getItemCount() - 1; i >= 0; i-- ) {
    !             String item =  field.getItemAt(i);
                  if (s.contains(item)) {
                      // this item is required, so remove it from the
                      // set to be added later
                      s.remove(item);
                  }
    *** 319,345 ****
                      // this item is not required, remove it
                      field.removeItemAt(i);
              }

              // those items remaining in s need to be added to the field
    !         for (Iterator iter = s.iterator(); iter.hasNext(); )
                  field.addItem(iter.next());
          }

          private Tool tool;
          private ActionListener okListener;
          private JPanel body;

    !     private JComboBox tsField;
          private JButton tsBtn;
          private TestSuiteChooser testSuiteChooser;

    !     private JComboBox wdField;
          private JButton wdBtn;
          private WorkDirChooser workDirChooser;

    !     private JComboBox cfField;
          private JButton cfBtn;
          private JFileChooser configFileChooser;

          private Listener listener;

    --- 319,345 ----
                      // this item is not required, remove it
                      field.removeItemAt(i);
              }

              // those items remaining in s need to be added to the field
    !         for (Iterator<String> iter = s.iterator(); iter.hasNext(); )
                  field.addItem(iter.next());
          }

          private Tool tool;
          private ActionListener okListener;
          private JPanel body;

    !     private JComboBox<String> tsField;
          private JButton tsBtn;
          private TestSuiteChooser testSuiteChooser;

    !     private JComboBox<String> wdField;
          private JButton wdBtn;
          private WorkDirChooser workDirChooser;

    !     private JComboBox<String> cfField;
          private JButton cfBtn;
          private JFileChooser configFileChooser;

          private Listener listener;

< prev index next >