Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.Preferences


   * @return
   */
  String addDefaultExtension(String filename) {
    StringBuffer newFileName = new StringBuffer(filename);

    Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
    String ext = preference.getString(JSPCorePreferenceNames.DEFAULT_EXTENSION);

    newFileName.append("."); //$NON-NLS-1$
    newFileName.append(ext);

    return newFileName.toString();
View Full Code Here


  public IStructuredFormatPreferences getFormatPreferences() {
    if (fFormatPreferences == null) {
      fFormatPreferences = new StructuredFormatPreferencesXML();

      Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
      if (preferences != null) {
        fFormatPreferences.setLineWidth(preferences.getInt(HTMLCorePreferenceNames.LINE_WIDTH));
        ((StructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(HTMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
        ((StructuredFormatPreferencesXML) fFormatPreferences).setAlignEndBracket(preferences.getBoolean(HTMLCorePreferenceNames.ALIGN_END_BRACKET));
        fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(HTMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));

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

        StringBuffer indent = new StringBuffer();
        for (int i = 0; i < indentationWidth; i++) {
          indent.append(indentChar);
        }
View Full Code Here

   * @return
   */
  String addDefaultExtension(String filename) {
    StringBuffer newFileName = new StringBuffer(filename);

    Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
    String ext = preference.getString(JSPCorePreferenceNames.DEFAULT_EXTENSION);

    newFileName.append("."); //$NON-NLS-1$
    newFileName.append(ext);

    return newFileName.toString();
View Full Code Here

      // put template contents into file
      String templateString = fNewFileTemplatesPage.getTemplateString();
      if (templateString != null) {
        templateString = applyLineDelimiter(file, templateString);
        // determine the encoding for the new file
        Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
        String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);

        try {
          ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
          OutputStreamWriter outputStreamWriter = null;
          if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
View Full Code Here

   * @return
   */
  private int getIndentationWidth() {
    int width = -1;

    Preferences preferences = HTMLCorePlugin.getDefault().getPluginPreferences();
    if (HTMLCorePreferenceNames.SPACE.equals(preferences.getString(HTMLCorePreferenceNames.INDENTATION_CHAR)))
      width = preferences.getInt(HTMLCorePreferenceNames.INDENTATION_SIZE);

    return width;
  }
View Full Code Here

   * @return <code>true</code> if this is a target, <code>false</code>
   *         otherwise
   * @see Eclipse 3.0
   */
  protected boolean isNavigationTarget(Annotation annotation) {
    Preferences preferences = EditorsUI.getPluginPreferences();
    AnnotationPreference preference = EditorsUI.getAnnotationPreferenceLookup().getAnnotationPreference(annotation);
    // See bug 41689
    // String key= forward ? preference.getIsGoToNextNavigationTargetKey()
    // : preference.getIsGoToPreviousNavigationTargetKey();
    String key = preference == null ? null : preference.getIsGoToNextNavigationTargetKey();
    return (key != null && preferences.getBoolean(key));
  }
View Full Code Here

  protected void updateCase() {
    if (fModel != null) {
      String modelContentTypeId = fModel.getContentTypeIdentifier();
      if (modelContentTypeId != null) {
        if (modelContentTypeId.equals(ContentTypeIdForJSP.ContentTypeID_JSP)) {
          Preferences prefs = HTMLCorePlugin.getDefault().getPluginPreferences(); //$NON-NLS-1$
          fTagCase = prefs.getInt(HTMLCorePreferenceNames.TAG_NAME_CASE);
          fAttrCase = prefs.getInt(HTMLCorePreferenceNames.ATTR_NAME_CASE);
        }
      }
    }
  }
View Full Code Here

      // put template contents into file
      String templateString = fNewFileTemplatesPage.getTemplateString();
      if (templateString != null) {
        templateString = applyLineDelimiter(file, templateString);
        // determine the encoding for the new file
        Preferences preference = JSPCorePlugin.getDefault().getPluginPreferences();
        String charSet = preference.getString(CommonEncodingPreferenceNames.OUTPUT_CODESET);

        try {
          ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
          OutputStreamWriter outputStreamWriter = null;
          if (charSet == null || charSet.trim().equals("")) { //$NON-NLS-1$
View Full Code Here

    fTagNameCase = tagNameCase;
  }

  protected void updateOptions() {

    Preferences p = getPreferences();
    fTagNameCase = p.getInt(IXMLPreferenceNames.CLEANUP_TAG_NAME_CASE);
    fAttrNameCase = p.getInt(IXMLPreferenceNames.CLEANUP_ATTR_NAME_CASE);
    fInsertMissingTags = p.getBoolean(IXMLPreferenceNames.INSERT_MISSING_TAGS);
    fQuoteAttrValues = p.getBoolean(IXMLPreferenceNames.QUOTE_ATTR_VALUES);
    fFormatSource = p.getBoolean(IXMLPreferenceNames.FORMAT_SOURCE);
    fConvertEOLCodes = p.getBoolean(IXMLPreferenceNames.CONVERT_EOL_CODES);
    fEOLCode = p.getString(IXMLPreferenceNames.CLEANUP_EOL_CODE);
  }
View Full Code Here

  public IStructuredFormatPreferences getFormatPreferences() {
    if (fFormatPreferences == null) {
      fFormatPreferences = new StructuredFormatPreferencesXML();

      Preferences preferences = getModelPreferences();
      if (preferences != null) {
        fFormatPreferences.setLineWidth(preferences.getInt(XMLCorePreferenceNames.LINE_WIDTH));
        ((StructuredFormatPreferencesXML) fFormatPreferences).setSplitMultiAttrs(preferences.getBoolean(XMLCorePreferenceNames.SPLIT_MULTI_ATTRS));
        ((StructuredFormatPreferencesXML) fFormatPreferences).setAlignEndBracket(preferences.getBoolean(XMLCorePreferenceNames.ALIGN_END_BRACKET));
        ((StructuredFormatPreferencesXML) fFormatPreferences).setPreservePCDATAContent(preferences.getBoolean(XMLCorePreferenceNames.PRESERVE_CDATACONTENT));
        fFormatPreferences.setClearAllBlankLines(preferences.getBoolean(XMLCorePreferenceNames.CLEAR_ALL_BLANK_LINES));

        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);
        }
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.