@Override public String getView() { if (view == null) { return super.getView(); } return view; }
/** * @return Name of view to show */ public String getView() { return delegate == null ? GadgetSpec.DEFAULT_VIEW : delegate.getView(); }
/** * @return Name of view to show */ public String getView() { return delegate == null ? GadgetSpec.DEFAULT_VIEW : delegate.getView(); }
@Override public String getView() { if (view == null) { return super.getView(); } return view; }
/** * @return Name of view to show */ public String getView() { return delegate == null ? GadgetSpec.DEFAULT_VIEW : delegate.getView(); }
@Override public String getView() { return view == null ? super.getView() : view; }
@Override public String getView() { if (view == null) { return super.getView(); } return view; }
@Override public String getView() { return view == null ? super.getView() : view; }
@Override public String getView() { return view == null ? super.getView() : view; }
private void initializeFeatureDeps() { if (directFeatureDeps == null) { directFeatureDeps = Sets.newHashSet(); // If we have context, lets generate the correct set of views. if (context != null) { directFeatureDeps.addAll(spec.getModulePrefs() .getViewFeatures(context.getView()).keySet()); } else { directFeatureDeps.addAll(spec.getModulePrefs().getFeatures().keySet()); } } }
public Collection<Callable<PreloadedData>> createPreloadTasks(Gadget gadget) { List<Callable<PreloadedData>> preloads = Lists.newArrayList(); GadgetContext context = gadget.getContext(); for (Preload preload : gadget.getSpec().getModulePrefs().getPreloads()) { Set<String> preloadViews = preload.getViews(); if (preloadViews.isEmpty() || preloadViews.contains(context.getView())) { preloads.add(new PreloadTask(context, preload, preload.getHref().toString())); } } return preloads; }
public Collection<Callable<PreloadedData>> createPreloadTasks(Gadget gadget) { List<Callable<PreloadedData>> preloads = Lists.newArrayList(); GadgetContext context = gadget.getContext(); for (Preload preload : gadget.getSpec().getModulePrefs().getPreloads()) { Set<String> preloadViews = preload.getViews(); if (preloadViews.isEmpty() || preloadViews.contains(context.getView())) { preloads.add(new PreloadTask(context, preload, preload.getHref().toString())); } } return preloads; }
public Collection<Callable<PreloadedData>> createPreloadTasks(Gadget gadget) { List<Callable<PreloadedData>> preloads = Lists.newArrayList(); GadgetContext context = gadget.getContext(); for (Preload preload : gadget.getSpec().getModulePrefs().getPreloads()) { Set<String> preloadViews = preload.getViews(); if (preloadViews.isEmpty() || preloadViews.contains(context.getView())) { preloads.add(new PreloadTask(context, preload, preload.getHref().toString())); } } return preloads; }
public void addSubstitutions(Substitutions substituter, GadgetContext context, GadgetSpec spec) throws GadgetException { MessageBundle bundle = messageBundleFactory.getBundle(spec, context.getLocale(), context.getIgnoreCache(), context.getContainer(), context.getView()); substituter.addSubstitutions(Substitutions.Type.MESSAGE, bundle.getMessages()); } }
public void addSubstitutions(Substitutions substituter, GadgetContext context, GadgetSpec spec) throws GadgetException { MessageBundle bundle = messageBundleFactory.getBundle(spec, context.getLocale(), context.getIgnoreCache(), context.getContainer(), context.getView()); String dir = bundle.getLanguageDirection(); boolean rtl = RTL.equals(dir); substituter.addSubstitution(Substitutions.Type.BIDI, START_EDGE, rtl ? RIGHT : LEFT); substituter.addSubstitution(Substitutions.Type.BIDI, END_EDGE, rtl ? LEFT : RIGHT); substituter.addSubstitution(Substitutions.Type.BIDI, DIR, rtl ? RTL : LTR); substituter.addSubstitution(Substitutions.Type.BIDI, REVERSE_DIR, rtl ? LTR : RTL); } }
@Override public Gadget process(GadgetContext context) throws ProcessingException { if (exception != null) { throw exception; } try { GadgetSpec spec = new GadgetSpec(SPEC_URL, gadgetData); View view = spec.getView(context.getView()); return new Gadget() .setContext(context) .setSpec(spec) .setCurrentView(view); } catch (GadgetException e) { throw new RuntimeException(e); } } }
@Override public Gadget process(GadgetContext context) throws ProcessingException { if (exception != null) { throw exception; } try { GadgetSpec spec = new GadgetSpec(SPEC_URL, GADGET); View view = spec.getView(context.getView()); return new Gadget() .setContext(context) .setSpec(spec) .setCurrentView(view); } catch (GadgetException e) { throw new RuntimeException(e); } } }
@Override public Gadget process(GadgetContext context) throws ProcessingException { ProcessingException exception = exceptions.get(context.getUrl()); if (exception != null) { throw exception; } try { GadgetSpec spec = new GadgetSpec(Uri.parse("#"), gadgets.get(context.getUrl())); View view = spec.getView(context.getView()); return new Gadget() .setContext(context) .setSpec(spec) .setCurrentView(view); } catch (GadgetException e) { throw new RuntimeException(e); } } }
@Override public Gadget process(GadgetContext context) throws ProcessingException { if (exception != null) { throw exception; } try { GadgetSpec spec = new GadgetSpec(SPEC_URL, gadgetData); View view = spec.getView(context.getView()); return new Gadget() .setContext(context) .setSpec(spec) .setCurrentView(view); } catch (GadgetException e) { throw new RuntimeException(e); } } }
@Override public Gadget process(GadgetContext context) throws ProcessingException { ProcessingException exception = exceptions.get(context.getUrl()); if (exception != null) { throw exception; } try { GadgetSpec spec = new GadgetSpec(context.getUrl(), gadgets.get(context.getUrl())); View view = spec.getView(context.getView()); return new Gadget() .setContext(context) .setSpec(spec) .setCurrentView(view) .setGadgetFeatureRegistry(featureRegistry); } catch (GadgetException e) { throw new RuntimeException(e); } } }