Package org.eclipse.imp.preferences

Examples of org.eclipse.imp.preferences.IPreferencesService


  public FregeTokenColorer() {
    super();
   
    Display display = Display.getDefault();
    IPreferencesService service = FregePlugin.getInstance().getPreferencesService();
   
    final boolean boldns = service.getBooleanPreference(FregePreferencesConstants.P_BOLDNS);
    final boolean italic = service.getBooleanPreference(FregePreferencesConstants.P_ITALICIMPORTS);
   
    Color docuColor = new Color (display,
        StringConverter.asRGB(service.getStringPreference(FregePreferencesConstants.P_DOCUCOLOR),
            display.getSystemColor(SWT.COLOR_DARK_BLUE).getRGB()));
    Color commColor = new Color (display,
        StringConverter.asRGB(service.getStringPreference(FregePreferencesConstants.P_COMMCOLOR),
            display.getSystemColor(SWT.COLOR_DARK_CYAN).getRGB()));
    Color tconColor = new Color (display,
        StringConverter.asRGB(service.getStringPreference(FregePreferencesConstants.P_TCONCOLOR),
            display.getSystemColor(SWT.COLOR_DARK_RED).getRGB()));
    Color dconColor = new Color (display,
        StringConverter.asRGB(service.getStringPreference(FregePreferencesConstants.P_DCONCOLOR),
            display.getSystemColor(SWT.COLOR_DARK_YELLOW).getRGB()));
    Color varidColor = new Color (display,
        StringConverter.asRGB(service.getStringPreference(FregePreferencesConstants.P_VARIDCOLOR),
            display.getSystemColor(SWT.COLOR_BLACK).getRGB()));
    Color importColor = new Color (display,
        StringConverter.asRGB(service.getStringPreference(FregePreferencesConstants.P_IMPORTCOLOR),
            display.getSystemColor(SWT.COLOR_BLACK).getRGB()));
    Color keywdColor = new Color (display,
        StringConverter.asRGB(service.getStringPreference(FregePreferencesConstants.P_KEYWORDCOLOR),
            display.getSystemColor(SWT.COLOR_DARK_MAGENTA).getRGB()));
    Color litColor = new Color (display,
        StringConverter.asRGB(service.getStringPreference(FregePreferencesConstants.P_LITERALCOLOR),
            display.getSystemColor(SWT.COLOR_DARK_CYAN).getRGB()));
    Color errColor = new Color (display,
        StringConverter.asRGB(service.getStringPreference(FregePreferencesConstants.P_ERRORCOLOR),
            display.getSystemColor(SWT.COLOR_RED).getRGB()));
    Color spcColor = new Color (display,
        StringConverter.asRGB(service.getStringPreference(FregePreferencesConstants.P_SPECIALCOLOR),
            display.getSystemColor(SWT.COLOR_DARK_MAGENTA).getRGB()));
    commentAttribute = new TextAttribute(commColor, null, SWT.NORMAL);
    docuAttribute    = new TextAttribute(docuColor, null, SWT.ITALIC);
    normalAttribute  = null; // new TextAttribute(display.getSystemColor(SWT.COLOR_BLACK), null, SWT.NORMAL);
    keywordAttribute = new TextAttribute(keywdColor, null, SWT.BOLD);
View Full Code Here


  /*
   * (non-Javadoc)
   * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
   */
  public void initializeDefaultPreferences() {
    IPreferencesService service = FregePlugin.getInstance().getPreferencesService();
    Display display = Display.getDefault();
//    String darkYellow = StringConverter.asString(display.getSystemColor(SWT.COLOR_DARK_YELLOW).getRGB());
//    String darkRed    = StringConverter.asString(display.getSystemColor(SWT.COLOR_DARK_RED).getRGB());
//    String black      = StringConverter.asString(display.getSystemColor(SWT.COLOR_BLACK).getRGB());
//    String red        = StringConverter.asString(display.getSystemColor(SWT.COLOR_RED).getRGB());
//    String blue       = StringConverter.asString(display.getSystemColor(SWT.COLOR_BLUE).getRGB());
//    String darkBlue   = StringConverter.asString(display.getSystemColor(SWT.COLOR_DARK_BLUE).getRGB());
//    String darkMagenta= StringConverter.asString(display.getSystemColor(SWT.COLOR_DARK_MAGENTA).getRGB());
//    String darkGreen  = StringConverter.asString(display.getSystemColor(SWT.COLOR_DARK_GREEN).getRGB());
//    String darkCyan   = StringConverter.asString(display.getSystemColor(SWT.COLOR_DARK_CYAN).getRGB());

    // in the following, we set some "light solarized colours as defaults"
    String base01  = StringConverter.asString(hexRGB(0x586e75));
    String brgreen = base01;
    String base1   = StringConverter.asString(hexRGB(0x93a1a1));
    String brcyan  = base1;
    String yellow  = StringConverter.asString(hexRGB(0xb58900));
    String orange  = StringConverter.asString(hexRGB(0xcb4b16));
    String red     = StringConverter.asString(hexRGB(0xdc322f));
    String magenta = StringConverter.asString(hexRGB(0xd33682));
    String violet  = StringConverter.asString(hexRGB(0x6c71c4));
    String blue    = StringConverter.asString(hexRGB(0x268bd2));
    String cyan    = StringConverter.asString(hexRGB(0x2aa198));
    String green   = StringConverter.asString(hexRGB(0x859900));
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_SOURCEFONT, "Consolas");
    service.setIntPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_TABWITH, 4);
    service.setIntPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_PARSETIMEOUT, 250);
    service.setBooleanPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_SPACESFORTABS, true);
    service.setBooleanPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_INLINE, true);
    service.setBooleanPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_INLINE, false);
    service.setBooleanPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_DECORATESTRICT, true);
    service.setBooleanPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_ITALICIMPORTS, true);
    service.setBooleanPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_BOLDNS, true);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_DOCUCOLOR, brgreen);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_COMMCOLOR, brcyan);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_TCONCOLOR, orange);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_DCONCOLOR, green);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_VARIDCOLOR, blue);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_IMPORTCOLOR, violet);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_KEYWORDCOLOR, magenta);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_SPECIALCOLOR, magenta);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_LITERALCOLOR, cyan);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_ERRORCOLOR, red);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, FregePreferencesConstants.P_PREFIX, "");
   
    /*
    System.err.println("darkYellow is " + darkYellow);
    System.err.println("darkRed is " + darkRed);
    System.err.println("black is " + black);
View Full Code Here

  /*
   * Clear (remove) any preferences set on the given level.
   */
  public void clearPreferencesOnLevel(String level) {
    IPreferencesService service = FregePlugin.getInstance().getPreferencesService();
    service.clearPreferencesAtLevel(level);

  }
