Java Code Examples for com.google.gwt.resources.client.ClientBundle

The following are top voted examples for showing how to use com.google.gwt.resources.client.ClientBundle. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: xapi   File: CssInjectorGenerator.java   View source code 6 votes vote down vote up
private void fillStyles(final TreeLogger logger,
                        final Many<Style> styles,
                        final Set<CssFile> files,
                        final Set<Class<? extends ClientBundle>> resourceTypes,
                        final Css ... csses) {
  for (final Css css : csses) {
    for (final Style style : css.style()) {
      if (style.names().length > 0) {
        styles.add(style.priority(), style);
      }
    }
    for (final Class<? extends ClientBundle> cls : css.resources()) {
      resourceTypes.add(cls);
    }
    for (final CssFile file : css.files()) {
      files.add(file);
    }
  }
}
 
Example 2
Project: gwtmockito   File: FakeClientBundleProvider.java   View source code 6 votes vote down vote up
/**
 * Returns a new instance of the given type that implements methods as
 * described in the class description.
 *
 * @param type interface to be implemented by the returned type.
 */
@Override
public ClientBundle getFake(Class<?> type) {
  return (ClientBundle) Proxy.newProxyInstance(
      FakeClientBundleProvider.class.getClassLoader(),
      new Class<?>[] {type},
      new InvocationHandler() {
        @Override
        public Object invoke(Object proxy, Method method, Object[] args) throws Exception {
          Class<?> returnType = method.getReturnType();
          if (CssResource.class.isAssignableFrom(returnType)) {
            return GWT.create(returnType);
          } else {
            return createFakeResource(returnType, method.getName());
          }
        }
      });
}
 
Example 3
Project: vue-gwt   File: GenerationUtil.java   View source code 5 votes vote down vote up
public static void generateGwtBundle(TypeElement sourceType, ClassName bundleClassName,
    String bundleMethodName, TypeName resourceType, String resourceExtension, Filer filer)
{
    Builder bundleClassBuilder = TypeSpec
        .interfaceBuilder(bundleClassName)
        .addModifiers(Modifier.PUBLIC)
        .addSuperinterface(ClientBundle.class);

    bundleClassBuilder.addField(FieldSpec
        .builder(bundleClassName, "INSTANCE", Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL)
        .initializer(CodeBlock.of("$T.create($T.class)", GWT.class, bundleClassName))
        .build());

    String typeElementName = sourceType.getQualifiedName().toString();
    String resourcePath = typeElementName.replaceAll("\\.", "/") + "." + resourceExtension;
    AnnotationSpec annotationSpec = AnnotationSpec
        .builder(Source.class)
        .addMember("value", CodeBlock.of("$S", resourcePath))
        .build();

    bundleClassBuilder.addMethod(MethodSpec
        .methodBuilder(bundleMethodName)
        .addAnnotation(annotationSpec)
        .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT)
        .returns(resourceType)
        .build());

    GenerationUtil.toJavaFile(filer, bundleClassBuilder, bundleClassName, sourceType);
}
 
Example 4
Project: xapi   File: CssMapProxy.java   View source code 5 votes vote down vote up
public CssMapProxy(String cssMapRoot, Class<? extends ClientBundle> resourceType, String methodName, Class<? extends Css> cssType) {
    this.proxy = Lazy.deferred1(this::createProxy);
    this.mapFile = Paths.get(cssMapRoot, resourceType.getCanonicalName() + "." + methodName + ".cssmap");
    this.cssType = cssType;
    onMapFileChanged = Do.NOTHING;
    knownNames= X_Collect.newStringMap(String.class);
    this.handler = new ProxyHandler();
    refreshNames();
    watchFile();

}
 
Example 5
Project: Wiab.pro   File: DynamicRendererImpl.java   View source code 4 votes vote down vote up
@ClientBundle.Source("Render.css")
Css css();
 
Example 6
Project: Wiab.pro   File: ViewToolbarResources.java   View source code 4 votes vote down vote up
@ClientBundle.Source("ViewToolbar.css")
ViewToolbarResources.Css css();
 
Example 7
Project: Wiab.pro   File: Dialog.java   View source code 4 votes vote down vote up
@ClientBundle.Source("Dialog.css")
Css css();
 
