List of usage examples for com.google.gwt.user.client Cookies getCookie
public static String getCookie(String name)
From source file:org.jboss.errai.workspaces.client.framework.CookiePreferences.java
License:Apache License
public String get(String key) { return Cookies.getCookie(key); }
From source file:org.jboss.errai.workspaces.client.Header.java
License:Apache License
private void createInfoPanel() { // ----------- logo panel LayoutPanel logoPanel = new LayoutPanel(new BoxLayout()); logoPanel.setStyleName("bpm-header-left"); /*/*from www. j av a 2 s. co m*/ * Image logo = new Image(appContext.getConfig().getLogo()); logo.setHeight("50"); logoPanel.add(logo); */ // ----------- info panel HorizontalPanel infoPanel = new HorizontalPanel(); infoPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); infoPanel.setSpacing(5); infoPanel.setStyleName("bpm-header-right"); // account info ErraiImageBundle icons = GWT.create(ErraiImageBundle.class); Image img = new Image(icons.user()); img.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { String sessionId = Cookies.getCookie("JSESSIONID") != null ? Cookies.getCookie("JSESSIONID") : ""; AuthenticationContext authContext = Registry.get(SecurityService.class).getAuthenticationContext(); Set<Role> roleSet = authContext.getRoles(); StringBuffer roles = new StringBuffer(); for (Role r : roleSet) { roles.append(r.getRoleName()).append(" "); } StringBuffer sb = new StringBuffer("<h3>User information</h3>"); sb.append("- User: ").append(authContext.getName()).append("<br/>"); sb.append("- Logged in since: ").append(loginDate).append("<br/>"); sb.append("- SID: ").append(sessionId).append("<br/>"); sb.append("- Roles: ").append(roles.toString()).append("<br/>"); final LayoutPopupPanel popup = new LayoutPopupPanel(true); popup.setPopupPosition(clickEvent.getRelativeElement().getAbsoluteLeft() - 120, clickEvent.getRelativeElement().getAbsoluteTop() + 20); popup.setAnimationEnabled(true); popup.setSize("240px", "130px"); HTML html = new HTML(sb.toString()); html.setStyleName("bpm-user-info-popup"); popup.add(html); popup.show(); } }); Button btn = new Button("Logout", new ClickHandler() { public void onClick(ClickEvent clickEvent) { MessageBuilder.createMessage().toSubject("AuthenticationService") .command(SecurityCommands.EndSession).noErrorHandling().sendNowWith(ErraiBus.get()); } }); infoPanel.add(img); infoPanel.add(username); infoPanel.add(btn); this.add(logoPanel, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL)); this.add(infoPanel, new BoxLayoutData(177, 50)); }
From source file:org.kuali.continuity.admin.main.client.Acronym.java
License:Educational Community License
public void onModuleLoad() { // Grid//from w w w .j a v a 2 s .com String proxyUrl = "./items.lst"; this.formController = sf; String formItemName = this.setElementNames(columnModel, recordDef); // Form textBox.setMaxLength(25); textBox.setWidth("100px"); flexForm.addFormItem(formItemName, textBox); fullName.setMaxLength(60); fullName.setWidth("400px"); HTML fullLabel = new HTML("Full Name"); flexForm.addIdentifiedItem(fullLabel, fullName); itemRootName = "acronym"; // set token String token = Cookies.getCookie(CSRF_TOKEN); csrfToken.setValue(token); flexForm.registerWidget(csrfToken); }
From source file:org.kuali.continuity.admin.main.client.Application.java
License:Educational Community License
public void onModuleLoad() { // Top level info String pageInfo;//ww w .j a va 2 s . c o m String formItemName = this.setElementNames(ItemService.class); // Admin item specific settings this.formController = topFormController; textBox.setMaxLength(50); textBox.setWidth("500px"); flexForm.addFormItem(formItemName, textBox); flexForm.addFormItem("Order", orderBox); itemRootName = itemRootName.toLowerCase(); // set token String token = Cookies.getCookie(CSRF_TOKEN); csrfToken.setValue(token); flexForm.registerWidget(csrfToken); }
From source file:org.kuali.continuity.admin.main.client.Building.java
License:Educational Community License
public void onModuleLoad() { this.formController = sf; String formItemName = this.setElementNames(columnModel, recordDef); this.formController = sf; // Form//from w ww . j a va2 s . co m textBox.setWidth("344px"); textBox.setMaxLength(50); flexForm.addFormItem("Common Name", textBox); ownership.setVisibleItemCount(1); ownership.addItem("Owned", "1"); ownership.addItem("Not Owned", "0"); ownership.addItem("Special Status", "2"); flexForm.addFormItem("Ownership", ownership); flexForm.addRow(); caanname.setWidth("344px"); caanname.setMaxLength(50); HTML offName = new HTML("Official Name"); flexForm.addIdentifiedItem(offName, caanname); caanno.setWidth("134px"); caanno.setMaxLength(5); flexForm.addFormItem("Identifier", caanno); formPanel.add(new Label("Address")); address.setWidth(screenWidth); address.setHeight("40px"); formPanel.add(address); flexForm.addRow(); itemRootName = "building"; //formGrid.addFormItem("Order", orderBox); this.formController = sf; // set token String token = Cookies.getCookie(CSRF_TOKEN); csrfToken.setValue(token); flexForm.registerWidget(csrfToken); }
From source file:org.kuali.continuity.admin.main.client.CriticalFunction.java
License:Educational Community License
public void onModuleLoad() { RootPanel rootPanel = RootPanel.get("gwtRoot"); rootPanel.setWidth("642"); Element screenelement = DOM.getElementById("itemdata"); Element formelement = DOM.getElementById("formelement"); Element pluralelement = DOM.getElementById("plural"); String panelHeight = "250px"; String planBoxWidth = "275px"; String pageInfo = screenelement.getTitle(); String pageTitle = screenelement.getTitle(); String proxyUrl = "./items.lst"; itemService = (SimpleServiceAsync) GWT.create(SimpleService.class); rootPanel.add(dockPanel);//from w w w. j av a2 s . c o m // set token String token = Cookies.getCookie(CSRF_TOKEN); csrfToken.setValue(token); rootPanel.add(csrfToken); dockPanel.add(horizontalPanel, DockPanel.NORTH); horizontalPanel.setSize("601px", panelHeight); VerticalPanel leftPanel = new VerticalPanel(); leftPanel.add(new Label("Available Plans")); leftPanel.add(availablePlanListBox); horizontalPanel.add(leftPanel); availablePlanListBox.setWidth(planBoxWidth); availablePlanListBox.setVisibleItemCount(listBoxHeight); availablePlanListBox.addClickListener(new ClickListener() { public void onClick(final Widget arg0) { if (availablePlanListBox.getSelectedIndex() >= 0) if (availablePlanListBox.getSelectedIndex() <= availablePlanListBox.getItemCount()) { int index = availablePlanListBox.getSelectedIndex(); Integer planId = Integer.parseInt(availablePlanListBox.getValue(index)); criticalFunctionLabel.setText(" - " + availablePlanListBox.getItemText(index)); itemService.getStringArray("function", planId, callbackGetFunctions); } } }); examplePlanListBox.setWidth(planBoxWidth); examplePlanListBox.addClickListener(new ClickListener() { public void onClick(final Widget arg0) { int index = examplePlanListBox.getSelectedIndex(); if (index >= 0) if (index < examplePlanListBox.getItemCount()) { // Window.alert("" + // examplePlanListBox.getSelectedIndex() // + " " + examplePlanListBox.getItemCount()); Integer planId = Integer.parseInt(examplePlanListBox.getValue(index)); //Window.alert("Before getting plans for plan id " + planId); // criticalFunctionLabel.setText(" - "+examplePlanListBox // .getItemText(index)); criticalFunctionLabel.setText(" - " + examplePlanListBox.getItemText(index)); itemService.getStringArray("function", planId, callbackGetFunctions); } } }); availablePlanListBox.addChangeListener(new ChangeListener() { public void onChange(Widget arg0) { // Window.alert("Double click "+availablePlanListBox.getItemText( // availablePlanListBox.getSelectedIndex())); addMethod(); } }); examplePlanListBox.addChangeListener(new ChangeListener() { public void onChange(Widget arg0) { // Window.alert("Double click "+availablePlanListBox.getItemText( // availablePlanListBox.getSelectedIndex())); removeMethod(); } }); itemRootName = pageInfo.toLowerCase(); VerticalPanel topFiller = new VerticalPanel(); String midwid = "90px"; topFiller.setSize(midwid, "90px"); topFiller.add(new Label(" ")); midPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); midPanel.add(topFiller); horizontalPanel.add(midPanel); midPanel.add(addButton); addButton.addClickListener(new ClickListener() { public void onClick(final Widget arg0) { // Get plan from Available Plan List // Remove it and add it to example plan List addMethod(); } }); // addButton.setText("Add >"); VerticalPanel midFiller = new VerticalPanel(); midFiller.setSize(midwid, "12px"); midFiller.add(new Label(" ")); midPanel.add(midFiller); midPanel.add(removeButton); removeButton.addClickListener(new ClickListener() { public void onClick(final Widget arg0) { // Get selected item from example Plan List // Remove it from selected List and add it to // Available list. removeMethod(); } }); // removeButton.setText("< Remove "); VerticalPanel rightPanel = new VerticalPanel(); rightPanel.add(new Label("Selected Plans")); rightPanel.add(examplePlanListBox); horizontalPanel.add(rightPanel); examplePlanListBox.setVisibleItemCount(listBoxHeight); examplePlanListBox.addClickListener(new ClickListener() { public void onClick(final Widget arg0) { // Show functions for the current plan. //itemService.getStringArray("function", thisInstitution,callbackGetPlans); } }); horizontalPanel_1.setSize("601px", "128px"); VerticalPanel bottom = new VerticalPanel(); AbsolutePanel bottomLabelPanel = new AbsolutePanel(); // HorizontalPanel bottomLabelPanelLeft = new HorizontalPanel(); // bottomLabelPanelLeft.setWidth("220px"); // bottomLabelPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); // bottomLabelPanelLeft.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); // bottomLabelPanel.add(bottomLabelPanelLeft); final Label cfTitle = new Label("Critical Functions of Plan"); bottomLabelPanel.add(cfTitle, 0, 0); cfTitle.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); // functionLabelPanel.add(spacer); criticalFunctionLabel.setStyleName("AttentionClass2"); bottomLabelPanel.add(criticalFunctionLabel, 140, 0); criticalFunctionLabel.setWidth("341px"); bottomLabelPanel.setHeight("12px"); criticalFunctionLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); // criticalFunctionLabel.setText("Hi there Joe Smudley"); // HorizontalPanel functionLabelPanel = new HorizontalPanel(); // functionLabelPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); // functionLabelPanel.setWidth("136px"); // bottomLabelPanel.add(functionLabelPanel, 409, 0); bottom.add(bottomLabelPanel); bottom.add(criticalFunctionsListBox); horizontalPanel_1.add(bottom); criticalFunctionsListBox.setWidth("642px"); criticalFunctionsListBox.setVisibleItemCount(10); // Button Bar backButton.setText("Back"); backButton.setStyleName("ButtonClass"); backButton.addClickListener(new ClickListener() { public void onClick(final Widget sender) { showErr(false); redirect("/continuity/admin/adminHome"); } }); viewButton.setText("View User-Screen"); viewButton.setStyleName("ButtonClass"); viewButton.addClickListener(new ClickListener() { public void onClick(final Widget sender) { showErr(false); redirect("/continuity/plan/getCriticalFunctionExamples"); } }); saveButton.setText("Save Selections"); saveButton.setStyleName("ButtonClass"); saveButton.addClickListener(new ClickListener() { public void onClick(final Widget sender) { showErr(false); NamedItem item = new NamedItem(); item.setId(currentId); // Create plan list String planString = ""; String comma = ""; for (int i = 0; i < examplePlanListBox.getItemCount(); i++) { String planId = examplePlanListBox.getValue(i); planString += comma + planId; comma = ","; } item.setName(planString); item.setCsrfToken(csrfToken.getValue()); itemService.updateItem("function", item, callbackUpdate); } }); buttonBar.add(left, DockPanel.WEST); left.setWidth("200px"); right.setWidth("440px"); right.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); left.add(backButton); right.add(saveButton); right.add(viewButton); buttonBar.add(right, DockPanel.EAST); buttonBar.setSize(screenWidth, "58px"); dockPanel.add(buttonBar, DockPanel.SOUTH); dockPanel.add(horizontalPanel_1, DockPanel.SOUTH); // Begin load process. // Get Function Example list itemService.getItem("function", thisInstitution, callbackLoad); // formGrid.addFormItem("Order", orderBox); }
From source file:org.kuali.continuity.admin.main.client.Dependency.java
License:Educational Community License
public void onModuleLoad() { // Top level info itemService = (ItemServiceAsync) GWT.create(ItemService.class); Element screenelement = DOM.getElementById("itemdata"); Element formelement = DOM.getElementById("formelement"); Element pluralelement = DOM.getElementById("plural"); String plural = pluralelement.getTitle(); String pageInfo = screenelement.getTitle(); String pageTitle = screenelement.getTitle(); String proxyUrl = "./items"; String formItemName = pageTitle; itemRootName = pageInfo;/*from w w w . jav a 2 s .c o m*/ // Grid RecordDef recordDef = new RecordDef(new FieldDef[] { new StringFieldDef("id"), new StringFieldDef("name"), new IntegerFieldDef("order"), new StringFieldDef("description") }); super.onModuleLoad(plural, proxyUrl, columnModel, recordDef); this.formController = dependencyFormController; // Buttons this.setButtonNames(pageTitle); // Heading this.setHeadingName(plural + " Setup"); // Form Data textBox.setMaxLength(50); textBox.setWidth("335px"); flexForm.addFormItem(formItemName, textBox); type.setVisibleItemCount(1); type.addItem("--Select--", "2"); type.addItem("Upstream", "1"); type.addItem("Downstream", "0"); flexForm.addFormItem("Type", type); flexForm.addFormItem("Order", orderBox); // set token String token = Cookies.getCookie(CSRF_TOKEN); csrfToken.setValue(token); flexForm.registerWidget(csrfToken); gridPanel.setCls(".myclass"); itemRootName = itemRootName.toLowerCase(); }
From source file:org.kuali.continuity.admin.main.client.Faq.java
License:Educational Community License
public void onModuleLoad() { // Grid//from ww w.j a va2 s . co m String proxyUrl = "./items.lst"; // gpheight="250px"; Element dataelement = DOM.getElementById("dataelement"); itemRootName = dataelement.getTitle(); this.formController = fc; itemService = (ItemServiceAsync) GWT.create(ItemService.class); onModuleLoad("FAQs", proxyUrl, columnModel, recordDef); // questionCol.setCss("white-space:wrap !important;"); // answerCol.setCss("white-space:wrap !important;"); // Buttons setButtonNames("FAQ"); // Heading String plural = "Frequently Asked Questions"; setHeadingName(plural + " Setup"); // Form // Fields: Order HorizontalPanel formdata = new HorizontalPanel(); formdata.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); flexForm.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); flexForm.addIdentifiedItem(new HTML("<B>Order</B>"), orderBox); formPanel.add(formdata); // Create Rich Text Area richBox1.ensureDebugId("cwRichText-area"); richBox1.setSize("642px", "6em"); richBox1.setStyleName("select"); richBox1.setStylePrimaryName("select"); RichTextToolbar toolbar1 = new RichTextToolbar(richBox1); toolbar1.ensureDebugId("cwRichText-toolbar"); toolbar1.setWidth("642px"); Grid grid1 = new Grid(2, 1); grid1.setStyleName("cw-RichText"); grid1.setWidget(0, 0, toolbar1); grid1.setWidget(1, 0, richBox1); flexForm.addRow(); flexForm.addIdentifiedItemVertical(new HTML("<B>Question</B>"), grid1); richBox2.ensureDebugId("cwRichText-area"); richBox2.setSize("642px", "8em"); richBox2.setStyleName("r-text"); RichTextToolbar toolbar2 = new RichTextToolbar(richBox2); toolbar2.ensureDebugId("cwRichText-toolbar"); toolbar2.setWidth("642px"); Grid grid2 = new Grid(2, 1); grid2.setStyleName("cw-RichText"); grid2.setWidget(0, 0, toolbar2); grid2.setWidget(1, 0, richBox2); flexForm.addRow(); flexForm.addIdentifiedItemVertical(new HTML("<B>Answer</B>"), grid2); flexForm.registerWidget(richBox1); flexForm.registerWidget(richBox2); itemRootName = "faq"; // set token String token = Cookies.getCookie(CSRF_TOKEN); csrfToken.setValue(token); flexForm.registerWidget(csrfToken); }
From source file:org.kuali.continuity.admin.main.client.Location.java
License:Educational Community License
public void onModuleLoad() { this.formController = lfc; this.setElementNames(columnModel, recordDef); // labels//from www. j av a 2 s . com Label lblIns = new Label("Institution"); Label lblLoc = new Label("Location"); Label lblAcc = new Label("Access"); Label lblCus = new Label("User Friendly Url:"); Label lblCs1 = new Label("https://us.continuity.ariahgroup.org/"); Label lblLog = new Label("Login Method"); Label lblIdp = new Label("IDP"); Label lblIdi = new Label("Shibboleth unique attribute"); lblIns.setStyleName("gwt-HTML-location"); lblLoc.setStyleName("gwt-HTML-location"); lblAcc.setStyleName("gwt-HTML-location"); lblCus.setStyleName("gwt-HTML-location"); lblCs1.setStyleName("gwt-HTML-location"); lblLog.setStyleName("gwt-HTML-location"); lblIdp.setStyleName("gwt-HTML-location"); lblIdi.setStyleName("gwt-HTML-location"); instBox.setWidth("100px"); textBox.setWidth("180px"); customUrlBox.setWidth("100px"); idpBox.setWidth("350px"); shibUniqueIdBox.setWidth("350px"); // enable text boxes enableTextBox(instBox, true); enableTextBox(textBox, true); enableTextBox(customUrlBox, true); enableTextBox(idpBox, false); enableTextBox(shibUniqueIdBox, false); // access access.setVisibleItemCount(1); access.addItem("System Admin Only", "0"); access.addItem("System and Institutional Admins Only", "3"); access.addItem("Admins Only", "1"); access.addItem("All Users", "2"); systemAccessIndex.put("0", "0"); // For System Admins systemAccessIndex.put("3", "1"); // For System and Insitutional systemAccessIndex.put("1", "2"); // For Admins systemAccessIndex.put("2", "3"); // For All Users // login method loginMethod.setVisibleItemCount(1); loginMethod.addItem("Direct Login", "0"); loginMethod.addItem("Shibboleth Login", "1"); loginMethod.addChangeListener(new ChangeListener() { public void onChange(Widget sender) { showErr(false); int idx = loginMethod.getSelectedIndex(); enableShibTextBoxes(idx); } }); // tables FlexTable formTable = new FlexTable(); formTable.setStylePrimaryName("location-form"); formTable.setWidget(0, 0, lblIns); formTable.setWidget(0, 1, instBox); formTable.setWidget(0, 2, lblLoc); formTable.setWidget(0, 3, textBox); formTable.getFlexCellFormatter().setColSpan(1, 0, 4); formTable.setWidget(1, 0, lblCus); formTable.setWidget(2, 0, lblCs1); formTable.setWidget(2, 1, customUrlBox); formTable.setWidget(2, 2, lblAcc); formTable.setWidget(2, 3, access); FlexTable shibTable = new FlexTable(); shibTable.setStylePrimaryName("location-shib-form"); shibTable.setWidget(0, 0, lblLog); shibTable.setWidget(0, 1, loginMethod); shibTable.setWidget(0, 2, lblIdp); shibTable.setWidget(0, 3, idpBox); shibTable.setWidget(1, 0, new Label(" ")); shibTable.setWidget(1, 1, new Label(" ")); shibTable.setWidget(1, 2, lblIdi); shibTable.setWidget(1, 3, shibUniqueIdBox); flexForm.add(formTable); flexForm.add(shibTable); itemRootName = "location"; // set token String token = Cookies.getCookie(CSRF_TOKEN); csrfToken.setValue(token); flexForm.registerWidget(csrfToken); this.doExtraSectionLoad(); }
From source file:org.kuali.continuity.admin.main.client.Location.java
License:Educational Community License
protected void doExtraSectionLoad() { // init form//from w w w. java2 s . com final VerticalPanel vPanel = new VerticalPanel(); final FormPanel formPanel = new FormPanel(); formPanel.setEncoding(FormPanel.ENCODING_MULTIPART); formPanel.setMethod(FormPanel.METHOD_POST); formPanel.setAction(Window.Location.getProtocol() + "//" + Window.Location.getHost() + "/continuity/admin/customImageUpload"); // set form handler formPanel.addFormHandler(new FormHandler() { public void onSubmit(FormSubmitEvent event) { // event.setCancelled(true); } public void onSubmitComplete(FormSubmitCompleteEvent event) { boolean isRestore = restore.getValue().equals("true"); if (uiImageEnum.getValue().equals("BEGIN")) { imgRestoreButton1.setVisible(!isRestore); } else if (uiImageEnum.getValue().equals("BEGIN_TEXT")) { imgRestoreButton2.setVisible(!isRestore); } else if (uiImageEnum.getValue().equals("BANNER")) { imgRestoreButton3.setVisible(!isRestore); } else if (uiImageEnum.getValue().equals("BANNER_TEXT")) { imgRestoreButton4.setVisible(!isRestore); } csrfToken.setValue(Cookies.getCookie(CSRF_TOKEN)); String message = isRestore ? "Default image restored!" : "Custom image upload completed!"; Window.alert(message); } }); // custom image labels Label lblImg1 = new Label("Entry screen top image:"); Label lblImg2 = new Label("Entry screen bottom image:"); Label lblImg3 = new Label("Banner left image:"); Label lblImg4 = new Label("Banner right image:"); Label lblImgDim1 = new Label("Recommended dimensions: 700 pixels x 200 pixels"); Label lblImgDim2 = new Label("Recommended dimensions: 700 pixels x 100 pixels"); Label lblImgDim3 = new Label("Recommended height: 80 pixels"); Label lblImgDim4 = new Label("Recommended height: 80 pixels"); // styles lblImg1.setStyleName("gwt-HTML-location-bold"); lblImg2.setStyleName("gwt-HTML-location-bold"); lblImg3.setStyleName("gwt-HTML-location-bold"); lblImg4.setStyleName("gwt-HTML-location-bold"); lblImgDim1.setStyleName("gwt-HTML-location"); lblImgDim2.setStyleName("gwt-HTML-location"); lblImgDim3.setStyleName("gwt-HTML-location"); lblImgDim4.setStyleName("gwt-HTML-location"); // entry fields imgInstallButton1.setStyleName("ButtonClass"); imgInstallButton2.setStyleName("ButtonClass"); imgInstallButton3.setStyleName("ButtonClass"); imgInstallButton4.setStyleName("ButtonClass"); imgRestoreButton1.setStyleName("ButtonClass"); imgRestoreButton2.setStyleName("ButtonClass"); imgRestoreButton3.setStyleName("ButtonClass"); imgRestoreButton4.setStyleName("ButtonClass"); imgUpload1.setStyleName("ButtonClass"); imgUpload2.setStyleName("ButtonClass"); imgUpload3.setStyleName("ButtonClass"); imgUpload4.setStyleName("ButtonClass"); imgUpload1.setWidth("300px"); imgUpload2.setWidth("300px"); imgUpload3.setWidth("300px"); imgUpload4.setWidth("300px"); imgUpload1.setName("uploadedImg1"); imgUpload2.setName("uploadedImg2"); imgUpload3.setName("uploadedImg3"); imgUpload4.setName("uploadedImg4"); // construct table FlexTable imageTable = new FlexTable(); imageTable.setStylePrimaryName("location-form"); imageTable.getFlexCellFormatter().setColSpan(0, 0, 3); imageTable.setWidget(0, 0, lblImg1); imageTable.getFlexCellFormatter().setColSpan(1, 0, 3); imageTable.setWidget(1, 0, lblImgDim1); imageTable.setWidget(2, 0, imgUpload1); imageTable.setWidget(2, 1, imgInstallButton1); imageTable.setWidget(2, 2, imgRestoreButton1); imageTable.getFlexCellFormatter().setColSpan(3, 0, 3); imageTable.setWidget(3, 0, lblImg2); imageTable.getFlexCellFormatter().setColSpan(4, 0, 3); imageTable.setWidget(4, 0, lblImgDim2); imageTable.setWidget(5, 0, imgUpload2); imageTable.setWidget(5, 1, imgInstallButton2); imageTable.setWidget(5, 2, imgRestoreButton2); imageTable.getFlexCellFormatter().setColSpan(6, 0, 3); imageTable.setWidget(6, 0, lblImg3); imageTable.getFlexCellFormatter().setColSpan(7, 0, 3); imageTable.setWidget(7, 0, lblImgDim3); imageTable.setWidget(8, 0, imgUpload3); imageTable.setWidget(8, 1, imgInstallButton3); imageTable.setWidget(8, 2, imgRestoreButton3); imageTable.getFlexCellFormatter().setColSpan(9, 0, 3); imageTable.setWidget(9, 0, lblImg4); imageTable.getFlexCellFormatter().setColSpan(10, 0, 3); imageTable.setWidget(10, 0, lblImgDim4); imageTable.setWidget(11, 0, imgUpload4); imageTable.setWidget(11, 1, imgInstallButton4); imageTable.setWidget(11, 2, imgRestoreButton4); imageTable.setWidget(12, 0, systemDomainId); imageTable.setWidget(12, 1, restore); imageTable.setWidget(12, 2, uiImageEnum); // button click listener imgInstallButton1.addClickListener(new ClickListener() { public void onClick(final Widget sender) { customImageFormSubmit(formPanel, imgUpload1, false, "BEGIN"); } }); imgInstallButton2.addClickListener(new ClickListener() { public void onClick(final Widget sender) { customImageFormSubmit(formPanel, imgUpload2, false, "BEGIN_TEXT"); } }); imgInstallButton3.addClickListener(new ClickListener() { public void onClick(final Widget sender) { customImageFormSubmit(formPanel, imgUpload3, false, "BANNER"); } }); imgInstallButton4.addClickListener(new ClickListener() { public void onClick(final Widget sender) { customImageFormSubmit(formPanel, imgUpload4, false, "BANNER_TEXT"); } }); imgRestoreButton1.addClickListener(new ClickListener() { public void onClick(final Widget sender) { customImageFormSubmit(formPanel, imgUpload1, true, "BEGIN"); } }); imgRestoreButton2.addClickListener(new ClickListener() { public void onClick(final Widget sender) { customImageFormSubmit(formPanel, imgUpload2, true, "BEGIN_TEXT"); } }); imgRestoreButton3.addClickListener(new ClickListener() { public void onClick(final Widget sender) { customImageFormSubmit(formPanel, imgUpload3, true, "BANNER"); } }); imgRestoreButton4.addClickListener(new ClickListener() { public void onClick(final Widget sender) { customImageFormSubmit(formPanel, imgUpload4, true, "BANNER_TEXT"); } }); // vertical panel vPanel.setStylePrimaryName("location-shib-form"); vPanel.add(new HTML("<h1>Upload Custom Images</h1>")); vPanel.add(new HTML( "To upload custom images, highlight the row on the grid then use the entry form below to upload your images.")); // add table to form formPanel.add(imageTable); vPanel.add(formPanel); // dock form // dockPanel.add(vPanel, DockPanel.SOUTH); RootPanel rootPanel = RootPanel.get("gwtRoot"); rootPanel.add(vPanel); }