Examples of Preferences


Examples of com.nevernote.domain.Preferences

      newUser.setPriviledge("standard");
      newUser.setEnabled(true);
      System.out.println(newUser.toString())
      Users savedUser = usersService.save(request.getParameter("un"),newUser);

      Preferences prefs = new Preferences();
      prefs.setUserID(savedUser.getId());
      prefs.setColors(ColorScheme.valueOf("BLACK_ON_WHITE").toString());
      prefs.setSort(SortingMethod.valueOf("ALPHA_ASCENDING").toString());
      preferenceService.save(prefs);

      String relativeWebPath = "WEB-INF/notesRepo";
      String absoluteDiskPath = getServletContext().getRealPath(relativeWebPath);
      File directory = new File(absoluteDiskPath + "/" + newUser.getId());
View Full Code Here

Examples of de.hwrberlin.it11.tsp.model.Preferences

    shell.setText("Eigenschaften");
    shell.setImage(Images.COG);
    shell.setLayout(new MigLayout("fill, wrap 2"));
    shell.setLayoutData("hmin pref, wmin pref");

    final Preferences preferences = Preferences.getInstance();

    Label lAntialias = new Label(shell, SWT.NONE);
    lAntialias.setText("Antialiasing:");
    lAntialias.setLayoutData("hmin pref, wmin pref");

    final AntButton bAntialias = new AntButton(new Button(shell, SWT.CHECK), getProject());
    bAntialias.getButton().setSelection(preferences.isAntialias());
    bAntialias.getButton().setLayoutData("hmin pref, wmin pref");
    bAntialias.setTooltipText("Mit dieser Optionen k�nnen Sie Antialiasing an- und ausschalten.");

    Label lRedrawInterval = new Label(shell, SWT.NONE);
    lRedrawInterval.setText("Neuzeichnungsintervall:");
    lRedrawInterval.setLayoutData("hmin pref, wmin pref");

    final AntText tRedrawInterval = new AntText(new Text(shell, SWT.BORDER), getProject());
    tRedrawInterval.getText().setText(Utility.FORMAT.format(preferences.getRedrawInterval()));
    tRedrawInterval.getText().setLayoutData("hmin pref, wmin pref, grow");
    tRedrawInterval.setTooltipText("Hier k�nnen Sie einstellen, nach wie vielen Iterationen neu gezeichnet werden soll. (X > 0)");
    tRedrawInterval.setInputMode(AntText.INTEGER_ONLY);
    tRedrawInterval.setNumberRange(1, Double.POSITIVE_INFINITY, true, true);

    Label lNodeColor = new Label(shell, SWT.NONE);
    lNodeColor.setText("Farbe der Knoten:");
    lNodeColor.setLayoutData("hmin pref, wmin pref");

    final AntComposite cNodeColor = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    cNodeColor.setBackground(preferences.getNodeColor());
    cNodeColor.getComposite().setLayoutData("height 20!, wmin 50");
    cNodeColor.setTooltipText("Hier k�nnen Sie die Farbe einstellen, mit der die Knoten gezeichnet werden.");
    cNodeColor.getComposite().addMouseListener(new ChooseColorListener(cNodeColor));

    Label lCurrentNodeColor = new Label(shell, SWT.NONE);
    lCurrentNodeColor.setText("Farbe der ausgew�hlten Knoten:");
    lCurrentNodeColor.setLayoutData("hmin pref, wmin pref");

    final AntComposite cCurrentNodeColor = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    cCurrentNodeColor.setBackground(preferences.getCurrentNodeColor());
    cCurrentNodeColor.getComposite().setLayoutData("height 20!, wmin 50");
    cCurrentNodeColor.setTooltipText("Hier k�nnen Sie die Farbe einstellen, mit der die ausgew�hlten Knoten gezeichnet werden.");
    cCurrentNodeColor.getComposite().addMouseListener(new ChooseColorListener(cCurrentNodeColor));

    Label lBestTourGlobalColor = new Label(shell, SWT.NONE);
    lBestTourGlobalColor.setText("Farbe der besten globalen Tour:");
    lBestTourGlobalColor.setLayoutData("hmin pref, wmin pref");

    final AntComposite cBestTourGlobalColor = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    cBestTourGlobalColor.setBackground(preferences.getBestTourGlobalColor());
    cBestTourGlobalColor.getComposite().setLayoutData("height 20!, wmin 50");
    cBestTourGlobalColor.setTooltipText("Hier k�nnen Sie die Farbe einstellen, mit der die Linien der globalen besten Tour gezeichnet werden.");
    cBestTourGlobalColor.getComposite().addMouseListener(new ChooseColorListener(cBestTourGlobalColor));

    Label lBestTourIterationColor = new Label(shell, SWT.NONE);
    lBestTourIterationColor.setText("Farbe der besten Tour der Iteration:");
    lBestTourIterationColor.setLayoutData("hmin pref, wmin pref");

    final AntComposite cBestTourIterationColor = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    cBestTourIterationColor.setBackground(preferences.getBestTourIterationColor());
    cBestTourIterationColor.getComposite().setLayoutData("height 20!, wmin 50");
    cBestTourIterationColor
        .setTooltipText("Hier k�nnen Sie die Farbe einstellen, mit der die Linien der besten Tour der Iteration gezeichnet werden.");
    cBestTourIterationColor.getComposite().addMouseListener(new ChooseColorListener(cBestTourIterationColor));

    Label lBackgroundColor = new Label(shell, SWT.NONE);
    lBackgroundColor.setText("Farbe des Malfl�chenhintergrundes:");
    lBackgroundColor.setLayoutData("hmin pref, wmin pref");

    final AntComposite cBackgroundColor = new AntComposite(new Composite(shell, SWT.BORDER), getProject());
    cBackgroundColor.setBackground(preferences.getBackgroundColor());
    cBackgroundColor.getComposite().setLayoutData("height 20!, wmin 50");
    cBackgroundColor.setTooltipText("Hier k�nnen Sie die Hintergrundfarbe der Malfl�che einstellen.");
    cBackgroundColor.getComposite().addMouseListener(new ChooseColorListener(cBackgroundColor));

    Composite buttonComp = new Composite(shell, SWT.NONE);
    buttonComp.setLayout(new MigLayout("wrap 2, ins 0", "[50%][50%]"));
    buttonComp.setLayoutData("hmin 0, wmin 0, growx, spanx");

    AntButton confirm = new AntButton(new Button(buttonComp, SWT.PUSH), getProject());
    confirm.getButton().setText("Speichern");
    confirm.getButton().setLayoutData("hmin pref, wmin pref, grow");
    confirm.setTooltipText("Speichert die Eigenschaften und schlie�t den Dialog.");
    confirm.getButton().addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent pE) {
        if (tRedrawInterval.isValidInput()) {
          try {
            preferences.setAntialias(bAntialias.getButton().getSelection());
            preferences.setRedrawInterval(Utility.FORMAT.parse(tRedrawInterval.getText().getText()).intValue());
            preferences.setNodeColor(cNodeColor.getBackground());
            preferences.setCurrentNodeColor(cCurrentNodeColor.getBackground());
            preferences.setBestTourGlobalColor(cBestTourGlobalColor.getBackground());
            preferences.setBestTourIterationColor(cBestTourIterationColor.getBackground());
            preferences.setBackgroundColor(cBackgroundColor.getBackground());
          }
          catch (ParseException e) {
            MessageDialog.openError(shell, "Fehler beim umwandeln der Werte",
                "Beim Umwandeln der Werte von Text in eine Zahl ist ein Fehler aufgetreten.");
          }
View Full Code Here

Examples of de.iritgo.aktera.configuration.preferences.Preferences

   
    if (field.isComment())
    {
      input.setAttribute("desc", "Y");

      Preferences preferences = UserTools.getUserPreferences(req);

      if (preferences == null || preferences.getPowerUser() == null
              || ! preferences.getPowerUser().booleanValue())
      {
        if (outGroup != null)
        {
          outGroup.add(input);
        }
View Full Code Here

Examples of fr.ippon.tatami.web.rest.dto.Preferences

    public Preferences getPreferences() {
        this.log.debug("REST request to get account's preferences");
        User currentUser = authenticationService.getCurrentUser();
        User user = userService.getUserByLogin(currentUser.getLogin());

        Preferences preferences = new Preferences(user);
        return preferences;
    }
View Full Code Here

Examples of hirondelle.predict.main.preferences.Preferences

    //AllowStringAsBuildingBlock is set to NO in web.xml
    SafeText userName = SafeText.from(aRequest.getUserPrincipal().getName());
    fLogger.fine("Adding user preferences to session, for principal name:" + userName);
    PreferencesDAO dao  = new PreferencesDAO();
    try {
      Preferences prefs = dao.fetch(userName);
      fLogger.fine("Adding user id and screen name to session");
      aSession.setAttribute(ActionImpl.USER_ID, prefs.getUserId());
      aSession.setAttribute(Preferences.SCREEN_NAME, prefs.getScreenName());
    }
    catch (DAOException ex){
      throw new AppException("Cannot fetch Preferences from database.", ex);
    }
  }
View Full Code Here

Examples of java.util.prefs.Preferences

        p.setNote("Done.");
        p.setProgress(++progress);
    }

    private InputStream getLMSTemplate() throws IOException {
        Preferences userPrefs = Preferences.userNodeForPackage(CourseBuilder.class);
        if (userPrefs.getBoolean("courseBuilder.useInternalTemplate", true)) {
            return getClass().getResourceAsStream("/lmshtml.zip");
        } else {
            return new FileInputStream(userPrefs.get("courseBuilder.externalTemplate", ""));
        }
    }
View Full Code Here

Examples of java.util.prefs.Preferences

  if (g.error()) {    // Any bad command line argument?
    usage(null);    // If so, whine and exit
  }

  // Get user's preferences, if any.
  Preferences prefs = Preferences.userRoot().node("/jimm/datavision");

  // Set look & feel.
  try {
    javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
  } catch (Exception e) {
    // Default L&F will be used if any problems occur, most probably,
    // ClassNotFound.
  }

    DataVision dv = new DataVision();

    // Language
    if (g.hasOption('g') || g.hasOption('i'))
  I18N.setLanguage(new Locale(g.option('g', "").toLowerCase(),
            g.option('i', "").toUpperCase()));

    dv.layoutEngineChoiceFromOptions(g);
    dv.dataSourceFromOptions(g);

    if (dv.hasLayoutEngine()) {
  if (dv.usesGUI())  // Can ask for password via GUI
      ErrorHandler.useGUI(true);
  else if (!g.hasOption('n') && !g.hasOption('p') && !g.hasOption('e'))
      usage(I18N.get("DataVision.n_or_p"));
    }

    dv.paramXMLFile = g.option('r', null); // Parameter XML file name or null
    dv.reportDir = g.option('R', null); // Report Directory or null
    dv.outputDir = g.option('o', null); // Output Directory or null

    // Store the report directory in the preferences for this package
    // These values are stored in the root package jimm.datavision
    if (dv.reportDir != null) {
        prefs.put("reportDir",dv.reportDir);
    }
    if (dv.outputDir != null) {
        prefs.put("outputDir",dv.outputDir);
    }

    if (g.argc() == 0) {
  if (startupDialog())  // Returns true if we should exit
      return;
View Full Code Here

Examples of java.util.prefs.Preferences

  /**
   * Creates user preferences read from Java preferences.
   */
  public FileFurnitureLibraryUserPreferences() {
    Preferences preferences = getPreferences();
    setLanguage(preferences.get(LANGUAGE, getLanguage()));   
    setUnit(LengthUnit.valueOf(preferences.get(UNIT, getLengthUnit().name())));
    setDefaultCreator(preferences.get(DEFAULT_CREATOR, getDefaultCreator()));
    boolean offlineFurnitureLibrary = preferences.getBoolean(OFFLINE_FURNITURE_LIBRARY, isFurnitureLibraryOffline());
    if (isOnlineFurnitureLibrarySupported()) {
      setFurnitureLibraryOffline(offlineFurnitureLibrary);
      setFurnitureResourcesLocalDirectory(preferences.get(FURNITURE_RESOURCES_LOCAL_DIRECTORY,
          getFurnitureResourcesLocalDirectory()));
      setFurnitureResourcesRemoteURLBase(preferences.get(FURNITURE_RESOURCES_REMOTE_URL_BASE,
          getFurnitureResourcesRemoteURLBase()));
    }
  }
View Full Code Here

Examples of java.util.prefs.Preferences

    }
  }
 
  @Override
  public void write() throws RecorderException {
    Preferences preferences = getPreferences();
    preferences.put(LANGUAGE, getLanguage());
    preferences.put(UNIT, getLengthUnit().name());  
    if (getDefaultCreator() != null) {
      preferences.put(DEFAULT_CREATOR, getDefaultCreator());
    } else {
      preferences.remove(DEFAULT_CREATOR);
    }
    preferences.putBoolean(OFFLINE_FURNITURE_LIBRARY, isFurnitureLibraryOffline());
    if (getFurnitureResourcesLocalDirectory() != null) {
      preferences.put(FURNITURE_RESOURCES_LOCAL_DIRECTORY, getFurnitureResourcesLocalDirectory());
    } else {
      preferences.remove(FURNITURE_RESOURCES_LOCAL_DIRECTORY);
    }
    if (getFurnitureResourcesRemoteURLBase() != null) {
      preferences.put(FURNITURE_RESOURCES_REMOTE_URL_BASE, getFurnitureResourcesRemoteURLBase());
    } else {
      preferences.remove(FURNITURE_RESOURCES_REMOTE_URL_BASE);
    }
   
    try {
      // Write preferences
      preferences.sync();
    } catch (BackingStoreException ex) {
      throw new RecorderException("Couldn't write preferences", ex);
    }
  }
View Full Code Here

Examples of java.util.prefs.Preferences

    String ac = ae.getActionCommand();

    // Set the starting report directory (null is default home directory)
    // Store the report directory in the preferences for this package
    Preferences prefs = Preferences.userRoot().node("/jimm/datavision");
    String reportDir = prefs.get("reportDir", null);
    System.out.println("reportDir(1) = " + reportDir);

    // Open an existing report
    if (ac.equalsIgnoreCase(I18N.get("StartupDialog.open"))) {
      JFileChooser jfc = new JFileChooser();
      if (reportDir != null) {
        jfc.setCurrentDirectory(new File(reportDir));
      }
      jfc.setMultiSelectionEnabled(false);
      int rv = jfc.showOpenDialog(this);
      if (rv == JFileChooser.APPROVE_OPTION) {
        selectedFile = jfc.getSelectedFile().getPath();
        // If the file path has changed then store it in the preferences
        String jfcap = jfc.getSelectedFile().getAbsolutePath();
        if (jfcap != null) {
          File f = new File(jfcap);
          String newReportDir = f.getParent();
          if (newReportDir == null) {
            newReportDir = reportDir;
          }
          if (newReportDir != null) {
            boolean changed = true;
            if (reportDir != null && newReportDir.compareTo(reportDir) == 0) {
              changed = false;
            }
            if (changed) {
              prefs.put("reportDir", newReportDir);
            }
          }
        }
        dispose();
      }
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.