コード例 #1
0
 private Component createChameleonTab() {
   Embedded embedded = new Embedded();
   embedded.setSource(new ExternalResource("/splitbutton/chameleon?restartApplication"));
   embedded.setType(Embedded.TYPE_BROWSER);
   embedded.setSizeFull();
   return embedded;
 }
コード例 #2
0
  public void onViewDocument(FileEntry fileEntry) {
    this.fileEntry = fileEntry;
    try {
      String fileEntryId = Long.toString(DocViewerPresenter.this.fileEntry.getFileEntryId());
      String version = fileEntry.getVersion();

      MainMVPApplication mvpApp = (MainMVPApplication) super.getApplication();
      IRemoteDocumentRepository docLibRepository =
          mvpApp.getDaoProvider().provideByDAOClass(IRemoteDocumentRepository.class);

      String docUrl = docLibRepository.getFileAsURL(fileEntryId, version);
      ExternalResource eress = new ExternalResource(docUrl, fileEntry.getMimeType());

      Embedded pdf = new Embedded(null, eress);

      // pdf.setType(Embedded.TYPE_BROWSER);
      pdf.setType(Embedded.TYPE_BROWSER);
      String mt = fileEntry.getMimeType();
      pdf.setMimeType(mt);
      pdf.setSizeFull();
      pdf.setHeight("800px");
      getView().getMainLayout().addComponent(pdf);
    } catch (Exception e) {
      throw new RuntimeException(e);
    } finally {

    }
  }