Java Code Examples for com.google.gwt.core.client.GWT.getModuleBaseURL()

The following are Jave code examples for showing how to use getModuleBaseURL() of the com.google.gwt.core.client.GWT class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Mindustry   File: HtmlLauncher.java   View Source Code Vote up 5 votes
@Override
   public PreloaderCallback getPreloaderCallback () {
	final Panel preloaderPanel = new VerticalPanel();
	preloaderPanel.setStyleName("gdx-preloader");
	final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
	logo.setStyleName("logo");		
	preloaderPanel.add(logo);
	final Panel meterPanel = new SimplePanel();
	meterPanel.setStyleName("gdx-meter");
	meterPanel.addStyleName("red");
	final InlineHTML meter = new InlineHTML();
	final Style meterStyle = meter.getElement().getStyle();
	meterStyle.setWidth(0, Unit.PCT);
	meterPanel.add(meter);
	preloaderPanel.add(meterPanel);
	getRootPanel().add(preloaderPanel);
	return new PreloaderCallback() {

		@Override
		public void error (String file) {
			System.out.println("error: " + file);
		}
		
		@Override
		public void update (PreloaderState state) {
			meterStyle.setWidth(100f * state.getProgress(), Unit.PCT);
		}			
		
	};
}
 
Example 2
Project: empiria.player   File: FlashLocalMediaImpl.java   View Source Code Vote up 5 votes
@Override
public void onLoad() {
    String swfSrc = getSwfSrc();
    String installSrc = GWT.getModuleBaseURL() + "swfobject/expressInstall.swf";
    String srcNormalized = PathUtil.normalizePath(src);
    loadFlvPlayerThroughSwfobject(elementId, swfSrc, installSrc, srcNormalized, getWidth(), getHeight());
}
 
Example 3
Project: empiria.player   File: SoundExecutorSwfSimple.java   View Source Code Vote up 5 votes
private void playFromSource(String src) {
    panelMain.clear();
    FlowPanel panelEmbed = new FlowPanel();
    String htmlId = Document.get().createUniqueId();
    panelEmbed.getElement().setId(htmlId);
    panelMain.add(panelEmbed);
    String installSrc = GWT.getModuleBaseURL() + "swfobject/expressInstall.swf";
    String swfSrc = GWT.getModuleBaseURL() + "flashAudioExecutorSimple/flashAudioExecutorSimple.swf";
    embedSwf(htmlId, swfSrc, installSrc, src);
}
 
Example 4
Project: odb-artax   File: HtmlLauncher.java   View Source Code Vote up 5 votes
@Override
public Preloader.PreloaderCallback getPreloaderCallback() {
    final VerticalPanel preloaderPanel = new VerticalPanel();
    preloaderPanel.setStyleName("gdx-preloader");
    preloaderPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    final Image logo = new Image(GWT.getModuleBaseURL() + "logo.gif");
    logo.setStyleName("logo");
    preloaderPanel.add(logo);
    final Panel meterPanel = new SimplePanel();
    meterPanel.setStyleName("gdx-meter");
    meterPanel.addStyleName("red");
    final InlineHTML meter = new InlineHTML();
    final Style meterStyle = meter.getElement().getStyle();
    meterStyle.setWidth(0, Style.Unit.PCT);
    meterPanel.add(meter);
    preloaderPanel.add(meterPanel);
    getRootPanel().add(preloaderPanel);
    return new Preloader.PreloaderCallback() {
        @Override
        public void error(String file) {
            System.out.println("error: " + file);
        }

        @Override
        public void update(Preloader.PreloaderState state) {
            meterStyle.setWidth(100f * state.getProgress(), Style.Unit.PCT);
        }

    };
}
 
Example 5
Project: appinventor-extensions   File: ProfilePage.java   View Source Code Vote up 5 votes
/**
 * Main method to validify and upload the app image
 */
private void uploadImage() {
  String uploadFilename = imageUpload.getFilename();
  if (!uploadFilename.isEmpty()) {
    String filename = makeValidFilename(uploadFilename);
    // Forge the request URL for gallery servlet
    String uploadUrl = GWT.getModuleBaseURL() + ServerLayout.GALLERY_SERVLET +
        "/user/" + userId + "/" + filename;
    Uploader.getInstance().upload(imageUpload, uploadUrl,
        new OdeAsyncCallback<UploadResponse>(MESSAGES.fileUploadError()) {
      @Override
      public void onSuccess(UploadResponse uploadResponse) {
        switch (uploadResponse.getStatus()) {
          case SUCCESS:
            ErrorReporter.hide();
            imageUploadBoxInner.clear();
            updateUserImage(gallery.getUserImageURL(userId), imageUploadBoxInner);
            break;
          case FILE_TOO_LARGE:
            // The user can resolve the problem by uploading a smaller file.
            ErrorReporter.reportInfo(MESSAGES.fileTooLargeError());
            break;
          default:
            ErrorReporter.reportError(MESSAGES.fileUploadError());
            break;
        }
      }
    });
  }
}
 
