示例#1
0
 public void exportDependencies(File file) {
   IAnalyseService analyseService = ServiceProvider.getInstance().getAnalyseService();
   try {
     analyseService.exportDependencies(file.getAbsolutePath());
   } catch (Exception exception) {
     IControlService controlService = ServiceProvider.getInstance().getControlService();
     controlService.showErrorMessage(exception.getMessage());
   }
 }
示例#2
0
 public void exportViolationsReport(File file) {
   Filename filename = new Filename(file, File.separatorChar, '.');
   IValidateService validateService = ServiceProvider.getInstance().getValidateService();
   try {
     validateService.exportViolations(file, filename.getExtension());
   } catch (Exception exception) {
     IControlService controlService = ServiceProvider.getInstance().getControlService();
     controlService.showErrorMessage(exception.getMessage());
   }
 }
  private void addComponents() {
    pathLabel = new JLabel(controlService.getTranslatedString("PathLabel"));
    pathText = new JTextField(20);
    browseButton = new JButton(controlService.getTranslatedString("BrowseButton"));
    exportButton = new JButton(controlService.getTranslatedString("ExportButton"));
    exportButton.setEnabled(false);
    pathText.setEnabled(false);

    getRootPane().setDefaultButton(exportButton);

    add(pathLabel);
    add(pathText);
    add(browseButton);
    add(exportButton);
  }
 public ExportArchitectureDialog(MainController mainController) {
   super(mainController.getMainGui(), true);
   this.mainController = mainController;
   setTitle(controlService.getTranslatedString("ExportArchitecture"));
   setup();
   addComponents();
   setListeners();
   this.setVisible(true);
 }
 private void showFileDialog() {
   FileNameExtensionFilter filter = new FileNameExtensionFilter("XML", "xml", "xml");
   FileDialog fileDialog =
       new FileDialog(
           JFileChooser.FILES_ONLY, controlService.getTranslatedString("ExportButton"), filter);
   int returnVal = fileDialog.showDialog(this);
   if (returnVal == JFileChooser.APPROVE_OPTION) {
     setFile(fileDialog.getSelectedFile());
   }
 }
示例#6
0
  public void analyseApplication() {
    IControlService controlService = ServiceProvider.getInstance().getControlService();
    ILocaleService localeService = ServiceProvider.getInstance().getLocaleService();
    ApplicationDTO applicationDTO =
        ServiceProvider.getInstance().getDefineService().getApplicationDetails();

    ThreadWithLoader analyseThread =
        controlService.getThreadWithLoader(
            localeService.getTranslatedString("AnalysingApplication"),
            new AnalyseTask(mainController, applicationDTO));
    currentLoader = analyseThread.getLoader();
    currentThread = analyseThread.getThread();
    currentLoader.addWindowListener(
        new WindowAdapter() {
          @Override
          public void windowClosing(WindowEvent e) {
            mainController.getStateController().setAnalysing(false);

            logger.debug("Stopping Thread");
          }
        });
    analyseThread.run();
  }