示例#1
0
 void store() {
   if (javaServerRadioButton.isSelected())
     NbPreferences.forModule(NetworkingPanel.class)
         .put("NetworkConnection", InsecureClientManager.class.getName());
   else NbPreferences.root().put("NetworkConnection", "JSON CONNECTION CLASS");
   NbPreferences.root().put("ServerAddress", serverAddressField.getText());
 }
示例#2
0
 void load() {
   javaServerRadioButton.setSelected(true);
   serverAddressField.setText(NbPreferences.root().get("ServerAddress", "master.betaville.net"));
   if (NbPreferences.root()
       .get("NetworkConnection", InsecureClientManager.class.getName())
       .equals(InsecureClientManager.class.getName())) {
     javaServerRadioButton.setSelected(true);
   } else {
     webServiceRadioButton.setSelected(true);
   }
 }
 private String formatCurrency(String amount) {
   String text = "";
   if (NbPreferences.root().getBoolean("inFront", false)) {
     text += NbPreferences.root().get("currency", " €");
   }
   text += amount;
   if (NbPreferences.root().getBoolean("inFront", false)) {
   } else {
     text += NbPreferences.root().get("currency", " €");
   }
   return text;
 }
  private String formatWithIVA(BigDecimal price) {
    BigDecimal iva =
        new BigDecimal(NbPreferences.root().get("iva", "21")).divide(new BigDecimal("100"));

    BigDecimal total = price.add(price.multiply(iva));

    return formatCurrency(total.setScale(2, RoundingMode.HALF_UP).toPlainString());
  }
  @Override
  public void selectPerspective(Perspective perspective) {
    if (perspective.getName().equals(selectedPerspective)) {
      return;
    }

    openAndCloseMembers(perspective);

    selectedPerspective = perspective.getName();
    NbPreferences.root().put(SELECTED_PERSPECTIVE_PREFERENCE, selectedPerspective);
  }
  public PerspectiveControllerImpl() {
    // Load perspectives
    perspectives = Lookup.getDefault().lookupAll(Perspective.class).toArray(new Perspective[0]);
    members =
        Lookup.getDefault().lookupAll(PerspectiveMember.class).toArray(new PerspectiveMember[0]);

    // Find if there is a default
    String firstPerspective = perspectives.length > 0 ? perspectives[0].getName() : null;
    String defaultPerspectiveName = System.getProperty("org.gephi.perspective.default");
    if (defaultPerspectiveName != null) {
      for (Perspective p : perspectives) {
        if (p.getName().equals(defaultPerspectiveName)) {
          selectedPerspective = p.getName();
          break;
        }
      }
    }
    if (selectedPerspective == null) {
      selectedPerspective =
          NbPreferences.root().get(SELECTED_PERSPECTIVE_PREFERENCE, firstPerspective);
    }

    // Store selected in prefs
    NbPreferences.root().put(SELECTED_PERSPECTIVE_PREFERENCE, selectedPerspective);

    WindowManager.getDefault()
        .invokeWhenUIReady(
            new Runnable() {

              @Override
              public void run() {
                // Set to previously selected perspective
                Perspective selectedPerspectiveInstance = getSelectedPerspective();

                openAndCloseMembers(selectedPerspectiveInstance);
              }
            });
  }
示例#7
0
 public String getNickname() {
   return NbPreferences.root().node("/org/chartsy/chat").get("nickname", "");
 }