View Full Code Here

    global = TGlobal.upd$options(global, TOptions.upd$dir(
        TGlobal.options(global),
        bp));
    global = runSTIO(Utilities.newLoader, global);
     
    IPreferencesService service = FregePlugin.getInstance().getPreferencesService();
    if (service != null) {
      timeout = service.getIntPreference(FregePreferencesConstants.P_PARSETIMEOUT);
      if (service.getBooleanPreference(FregePreferencesConstants.P_INLINE)) {
        global = TGlobal.upd$options(global, TOptions.upd$flags(
              TGlobal.options(global),
              Delayed.<Long> forced(
                TBitSet.unionE(new IEnum_Flag(),
                  TOptions.flags(TGlobal.options(global)),
                  TFlag.INLINE))
            ));
      } else {
        global = TGlobal.upd$options(global, TOptions.upd$flags(
            TGlobal.options(global),
            Delayed.<Long> forced(
              TBitSet.differenceE(new IEnum_Flag(),
                TOptions.flags(TGlobal.options(global)),
                TFlag.INLINE))
          ));
      }
      if (service.getBooleanPreference(FregePreferencesConstants.P_COMMENTS)) {
        global = TGlobal.upd$options(global, TOptions.upd$flags(
              TGlobal.options(global),
              Delayed.<Long> forced(
                TBitSet.unionE(new IEnum_Flag(),
                  TOptions.flags(TGlobal.options(global)),
                  TFlag.COMMENTS))
            ));
      } else {
        global = TGlobal.upd$options(global, TOptions.upd$flags(
            TGlobal.options(global),
            Delayed.<Long> forced(
              TBitSet.differenceE(new IEnum_Flag(),
                TOptions.flags(TGlobal.options(global)),
                TFlag.COMMENTS))
          ));
      }
      final String prefix = service.getStringPreference(FregePreferencesConstants.P_PREFIX);
      if (prefix != null && prefix.length() > 0) {
        global = TGlobal.upd$options(global, TOptions.upd$prefix(
              TGlobal.options(global), prefix));
      }
    }
View Full Code Here

  /*
   * (non-Javadoc)
   * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
   */
  public void initializeDefaultPreferences() {
    IPreferencesService service = Activator.getInstance().getPreferencesService();

    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_SOURCEFONT, "Courier New");
    service.setIntPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_TABWIDTH, 4);
    service.setBooleanPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_SPACESFORTABS, false);
    service.setBooleanPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_USEDEFAULTINCLUDEPATH, true);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_INCLUDEPATHTOUSE, ".;..; ${workspaceLoc;${projectLoc:projectName}");
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_SOURCEFILEEXTENSIONS, "dontExistExtention");
    service.setBooleanPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_GENERATELOG, true);
    service.setIntPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_MAXLOGENTRIES, 100);
  }
View Full Code Here

  /*
   * Clear (remove) any preferences set on the given level.
   */
  public void clearPreferencesOnLevel(String level) {
    IPreferencesService service = Activator.getInstance().getPreferencesService();
    service.clearPreferencesAtLevel(level);

  }
View Full Code Here

  /*
   * (non-Javadoc)
   * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
   */
  public void initializeDefaultPreferences() {
    IPreferencesService service = Activator.getInstance().getPreferencesService();

    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_SOURCEFONT, "Courier New");
    service.setIntPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_TABWIDTH, 4);
    service.setBooleanPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_SPACESFORTABS, false);
    service.setBooleanPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_USEDEFAULTINCLUDEPATH, true);
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_INCLUDEPATHTOUSE, ".;..; ${workspaceLoc;${projectLoc:projectName}");
    service.setStringPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_SOURCEFILEEXTENSIONS, "hx");
    service.setBooleanPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_GENERATELOG, true);
    service.setIntPreference(IPreferencesService.DEFAULT_LEVEL, HaxeConstants.P_MAXLOGENTRIES, 100);
  }
View Full Code Here

  /*
   * Clear (remove) any preferences set on the given level.
   */
  public void clearPreferencesOnLevel(String level) {
    IPreferencesService service = Activator.getInstance().getPreferencesService();
    service.clearPreferencesAtLevel(level);

  }
View Full Code Here

TOP

Related Classes of org.eclipse.imp.preferences.IPreferencesService

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.