当前位置: 首页>>代码示例>>Java>>正文


Java Settings类代码示例

本文整理汇总了Java中com.vectorprint.configuration.Settings的典型用法代码示例。如果您正苦于以下问题:Java Settings类的具体用法?Java Settings怎么用?Java Settings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Settings类属于com.vectorprint.configuration包,在下文中一共展示了Settings类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildSettings

import com.vectorprint.configuration.Settings; //导入依赖的package包/类
private EnhancedMap buildSettings() throws IOException {
   ParsingProperties eh = new ParsingProperties(new SortedProperties(new Settings()));
   stylesheet.getText().clear();

   defaults.stream().forEach((DefaultValue def) -> {
      printComment(def.clazz + "." + def.key + '.' + def.suffix.name(), eh);
      eh.put(def.clazz + "." + def.key + '.' + def.suffix.name(), def.value);
   });

   for (Map.Entry<String, List<Parameterizable>> e : stylingConfig.entrySet()) {
      printComment(e.getKey(), eh);
      toConfigString(e.getKey(), e.getValue(), eh);
   }

   extraSettings.entrySet().stream().map((e) -> {
      printComment(e.getKey(), eh);
      return e;
   }).forEach((e) -> {
      eh.put(e.getKey(), e.getValue());
   });
   return eh;
}
 
开发者ID:eduarddrenth,项目名称:iText-GUI,代码行数:23,代码来源:Controller.java

示例2: initSettings

import com.vectorprint.configuration.Settings; //导入依赖的package包/类
/**
 * Look for annotated fields in the Object class, use settings argument to apply settings. NOTE that the settings
 * argument may be wrapped, you should always use the {@link Settings#getOutermostDecorator() }
 * in that case, and not call the settings argument directly after initialization is performed. When the Object
 * argument is a class only static fields will be processed, otherwise only instance fields.
 *
 * @param o
 * @param settings when null create a new {@link Settings} instance.
 */
@Override
public boolean initSettings(Object o, EnhancedMap settings) {
   if (settings == null || settings.isEmpty()) {
      if (LOGGER.isLoggable(Level.FINE)) {
         LOGGER.fine("settings null or empty, no initialization");
      }
      return false;
   }
   if (settingsUsed == null) {
      settingsUsed = settings;
   } else if (o instanceof Class && objects.contains(o) && settingsUsed.equals(settings)) {
      // only check for classes, because equals of objects may be very expensive
      if (LOGGER.isLoggable(Level.FINE)) {
         LOGGER.fine(String.format("assuming, based on equals, settings for %s already initialized with %s", o, settings));
      }
      return false;
   }
   initSettings(o instanceof Class ? (Class) o : o.getClass(), o instanceof Class ? null : o, settings == null ? new Settings() : settings, settings != null);
   if (o instanceof Class) {
      objects.add(o);
   }
   return true;
}
 
开发者ID:eduarddrenth,项目名称:Configuration,代码行数:33,代码来源:SettingsAnnotationProcessorImpl.java

示例3: toConfigString

import com.vectorprint.configuration.Settings; //导入依赖的package包/类
private String toConfigString(String clazz, List<? extends Parameterizable> sp) throws IOException {
   ParsingProperties p = new ParsingProperties(new Settings());
   toConfigString(clazz, sp, p);
   StringWriter sw = new StringWriter(p.size() * 30);
   SettingsBindingService.getInstance().getFactory().getSerializer().serialize(p, sw);
   return sw.toString();
}
 
开发者ID:eduarddrenth,项目名称:iText-GUI,代码行数:8,代码来源:Controller.java

示例4: importStyle

import com.vectorprint.configuration.Settings; //导入依赖的package包/类
@FXML
private void importStyle(ActionEvent event) {
   try {
      FileChooser fc = new FileChooser();
      fc.setTitle("import stylesheet");
      File f = fc.showOpenDialog(null);
      if (f != null && f.canRead()) {
         importStyle(new ParsingProperties(new SortedProperties(new Settings()), f.getPath()));
      }
   } catch (Exception ex) {
      ViewHelper.toError(ex, error);
   }
}
 
开发者ID:eduarddrenth,项目名称:iText-GUI,代码行数:14,代码来源:Controller.java

示例5: importCss

import com.vectorprint.configuration.Settings; //导入依赖的package包/类
@FXML
private void importCss(ActionEvent event) {
   try {
      File f = ViewHelper.prepareFC("import css", "Css files (*.css)", "*.css", "*.CSS", "*.Css").showOpenDialog(null);
      if (f != null && f.canRead()) {
         System.setProperty("org.w3c.css.sac.parser", SACParser.class.getName());
         ByteArrayOutputStream bo = new ByteArrayOutputStream(2048);
         CssTransformer.transform(new FileInputStream(f), bo, cssvalidate.isSelected());
         importStyle(new ParsingProperties(new SortedProperties(new Settings()), new StringReader(bo.toString())));
      }
   } catch (Exception ex) {
      ViewHelper.toError(ex, error);
   }
}
 
开发者ID:eduarddrenth,项目名称:iText-GUI,代码行数:15,代码来源:Controller.java

示例6: testStyleSheet

import com.vectorprint.configuration.Settings; //导入依赖的package包/类
public void testStyleSheet(String stylesheet) throws Exception {

      EnhancedMap settings = new CachingProperties(new ParsingProperties(new Settings(), new StringReader(stylesheet)));
      settings.put(ReportConstants.REPORTCLASS, getClass().getName());
      ByteArrayOutputStream out = new ByteArrayOutputStream();
      new ReportRunner(settings).buildReport(null, out);
      controller.openPdf(new ByteArrayInputStream(out.toByteArray()), "test stylesheet in pdf");
   }
 
开发者ID:eduarddrenth,项目名称:iText-GUI,代码行数:9,代码来源:StylesheetTester.java


注:本文中的com.vectorprint.configuration.Settings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。