Examples of BrowseFSDialogViaFactories


Examples of org.jamesii.gui.utils.dialogs.BrowseFSDialogViaFactories

  @Override
  public Pair<ParameterBlock, ModelParameterFileReaderFactory> getFactoryParameter(
      Window parentWindow) {
    chosenURI = null;

    final BrowseFSDialogViaFactories dialog =
        new BrowseFSDialogViaFactories(parentWindow,
            "Search for Model Parameter files", factories) {

          /**
           * Serialization ID
           */
          private static final long serialVersionUID = 4373755720333003469L;

          @Override
          protected boolean checkFile(File f) {
            try {
              for (ModelParameterReaderFactory fac : factories) {
                if (fac.supportsURI(Files.getURIFromFile(f))) {
                  System.out.println(f);
                  return true;
                }
              }
            } catch (Exception e) {
              SimSystem.report(e);
            }
            return false;
          }

          @Override
          protected ModelParameterTableData getComponent(File f) {
            System.out.println(f);
            return new ModelParameterTableData(f);
          }

        };
    dialog.addBrowseFSDialogListener(new IBrowseFSDialogListener() {

      @Override
      public void elementChosen(IBrowseFSDialogEntry element) {
        try {
          chosenURI = Files.getURIFromFile(element.getFile());
        } catch (URISyntaxException e1) {
          SimSystem.report(e1);
        }
        dialog.setVisible(false);
      }

    });

    dialog.setVisible(true);

    if (chosenURI == null) {
      return 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.