Package com.intellij.openapi.options

Examples of com.intellij.openapi.options.ConfigurationException


    }

    @Override
    protected void applyEditorTo(GoApplicationConfiguration configuration) throws ConfigurationException {
        if (applicationName.getText().length() == 0 && !goPackageRadioButton.isSelected())
            throw new ConfigurationException("Please select the go file to run.");
        if (applicationPackage.getText().length() == 0 && goPackageRadioButton.isSelected())
            throw new ConfigurationException("Please select the package directory to build.");
        if (buildBeforeRunCheckBox.isSelected() && buildDirectoryPathBrowser.getText().equals("")) {
            throw new ConfigurationException("Please select the directory for the executable.");
        }
        if (!buildBeforeRunCheckBox.isSelected() && goPackageRadioButton.isSelected()) {
            throw new ConfigurationException("A package has to be build before it can run. Please check the box buld-before-run or select a go gile to run instead of a package.");
        }

        configuration.scriptName = applicationName.getText();
        configuration.packageDir = applicationPackage.getText();
        configuration.runPackage = goPackageRadioButton.isSelected();
        configuration.scriptArguments = appArguments.getText();
        configuration.runBuilderArguments = m_runBuilderArguments.getText();
        configuration.runExecutableName = m_runExecutableName.getText();
        configuration.goBuildBeforeRun = buildBeforeRunCheckBox.isSelected();
        configuration.runDebugger = enableDebuggingCheckBox.isSelected();
        configuration.goOutputDir = buildDirectoryPathBrowser.getText();
        configuration.workingDir = workingDirectoryBrowser.getText();
        configuration.envVars = envVars.getText();

        //Debug stuff
        String gdbPath = m_gdbPath.getText();
        if (enableDebuggingCheckBox.isSelected()) {
            if (gdbPath.isEmpty()) {
                throw new ConfigurationException("Please select the path to gdb.");
            } else if (!GoGdbUtil.doesExecutableExist(gdbPath) || !GoGdbUtil.isValidGdbPath(gdbPath)) {
                throw new ConfigurationException("Please select a valid path to gdb.");
            } else {
                gdbVersionWarning.setVisible(!GoGdbUtil.isKnownGdb(gdbPath));
            }
        }
View Full Code Here


            goimportsExecName += ".exe";
        }

        if (goimportsOnSave.isSelected () &&
                !(new File(goimportsPath.getText() + goimportsExecName).exists())) {
            throw new ConfigurationException("goimports could not be found at the desired location");
        }

        settingsBean.useGoPath = enableAppendSysGoPath.isSelected();
        settingsBean.prependGoPath = enablePrependSysGoPath.isSelected();
View Full Code Here

    @Override
    protected void applyEditorTo(GaeLocalConfiguration configuration) throws ConfigurationException {
        String cwd = workingDirectoryBrowser.getText();

        if (cwd.isEmpty()) {
            throw new ConfigurationException("You must supply a working directory");
        }

        if (!(new File(cwd)).exists() || !(new File(cwd)).isDirectory()) {
            throw new ConfigurationException("You must supply a valid directory");
        }

        if (!(new File(cwd + File.separator + "app.yaml")).exists() || !(new File(cwd + File.separator + "app.yaml")).isFile()) {
            throw new ConfigurationException("You must supply a directory containing an app.yaml file");
        }

        if (hostname.getText().isEmpty()) {
            throw new ConfigurationException("hostname cannot be empty");
        }

        if (port.getText().isEmpty()) {
            throw new ConfigurationException("port cannot be empty");
        } else if (!port.getText().matches("\\d+")) {
            throw new ConfigurationException("port is not a valid number");
        } else if (Integer.parseInt(port.getText()) < 1024) {
            throw new ConfigurationException("port is below 1024 and you will need special privileges for it");
        }

        if (adminPort.getText().isEmpty()) {
            throw new ConfigurationException("admin_port cannot be empty");
        } else if (!adminPort.getText().matches("\\d+")) {
            throw new ConfigurationException("admin_port is not a valid number");
        } else if (Integer.parseInt(adminPort.getText()) < 1024) {
            throw new ConfigurationException("admin_port is below 1024 and you will need special privileges for it");
        }

        if (port.getText().equals(adminPort.getText())) {
            throw new ConfigurationException("port and admin_port must be different values");
        }

        // @TODO validation for app.yaml would be nice

        configuration.builderArguments = builderArguments.getText();
View Full Code Here

    if (alreadyExist != null) {
      final Object o = getSelectedObject();
      if (o instanceof NamedScope && !Comparing.strEqual(alreadyExist, ((NamedScope)o).getName())) {
        selectNodeInTree(alreadyExist);
      }
      throw new ConfigurationException(CommonBundle.message("smth.already.exist.error.message", prefix, alreadyExist), title);
    }
  }
