Package org.pentaho.mantle.client.usersettings

Examples of org.pentaho.mantle.client.usersettings.JsSetting


    if ( settings == null ) {
      return;
    }

    for ( int i = 0; i < settings.length(); i++ ) {
      JsSetting setting = settings.get( i );
      try {
        if ( IMantleUserSettingsConstants.MANTLE_SHOW_NAVIGATOR.equals( setting.getName() ) ) {
          boolean showNavigator = "true".equals( setting.getValue() ); //$NON-NLS-1$
          model.setShowNavigatorSelected( showNavigator );
        } else if ( IMantleUserSettingsConstants.MANTLE_SHOW_DESCRIPTIONS_FOR_TOOLTIPS.equals( setting.getName() ) ) {
          boolean checked = "true".equals( setting.getValue() ); //$NON-NLS-1$
          ( (PentahoMenuItem) useDescriptionsMenuItem.getManagedObject() ).setChecked( checked );
        } else if ( IMantleUserSettingsConstants.MANTLE_SHOW_HIDDEN_FILES.equals( setting.getName() ) ) {
          boolean checked = "true".equals( setting.getValue() ); //$NON-NLS-1$
          ( (PentahoMenuItem) showHiddenFilesMenuItem.getManagedObject() ).setChecked( checked );
        }
      } catch ( Exception e ) {
        MessageDialogBox dialogBox =
            new MessageDialogBox(
View Full Code Here


      public void onSuccess( JsArray<JsSetting> result ) {
        if ( result == null ) {
          return;
        }
        JsSetting setting;
        for ( int j = 0; j < result.length(); j++ ) {
          setting = result.get( j );
          if ( "favorites".equalsIgnoreCase( setting.getName() ) ) { //$NON-NLS-1$
            try {
              // handle favorite
              JSONArray favorites = JSONParser.parseLenient( setting.getValue() ).isArray();
              if ( favorites != null ) {
                // Create the FavoritePickList object from the JSONArray
                favoritePickList = FavoritePickList.getInstanceFromJSON( favorites );
              } else {
                favoritePickList = FavoritePickList.getInstance();
              }
            } catch ( Throwable t ) {
              //ignore
            }
          } else if ( "recent".equalsIgnoreCase( setting.getName() ) ) { //$NON-NLS-1$
            try {
              // handle recent
              JSONArray recents = JSONParser.parseLenient( setting.getValue() ).isArray();
              if ( recents != null ) {
                // Create the RecentPickList object from the JSONArray
                recentPickList = RecentPickList.getInstanceFromJSON( recents );
              } else {
                recentPickList = RecentPickList.getInstance();
View Full Code Here

      public void onSuccess( HashMap<String, String> mantleSettings ) {
        // merge user settings with mantle settings for possible system/tenant/user overrides
        JsArray<JsSetting> userSettings = event.getSettings();
        if ( userSettings != null ) {
          for ( int i = 0; i < userSettings.length(); i++ ) {
            JsSetting setting = userSettings.get( i );
            mantleSettings.put( setting.getName(), setting.getValue() );
          }
        }
        onMantleSettingsLoaded( new MantleSettingsLoadedEvent( mantleSettings ) );
      }
View Full Code Here

  @Override
  public void onUserSettingsLoaded( UserSettingsLoadedEvent event ) {
    JsArray<JsSetting> settings = event.getSettings();
    if ( settings != null ) {
      for ( int i = 0; i < settings.length(); i++ ) {
        JsSetting setting = settings.get( i );
        if ( IMantleUserSettingsConstants.MANTLE_SHOW_LOCALIZED_FILENAMES.equals( setting.getName() ) ) {
          boolean showLocalizedFileNames = "true".equals( setting.getName() ); //$NON-NLS-1$
          setShowLocalizedFileNames( showLocalizedFileNames );
        } else if ( IMantleUserSettingsConstants.MANTLE_SHOW_DESCRIPTIONS_FOR_TOOLTIPS.equals( setting.getName() ) ) {
          boolean useDescriptions = "true".equals( setting.getValue() ); //$NON-NLS-1$
          setUseDescriptionsForTooltip( useDescriptions );
        } else if ( IMantleUserSettingsConstants.MANTLE_SHOW_HIDDEN_FILES.equals( setting.getName() ) ) {
          boolean showHiddenFiles = "true".equals( setting.getValue() ); //$NON-NLS-1$
          setShowHiddenFiles( showHiddenFiles );
        }
      }
    }
    RepositoryFileTreeManager.getInstance().addRepositoryFileTreeListener( this, null, null, showHiddenFiles );
View Full Code Here

TOP

Related Classes of org.pentaho.mantle.client.usersettings.JsSetting

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.