GWT Java - "getWidget ()" is deprecated - what replaces it?

I upload images using the code (see below) that I found through stackoverflow. However, now I notice that "getWidget ()" is deprecated. Instead of waiting until it is no longer available, I would like to fix it now. What should I use instead of "getWidget ()", please?

// Add a finish handler which will load the image once the upload finishes
            existingdefaultUploader.addOnFinishUploadHandler(onReplaceFinishUploaderHandler);
            existingdefaultUploader.getFileInput().getWidget().setStyleName("customButton");
            existingdefaultUploader.getFileInput().getWidget().setSize("100px", "20px");

Hello,

Clay

+4
source share
1 answer

You can use instead .asWidget().

, .
. , , :

@Deprecated
public Widget getWidget() {
  return asWidget();
}

EDIT: , Javadoc , .

+5

Source: https://habr.com/ru/post/1607370/


All Articles