You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
accounting-dashboard/src/main/java/org/gcube/portlets/user/accountingdashboard/client/application/dialog/monitor/MonitorView.java

58 lines
1.3 KiB
Java

package org.gcube.portlets.user.accountingdashboard.client.application.dialog.monitor;
import javax.inject.Inject;
import org.gcube.portlets.user.accountingdashboard.client.resources.AppResources;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.web.bindery.event.shared.EventBus;
import com.gwtplatform.mvp.client.PopupViewWithUiHandlers;
/**
*
* @author Giancarlo Panichi
*
*/
public class MonitorView extends PopupViewWithUiHandlers<MonitorPresenter>
implements MonitorPresenter.MonitorPresenterView {
interface Binder extends UiBinder<PopupPanel, MonitorView> {
}
@UiField
DialogBox dialogBox;
private AppResources resources;
@Inject
MonitorView(Binder uiBinder, EventBus eventBus, AppResources resources) {
super(eventBus);
this.resources=resources;
init();
initWidget(uiBinder.createAndBindUi(this));
}
private void init() {
dialogBox = new DialogBox(false, true);
dialogBox.addStyleName(resources.uiDataCss().uiDataMonitorPopup());
}
@Override
public void monitor(boolean enable) {
if (enable) {
dialogBox.center();
dialogBox.show();
} else {
dialogBox.hide();
}
}
}