コード例 #1
0
ファイル: MainProcessor.java プロジェクト: KUNHO-YANG/scouter
  private ParserConfig selectAdoptiveParserConfig() {
    PreferenceManager prefManager = PreferenceManager.get();
    String configFile = prefManager.getCurrentParserConfig();
    if (m_isDefaultConfiguration) {
      configFile = XMLReader.DEFAULT_XMLCONFIG;
    }

    if (configFile == null) {
      MessageBox messageBox =
          new MessageBox(
              m_parentComposite.getShell(),
              SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.APPLICATION_MODAL);
      messageBox.setText("Check Setting selection");
      messageBox.setMessage(
          "The configuration file is not selected.\r\nDo you want to use the default configuration?");
      int result = messageBox.open();
      if (result == SWT.YES) {
        configFile = XMLReader.DEFAULT_XMLCONFIG;
      } else {
        configFile = selectCurrentParserConfig();
        if (configFile == null) {
          throw new RuntimeException("Parser config file is not selected!");
        }
      }
    }

    ParserConfigReader reader = new ParserConfigReader(configFile);
    return reader.read();
  }