Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Preferences


  /*
   * Update eclipse preferences from old preferences.
   */
   private void updatePreferences(IEclipsePreferences preferences) {
    
     Preferences oldPreferences = loadPreferences();
     if (oldPreferences != null) {
       String[] propertyNames = oldPreferences.propertyNames();
      for (int i = 0; i < propertyNames.length; i++){
        String propertyName = propertyNames[i];
          String propertyValue = oldPreferences.getString(propertyName);
          if (!"".equals(propertyValue)) { //$NON-NLS-1$
            preferences.put(propertyName, propertyValue);
          }
      }
      try {
View Full Code Here


    preferences = loadPreferences();
    if (preferences == null) preferences = new Preferences();
    perProjectInfo.preferences = preferences;
    return preferences;
    */
    return new Preferences();
  }
View Full Code Here

  /**
   * load preferences from a shareable format (VCM-wise)
   */
   private Preferences loadPreferences() {
    
     Preferences preferences = new Preferences();
     IPath projectMetaLocation = getPluginWorkingLocation();
    if (projectMetaLocation != null) {
      File prefFile = projectMetaLocation.append(PREF_FILENAME).toFile();
      if (prefFile.exists()) { // load preferences from file
        InputStream in = null;
        try {
          in = new BufferedInputStream(new FileInputStream(prefFile));
          preferences.load(in);
        } catch (IOException e) { // problems loading preference store - quietly ignore
        } finally {
          if (in != null) {
            try {
              in.close();
View Full Code Here

    {
        monitor.beginTask( BrowserCoreMessages.jobs__export_csv_task, 2 );
        monitor.reportProgress( " " ); //$NON-NLS-1$
        monitor.worked( 1 );

        Preferences coreStore = BrowserCorePlugin.getDefault().getPluginPreferences();

        String attributeDelimiter = coreStore.getString( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_ATTRIBUTEDELIMITER );
        String valueDelimiter = coreStore.getString( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_VALUEDELIMITER );
        String quoteCharacter = coreStore.getString( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_QUOTECHARACTER );
        String lineSeparator = coreStore.getString( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_LINESEPARATOR );
        String encoding = coreStore.getString( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_ENCODING );
        int binaryEncoding = coreStore.getInt( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_BINARYENCODING );
        String[] exportAttributes = this.searchParameter.getReturningAttributes();

        try
        {
            // open file
View Full Code Here

    {
        monitor.beginTask( BrowserCoreMessages.jobs__export_odf_task, 2 );
        monitor.reportProgress( " " ); //$NON-NLS-1$
        monitor.worked( 1 );

        Preferences coreStore = BrowserCorePlugin.getDefault().getPluginPreferences();
        String valueDelimiter = coreStore.getString( BrowserCoreConstants.PREFERENCE_FORMAT_ODF_VALUEDELIMITER );
        int binaryEncoding = coreStore.getInt( BrowserCoreConstants.PREFERENCE_FORMAT_ODF_BINARYENCODING );

        // export
        try
        {
            OdfSpreadsheetDocument doc = OdfSpreadsheetDocument.createSpreadsheetDocument();
View Full Code Here

    {
        monitor.beginTask( BrowserCoreMessages.jobs__export_xls_task, 2 );
        monitor.reportProgress( " " ); //$NON-NLS-1$
        monitor.worked( 1 );

        Preferences coreStore = BrowserCorePlugin.getDefault().getPluginPreferences();
        String valueDelimiter = coreStore.getString( BrowserCoreConstants.PREFERENCE_FORMAT_XLS_VALUEDELIMITER );
        int binaryEncoding = coreStore.getInt( BrowserCoreConstants.PREFERENCE_FORMAT_XLS_BINARYENCODING );

        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sheet = wb.createSheet( "Export" ); //$NON-NLS-1$

        // header
View Full Code Here

            }
            saslRealmText.setEnabled( isSaslRealmTextEnabled() );
        }

        // TODO: get setting from global preferences.
        Preferences preferences = ConnectionCorePlugin.getDefault().getPluginPreferences();
        boolean useKrb5SystemProperties = preferences
            .getBoolean( ConnectionCoreConstants.PREFERENCE_USE_KRB5_SYSTEM_PROPERTIES );
        if ( krb5Composite != null )
        {
            krb5CredentialConfigurationUseNativeButton.setEnabled( isGssapiEnabled() && !useKrb5SystemProperties );
            krb5CredentialConfigurationObtainTgtButton.setEnabled( isGssapiEnabled() && !useKrb5SystemProperties );
View Full Code Here

    return true;
  }

  public void setDefaults(ILaunchConfigurationWorkingCopy config)
  {
    Preferences pref = HelpPlugin.getDefault().getPluginPreferences();
    String browserPath =
      pref.getString(org.eclipse.help.internal.browser.CustomBrowser.CUSTOM_BROWSER_PATH_KEY);

    config.setAttribute(PerlLaunchConfigurationConstants.ATTR_BROWSER_ID, BrowserManager.getInstance().getDefaultBrowserID()); //$NON-NLS-1$;
    config.setAttribute(
      PerlLaunchConfigurationConstants.ATTR_CUSTOM_BROWSER_PATH,
      browserPath);
View Full Code Here

  private String fMixedWhitespaceStrategy = XMLFormattingConstraints.IGNORE;
  private String fOneIndent = "\t"; //$NON-NLS-1$
  private boolean fClearAllBlankLines = false;

  public XMLFormattingPreferences() {
    Preferences preferences = XMLCorePlugin.getDefault().getPluginPreferences();
    if (preferences != null) {
      setFormatCommentText(preferences.getBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_TEXT));
      setJoinCommentLines(preferences.getBoolean(XMLCorePreferenceNames.FORMAT_COMMENT_JOIN_LINES));

      setMaxLineWidth(preferences.getInt(XMLCorePreferenceNames.LINE_WIDTH));
      setIndentMultipleAttributes(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
      setAlignFinalBracket(preferences.getBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET));
      setSpaceBeforeEmptyCloseTag(preferences.getBoolean(XMLCorePreferenceNames.SPACE_BEFORE_EMPTY_CLOSE_TAG));
     
      boolean preservepcdata = preferences.getBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT);
      if (preservepcdata)
        fPCDataWhitespaceStrategy = XMLFormattingPreferences.PRESERVE;
      else
        fPCDataWhitespaceStrategy = XMLFormattingPreferences.COLLAPSE;

      char indentChar = ' ';
      String indentCharPref = preferences.getString(XMLCorePreferenceNames.INDENTATION_CHAR);
      if (XMLCorePreferenceNames.TAB.equals(indentCharPref)) {
        indentChar = '\t';
      }
      int indentationWidth = preferences.getInt(XMLCorePreferenceNames.INDENTATION_SIZE);

      StringBuffer indent = new StringBuffer();
      for (int i = 0; i < indentationWidth; i++) {
        indent.append(indentChar);
      }
      setOneIndent(indent.toString());
      setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));
    }
  }
View Full Code Here

    }


    public static LdifFormatParameters getLdifFormatParameters()
    {
        Preferences store = BrowserCorePlugin.getDefault().getPluginPreferences();
        boolean spaceAfterColon = store.getBoolean( BrowserCoreConstants.PREFERENCE_LDIF_SPACE_AFTER_COLON );
        int lineWidth = store.getInt( BrowserCoreConstants.PREFERENCE_LDIF_LINE_WIDTH );
        String lineSeparator = store.getString( BrowserCoreConstants.PREFERENCE_LDIF_LINE_SEPARATOR );
        LdifFormatParameters ldifFormatParameters = new LdifFormatParameters( spaceAfterColon, lineWidth, lineSeparator );
        return ldifFormatParameters;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.Preferences

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.