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


Java LessSource类代码示例

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


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

示例1: instantiate

import org.lesscss.LessSource; //导入依赖的package包/类
/**
 * instantiates the actual less compilement
 * 
 * @throws Exception
 */
public void instantiate() throws Exception
{
  instantiateFiles();
  final LessSource mainLessSource = compile();

  if (Configuration.isDevelopmentMode() == true) {
    // only add this fancy resource watcher in dev mode
    final IModificationWatcher resourceWatcher = application.getResourceSettings().getResourceWatcher(true);
    // add watchers
    addWatcher(resourceWatcher, mainLessSource);
    for (final LessSource importedSource : mainLessSource.getImports().values()) {
      addWatcher(resourceWatcher, importedSource);
    }

  }

  // mount compiled css file
  reference = new LessResourceReference(relativeCssPath, cssTargetFile);
  application.mountResource(encodePathWithCachingStrategy(relativeCssPath), reference);
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:26,代码来源:LessWicketApplicationInstantiator.java

示例2: addWatcher

import org.lesscss.LessSource; //导入依赖的package包/类
/**
 * adds a resource watcher entry to the given less source
 * 
 * @param resourceWatcher
 * @param importedSource
 */
private void addWatcher(final IModificationWatcher resourceWatcher, final LessSource importedSource)
{
  log.info("adding watcher to less file " + importedSource.getAbsolutePath());
  resourceWatcher.add(new org.apache.wicket.util.file.File(new File(importedSource.getAbsolutePath())), new IChangeListener() {

    @Override
    public void onChange()
    {
      try {
        compile();
      } catch (final Exception e) {
        log.error("unable to compile less source during watcher for file " + importedSource.getAbsolutePath(), e);
      }
    }
  });
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:23,代码来源:LessWicketApplicationInstantiator.java

示例3: compile

import org.lesscss.LessSource; //导入依赖的package包/类
/**
 * compiles the saved .less to the wanted .css file
 * 
 * @return
 * @throws Exception
 */
private LessSource compile() throws Exception
{
  // compile file
  final LessCompiler lessCompiler = new LessCompiler();

  // create new source
  final LessSource mainLessSource = new LessSource(lessTargetFile);

  log.info("compiling " + lessTargetFile.getAbsolutePath() + " to " + cssTargetFile.getAbsolutePath());
  lessCompiler.compile(mainLessSource, cssTargetFile, false);
  return mainLessSource;
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:19,代码来源:LessWicketApplicationInstantiator.java


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