コード例 #1
0
  public ProtobufFacetEditor(
      FacetEditorContext editorContext,
      FacetValidatorsManager validatorsManager,
      ProtobufFacetConfiguration configuration) {
    this.configuration = configuration;

    final Project project = editorContext.getProject();
    final Module module = editorContext.getModule();

    commonSettingsEditor
        .getEnableCompilationCheckbox()
        .setSelected(configuration.isCompilationEnabled());
    commonSettingsEditor
        .getProtobufCompilerOutputPathField()
        .setText(configuration.getCompilerOutputPath());
    commonSettingsEditor
        .getProtobufCompilerOutputPathField()
        .addBrowseFolderListener(
            project,
            new CompilerOutputBrowseFolderActionListener(
                project, module, commonSettingsEditor.getProtobufCompilerOutputPathField()));
    commonSettingsEditor
        .getProtobufCompilerRunInFixedDirectory()
        .setSelected(configuration.isCompilationUseGivenRunDirectory());
    commonSettingsEditor
        .getProtobufCompilerRunDirectory()
        .setText(configuration.getCompilationRunDirectory());
    commonSettingsEditor
        .getProtobufCompilerRunDirectory()
        .addBrowseFolderListener(
            project,
            new CompilerOutputBrowseFolderActionListener(
                project, module, commonSettingsEditor.getProtobufCompilerRunDirectory()));
  }
コード例 #2
0
 @Override
 public void apply() throws ConfigurationException {
   configuration.setIsCompilationEnabled(
       commonSettingsEditor.getEnableCompilationCheckbox().isSelected());
   configuration.setCompilerOutputPath(
       FileUtil.toSystemIndependentName(
           commonSettingsEditor.getProtobufCompilerOutputPathField().getText().trim()));
   configuration.setCompilationUseGivenRunDirectory(
       commonSettingsEditor.getProtobufCompilerRunInFixedDirectory().isSelected());
   configuration.setCompilationRunDirectory(
       FileUtil.toSystemIndependentName(
           commonSettingsEditor.getProtobufCompilerRunDirectory().getText().trim()));
 }
コード例 #3
0
  @Override
  public boolean isModified() {
    boolean compilationEnabled = commonSettingsEditor.getEnableCompilationCheckbox().isSelected();
    String outputPath = commonSettingsEditor.getProtobufCompilerOutputPathField().getText().trim();
    boolean compileInGivenPath =
        commonSettingsEditor.getProtobufCompilerRunInFixedDirectory().isSelected();
    String runDirectory = commonSettingsEditor.getProtobufCompilerRunDirectory().getText().trim();

    return (configuration.isCompilationEnabled() != compilationEnabled
        || !Comparing.equal(
            configuration.getCompilerOutputPath(), FileUtil.toSystemIndependentName(outputPath))
        || configuration.isCompilationUseGivenRunDirectory() != compileInGivenPath
        || !Comparing.equal(
            configuration.getCompilationRunDirectory(),
            FileUtil.toSystemIndependentName(runDirectory)));
  }
コード例 #4
0
 public TextFieldWithBrowseButton getProtobufCompilerRunDirectory() {
   return commonSettingsEditor.getProtobufCompilerRunDirectory();
 }