1 /* 2 * EnableRStudioConnectUIEvent.java 3 * 4 * Copyright (C) 2021 by RStudio, PBC 5 * 6 * Unless you have received this program directly from RStudio pursuant 7 * to the terms of a commercial license agreement with RStudio, then 8 * this program is licensed to you under the terms of version 3 of the 9 * GNU Affero General Public License. This program is distributed WITHOUT 10 * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT, 11 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the 12 * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details. 13 * 14 */ 15 package org.rstudio.studio.client.rsconnect.events; 16 17 import com.google.gwt.core.client.JavaScriptObject; 18 import com.google.gwt.event.shared.EventHandler; 19 import com.google.gwt.event.shared.GwtEvent; 20 21 public class EnableRStudioConnectUIEvent 22 extends GwtEvent<EnableRStudioConnectUIEvent.Handler> 23 { 24 public static class Data extends JavaScriptObject 25 { Data()26 protected Data() 27 { 28 } 29 getEnable()30 public final native boolean getEnable() /*-{ 31 return this; 32 }-*/; 33 } 34 35 public interface Handler extends EventHandler 36 { onEnableRStudioConnectUI(EnableRStudioConnectUIEvent event)37 void onEnableRStudioConnectUI(EnableRStudioConnectUIEvent event); 38 } 39 40 public static final GwtEvent.Type<EnableRStudioConnectUIEvent.Handler> TYPE = new GwtEvent.Type<>(); 41 EnableRStudioConnectUIEvent(Data enable)42 public EnableRStudioConnectUIEvent(Data enable) 43 { 44 enable_ = enable.getEnable(); 45 } 46 getEnable()47 public boolean getEnable() 48 { 49 return enable_; 50 } 51 52 @Override dispatch(EnableRStudioConnectUIEvent.Handler handler)53 protected void dispatch(EnableRStudioConnectUIEvent.Handler handler) 54 { 55 handler.onEnableRStudioConnectUI(this); 56 } 57 58 @Override getAssociatedType()59 public GwtEvent.Type<EnableRStudioConnectUIEvent.Handler> getAssociatedType() 60 { 61 return TYPE; 62 } 63 64 private boolean enable_; 65 } 66