org.weasis.core.api.service.WProperties.put()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中org.weasis.core.api.service.WProperties.put()方法的一些代码示例,展示了WProperties.put()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WProperties.put()方法的具体详情如下:
包路径:org.weasis.core.api.service.WProperties
类名称:WProperties
方法名:put

WProperties.put介绍

暂无

代码示例

代码示例来源:origin: nroduit/Weasis

public void putIntProperty(String key, int value) {
  if (isValid(key, value)) {
    this.put(key, String.valueOf(value));
  }
}

代码示例来源:origin: nroduit/Weasis

BundleTools.SYSTEM_PREFERENCES.put("weasis.look", look.getClassName()); //$NON-NLS-1$

代码示例来源:origin: nroduit/Weasis

public void putBooleanProperty(String key, boolean value) {
  if (isKeyValid(key)) {
    this.put(key, String.valueOf(value));
  }
}

代码示例来源:origin: nroduit/Weasis

public void putDoubleProperty(String key, double value) {
  if (isKeyValid(key)) {
    this.put(key, String.valueOf(value));
  }
}

代码示例来源:origin: nroduit/Weasis

public void putLongProperty(String key, long value) {
  if (isValid(key, value)) {
    this.put(key, String.valueOf(value));
  }
}

代码示例来源:origin: nroduit/Weasis

public void putFloatProperty(String key, float value) {
  if (isKeyValid(key)) {
    this.put(key, String.valueOf(value));
  }
}

代码示例来源:origin: nroduit/Weasis

public void putByteArrayProperty(String key, byte[] value) {
  if (isValid(key, value)) {
    try {
      this.put(key, Base64.getEncoder().encode(GzipManager.gzipCompressToByte(value)));
    } catch (IOException e) {
      LOGGER.error("Set byte property", e); //$NON-NLS-1$
    }
  }
}

代码示例来源:origin: nroduit/Weasis

public void resetServiceProperty(String key, String defaultValue) {
  if (isKeyValid(key)) {
    String value = System.getProperty(key, null);
    if (value == null) {
      value = context == null ? null : context.getProperty("def." + key); //$NON-NLS-1$
      if (value == null) {
        value = defaultValue;
      }
    }
    if (isValid(key, value)) {
      this.put(key, value);
    }
  }
}

代码示例来源:origin: nroduit/Weasis

public void resetProperty(String key, String defaultValue) {
  if (isKeyValid(key)) {
    String value = System.getProperty(key, null);
    if (value == null) {
      value = context == null ? null : context.getProperty(key);
      if (value == null) {
        value = defaultValue;
      }
    }
    if (isValid(key, value)) {
      this.put(key, value);
    }
  }
}

代码示例来源:origin: nroduit/Weasis

public void putColorProperty(String key, Color color) {
  if (isValid(key, color)) {
    this.put(key, color2Hexadecimal(color, true));
  }
}

代码示例来源:origin: nroduit/Weasis

private void setLocalUtil(Locale local) {
  if (local == null) {
    BundleTools.SYSTEM_PREFERENCES.remove(BundleTools.P_FORMAT_CODE);
  } else {
    BundleTools.SYSTEM_PREFERENCES.put(BundleTools.P_FORMAT_CODE, LocalUtil.localeToText(local));
  }
  Locale l = local == null ? null : local.equals(Locale.getDefault()) ? null : local;
  LocalUtil.setLocaleFormat(l);
}

代码示例来源:origin: nroduit/Weasis

@Override
  public void itemStateChanged(ItemEvent iEvt) {
    if (iEvt.getStateChange() == ItemEvent.SELECTED) {
      Object item = getSelectedItem();
      if (item instanceof JLocale) {
        removeItemListener(this);
        Locale locale = ((JLocale) item).getLocale();
        Locale.setDefault(locale);
        BundleTools.SYSTEM_PREFERENCES.put("locale.lang.code", LocalUtil.localeToText(locale)); //$NON-NLS-1$
        removeAllItems();
        sortLocales();
        addItemListener(this);
        firePropertyChange("locale", null, locale); //$NON-NLS-1$
        valueHasChanged();
      }
    }
  }
}

相关文章