private static void upgradeWarnDialog(String aMessage) { final DialogBox dialogBox = new DialogBox(false, true); dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setText(MESSAGES.warningDialogTitle()); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); final HTML message = new HTML(aMessage); message.setStyleName("DialogBox-message"); VerticalPanel vPanel = new VerticalPanel(); Button okButton = new Button("OK"); okButton.addClickListener(new ClickListener() { @Override public void onClick(Widget sender) { dialogBox.hide(); } }); vPanel.add(message); vPanel.add(okButton); dialogBox.setWidget(vPanel); dialogBox.center(); dialogBox.show(); }
/** * The "Final" Dialog box. When a user chooses to end their session * due to a conflicting login, we should show this dialog which is modal * and has no exit! My preference would have been to close the window * altogether, but the browsers won't let javascript code close windows * that it didn't open itself (like the main window). I also tried to * use document.write() to write replacement HTML but that caused errors * in Firefox and strange behavior in Chrome. So we do this... * * We are called from invalidSessionDialog() (above). */ private void finalDialog() { // Create the UI elements of the DialogBox final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal) dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setText(MESSAGES.finalDialogText()); dialogBox.setHeight("100px"); dialogBox.setWidth("400px"); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); dialogBox.center(); VerticalPanel DialogBoxContents = new VerticalPanel(); HTML message = new HTML(MESSAGES.finalDialogMessage()); message.setStyleName("DialogBox-message"); DialogBoxContents.add(message); dialogBox.setWidget(DialogBoxContents); dialogBox.show(); }
/** * corruptionDialog -- Put up a dialog box explaining that we detected corruption * while reading in a project file. There is no continuing once this happens. * */ void corruptionDialog() { // Create the UI elements of the DialogBox final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal) dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setText(MESSAGES.corruptionDialogText()); dialogBox.setHeight("100px"); dialogBox.setWidth("400px"); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); dialogBox.center(); VerticalPanel DialogBoxContents = new VerticalPanel(); HTML message = new HTML(MESSAGES.corruptionDialogMessage()); message.setStyleName("DialogBox-message"); DialogBoxContents.add(message); dialogBox.setWidget(DialogBoxContents); dialogBox.show(); }
/** * This dialog is showned if an account is disabled. It is * completely modal with no escape. The provided URL is displayed in * an iframe, so it can be tailored to each person whose account is * disabled. * * @param Url the Url to display in the dialog box. */ public void disabledAccountDialog(String Url) { // Create the UI elements of the DialogBox final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal) dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setText(MESSAGES.accountDisabledMessage()); dialogBox.setHeight("700px"); dialogBox.setWidth("700px"); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); dialogBox.center(); VerticalPanel DialogBoxContents = new VerticalPanel(); HTML message = new HTML("<iframe src=\"" + Url + "\" style=\"border: 0; width: 680px; height: 660px;\"></iframe>"); message.setStyleName("DialogBox-message"); DialogBoxContents.add(message); dialogBox.setWidget(DialogBoxContents); dialogBox.show(); }
/** * The constructor * @param forumMessage the forum message we will manage filed for * @param parentDialog the parent dialog */ public ForumFilesManagerUI( final ShortForumMessageData forumMessage, final DialogBox parentDialog ) { super( false, true, true, NUMBER_OF_FILES_PER_PAGE, NUMBER_OF_COLUMNS, SiteManager.getUserID(), parentDialog ); //Store the message data this.forumMessage = forumMessage; //Enable the action buttons and hot key, even though we will not be adding these buttons //to the grid, we will use the hot keys associated with them to close this dialog setLeftEnabled( true ); setRightEnabled( true ); //Set the dialog's caption. updateDialogTitle(); //Disable the actual dialog buttons for now disableAllControls(); //Fill dialog with data populateDialog(); }
/** * @param messageID the ID of the message that we want to move * @param parentDialog the id of the parent dialog or null if none */ public MoveMessageDialogUI(final int messageID, DialogBox parentDialog) { super( false, false, true, parentDialog ); //Store the message ID this.messageID = messageID; //Set the dialog's caption. this.setText( titlesI18N.moveForumMessageDialogTitle( messageID ) ); //Enable the action buttons and hot key setLeftEnabled( true ); setRightEnabled( true ); //Fill dialog with data populateDialog(); }
/** * The user search constructor. Allows to provide the type of * user selection: single or multiple users. The latter is needed * if we select users when adding them to rooms, or writing messages. * @param numberOfRows the number of result rows in the user rearch, per page. * @param parentDialog the parent dialog, from which we open this one. * @param isSelectSingle true if we allow for a single user selection only */ public UserSearchDialog(final int numberOfRows, final DialogBox parentDialog, final boolean isSelectSingle) { super(true, true, true, SiteManager.getUserID(), parentDialog, isSelectSingle); //Store the needed param values NUMBER_OF_ROWS_PER_PAGE = numberOfRows; USER_GENDER_UNKNOWN_STR = titlesI18N.genderUnknownValue(); USER_GENDER_MALE_STR = titlesI18N.genderMaleValue(); USER_GENDER_FEMALE_STR = titlesI18N.genderFemaleValue(); //Enable the default action buttons it will be used to close the dialog setLeftEnabled( true ); this.setStyleName( CommonResourcesContainer.USER_DIALOG_STYLE_NAME ); }
/** * The generic constructor * @param hasSmileyTarget must be true if the dialog contains smiley selection targets, instances. * @param autoHide true for auto hide * @param modal true for a modal dialog * @param parentDialog the parent dialog * @param numberOfFiles the number of files that we are going to view * @param initialFileIndex the index of the initial file to view */ public ViewMediaDialogBase( final boolean hasSmileyTarget, final boolean autoHide, final boolean modal, final DialogBox parentDialog, final int numberOfFiles, final int initialFileIndex ) { super( hasSmileyTarget, autoHide, modal, parentDialog); //Store the parameters this.numberOfFiles = numberOfFiles; this.currentFileIndex = initialFileIndex; //Enable dialog's animation this.setAnimationEnabled(true); //Enable the action buttons and hot key, even though we will not be adding these buttons //to the grid, we will use the hot keys associated with them to close this dialog setLeftEnabled( true ); setRightEnabled( true ); }
/** * The constructor * @param forumMessage the forum message we will manage filed for * @param parentDialog the parent dialog */ public ProfileFilesManagerUI( final UserData userData, final DialogBox parentDialog ) { super( false, true, true, NUMBER_OF_FILES_PER_PAGE, NUMBER_OF_COLUMNS, SiteManager.getUserID(), parentDialog ); //Store the profile data this.userData = userData; //Enable the action buttons and hot key, even though we will not be adding these buttons //to the grid, we will use the hot keys associated with them to close this dialog setLeftEnabled( true ); setRightEnabled( true ); //Set the dialog's caption. updateDialogTitle(); //Disable the actual dialog buttons for now disableAllControls(); //Fill dialog with data populateDialog(); }
public UserProfileDialogUI(final DialogBox parendDialog) { //No autohide, and the dialog is modal super( true, false, true, parendDialog ); //Initialize the user files view this.userFilesView = new UserProfileFilesView( this, null); //Set the dialog's caption. setText( titlesI18N.userProfileDialogTitle( ) ); //Set a style name so we can style it with CSS. this.setStyleName(CommonResourcesContainer.USER_DIALOG_STYLE_NAME); //Fill dialog with data populateDialog(); //Get the current MainUserData object from the server retrieveUserData(); }
/** * The constructor that has to be used when we send * a message to a particular user * @param parentDialog the parent dialog, i.e. the one we open this dialog from * @param toUserID the ID of the user we send the message to * @param toUserLoginName the login name of the user we send the message to * @param replyMsgData if not null then this is the message we reply to */ public SendMessageDialogUI( final DialogBox parentDialog, final int toUserID, final String toUserLoginName, final PrivateMessageData replyMsgData) { super( true, false, true, parentDialog ); //Store the local value of the message we reply to this.replyMsgData = replyMsgData; //Increment the number of opened send message dialogs openSendMessageDialogCounter++; this.addCloseHandler( new CloseHandler<PopupPanel>(){ public void onClose( CloseEvent<PopupPanel> e ) { if( e.getTarget() == thisDialog ) { //The send message is closed, decrement the number of //opened send message dialogs if( openSendMessageDialogCounter > 0 ) { openSendMessageDialogCounter--; } } } } ); //Set the message recepient setMessageRecepient(toUserID, toUserLoginName); //Set title and style this.setText(titlesI18N.sendPersonalMessageDialogTitle() ); this.setStyleName( CommonResourcesContainer.USER_DIALOG_STYLE_NAME ); //Fill dialog with data populateDialog(); }
/** * A simple sialog for viewing the rooms of a user * @param forUserID the user ID we browse statistics for * @param forUserLoginName the login name of the user we brows data for * @param roomsManager the instance of the rooms manager */ public MessagesManagerDialogUI( final int forUserID, final String forUserLoginName, final DialogBox parentDialog, final RoomsManagerUI roomsManager ) { super( false, true, true, NUMBER_OF_ROWS_PER_PAGE, NUMBER_OF_COLUMNS_IN_MESSAGES_TABLE, forUserID, parentDialog ); //Store the data this.forUserID = forUserID; this.forUserLoginName = forUserLoginName; this.roomsManager = roomsManager; //Set the dialog's caption. updateDialogTitle(); this.setStyleName( CommonResourcesContainer.USER_DIALOG_STYLE_NAME ); //Enable the action buttons and hot key, even though we will not be adding these buttons //to the grid, we will use the hot keys associated with them to close this dialog setLeftEnabled( true ); setRightEnabled( true ); //Disable the actual dialog buttons for now disableAllControls(); //Fill dialog with data populateDialog(); }
/** * A simple sialog for viewing the rooms of a user * @param forUserID the user ID we browse statistics for * @param forUserLoginName the login name of the user we brows data for * @param roomsManager the instance of the rooms manager */ public RoomsManagerDialogUI( final int forUserID, final String forUserLoginName, final DialogBox parentDialog, final RoomsManagerUI roomsManager ) { super( false, true, true, NUMBER_OF_ROWS_PER_PAGE, NUMBER_OF_ROOM_COLUMNS, forUserID, parentDialog ); //Store the data this.forUserID = forUserID; this.forUserLoginName = forUserLoginName; this.roomsManager = roomsManager; //Set the dialog's caption. updateDialogTitle(); this.setStyleName( CommonResourcesContainer.USER_DIALOG_STYLE_NAME ); //Enable the action buttons and hot key, even though we will not be adding these buttons //to the grid, we will use the hot keys associated with them to close this dialog setLeftEnabled( true ); setRightEnabled( true ); //Disable the actual dialog buttons for now disableAllControls(); //Fill dialog with data populateDialog(); }
/** * This constructor allows to initialize the dialog * to work with a new room or with an existing room. * @param isNew if true then we want to create a new room. * @param userAccess the room data in case isNew == false * @param forUserID the user ID we create/edit user access rule for * @param forUserLoginName the user login name we create/edit user access rule for */ public RoomUserAccessDialogUI(final boolean isNew, final RoomUserAccessData userAccess, final DialogBox parentDialog, final int forUserID, final String forUserLoginName, final int roomID, final String roomName ) { super( false, false, true, parentDialog ); //Store the id and login of the user we manage rooms for this.forUserID = forUserID; this.forUserLoginName = forUserLoginName; //Store the values this.isNew = isNew; this.userAccess = userAccess; this.roomID = roomID; this.roomName = roomName; //Set title and style updateTitle(); this.setStyleName( CommonResourcesContainer.USER_DIALOG_STYLE_NAME ); //Fill dialog with data populateDialog(); }
/** * This constructor allows to initialize the dialog * to work with a new room or with an existing room. * @param isNew if true then we want to create a new room. * @param roomData the room data in case isNew == false * @param forUserID the user ID we create/edit room for * @param forUserLoginName the user login name we create/edit room for * @param roomsManager the instane of the rooms manager */ public RoomDialogUI(final boolean isNew, ChatRoomData roomData, final DialogBox parentDialog, final int forUserID, final String forUserLoginName, final RoomsManagerUI roomsManager ) { super( true, false,true, parentDialog ); //Store the data this.forUserID = forUserID; this.forUserLoginName = forUserLoginName; this.roomsManager = roomsManager; //Store the values this.isNew = isNew; this.roomData = roomData; //Set the amin marker isAdmin = (SiteManager.getUserProfileType() == MainUserData.ADMIN_USER_TYPE); //Set title and style updateTitle(); this.setStyleName( CommonResourcesContainer.USER_DIALOG_STYLE_NAME ); //Fill dialog with data populateDialog(); }
/** * A simple sialog for viewing the rooms of a user * @param roomData the room object we manage users for * @param parentDialog the reference to the parent dialog */ public RoomUsersManagerDialogUI( ChatRoomData roomData, final DialogBox parentDialog ) { super( false, true, true, NUMBER_OF_ROWS_PER_PAGE, ( (SiteManager.getUserProfileType() == MainUserData.ADMIN_USER_TYPE) ? NUMBER_OF_COLUMNS_ADMIN : NUMBER_OF_COLUMNS_USER ), SiteManager.getUserID(), parentDialog ); this.thisRoomData = roomData; this.thisDialogRef = this; //Enable the action buttons and hot key, even though we will not be adding these buttons //to the grid, we will use the hot keys associated with them to close this dialog setLeftEnabled( true ); setRightEnabled( true ); //Set the dialog's caption. updateDialogTitle(); //Disable the actual dialog buttons for now disableAllControls(); //Fill dialog with data populateDialog(); }
/** * A simple constructor for the user statistics management dialog * @param forUserID the user ID we brows statistics for * @param forUserLoginName the login name of the user we brows data for * @param parentDialog the parent dialog if any */ public UserStatsViewerDialogUI( final int forUserID, final String forUserLoginName, final DialogBox parentDialog ){ super( false, true, true, NUMBER_OF_ROWS_PER_PAGE, NUMBER_OF_STAT_TABLE_COLUMNS, forUserID, parentDialog ); this.forUserLoginName = forUserLoginName; //Set the dialog's caption. updateDialogTitle( ); this.setStyleName( CommonResourcesContainer.USER_DIALOG_STYLE_NAME ); //Enable the action buttons and hot key, even though we will not be adding these buttons //to the grid, we will use the hot keys associated with them to close this dialog setLeftEnabled( true ); setRightEnabled( true ); //Disable the actual dialog buttons for now disableAllControls(); //Fill dialog with data populateDialog(); }
/** * THe basic constructor * @param parentDialog the dialog which contains this panel or null * @param maxOffsetWidth the maximum width of the recipients panel in pixels * @param currentRoomID the id of the room we are currently in * @param roomsManager the instance of the rooms manager */ public MessageRecepientsPanelUI( final DialogBox parentDialog, final int maxOffsetWidth, final int currentRoomID, final RoomsManagerUI roomsManager ) { //Store the parameters this.parentDialog = parentDialog; this.maxOffsetWidth = maxOffsetWidth; this.currentRoomID = currentRoomID; this.roomsManager = roomsManager; //Populate the panel populatePanel(); //Set the style name mainRecipientsTable.setStyleName( CommonResourcesContainer.RECEPIENTS_PANEL_STYLE ); //Initialize the composite initWidget( mainRecipientsTable ); }
public SendChatMessageWidgets( final int roomID, final ClickHandler smileyActionLinkClickHandler, final SendChatMessageManager.SendChatMsgUI parentWidget, final boolean isPanelMode, final RoomsManagerUI roomsManager ) { //Store the rooms manager this.roomsManager = roomsManager; //Store the room ID this.roomID = roomID; //Store the click handler this.smileyActionLinkClickHandler = smileyActionLinkClickHandler; //Initialize the message recipients panel this.messageRecepientsPanel = new MessageRecepientsPanelUI( ( parentWidget instanceof DialogBox) ? (DialogBox) parentWidget : null, SendChatMessageWidgets.MAXIMUM_MESAGE_TEXT_BASE_ELEMENT_WIDTH, this.roomID, roomsManager ); //Store the mode this.isPanelMode = isPanelMode; //Store the wrapping dialog link this.parentWidget = parentWidget; }
/** * @param roomID the id of the room the message file comes from * @param fileDescr the descriptor of the file we want to view * @param isMsgAtt if the file is already attached to the chat message * @param parentDialog the parent dialog we call this */ public ViewChatMediaFileDialogUI( final int roomID, final ShortFileDescriptor fileDescr, final boolean isMsgAtt, final DialogBox parentDialog ) { super( parentDialog, fileDescr ); this.isMsgAtt = isMsgAtt; this.roomID = roomID; //In case the file we are viewing comes from the chat, and is not the file the user //is adding to the chat message right now, then if this is a playable file we make //the dialog non-modal and do not let it auto-close if( isMsgAtt && SupportedFileMimeTypes.isPlayableMimeType( fileDescr.mimeType ) ) { this.setModal(false); this.setAutoHideEnabled(false); } //Fill dialog with data this.populateDialog(); }
private void showAssociateBatchClassField(Boolean isFinishButtonClicked) { if (isFinishButtonClicked != null && isFinishButtonClicked) { presenter.getController().setIsFinishButtonClicked(isFinishButtonClicked); } else { presenter.getController().setIsFinishButtonClicked(Boolean.FALSE); } String identifier = getSelectedBatchClassNameListBoxValue(); if (identifier == null || identifier.isEmpty()) { ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get() .getMessageValue(UploadBatchMessages.NONE_SELECTED_WARNING)); } else { final DialogBox dialogBox = new DialogBox(); associateBCFView.setDialogBox(dialogBox); presenter.onAssociateBatchClassFieldButtonClicked(identifier); associateBCFView.getSave().setFocus(true); } }
private void createLyricsDialog() { lyricsDialog = new DialogBox(); VerticalPanel vPanel = new VerticalPanel(); vPanel.setHeight( "100%" ); vPanel.setHorizontalAlignment( VerticalPanel.ALIGN_CENTER ); vPanel.setVerticalAlignment( VerticalPanel.ALIGN_MIDDLE ); lyricsDialog.add( vPanel ); lyrics = new HTML(); ScrollPanel scrollPanel = new ScrollPanel(); scrollPanel.setWidth( "300px" ); scrollPanel.setHeight( "250px" ); scrollPanel.add( lyrics ); vPanel.add( scrollPanel ); Button close = new NativeButton( "Close" ); close.addClickListener( new ClickListener() { public void onClick( Widget arg0 ) { lyricsDialog.hide(); } } ); vPanel.add( close ); }
private void closeClientSession() { final DialogBox dialog = new DialogBox(); dialog.add( new Label( "Exiting..." ) ); dialog.center(); dialog.show(); Value v = getLocationValue(); v.getNewChild( "sid" ).setValue( sid ); JolieService.Util.getInstance().call( "closeClientSession", v, new EchoesCallback() { @Override public void onSuccess( Value response ) { dialog.hide(); } } ); }
public void showEndGame(final Runnable runnable) { final DialogBox box = new DialogBox(); box.setAnimationEnabled(true); box.setText("Thanks for playing Higher or Lower! *ding*ding*ding*ding*"); Button b = new Button("Thanks for having me!"); b.addStyleName("centered"); b.addClickListener(new ClickListener() { public void onClick(Widget sender) { runnable.run(); box.hide(); } }); box.setWidget(b); box.center(); box.show(); }
static public void popInfo(String title, String info) { final DialogBox dialogBox = new DialogBox(); dialogBox.setText(title); dialogBox.setAnimationEnabled(true); VerticalPanel base = new VerticalPanel(); base.add(new Label(info)); Button closeButton = new Button("Close"); base.add(closeButton); dialogBox.setWidget(base); // Add a handler to close the DialogBox closeButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { dialogBox.hide(); } }); dialogBox.center(); closeButton.setFocus(true); }
private static DialogBox createWaitingDialog( final String message ) { final DialogBox dialogBox = new DialogBox(); dialogBox.setText( "Info" ); final HorizontalPanel hp = new HorizontalPanel(); DOM.setStyleAttribute( hp.getElement(), "padding", "20px" ); hp.setHeight( "20px" ); hp.add( new Image( "/images/loading.gif" ) ); hp.add( ClientUtils.createHorizontalEmptyWidget( 5 ) ); hp.add( new Label( message ) ); dialogBox.setWidget( hp ); dialogBox.center(); return dialogBox; }
private void showIntroDialogBox() { if (config.getIntroMessage() == null) return; final DialogBox dialogBox = new DialogBox(true, true); VerticalPanel dialogBoxContents = new VerticalPanel(); dialogBox.setText(I18nUtils.tr("welcome")); HTML message = new HTML(config.getIntroMessage()); Button button = new Button(I18nUtils.tr("ok"), new ClickHandler() { @Override public void onClick(ClickEvent event) { dialogBox.hide(); } }); dialogBox.setWidth("400px"); dialogBoxContents.add(message); dialogBoxContents.add(button); dialogBox.setWidget(dialogBoxContents); dialogBox.center(); }
@Override public void execute() { final DialogBox db = new DialogBox(false, true); db.setText("About MIT App Inventor"); db.setStyleName("ode-DialogBox"); db.setHeight("200px"); db.setWidth("400px"); db.setGlassEnabled(true); db.setAnimationEnabled(true); db.center(); VerticalPanel DialogBoxContents = new VerticalPanel(); String html = MESSAGES.gitBuildId(GitBuildId.getDate(), GitBuildId.getVersion()) + "<BR/>Use Companion: " + BlocklyPanel.getCompVersion(); Config config = Ode.getInstance().getSystemConfig(); String releaseNotesUrl = config.getReleaseNotesUrl(); if (!Strings.isNullOrEmpty(releaseNotesUrl)) { html += "<BR/><BR/>Please see <a href=\"" + releaseNotesUrl + "\" target=\"_blank\">release notes</a>"; } String tosUrl = config.getTosUrl(); if (!Strings.isNullOrEmpty(tosUrl)) { html += "<BR/><BR/><a href=\"" + tosUrl + "\" target=\"_blank\">" + MESSAGES.privacyTermsLink() + "</a>"; } HTML message = new HTML(html); SimplePanel holder = new SimplePanel(); Button ok = new Button("Close"); ok.addClickListener(new ClickListener() { public void onClick(Widget sender) { db.hide(); } }); holder.add(ok); DialogBoxContents.add(message); DialogBoxContents.add(holder); db.setWidget(DialogBoxContents); db.show(); }
@Override public void execute() { final DialogBox db = new DialogBox(false, true); db.setText("About The Companion"); db.setStyleName("ode-DialogBox"); db.setHeight("200px"); db.setWidth("400px"); db.setGlassEnabled(true); db.setAnimationEnabled(true); db.center(); String downloadinfo = ""; if (!YaVersion.COMPANION_UPDATE_URL1.equals("")) { String url = "http://" + Window.Location.getHost() + YaVersion.COMPANION_UPDATE_URL1; downloadinfo = "<br/>\n<a href=" + url + ">Download URL: " + url + "</a><br/>\n"; downloadinfo += BlocklyPanel.getQRCode(url); } VerticalPanel DialogBoxContents = new VerticalPanel(); HTML message = new HTML( "Companion Version " + BlocklyPanel.getCompVersion() + downloadinfo ); SimplePanel holder = new SimplePanel(); Button ok = new Button("Close"); ok.addClickListener(new ClickListener() { public void onClick(Widget sender) { db.hide(); } }); holder.add(ok); DialogBoxContents.add(message); DialogBoxContents.add(holder); db.setWidget(DialogBoxContents); db.show(); }
/** * Creates video on page! */ private static void createVideoDialog(String tutorialId) { // Create the UI elements of the DialogBox final DialogBox dialogBox = new DialogBox(true, true); // DialogBox(autohide, modal) dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setText("Tutorial Video"); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); VerticalPanel DialogBoxContents = new VerticalPanel(); // Adds Youtube Video HTML message = new HTML("<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/" + tutorialId + "?rel=0&autoplay=1\" frameborder=\"0\" allowfullscreen></iframe>"); message.setStyleName("DialogBox-message"); FlowPanel holder = new FlowPanel(); Button ok = new Button("Close"); ok.addClickListener(new ClickListener() { public void onClick(Widget sender) { dialogBox.hide(); } }); ok.setStyleName("DialogBox-button"); holder.add(ok); DialogBoxContents.add(message); DialogBoxContents.add(holder); dialogBox.setWidget(DialogBoxContents); dialogBox.center(); dialogBox.show(); }
/** * Enlarges image on page */ private static void createImageDialog(String img) { // Create the UI elements of the DialogBox final DialogBox dialogBox = new DialogBox(true, true); // DialogBox(autohide, modal) dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); VerticalPanel DialogBoxContents = new VerticalPanel(); FlowPanel holder = new FlowPanel(); Button ok = new Button("Close"); ok.addClickListener(new ClickListener() { public void onClick(Widget sender) { dialogBox.hide(); } }); ok.setStyleName("DialogBox-button"); // Adds Image Image image = new Image(img); image.addLoadHandler(new LoadHandler() { public void onLoad(LoadEvent evt) { dialogBox.center(); } }); image.setStyleName("DialogBox-image"); holder.add(ok); DialogBoxContents.add(image); DialogBoxContents.add(holder); dialogBox.setWidget(DialogBoxContents); dialogBox.center(); dialogBox.show(); }
/** * Possibly display the MIT App Inventor "Splash Screen" * * @param force Bypass the check to see if they have dimissed this version */ private void createWelcomeDialog(boolean force) { if (!shouldShowWelcomeDialog() && !force) { maybeShowNoProjectsDialog(); return; } // Create the UI elements of the DialogBox final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal) dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setText(MESSAGES.createWelcomeDialogText()); dialogBox.setHeight(splashConfig.height + "px"); dialogBox.setWidth(splashConfig.width + "px"); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); dialogBox.center(); VerticalPanel DialogBoxContents = new VerticalPanel(); HTML message = new HTML(splashConfig.content); message.setStyleName("DialogBox-message"); FlowPanel holder = new FlowPanel(); Button ok = new Button(MESSAGES.createWelcomeDialogButton()); final CheckBox noshow = new CheckBox(MESSAGES.doNotShow()); ok.addClickListener(new ClickListener() { public void onClick(Widget sender) { dialogBox.hide(); if (noshow.getValue()) { // User checked the box userSettings.getSettings(SettingsConstants.SPLASH_SETTINGS). changePropertyValue(SettingsConstants.SPLASH_SETTINGS_VERSION, "" + splashConfig.version); userSettings.saveSettings(null); } maybeShowNoProjectsDialog(); } }); holder.add(ok); holder.add(noshow); DialogBoxContents.add(message); DialogBoxContents.add(holder); dialogBox.setWidget(DialogBoxContents); dialogBox.show(); }
/** * Show a Dialog Box when we receive an SC_PRECONDITION_FAILED * response code to any Async RPC call. This is a signal that * either our session has expired, or our login cookie has otherwise * become invalid. This is a fatal error and the user should not * be permitted to continue (many ignore the red error bar and keep * working, in vain). So now when this happens, we put up this * modal dialog box which cannot be dismissed. Instead it presents * just one option, a "Reload" button which reloads the browser. * This should trigger a re-authentication (or in the case of an * App Inventor upgrade trigging the problem, the loading of newer * code). */ public void sessionDead() { // Create the UI elements of the DialogBox final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal) dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setText(MESSAGES.invalidSessionDialogText()); dialogBox.setWidth("400px"); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); dialogBox.center(); VerticalPanel DialogBoxContents = new VerticalPanel(); HTML message = new HTML(MESSAGES.sessionDead()); message.setStyleName("DialogBox-message"); FlowPanel holder = new FlowPanel(); Button reloadSession = new Button(MESSAGES.reloadWindow()); reloadSession.addClickListener(new ClickListener() { public void onClick(Widget sender) { dialogBox.hide(); reloadWindow(true); } }); holder.add(reloadSession); DialogBoxContents.add(message); DialogBoxContents.add(holder); dialogBox.setWidget(DialogBoxContents); dialogBox.show(); }
/** * Display a Dialog box that explains that you cannot connect a * device or the emulator to App Inventor until you have a project * selected. */ private void wontConnectDialog() { // Create the UI elements of the DialogBox final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal) dialogBox.setStylePrimaryName("ode-DialogBox"); dialogBox.setText(MESSAGES.noprojectDialogTitle()); dialogBox.setHeight("100px"); dialogBox.setWidth("400px"); dialogBox.setGlassEnabled(true); dialogBox.setAnimationEnabled(true); dialogBox.center(); VerticalPanel DialogBoxContents = new VerticalPanel(); HTML message = new HTML("<p>" + MESSAGES.noprojectDuringConnect() + "</p>"); message.setStyleName("DialogBox-message"); FlowPanel holder = new FlowPanel(); Button okButton = new Button("OK"); okButton.addClickListener(new ClickListener() { public void onClick(Widget sender) { dialogBox.hide(); } }); holder.add(okButton); DialogBoxContents.add(message); DialogBoxContents.add(holder); dialogBox.setWidget(DialogBoxContents); dialogBox.show(); }
/** * The basic constructor */ public UserProfileFilesView( final DialogBox parentDialog, final UserData userData ) { //Store the reference to the parent dialog this.parentDialog = parentDialog; //Set the local scroll panel ScrollPanel scrollPanel = new ScrollPanel(); scrollPanel.addStyleName( CommonResourcesContainer.FILE_TUMBNAILS_PANEL_STYLE ); //Set up the images panel thumbnailsPanel = new HorizontalPanel(); thumbnailsPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER ); thumbnailsPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE ); scrollPanel.add( thumbnailsPanel ); //Instantiate the buttons previousButton = new LeftRightButtons( CommonResourcesContainer.NAV_LEFT_IMG_BUTTON, false , false ); nextButton = new LeftRightButtons( CommonResourcesContainer.NAV_RIGHT_IMG_BUTTON, false , false ); //Set up the main panel mainHorPanel = new HorizontalPanel(); mainHorPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE ); mainHorPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER ); mainHorPanel.add( previousButton ); mainHorPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT ); mainHorPanel.add( scrollPanel ); mainHorPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER ); mainHorPanel.add( nextButton ); //Set the user profile files setUserProfile( userData ); //Initialize the widget initWidget( mainHorPanel ); }
/** * The basic constructor for viewing one file * @param parentDialog the parent dialog * @param fileDescr the file descriptor */ public ViewTop10ProfileFilesDialogUI(DialogBox parentDialog, ShortUserFileDescriptor fileDescr) { super(parentDialog, fileDescr); //Fill dialog with data populateDialog(); }