removed unsued eventbus

This commit is contained in:
Francesco Mangiacrapa 2020-10-09 16:34:04 +02:00
parent ed0097dada
commit 7e4d183c6b
1 changed files with 28 additions and 19 deletions

View File

@ -195,7 +195,7 @@ public class CreateMetadataForm extends Composite implements HasGenericFormListe
/** The event bus. */
// event bus
private HandlerManager eventBus;
private HandlerManager eventBus = new HandlerManager(null);
/** The custom field entries list. */
// added custom field entries (by the user)
@ -240,8 +240,8 @@ public class CreateMetadataForm extends Composite implements HasGenericFormListe
* @param genericResourceSecondaryType the generic resource secondary type
* @param eventBus the event bus
*/
public CreateMetadataForm(String scope, String genericResourceSecondaryType, HandlerManager eventBus) {
this(eventBus);
public CreateMetadataForm(String scope, String genericResourceSecondaryType) {
this();
this.scope = scope;
this.genericResourceSecondaryType = genericResourceSecondaryType;
showLoadingProfiles(true);
@ -268,8 +268,8 @@ public class CreateMetadataForm extends Composite implements HasGenericFormListe
* @param profiles the profiles
* @param eventBus the event bus
*/
public CreateMetadataForm(List<MetaDataProfileBean> profiles, HandlerManager eventBus) {
this(eventBus);
public CreateMetadataForm(List<MetaDataProfileBean> profiles) {
this();
showLoadingProfiles(true);
createDatasetFormBody(profiles);
showLoadingProfiles(false);
@ -291,9 +291,8 @@ public class CreateMetadataForm extends Composite implements HasGenericFormListe
*
* @param eventBus the event bus
*/
private CreateMetadataForm(HandlerManager eventBus) {
private CreateMetadataForm() {
initWidget(uiBinder.createAndBindUi(this));
this.eventBus = eventBus;
bind();
prepareInfoIcons();
showSelectedProfiles(false);
@ -413,18 +412,18 @@ public class CreateMetadataForm extends Composite implements HasGenericFormListe
//receivedBean.setChosenType(null);
}
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
if(profiles.size()==1) {
showChooseProfileForm(false);
metadataTypeListbox.setSelectedValue(profiles.get(0).getType());
customLegend.setText("Insert Information for: "+profiles.get(0).getType(), true);
DomEvent.fireNativeEvent(Document.get().createChangeEvent(), metadataTypeListbox);
}
}
});
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
if (profiles.size() == 1) {
showChooseProfileForm(false);
metadataTypeListbox.setSelectedValue(profiles.get(0).getType());
customLegend.setText("Insert Information for: " + profiles.get(0).getType(), true);
DomEvent.fireNativeEvent(Document.get().createChangeEvent(), metadataTypeListbox);
}
}
});
}
@ -864,5 +863,15 @@ public class CreateMetadataForm extends Composite implements HasGenericFormListe
public Button getCreateButton() {
return createButton;
}
/**
* Gets the metadata profiles.
*
* @return the metadata profiles
*/
public List<MetaDataProfileBean> getMetadataProfiles() {
return metadataProfiles;
}
}