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


Java Registries类代码示例

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


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

示例1: installDoodads

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
private DocumentRegistries.Builder installDoodads(DocumentRegistries.Builder doodads) {
  return doodads.use(new DoodadInstallers.GlobalInstaller() {

    @Override
    public void install(Registries r) {
      DiffAnnotationHandler.register(r.getAnnotationHandlerRegistry(), r.getPaintRegistry());
      DiffDeleteRenderer.register(r.getElementHandlerRegistry());
      StyleAnnotationHandler.register(r);
      LinkAnnotationHandler.register(r, createLinkAttributeAugmenter());
      SelectionAnnotationHandler.register(r, sessionId, profileManager);
      ImageThumbnail.register(r.getElementHandlerRegistry(), AttachmentManagerImpl.getInstance(),
          new ImageThumbnail.ThumbnailActionHandler() {

        @Override
        public boolean onClick(ImageThumbnailWrapper thumbnail) {
          return false;
        }
      });
    }
  });
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:22,代码来源:StageOneProvider.java

示例2: register

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
/**
 * Create and register a link annotation handler
 *
 * @param registries set of editor registries
 * @param augmenter paint function with wave link handling logic
 */
@SuppressWarnings("deprecation")
public static void register(Registries registries,
    LinkAnnotationHandler.LinkAttributeAugmenter augmenter) {
  PainterRegistry painterRegistry = registries.getPaintRegistry();
  LinkAnnotationHandler handler =
      new LinkAnnotationHandler(painterRegistry.getPainter());

  AnnotationRegistry annotationRegistry = registries.getAnnotationHandlerRegistry();
  annotationRegistry.registerHandler(AnnotationConstants.LINK_PREFIX, handler);
  // Don't register behaviour on the link/auto key, since an external agent
  // puts it there resulting in surprising behaviour mid-typing (e.g. if
  // the text is bold, the bold will suddenly get ended because of the link)
  registerBehaviour(annotationRegistry, AnnotationConstants.LINK_PREFIX);
  registerBehaviour(annotationRegistry, AnnotationConstants.LINK_MANUAL);
  registerBehaviour(annotationRegistry, AnnotationConstants.LINK_WAVE);

  painterRegistry.registerPaintFunction(KEYS, new LinkAnnotationHandler.RenderFunc(augmenter));
  painterRegistry.registerBoundaryFunction(BOUNDARY_KEYS, boundaryFunc);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:26,代码来源:LinkAnnotationHandler.java

示例3: createTestDocument

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
/** For testing purposes only. */
public static ContentDocument createTestDocument() {
  ContentDocument doc = new ContentDocument(DocumentSchema.NO_SCHEMA_CONSTRAINTS);
  Registries registries = Editor.ROOT_REGISTRIES.createExtension();
  for (String t : new String[] {"q", "a", "b", "c", "x"}) {
    final String tag = t;
    registries.getElementHandlerRegistry().registerRenderer(tag,
        new Renderer() {
          @Override
          public Element createDomImpl(Renderable element) {
            return element.setAutoAppendContainer(Document.get().createElement(tag));
          }
        });
  }
  doc.setRegistries(registries);
  Editor editor = getMinimalEditor();
  editor.setContent(doc);
  return doc;
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:20,代码来源:TestEditors.java

示例4: register

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
/**
 * Create and register a link annotation handler
 *
 * @param registries set of editor registries
 * @param augmenter paint function with wave link handling logic
 */
@SuppressWarnings("deprecation")
public static void register(Registries registries,
    LinkAttributeAugmenter augmenter) {
  PainterRegistry painterRegistry = registries.getPaintRegistry();
  LinkAnnotationHandler handler =
      new LinkAnnotationHandler(painterRegistry.getPainter());

  AnnotationRegistry annotationRegistry = registries.getAnnotationHandlerRegistry();
  annotationRegistry.registerHandler(AnnotationConstants.LINK_PREFIX, handler);
  // Don't register behaviour on the link/auto key, since an external agent
  // puts it there resulting in surprising behaviour mid-typing (e.g. if
  // the text is bold, the bold will suddenly get ended because of the link)
  registerBehaviour(annotationRegistry, AnnotationConstants.LINK_PREFIX);
  registerBehaviour(annotationRegistry, AnnotationConstants.LINK_MANUAL);
  registerBehaviour(annotationRegistry, AnnotationConstants.LINK_WAVE);

  painterRegistry.registerPaintFunction(KEYS, new RenderFunc(augmenter));
  painterRegistry.registerBoundaryFunction(BOUNDARY_KEYS, boundaryFunc);
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:26,代码来源:LinkAnnotationHandler.java

示例5: createDocumentRegistry

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
/** @return the registry of documents in the wave. Subclasses may override. */
protected WaveDocuments<LazyContentDocument> createDocumentRegistry() {
  IndexedDocumentImpl.performValidation = false;

  DocumentFactory<?> dataDocFactory =
      ObservablePluggableMutableDocument.createFactory(createSchemas());
  DocumentFactory<LazyContentDocument> blipDocFactory =
      new DocumentFactory<LazyContentDocument>() {
        private final Registries registries = RegistriesHolder.get();

        @Override
        public LazyContentDocument create(
            WaveletId waveletId, String docId, DocInitialization content) {
          // TODO(piotrkaleta,hearnden): hook up real diff state.
          SimpleDiffDoc noDiff = SimpleDiffDoc.create(content, null);
          return LazyContentDocument.create(registries, noDiff);
        }
      };

  return WaveDocuments.create(blipDocFactory, dataDocFactory);
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:22,代码来源:StageTwo.java

示例6: installDoodads

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
protected DocumentRegistries.Builder installDoodads(DocumentRegistries.Builder doodads) {
  return doodads.use(new DoodadInstallers.GlobalInstaller() {
    @Override
    public void install(Registries r) {
      DiffAnnotationHandler.register(r.getAnnotationHandlerRegistry(), r.getPaintRegistry());
      DiffDeleteRenderer.register(r.getElementHandlerRegistry());
      StyleAnnotationHandler.register(r);
      TitleAnnotationHandler.register(r);
      LinkAnnotationHandler.register(r, createLinkAttributeAugmenter());
      SelectionAnnotationHandler.register(r, getSessionId(), getProfileManager());
      ImageThumbnail.register(r.getElementHandlerRegistry(), AttachmentManagerProvider.get(),
          new ImageThumbnail.ThumbnailActionHandler() {

            @Override
            public boolean onClick(ImageThumbnailWrapper thumbnail) {
              return false;
            }
          });
    }
  });
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:22,代码来源:StageTwo.java

示例7: pageIn

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void pageIn(ConversationBlip blip) {
  BlipViewImpl<BlipViewDomImpl> blipUi =
      (BlipViewImpl<BlipViewDomImpl>) viewProvider.getBlipView(blip);
  if (blipUi != null) {
    BlipViewDomImpl blipDom = blipUi.getIntrinsic();
    BlipMetaDomImpl metaDom =
        ((BlipMetaViewImpl<BlipMetaDomImpl>) blipUi.getMeta()).getIntrinsic();
    InteractiveDocument doc = docProvider.docOf(blip);
    Registries r = registries.get(blip);

    // Very first thing that must be done is to extract and save the DOM of
    // inline threads, since content-document rendering will blast them away.
    saveInlineReplies(metaDom);

    // Clear content before rendering, so that doodad events caused by rendering
    // apply on a fresh state.
    metaDom.clearContent();
    doc.startRendering(r, logicalPanel);
    metaDom.setContent(
        doc.getDocument().getFullContentView().getDocumentElement().getImplNodelet());
    blipPopulator.render(blip, metaDom);
  }
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:26,代码来源:BlipPager.java

示例8: loadWith

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
/**
 * Loads the real document implementation with a particular set of registries.
 */
// Type conversion with flattened generics in setDelegate();
@SuppressWarnings("unchecked")
private void loadWith(Registries registries) {
  assert !isLoaded() : "already loaded";
  ContentDocument core = new ContentDocument(DocumentSchema.NO_SCHEMA_CONSTRAINTS);
  document = DiffContentDocument.create(core);
  if (outputSink != null) {
    core.setOutgoingSink(outputSink);
  }
  core.setRegistries(registries);
  setDelegate((MutableDocument) core.getMutableDoc());
  if (spec != null) {
    spec.applyTo(document);
    spec = null;
  }
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:20,代码来源:LazyContentDocument.java

示例9: startRendering

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
@Override
public void startRendering(Registries registries, LogicalPanel logicalPanel) {
  ContentDocument document;
  if (!isLoaded()) {
    loadWith(registries);
    document = this.document.getDocument();
  } else {
    document = this.document.getDocument();
    document.setRegistries(registries);
  }
  document.setInteractive(logicalPanel);
  // ContentDocument does not render synchronously, so we have to force it
  // to finish, rather than reveal half-rendered content at the end of the
  // event cycle.
  AnnotationPainter.flush(document.getContext());
}
 
开发者ID:apache,项目名称:incubator-wave,代码行数:17,代码来源:LazyContentDocument.java

示例10: register

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
/**
 * Creates and registers a title annotation handler
 *
 * @param registries registry to register on
 * @return the new handler
 */
public static void register(Registries registries) {
  PainterRegistry painterRegistry = registries.getPaintRegistry();
  TitleAnnotationHandler handler = new TitleAnnotationHandler(painterRegistry.getPainter());
  registries.getAnnotationHandlerRegistry().registerHandler(PREFIX, handler);
  registries.getAnnotationHandlerRegistry().registerBehaviour(PREFIX,
      new DefaultAnnotationBehaviour(AnnotationFamily.CONTENT));
  painterRegistry.registerPaintFunction(KEYS, renderFunc);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:15,代码来源:TitleAnnotationHandler.java

示例11: installer

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
public static GlobalInstaller installer() {
  return new GlobalInstaller() {
    @Override
    public void install(Registries r) {
      ElementHandlerRegistry handlers = r.getElementHandlerRegistry();
      RenderingMutationHandler multiHandler = TemplateNodeMutationHandler.create();

      LineRendering.registerContainer(PART_TAG, handlers);
      handlers.registerRenderingMutationHandler(TEMPLATE_TAG, multiHandler);
      handlers.registerMutationHandler(NAMEVALUEPAIR_TAG, new NameValuePairNodeMutationHandler());
      handlers.registerEventHandler(TEMPLATE_TAG, ChunkyElementHandler.INSTANCE);
      handlers.registerEventHandler(PART_TAG, LineRendering.DEFAULT_PARAGRAPH_EVENT_HANDLER);
    }
  };
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:16,代码来源:HtmlTemplate.java

示例12: register

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
/**
 * Installs this doodad.
 */
public static void register(
    Registries registries, String sessionId, ProfileManager profiles) {
  CaretMarkerRenderer carets = CaretMarkerRenderer.getInstance();
  registries.getElementHandlerRegistry().registerRenderer(
      CaretMarkerRenderer.FULL_TAGNAME, carets);
  register(registries, SchedulerInstance.getLowPriorityTimer(), carets, sessionId, profiles);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:11,代码来源:SelectionAnnotationHandler.java

示例13: install

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
public static BlipInstaller install(final ProfileManager profileManager,
    final ObservableSupplementedWave supplement, final ParticipantId signedInUser) {
  return new DoodadInstallers.BlipInstaller() {
    
    @Override
    public void install(Wavelet w, Conversation c, ConversationBlip b, Registries r) {
      WaveletName name = WaveletName.of(w.getWaveId(), w.getId());
      register(r.getElementHandlerRegistry(), name, b, supplement, profileManager,
          signedInUser.getAddress());
    }
  };
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:13,代码来源:Gadget.java

示例14: register

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
/**
 * Create and register a style annotation handler
 *
 * @param registries registry to register on
 * @return the new handler
 */
public static void register(Registries registries) {
  PainterRegistry painterRegistry = registries.getPaintRegistry();
  StyleAnnotationHandler handler = new StyleAnnotationHandler(painterRegistry.getPainter());
  registries.getAnnotationHandlerRegistry().registerHandler(AnnotationConstants.STYLE_PREFIX, handler);
  registries.getAnnotationHandlerRegistry().registerBehaviour(AnnotationConstants.STYLE_PREFIX,
      new DefaultAnnotationBehaviour(AnnotationFamily.CONTENT));
  painterRegistry.registerPaintFunction(AnnotationConstants.STYLE_KEYS, renderFunc);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:15,代码来源:StyleAnnotationHandler.java

示例15: init

import org.waveprotocol.wave.client.editor.content.Registries; //导入依赖的package包/类
@Override
public void init(Registries registries, KeyBindingRegistry bindings, EditorSettings settings) {
  Preconditions.checkState(
      ownsDocument == (registries != null), "Can only set registries on owned documents");
  this.registries = registries;
  this.keyBindings = bindings;
  this.settings = settings;

  eventHandler = new EditorEventHandler(
      new EditorInteractorImpl(), eventsSubHandler, NodeEventRouter.INSTANCE,
      settings.useWhitelistInEditor(), settings.useWebkitCompositionEvents());

  setEditing(false);
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:15,代码来源:EditorImpl.java


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