View Full Code Here

     */
    public void getData(ReviewBoardConfig config) throws ConfigurationException {
        String server = serverTextField.getText();
        if (server == null || server.trim().length() == 0) {
            setFocus(serverTextField);
            throw new ConfigurationException("server must be supplied.");
        }


        // update the configuration object
        if (server.endsWith("/")) {
View Full Code Here

  @Override
  public boolean validate() throws ConfigurationException {
   if (getComponent() instanceof AsposeWizardPanel) {
       AsposeWizardPanel _page = (AsposeWizardPanel) getComponent();
       if (!_page.isComponentSelected())
      throw new ConfigurationException(AsposeConstants.IS_COMPONENT_SELECTED);
    }

    return true;
  }
View Full Code Here

    myExecPath = path;
    myModule = module;

    if (notConfigured()) {
      throw new ConfigurationException("Can't create Clojure REPL process");
    } else {
      // Only a single command line per-project is supported. We may need more flexibility
      //  in the future (e.g., different Clojure paths with different args)

      final JavaParameters params = new JavaParameters();
View Full Code Here

            final String name = profile.getName();
            final String dirPath = profile.getLessDirPath();

            if (StringUtils.isBlank(name)) {
                selectNodeInTree(name);
                throw new ConfigurationException(UIBundle.message("blank.less.profile.name"));
            }

            if (names.contains(name)) {
                selectNodeInTree(name);
                throw new ConfigurationException(UIBundle.message("duplicate.less.profile.name", name));
            }

            if (StringUtils.isBlank(dirPath)) {
                selectNodeInTree(name);
                throw new ConfigurationException(UIBundle.message("blank.less.profile.source.dir"));
            }

            if (!profile.getLessDir().exists()) {
                if (!confirmWarning(UIBundle.message("nonexistent.less.profile.source.dir.title"),
                                    UIBundle.message("nonexistent.less.profile.source.dir.prompt", dirPath))) {
                    selectNodeInTree(name);
                    throw new ConfigurationException(UIBundle.message("nonexistent.less.profile.source.dir.error", dirPath));
                }
            }

            if (profile.getCssDirectories().isEmpty()) {
                selectNodeInTree(name);
                throw new ConfigurationException(UIBundle.message("no.less.profile.css.dirs"));
            }

            for (final CssDirectory cssDirectory : profile.getCssDirectories()) {
                if (!new File(cssDirectory.getPath()).exists()) {
                    if (!confirmWarning(UIBundle.message("nonexistent.less.profile.css.dir.title"),
                                        UIBundle.message("nonexistent.less.profile.css.dir.prompt", dirPath))) {
                        selectNodeInTree(name);
                        throw new ConfigurationException(UIBundle.message("nonexistent.less.profile.css.dir.error", dirPath));
                    }
                }
            }

            names.add(name);
View Full Code Here

TOP

Related Classes of com.intellij.openapi.options.ConfigurationException

Copyright © 2018 www.massapicom. 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.