Example 8
Project: gwt-material-table   File: MaterialDataPagerClientBundle.java   View source code 4 votes vote down vote up
@ClientBundle.Source("resources/css/data-pager.css")
TextResource dataPagerDebugCss();
 
Example 9
Project: gwt-material-table   File: MaterialDataPagerClientBundle.java   View source code 4 votes vote down vote up
@ClientBundle.Source("resources/css/data-pager.min.css")
TextResource dataPagerCss();
 
Example 10
Project: che   File: CellTreeResources.java   View source code 4 votes vote down vote up
@Override
@ClientBundle.Source({"cellTree.css", "org/eclipse/che/ide/api/ui/style.css"})
CellTreeStyle cellTreeStyle();
 
Example 11
Project: firefly   File: CssData.java   View source code 4 votes vote down vote up
@ClientBundle.Source("firefly-bundle.css")
FireflyCss getFireflyCss();
 
Example 12
Project: mvp4g-examples   File: Resources.java   View source code 4 votes vote down vote up
@ClientBundle.Source("EmployeeAdmin.css")
public EmployeeAdminCssStyles employeeAdmin();
 
Example 13
Project: lumongo   File: MainResources.java   View source code 4 votes vote down vote up
@ClientBundle.Source("main.gss")
MainGSS mainGSS();
 
Example 14
Project: incubator-wave   File: Dialog.java   View source code 4 votes vote down vote up
@ClientBundle.Source("Dialog.css")
Css css();
 
Example 15
Project: xapi   File: ShadowDomStyleInjectorGenerator.java   View source code 4 votes vote down vote up
public Class<? extends ClientBundle> getBundle() {
  return bundle;
}
 
Example 16
Project: xapi   File: DemoStyles.java   View source code 4 votes vote down vote up
@Override
public Class<? extends ClientBundle>[] allBundles() {
    return new Class[]{DemoResources.class};
}
 
Example 17
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("function_assets.gif")
ImageResource functionAssets();
 
Example 18
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("error.gif")
ImageResource error();
 
Example 19
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("config.png")
ImageResource config();
 
Example 20
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("edit.gif")
ImageResource edit();
 
Example 21
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("editDisabled.gif")
ImageResource editDisabled();
 
Example 22
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("add_field_to_fact.gif")
ImageResource addFieldToFact();
 
Example 23
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("add_connective.gif")
ImageResource addConnective();
 
Example 24
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("warning.gif")
ImageResource warning();
 
Example 25
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("new_wiz.gif")
ImageResource newWiz();
 
Example 26
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("field.gif")
ImageResource field();
 
Example 27
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("fact.gif")
ImageResource fact();
 
Example 28
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("BPM_FileIcons_guidedrule.png")
ImageResource typeGuidedRule();
 
Example 29
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("clock.png")
ImageResource clock();
 
Example 30
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("delete_item_small.gif")
ImageResource deleteItemSmall();
 
Example 31
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("emptyArrow.png")
ImageResource arrowSpacerIcon();
 
Example 32
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("icon-unmerge.png")
ImageResource toggleUnmergeIcon();
 
Example 33
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("icon-merge.png")
ImageResource toggleMergeIcon();
 
Example 34
Project: drools-wb   File: GuidedRuleEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("information.gif")
ImageResource information();
 
Example 35
Project: drools-wb   File: GuidedDecisionTableImageResources.java   View source code 4 votes vote down vote up
@ClientBundle.Source("shuffle_down.gif")
ImageResource shuffleDown();
 
Example 36
Project: drools-wb   File: GuidedDecisionTableImageResources.java   View source code 4 votes vote down vote up
@ClientBundle.Source("shuffle_up.gif")
ImageResource shuffleUp();
 
Example 37
Project: drools-wb   File: GuidedTemplateEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("BPM_FileIcons_guidedrule.png")
ImageResource typeGuidedRuleTemplate();
 
Example 38
Project: drools-wb   File: GuidedTemplateEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("emptyArrow.png")
ImageResource arrowSpacerIcon();
 
Example 39
Project: drools-wb   File: GuidedTemplateEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("icon-unmerge.png")
ImageResource toggleUnmergeIcon();
 
Example 40
Project: drools-wb   File: GuidedTemplateEditorImages.java   View source code 4 votes vote down vote up
@ClientBundle.Source("icon-merge.png")
ImageResource toggleMergeIcon();