Examples of OptionsPreferences


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

    assertTrue( page.isValid() );
  }

  @Test
  public void validationError_clearedOnUnsetProjectSpecific() {
    new OptionsPreferences( getPreferences() ).setProjectSpecific( true );
    page.createContents( shell );
    getConfigText().setText( "-invalid-" );

    getProjectSpecificCheckbox().deselect();
View Full Code Here

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

  }

  @Test
  public void configText_initilizedFromConfig() {
    preferences.put( "options", "foo:true" );
    new OptionsPreferences( preferences ).setConfig( "{ \"bar\": true }" );

    page.createContents( shell );

    assertEquals( "{ \"bar\": true }", getConfigText().getText() );
  }
View Full Code Here

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

    assertEquals( "{\n  \"foo\": true\n}", getConfigText().getText() );
  }

  @Test
  public void configText_isEditable() {
    new OptionsPreferences( preferences ).setConfig( "foo" );

    page.createContents( shell );

    assertTrue( getConfigText().widget.getEditable() );
  }
View Full Code Here

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

    verify( preferences ).flush();
  }

  @Test
  public void performOk_doesNotSavePreferencesIfUnchanged() throws BackingStoreException {
    new OptionsPreferences( preferences ).setConfig( "{ \"foo\": true }" );
    page.createContents( shell );

    page.performOk();

    verify( preferences, never() ).flush();
View Full Code Here

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

    verify( project, never() ).build( CLEAN_BUILD, JSHintBuilder.ID, null, null );
  }

  @Test
  public void performOk_doesNotTriggerRebuildIfOnlyWhitespaceAdded() throws CoreException {
    new OptionsPreferences( preferences ).setConfig( "{\"foo\":true}" );
    page.createContents( shell );
    getConfigText().setText( "{ \"foo\" : true }" );

    page.performOk();
View Full Code Here

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

    verify( project, never() ).build( CLEAN_BUILD, JSHintBuilder.ID, null, null );
  }

  @Test
  public void performOk_doesNotFailWhenInitialConfigWasInvalid() {
    new OptionsPreferences( preferences ).setConfig( "-invalid-" );
    page.createContents( shell );
    getConfigText().setText( "{ \"changed\" : true }" );

    boolean result = page.performOk();
View Full Code Here

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

    assertTrue( result );
  }

  @Test
  public void validationError_onStartup() {
    new OptionsPreferences( preferences ).setConfig( "-invalid-" );

    page.createContents( shell );

    assertTrue( page.getErrorMessage().startsWith( "Syntax error" ) );
    assertFalse( page.isValid() );
View Full Code Here

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

  private OptionsPreferences projectPrefs;

  @Before
  public void setUp() {
    project = createProject( "test" );
    workspacePrefs = new OptionsPreferences( PreferencesFactory.getWorkspacePreferences() );
    projectPrefs = new OptionsPreferences( PreferencesFactory.getProjectPreferences( project ) );
  }
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.