Esempio n. 1
0
  /** Displays the filters setup dialog to allow customizing file filters in detail. */
  public void optionsSetupFileFiltersMenuItemActionPerformed() {
    FiltersCustomizer dlg =
        new FiltersCustomizer(
            mainWindow,
            false,
            FilterMaster.createDefaultFiltersConfig(),
            FilterMaster.loadConfig(StaticUtils.getConfigDir()),
            null);
    dlg.setVisible(true);
    if (dlg.getReturnStatus() == FiltersCustomizer.RET_OK) {
      // saving config
      FilterMaster.saveConfig(dlg.result, StaticUtils.getConfigDir());

      if (Core.getProject().isProjectLoaded()) {
        if (FilterMaster.loadConfig(Core.getProject().getProjectProperties().getProjectInternal())
            != null) {
          // project specific filters are in place. No need to reload project when
          // non-project-specific filters are changed
          return;
        }
        // asking to reload a project
        int res =
            JOptionPane.showConfirmDialog(
                mainWindow,
                OStrings.getString("MW_REOPEN_QUESTION"),
                OStrings.getString("MW_REOPEN_TITLE"),
                JOptionPane.YES_NO_OPTION);
        if (res == JOptionPane.YES_OPTION) ProjectUICommands.projectReload();
      }
    }
  }
Esempio n. 2
0
  /** Create translated documents. */
  public void projectCompileMenuItemActionPerformed() {
    if (Preferences.isPreference(Preferences.TAGS_VALID_REQUIRED)) {
      List<ErrorReport> stes = Core.getTagValidation().listInvalidTags();
      if (stes != null) {
        Core.getTagValidation()
            .displayTagValidationErrors(stes, OStrings.getString("TF_MESSAGE_COMPILE"));
        return;
      }
    }

    ProjectUICommands.projectCompile();
  }
Esempio n. 3
0
  /** Displays the external TMX dialog to allow customizing the external TMX options. */
  public void optionsExtTMXMenuItemActionPerformed() {

    ExternalTMXMatchesDialog externalTMXOptions = new ExternalTMXMatchesDialog(mainWindow);
    externalTMXOptions.setVisible(true);

    if (externalTMXOptions.getReturnStatus() == ExternalTMXMatchesDialog.RET_OK
        && Core.getProject().isProjectLoaded()) {
      // asking to reload a project
      int res =
          JOptionPane.showConfirmDialog(
              mainWindow,
              OStrings.getString("MW_REOPEN_QUESTION"),
              OStrings.getString("MW_REOPEN_TITLE"),
              JOptionPane.YES_NO_OPTION);
      if (res == JOptionPane.YES_OPTION) ProjectUICommands.projectReload();
    }
  }
Esempio n. 4
0
  /** Create current translated document. */
  public void projectSingleCompileMenuItemActionPerformed() {
    String midName = Core.getEditor().getCurrentFile();
    if (StringUtil.isEmpty(midName)) {
      return;
    }

    String sourcePattern = StaticUtils.escapeNonRegex(midName);
    if (Preferences.isPreference(Preferences.TAGS_VALID_REQUIRED)) {
      List<ErrorReport> stes = Core.getTagValidation().listInvalidTags(sourcePattern);
      if (stes != null) {
        Core.getTagValidation()
            .displayTagValidationErrors(stes, OStrings.getString("TF_MESSAGE_COMPILE"));
        return;
      }
    }

    ProjectUICommands.projectSingleCompile(sourcePattern);
  }
Esempio n. 5
0
  /**
   * Displays the segmentation setup dialog to allow customizing the segmentation rules in detail.
   */
  public void optionsSentsegMenuItemActionPerformed() {
    SegmentationCustomizer segment_window =
        new SegmentationCustomizer(mainWindow, false, SRX.getDefault(), Preferences.getSRX(), null);
    segment_window.setVisible(true);

    if (segment_window.getReturnStatus() == SegmentationCustomizer.RET_OK) {
      Preferences.setSRX(segment_window.getSRX());
      if (Core.getProject().isProjectLoaded()
          && Core.getProject().getProjectProperties().getProjectSRX() == null) {
        // asking to reload a project
        int res =
            JOptionPane.showConfirmDialog(
                mainWindow,
                OStrings.getString("MW_REOPEN_QUESTION"),
                OStrings.getString("MW_REOPEN_TITLE"),
                JOptionPane.YES_NO_OPTION);
        if (res == JOptionPane.YES_OPTION) ProjectUICommands.projectReload();
      }
    }
  }
Esempio n. 6
0
  /**
   * Displays the tag validation setup dialog to allow customizing the diverse tag validation
   * options.
   */
  public void optionsTagValidationMenuItemActionPerformed() {
    TagProcessingOptionsDialog tagProcessingOptionsDialog =
        new TagProcessingOptionsDialog(mainWindow);
    tagProcessingOptionsDialog.setVisible(true);

    if (tagProcessingOptionsDialog.getReturnStatus() == TagProcessingOptionsDialog.RET_OK
        && Core.getProject().isProjectLoaded()) {
      // Redisplay according to new view settings
      Core.getEditor().getSettings().updateTagValidationPreferences();

      // asking to reload a project
      int res =
          JOptionPane.showConfirmDialog(
              mainWindow,
              OStrings.getString("MW_REOPEN_QUESTION"),
              OStrings.getString("MW_REOPEN_TITLE"),
              JOptionPane.YES_NO_OPTION);
      if (res == JOptionPane.YES_OPTION) {
        ProjectUICommands.projectReload();
      }
    }
  }
Esempio n. 7
0
 /** Edits project's properties */
 public void projectEditMenuItemActionPerformed() {
   ProjectUICommands.projectEditProperties();
 }
Esempio n. 8
0
 /** Save project. */
 public void projectSaveMenuItemActionPerformed() {
   ProjectUICommands.projectSave();
 }
Esempio n. 9
0
 public void projectReloadMenuItemActionPerformed() {
   ProjectUICommands.projectReload();
 }
Esempio n. 10
0
 /** Open project. */
 public void projectOpenMenuItemActionPerformed() {
   ProjectUICommands.projectOpen(null);
 }
Esempio n. 11
0
 /** Create new team project. */
 public void projectTeamNewMenuItemActionPerformed() {
   ProjectUICommands.projectTeamCreate();
 }