Examples of OptionsPreferences


Examples of com.eclipsesource.jshint.ui.internal.preferences.OptionsPreferences

  private IFile getConfigFile() {
    return getResource().getProject().getFile( ".jshintrc" );
  }

  private String getDefaultConfig() {
    return new OptionsPreferences( getPreferences() ).getConfig();
  }
View Full Code Here

Examples of com.eclipsesource.jshint.ui.internal.preferences.OptionsPreferences

      setValid( true );
    }
  }

  private void loadPreferences() {
    OptionsPreferences prefs = new OptionsPreferences( getPreferences() );
    projectSpecificCheckbox.setSelection( prefs.getProjectSpecific() );
    origConfig = readConfigFile();
    configEditor.setText( origConfig != null ? origConfig : getDefaultConfig() );
    configEditor.setEnabled( prefs.getProjectSpecific() );
  }
View Full Code Here

Examples of com.eclipsesource.jshint.ui.internal.preferences.OptionsPreferences

    configEditor.setText( origConfig != null ? origConfig : getDefaultConfig() );
    configEditor.setEnabled( prefs.getProjectSpecific() );
  }

  private boolean storePrefs() throws CoreException {
    OptionsPreferences prefs = new OptionsPreferences( getPreferences() );
    prefs.setProjectSpecific( projectSpecificCheckbox.getSelection() );
    boolean changed = prefs.hasChanged();
    if( changed ) {
      savePreferences();
    }
    return changed;
  }
View Full Code Here

Examples of com.eclipsesource.jshint.ui.internal.preferences.OptionsPreferences

    this.project = project;
  }

  public JsonObject getConfiguration() {
    Preferences projectNode = PreferencesFactory.getProjectPreferences( project );
    OptionsPreferences projectPreferences = new OptionsPreferences( projectNode );
    if( projectPreferences.getProjectSpecific() ) {
      return getProjectConfig( projectPreferences );
    }
    return getWorkspaceConfig();
  }
View Full Code Here

Examples of com.eclipsesource.jshint.ui.internal.preferences.OptionsPreferences

    }
  }

  private static String getWorkspaceConfigJson() {
    Preferences workspaceNode = PreferencesFactory.getWorkspacePreferences();
    return new OptionsPreferences( workspaceNode ).getConfig();
  }
View Full Code Here

Examples of com.eclipsesource.jshint.ui.internal.preferences.OptionsPreferences

    });
    return buttonBar;
  }

  private void loadPreferences() {
    OptionsPreferences optionsPreferences = new OptionsPreferences( getPreferences() );
    origConfig = optionsPreferences.getConfig();
    configEditor.setText( origConfig );
  }
View Full Code Here

Examples of com.eclipsesource.jshint.ui.internal.preferences.OptionsPreferences

    }
    return true;
  }

  private void storePreferences() throws CoreException {
    OptionsPreferences optionsPreferences = new OptionsPreferences( getPreferences() );
    optionsPreferences.setConfig( configEditor.getText() );
    if( optionsPreferences.hasChanged() ) {
      savePreferences();
    }
  }
View Full Code Here

Examples of com.eclipsesource.jshint.ui.internal.preferences.OptionsPreferences

    assertFalse( getConfigFile().exists() );
  }

  @Test
  public void projectSpecificCheckbox_checkedIfTrue() {
    new OptionsPreferences( getPreferences() ).setProjectSpecific( true );

    page.createContents( shell );

    assertTrue( getProjectSpecificCheckbox().isChecked() );
  }
View Full Code Here

Examples of com.eclipsesource.jshint.ui.internal.preferences.OptionsPreferences

    assertTrue( getProjectSpecificCheckbox().isChecked() );
  }

  @Test
  public void projectSpecificCheckbox_uncheckedIfFalse() {
    new OptionsPreferences( getPreferences() ).setProjectSpecific( false );

    page.createContents( shell );

    assertFalse( getProjectSpecificCheckbox().isChecked() );
  }
View Full Code Here

Examples of com.eclipsesource.jshint.ui.internal.preferences.OptionsPreferences

    assertFalse( getConfigText().widget.getEditable() );
  }

  @Test
  public void configText_enabledIfProjectSpecific() {
    new OptionsPreferences( getPreferences() ).setProjectSpecific( true );

    page.createContents( shell );

    assertTrue( getConfigText().widget.getEditable() );
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.