public CreateGroupWidget(UserGroup parent) { initComponents(); this.parent = parent; int row = 0; createTable.setWidget(row, 0, closeLink); createTable.getFlexCellFormatter().setColSpan(row, 0, 2); row += 1; createTable.setHTML(row, 0, "<b>Name</b>"); createTable.setWidget(row, 1, groupName); row += 1; createTable.setHTML(row, 0, "<b>Description</b>"); createTable.setWidget(row, 1, groupDescription); row += 1; createTable.setWidget(row, 0, table); createTable.getFlexCellFormatter().setColSpan(row, 0, 2); row += 1; createTable.setWidget(row, 0, createButton); createTable.getFlexCellFormatter().setHorizontalAlignment(row, 0, HasAlignment.ALIGN_RIGHT); createTable.setWidget(row, 1, cancelButton); popup.setWidget(createTable); popup.setGlassEnabled(true); popup.setGlassStyleName("dialog_box_glass"); closeLink.addClickHandler(new CloseWidgetHandler()); cancelButton.addClickHandler(new CloseWidgetHandler()); }
public static void init() { panel.setSize("300px", "80px"); panel.add(label); panel.add(fileUpload); popup.setGlassEnabled(true); popup.setAutoHideEnabled(true); popup.center(); popup.add(panel); }
private void showWaitPanelIfRequired(RequestContext context) { if (getServicePropertyBoolean(context.getMethodName(), "showWaitPanel", false)) { GwtUtils.log(getClass(), "showWaitPanelIfRequired", "showWaitPanel = true"); if (waitPanel == null) { waitPanel = new PopupPanel(); GwtUtils.setStyleAttribute(waitPanel, "border", "none"); GwtUtils.setStyleAttribute(waitPanel, "background", "transparent"); waitPanel.setGlassEnabled(false); waitPanel.setAnimationEnabled(true); Image waitingImg = new Image(UriUtils.fromTrustedString("/images/commons/transp-loading.gif")); waitPanel.setWidget(waitingImg); } GwtUtils.showWait(waitPanel); } }
private void deployProject() { createdProjectName = deploymentOptionsPanel.getProjectName(); ArrayList<String> paths = appBrowserPanel.getAppPaths(); ArrayList<String> apptypes = appBrowserPanel.getAppTypes(); ArrayList<String> appNames = appBrowserPanel.getAppNames(); StringBuffer formBuilder = new StringBuffer(); formBuilder.append("csrfmiddlewaretoken="); formBuilder.append(URL.encodeQueryString(jsVarHandler.getCSRFTokenURL())); formBuilder.append("&form-TOTAL_FORMS="); formBuilder.append(URL.encodeQueryString(String.valueOf(paths.size()))); formBuilder.append("&form-INITIAL_FORMS="); formBuilder.append(URL.encodeQueryString(String.valueOf(0))); formBuilder.append("&form-MAX_NUM_FORMS="); for (int i = 0; i < paths.size(); i++) { formBuilder.append("&form-" + i + "-apptype="); formBuilder.append(apptypes.get(i)); formBuilder.append("&form-" + i + "-apppath="); formBuilder.append(paths.get(i)); formBuilder.append("&form-" + i + "-appname="); formBuilder.append(appNames.get(i)); } formBuilder.append(deploymentOptionsPanel.getPostData()); formBuilder.append(projectOptionsPanel.getPostData()); formBuilder.append(databaseOptionsPanel.getPostData()); RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, "/deployments/" + createdProjectName + "/"); builder.setHeader("Content-type", "application/x-www-form-urlencoded"); // builder.setHeader(header, value); try { Request request = builder.sendRequest( formBuilder.toString(), new RequestCallback() { public void onError(Request request, Throwable exception) { ErrorPanel ep = new ErrorPanel(clientFactory); ep.errorHTML.setHTML("<p>Error Occured</p>"); deployerDeckPanel.add(ep); deployerDeckPanel.showWidget(deployerDeckPanel.getWidgetIndex(ep)); } public void onResponseReceived(Request request, Response response) { if (response.getText().contains("Back to")) { loadingPopup.hide(); eventBus.fireEvent(new AsyncRequestEvent("addProject", createdProjectName)); } else { loadingPopup.hide(); ErrorPanel ep = new ErrorPanel(clientFactory); ep.errorHTML.setHTML(response.getText()); deployerDeckPanel.add(ep); deployerDeckPanel.showWidget(deployerDeckPanel.getWidgetIndex(ep)); } } }); } catch (RequestException e) { } loadingPopup.setGlassEnabled(true); loadingPopup.setGlassStyleName(style.loadingGlass()); loadingPopup.show(); int left = (Window.getClientWidth() / 2) - 150; int top = (Window.getClientHeight() / 2) - 10; loadingPopup.setPopupPosition(left, top); loadingPopup.show(); }
public void switchSection(String token) { popup.hide(); tokenHistory.add(token); Map<String, String> parameters = getHistoryTokenParameters(token); AppPlace place = getPlace(token); if (mainPresenter != null) { mainPresenter.clearNotifications(); } if (ClientSessionUtil.checkSession()) { switch (place) { case HOME: HomePresenter homePresenter = new HomePresenter(new HomeView(), eventBus); homePresenter.bind(); getLayout().clear(); getLayout().add(homePresenter.getDisplay().asWidget()); break; case REQUEST: RequestPresenter requestPresenter = new RequestPresenter(new RequestView(), eventBus); requestPresenter.bind(); getLayout().clear(); getLayout().add(requestPresenter.getDisplay().asWidget()); break; case LOGOUT: ClientSessionUtil.destroySession(); eventBus.fireEvent(new LoginRequiredEvent()); break; case REQUESTSTATUS: try { Integer requestId = Integer.parseInt(parameters.get("requestId")); RequestStatusPresenter requestStatusPresenter = new RequestStatusPresenter(new RequestStatusView(), eventBus); requestStatusPresenter.bind(); requestStatusPresenter.showRequest(requestId); getLayout().clear(); getLayout().add(requestStatusPresenter.getDisplay().asWidget()); } catch (Exception e) { showNotification( "Id incorrecta: No se puede cargar la solicitud", NotificationEventType.ERROR); } break; case EDITREQUEST: try { Integer requestId = Integer.parseInt(parameters.get("requestId")); RequestEditPresenter editPresenter = new RequestEditPresenter(new RequestEditView(), eventBus); editPresenter.bind(); editPresenter.showRequest(requestId); getLayout().clear(); getLayout().add(editPresenter.getDisplay().asWidget()); } catch (Exception e) { showNotification( "Id incorrecta: No se puede cargar la solicitud", NotificationEventType.ERROR); } break; case RESPONSE: try { Integer requestId = Integer.parseInt(parameters.get("requestId")); RequestResponsePresenter requestResponsePresenter = new RequestResponsePresenter(new RequestResponseView(), eventBus); requestResponsePresenter.bind(); requestResponsePresenter.showRequest(requestId); getLayout().clear(); getLayout().add(requestResponsePresenter.getDisplay().asWidget()); } catch (Exception e) { showNotification( "Id incorrecta: No se puede cargar la solicitud", NotificationEventType.ERROR); } break; case LIST: try { String listType = parameters.get("type"); RequestListPresenter requestListPresenter = new RequestListPresenter(new RequestListView(), eventBus); requestListPresenter.bind(); requestListPresenter.loadRequests(0, 100, listType); getLayout().clear(); getLayout().add(requestListPresenter.getDisplay().asWidget()); } catch (Exception e) { showNotification( "Tipo de lista incorrecto: No se puede cargar la lista", NotificationEventType.ERROR); } break; case STATISTICS: StatisticsPresenter statistics = new StatisticsPresenter(new StatisticsView(), eventBus); statistics.bind(); getLayout().clear(); getLayout().add(statistics.getDisplay().asWidget()); break; case ABOUTPROJECT: AboutProjectPresenter aboutProjectPresenter = new AboutProjectPresenter(new AboutProjectView(), eventBus); aboutProjectPresenter.bind(); getLayout().clear(); getLayout().add(aboutProjectPresenter.getDisplay().asWidget()); break; case ASOCIATES: AsociatesPresenter asociatesPresenter = new AsociatesPresenter(new AsociatesView(), eventBus); asociatesPresenter.bind(); getLayout().clear(); getLayout().add(asociatesPresenter.getDisplay().asWidget()); break; case USERPROFILE: UserProfileEditPresenter userProfilePresenter = new UserProfileEditPresenter(new UserProfileEditView(), eventBus); userProfilePresenter.bind(); getLayout().clear(); getLayout().add(userProfilePresenter.getDisplay().asWidget()); break; default: History.newItem(AppPlace.HOME.toString()); } } else { switch (place) { case HOME: HomePresenter homePresenter = new HomePresenter(new HomeView(), eventBus); homePresenter.bind(); getLayout().clear(); getLayout().add(homePresenter.getDisplay().asWidget()); break; case REQUEST: case LOGIN: LoginPresenter loginPresenter = new LoginPresenter(new LoginView(), eventBus); loginPresenter.bind(); popup.setModal(true); popup.setGlassEnabled(true); popup.clear(); popup.add(loginPresenter.getDisplay().asWidget()); popup.center(); break; case REGISTER: RegisterPresenter registerPresenter = new RegisterPresenter(new RegisterView(), eventBus); registerPresenter.bind(); getLayout().clear(); getLayout().add(registerPresenter.getDisplay().asWidget()); break; case RESPONSE: try { Integer requestId = Integer.parseInt(parameters.get("requestId")); RequestResponsePresenter requestResponsePresenter = new RequestResponsePresenter(new RequestResponseView(), eventBus); requestResponsePresenter.bind(); requestResponsePresenter.showRequest(requestId); getLayout().clear(); getLayout().add(requestResponsePresenter.getDisplay().asWidget()); } catch (Exception e) { showNotification( "Id incorrecta: No se puede cargar la solicitud", NotificationEventType.ERROR); } break; case LIST: try { String listType = parameters.get("type"); RequestListPresenter requtesListPresenter = new RequestListPresenter(new RequestListView(), eventBus); requtesListPresenter.bind(); requtesListPresenter.loadRequests(0, 100, listType); getLayout().clear(); getLayout().add(requtesListPresenter.getDisplay().asWidget()); } catch (Exception e) { showNotification( "Tipo de lista incorrecto: No se puede cargar la lista", NotificationEventType.ERROR); } break; case STATISTICS: StatisticsPresenter statistics = new StatisticsPresenter(new StatisticsView(), eventBus); statistics.bind(); getLayout().clear(); getLayout().add(statistics.getDisplay().asWidget()); break; case ABOUTPROJECT: AboutProjectPresenter aboutProjectPresenter = new AboutProjectPresenter(new AboutProjectView(), eventBus); aboutProjectPresenter.bind(); getLayout().clear(); getLayout().add(aboutProjectPresenter.getDisplay().asWidget()); break; case ASOCIATES: AsociatesPresenter asociatesPresenter = new AsociatesPresenter(new AsociatesView(), eventBus); asociatesPresenter.bind(); getLayout().clear(); getLayout().add(asociatesPresenter.getDisplay().asWidget()); break; case PASSWORDRECOVERY: PasswordRecoveryPresenter passwordRecoveryPresenter = new PasswordRecoveryPresenter(new PasswordRecoveryView(), eventBus); passwordRecoveryPresenter.bind(); getLayout().clear(); getLayout().add(passwordRecoveryPresenter.getDisplay().asWidget()); break; default: History.newItem(AppPlace.HOME.toString()); } } }