Example 6
Project: odb-little-fortune-planet   File: HtmlLauncher.java   View Source Code Vote up 5 votes
@Override
public Preloader.PreloaderCallback getPreloaderCallback() {
    final VerticalPanel preloaderPanel = new VerticalPanel();
    preloaderPanel.setStyleName("gdx-preloader");
    preloaderPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    final Image logo = new Image(GWT.getModuleBaseURL() + "logo.gif");
    logo.setStyleName("logo");
    preloaderPanel.add(logo);
    final Panel meterPanel = new SimplePanel();
    meterPanel.setStyleName("gdx-meter");
    meterPanel.addStyleName("red");
    final InlineHTML meter = new InlineHTML();
    final Style meterStyle = meter.getElement().getStyle();
    meterStyle.setWidth(0, Style.Unit.PCT);
    meterPanel.add(meter);
    preloaderPanel.add(meterPanel);
    getRootPanel().add(preloaderPanel);
    return new Preloader.PreloaderCallback() {
        @Override
        public void error(String file) {
            System.out.println("error: " + file);
        }

        @Override
        public void update(Preloader.PreloaderState state) {
            meterStyle.setWidth(100f * state.getProgress(), Style.Unit.PCT);
        }

    };
}
 
Example 7
Project: empiria.player   File: FlashLocalAudioImpl.java   View Source Code Vote up 4 votes
@Override
protected String getSwfSrc() {
    return GWT.getModuleBaseURL() + "wpaudioplayer/wpaudioplayer.swf";
}
 
Example 8
Project: empiria.player   File: FlashLocalVideoImpl.java   View Source Code Vote up 4 votes
@Override
protected String getSwfSrc() {
    return GWT.getModuleBaseURL() + "flvplayer/flvplayer.swf";
}
 
Example 9
Project: appinventor-extensions   File: StorageUtil.java   View Source Code Vote up 4 votes
/**
 * Returns the URL for the given project file.
 */
public static String getFileUrl(long projectId, String fileId) {
  return GWT.getModuleBaseURL() + getFilePath(projectId, fileId);
}
 
Example 10
Project: appinventor-extensions   File: GalleryPage.java   View Source Code Vote up 4 votes
/**
 * Main method to validify and upload the app image
 */
private void uploadImage() {
  String uploadFilename = upload.getFilename();
  if (!uploadFilename.isEmpty()) {
    // Grab and validify the filename
    final String filename = makeValidFilename(uploadFilename);
    // Forge the request URL for gallery servlet
    // we used to send the gallery id to the servlet, now the project id as
    // the servlet just stores image temporarily before publish
    /* String uploadUrl = GWT.getModuleBaseURL() + ServerLayout.GALLERY_SERVLET +
        "/apps/" + String.valueOf(app.getGalleryAppId()) + "/"+ filename; */
    // send the project id as the id, to store image temporarily until published
    String uploadUrl = GWT.getModuleBaseURL() + ServerLayout.GALLERY_SERVLET +
        "/apps/" + String.valueOf(app.getProjectId()) + "/"+ filename;
    Uploader.getInstance().upload(upload, uploadUrl,
        new OdeAsyncCallback<UploadResponse>(MESSAGES.fileUploadError()) {
        @Override
        public void onSuccess(UploadResponse uploadResponse) {
          switch (uploadResponse.getStatus()) {
          case SUCCESS:
            // Update the app image preview after a success upload
            imageUploadBoxInner.clear();
            // updateAppImage(app.getCloudImageURL(), imageUploadBoxInner);
            updateAppImage(gallery.getProjectImageURL(app.getProjectId()),imageUploadBoxInner);
            imageUploaded=true;
            ErrorReporter.hide();
            break;
          case FILE_TOO_LARGE:
            // The user can resolve the problem by uploading a smaller file.
            ErrorReporter.reportInfo(MESSAGES.fileTooLargeError());
            break;
          default:
            ErrorReporter.reportError(MESSAGES.fileUploadError());
            break;
          }
        }
     });
  } else {
    if (editStatus == NEWAPP) {
      Window.alert(MESSAGES.noFileSelected());
    }
  }
}