private void showEmptyContentIfNoData(int dataSize) { if (dataSize == 0) { root.setWidget(noContentLabel); } else { root.setWidget(transUnitTable); } }
/** * Skeleton of content creation * * @return */ protected Widget buildContent() { ScrollPanel uiContent = new ScrollPanel(); uiContent.setWidget(buildStepContent()); uiContent.setStylePrimaryName("blockContent"); uiContent.setSize("600px", "300px"); return uiContent; }
public void setWidget(Widget w) { // If there is already a widget, remove it. if (child != null) sp.remove(child); // Add the widget to the center of the cell. if (w != null) sp.setWidget(w); child = w; }
/** * Create a ScrollPanel that contains one widget * * @param widget * @return */ public static ScrollPanel scrollPanel(Widget widget) { ScrollPanel panel = GWT.create(ScrollPanel.class); panel.setWidget(widget); return panel; }
@Override public void setDisplay(HasRows display) { assert display instanceof Widget : "display must extend Widget"; scrollable.setWidget((Widget) display); super.setDisplay(display); }
@SuppressWarnings("deprecation") Rform( final ServiceInitialization si, final LoginScreen lscr, final UniversityForm ufm, final StudentData sdata) { misc mi = new misc(); mainForm = new VerticalPanel(); mainForm.setWidth("100%"); AbsolutePanel absolutePanel = new AbsolutePanel(); absolutePanel.setSize("1000px", "162px"); mainForm.add(absolutePanel); Button btnCancel = new Button("New button"); btnCancel.setStyleName("logout"); btnCancel.addClickHandler( new ClickHandler() { @SuppressWarnings("deprecation") public void onClick(ClickEvent event) { ufm.getTabPanel().remove(getMainForm()); ufm.getTabPanel().selectTab(0); } }); btnCancel.setText("Cancel"); absolutePanel.add(btnCancel, 936, 0); txSummary = new TextArea(); absolutePanel.add(txSummary, 157, 10); txSummary.setSize("246px", "39px"); cbApplicationStatus = new ListBox(); absolutePanel.add(cbApplicationStatus, 447, 20); cbApplicationStatus.setSize("166px", "22px"); mi.fillListBox(cbApplicationStatus, si, "data/applicationStatus.txt"); // updating department index si.getGuiDataServiceAsync() .getDepartmentIndex( sdata.getApplicationStatus(), "data/applicationStatus.txt", new AsyncCallback<Integer>() { @Override public void onFailure(Throwable caught) {} @Override public void onSuccess(Integer result) { if (result != -1) { cbApplicationStatus.setItemSelected(result, true); } } }); // update summary from the database txSummary.setText(mi.isNull(sdata.getSummary()) ? sdata.getSummary() : ""); Button btUpdate = new Button("New button"); btUpdate.setStyleName("logout"); btUpdate.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { StudentData sd = new StudentData(); sd.setSummary(txSummary.getText()); sd.setApplicationStatus( cbApplicationStatus.getItemText(cbApplicationStatus.getSelectedIndex())); // sdata.getAddress(); sd.setAddress(sdata.getAddress()); sd.setAppliedSchoolName(sdata.getAppliedSchoolName()); sd.setCity(sdata.getCity()); sd.setCountry(sdata.getCountry()); sd.setDepartment(sdata.getDepartment()); sd.setEmail(sdata.getEmail()); sd.setFirstName(sdata.getFirstName()); sd.setLastName(sdata.getLastName()); sd.setLemail(sdata.getLemail()); sd.setMajor(sdata.getMajor()); sd.setMiddleName(sdata.getMiddleName()); sd.setState(sdata.getState()); sd.setStudiedSchoolCity(sdata.getStudiedSchoolCity()); sd.setStudiedSchoolCountry(sdata.getStudiedSchoolCountry()); sd.setStudiedSchoolName(sdata.getStudiedSchoolName()); sd.setZip(sdata.getZip()); sd.setDate(sdata.getDate()); sd.setUcode(sdata.getUcode()); sd.setComboBox_1_1(sdata.getComboBox_1_1()); sd.setComboBox_1_2(sdata.getComboBox_1_2()); sd.setComboBox_1_3(sdata.getComboBox_1_3()); sd.setComboBox_1_4(sdata.getComboBox_1_4()); sd.setComboBox_1_5(sdata.getComboBox_1_5()); sd.setComboBox_1_6(sdata.getComboBox_1_6()); sd.setComboBox_1_7(sdata.getComboBox_1_7()); sd.setComboBox_1_8(sdata.getComboBox_1_8()); sd.setComboBox_2_1(sdata.getComboBox_2_1()); sd.setComboBox_2_2(sdata.getComboBox_2_2()); sd.setComboBox_2_3(sdata.getComboBox_2_3()); sd.setComboBox_2_4(sdata.getComboBox_2_4()); sd.setComboBox_2_5(sdata.getComboBox_2_5()); sd.setComboBox_2_6(sdata.getComboBox_2_6()); sd.setComboBox_2_7(sdata.getComboBox_2_7()); sd.setComboBox_2_8(sdata.getComboBox_2_8()); sd.setComboBox_3_1(sdata.getComboBox_3_1()); sd.setComboBox_3_2(sdata.getComboBox_3_2()); sd.setComboBox_3_3(sdata.getComboBox_3_3()); sd.setComboBox_3_4(sdata.getComboBox_3_4()); sd.setComboBox_3_5(sdata.getComboBox_3_5()); sd.setComboBox_3_6(sdata.getComboBox_3_6()); sd.setComboBox_3_7(sdata.getComboBox_3_7()); sd.setComboBox_3_8(sdata.getComboBox_3_8()); sd.setComboBox_4_1(sdata.getComboBox_4_1()); sd.setComboBox_4_2(sdata.getComboBox_4_2()); sd.setComboBox_4_3(sdata.getComboBox_4_3()); sd.setComboBox_4_4(sdata.getComboBox_4_4()); sd.setComboBox_4_5(sdata.getComboBox_4_5()); sd.setComboBox_4_6(sdata.getComboBox_4_6()); sd.setComboBox_4_7(sdata.getComboBox_4_7()); sd.setComboBox_4_8(sdata.getComboBox_4_8()); sd.setComboBox_5_1(sdata.getComboBox_5_1()); sd.setComboBox_5_2(sdata.getComboBox_5_2()); sd.setComboBox_5_3(sdata.getComboBox_5_3()); sd.setComboBox_5_4(sdata.getComboBox_5_4()); sd.setComboBox_5_5(sdata.getComboBox_5_5()); sd.setComboBox_5_6(sdata.getComboBox_5_6()); sd.setComboBox_5_7(sdata.getComboBox_5_7()); sd.setComboBox_5_8(sdata.getComboBox_5_8()); sd.setComboBox_6_1(sdata.getComboBox_6_1()); sd.setComboBox_6_2(sdata.getComboBox_6_2()); sd.setComboBox_6_3(sdata.getComboBox_6_3()); sd.setComboBox_6_4(sdata.getComboBox_6_4()); sd.setComboBox_6_5(sdata.getComboBox_6_5()); sd.setComboBox_6_6(sdata.getComboBox_6_6()); sd.setComboBox_6_7(sdata.getComboBox_6_7()); sd.setComboBox_6_8(sdata.getComboBox_6_8()); sd.setComboBox_7_1(sdata.getComboBox_7_1()); sd.setComboBox_7_2(sdata.getComboBox_7_2()); sd.setComboBox_7_3(sdata.getComboBox_7_3()); sd.setComboBox_7_4(sdata.getComboBox_7_4()); sd.setComboBox_7_5(sdata.getComboBox_7_5()); sd.setComboBox_7_6(sdata.getComboBox_7_6()); sd.setComboBox_7_7(sdata.getComboBox_7_7()); sd.setComboBox_7_8(sdata.getComboBox_7_8()); sd.setComboBox_8_1(sdata.getComboBox_8_1()); sd.setComboBox_8_2(sdata.getComboBox_8_2()); sd.setComboBox_8_3(sdata.getComboBox_8_3()); sd.setComboBox_8_4(sdata.getComboBox_8_4()); sd.setComboBox_8_5(sdata.getComboBox_8_5()); sd.setComboBox_8_6(sdata.getComboBox_8_6()); sd.setComboBox_8_7(sdata.getComboBox_8_7()); sd.setComboBox_8_8(sdata.getComboBox_8_8()); sd.setTextBox_1_1(sdata.getTextBox_1_1()); sd.setTextBox_1_2(sdata.getTextBox_1_2()); sd.setTextBox_1_3(sdata.getTextBox_1_3()); sd.setTextBox_1_4(sdata.getTextBox_1_4()); sd.setTextBox_1_5(sdata.getTextBox_1_5()); sd.setTextBox_1_6(sdata.getTextBox_1_6()); sd.setTextBox_1_7(sdata.getTextBox_1_7()); sd.setTextBox_1_8(sdata.getTextBox_1_8()); sd.setTextBox_1_1(sdata.getTextBox_1_1()); sd.setTextBox_1_2(sdata.getTextBox_1_2()); sd.setTextBox_1_3(sdata.getTextBox_1_3()); sd.setTextBox_1_4(sdata.getTextBox_1_4()); sd.setTextBox_1_5(sdata.getTextBox_1_5()); sd.setTextBox_1_6(sdata.getTextBox_1_6()); sd.setTextBox_1_7(sdata.getTextBox_1_7()); sd.setTextBox_1_8(sdata.getTextBox_1_8()); sd.setTextBox_2_1(sdata.getTextBox_2_1()); sd.setTextBox_2_2(sdata.getTextBox_2_2()); sd.setTextBox_2_3(sdata.getTextBox_2_3()); sd.setTextBox_2_4(sdata.getTextBox_2_4()); sd.setTextBox_2_5(sdata.getTextBox_2_5()); sd.setTextBox_2_6(sdata.getTextBox_2_6()); sd.setTextBox_2_7(sdata.getTextBox_2_7()); sd.setTextBox_2_8(sdata.getTextBox_2_8()); sd.setTextBox_3_1(sdata.getTextBox_3_1()); sd.setTextBox_3_2(sdata.getTextBox_3_2()); sd.setTextBox_3_3(sdata.getTextBox_3_3()); sd.setTextBox_3_4(sdata.getTextBox_3_4()); sd.setTextBox_3_5(sdata.getTextBox_3_5()); sd.setTextBox_3_6(sdata.getTextBox_3_6()); sd.setTextBox_3_7(sdata.getTextBox_3_7()); sd.setTextBox_3_8(sdata.getTextBox_3_8()); sd.setTextBox_4_1(sdata.getTextBox_4_1()); sd.setTextBox_4_2(sdata.getTextBox_4_2()); sd.setTextBox_4_3(sdata.getTextBox_4_3()); sd.setTextBox_4_4(sdata.getTextBox_4_4()); sd.setTextBox_4_5(sdata.getTextBox_4_5()); sd.setTextBox_4_6(sdata.getTextBox_4_6()); sd.setTextBox_4_7(sdata.getTextBox_4_7()); sd.setTextBox_4_8(sdata.getTextBox_4_8()); sd.setTextBox_5_1(sdata.getTextBox_5_1()); sd.setTextBox_5_2(sdata.getTextBox_5_2()); sd.setTextBox_5_3(sdata.getTextBox_5_3()); sd.setTextBox_5_4(sdata.getTextBox_5_4()); sd.setTextBox_5_5(sdata.getTextBox_5_5()); sd.setTextBox_5_6(sdata.getTextBox_5_6()); sd.setTextBox_5_7(sdata.getTextBox_5_7()); sd.setTextBox_5_8(sdata.getTextBox_5_8()); sd.setTextBox_6_1(sdata.getTextBox_6_1()); sd.setTextBox_6_2(sdata.getTextBox_6_2()); sd.setTextBox_6_3(sdata.getTextBox_6_3()); sd.setTextBox_6_4(sdata.getTextBox_6_4()); sd.setTextBox_6_5(sdata.getTextBox_6_5()); sd.setTextBox_6_6(sdata.getTextBox_6_6()); sd.setTextBox_6_7(sdata.getTextBox_6_7()); sd.setTextBox_6_8(sdata.getTextBox_6_8()); sd.setTextBox_7_1(sdata.getTextBox_7_1()); sd.setTextBox_7_2(sdata.getTextBox_7_2()); sd.setTextBox_7_3(sdata.getTextBox_7_3()); sd.setTextBox_7_4(sdata.getTextBox_7_4()); sd.setTextBox_7_5(sdata.getTextBox_7_5()); sd.setTextBox_7_6(sdata.getTextBox_7_6()); sd.setTextBox_7_7(sdata.getTextBox_7_7()); sd.setTextBox_7_8(sdata.getTextBox_7_8()); sd.setTextBox_8_1(sdata.getTextBox_8_1()); sd.setTextBox_8_2(sdata.getTextBox_8_2()); sd.setTextBox_8_3(sdata.getTextBox_8_3()); sd.setTextBox_8_4(sdata.getTextBox_8_4()); sd.setTextBox_8_5(sdata.getTextBox_8_5()); sd.setTextBox_8_6(sdata.getTextBox_8_6()); sd.setTextBox_8_7(sdata.getTextBox_8_7()); sd.setTextBox_8_8(sdata.getTextBox_8_8()); try { si.getStudentDataServiceAsync() .addRegStudentData( sdata, sd, new AsyncCallback<String>() { @Override public void onFailure(Throwable caught) { Window.alert("error from server"); } @Override public void onSuccess(String result) { if (result != null) { if (result.equals("ok")) { Window.alert("Changed applied "); } } } }); } catch (LoggedInException e) { e.printStackTrace(); } } }); btUpdate.setText("Update"); absolutePanel.add(btUpdate, 646, 18); // retrieve image from server ImageData id = new ImageData(); id.setEmail(sdata.getEmail()); id.setFirstName(sdata.getFirstName()); id.setLastName(sdata.getLastName()); id.setName("sem1"); try { si.getImageDataServiceAsync() .readAllImage( id, new AsyncCallback<String[]>() { @Override public void onFailure(Throwable caught) {} @Override public void onSuccess(String[] result) { String[] vid = result; gid = result; if (vid != null) { for (int i = 0; i < vid.length; i++) { if (vid[i] == null) { continue; } long img = Long.parseLong(vid[i]); switch (i) { case 0: { if (img != 0L) { btnSem1.setEnabled(true); } break; } case 1: { if (img != 0L) { btnSem2.setEnabled(true); } break; } case 2: { if (img != 0L) { btnSem3.setEnabled(true); } break; } case 3: { if (img != 0L) { btnSem4.setEnabled(true); } break; } case 4: { if (img != 0L) { btnSem5.setEnabled(true); } break; } case 5: { if (img != 0L) { btnSem6.setEnabled(true); } break; } case 6: { if (img != 0L) { btnSem7.setEnabled(true); } break; } case 7: { if (img != 0L) { btnSem8.setEnabled(true); } break; } } } } } }); } catch (LoggedInException e) { e.printStackTrace(); } btnSem1 = new Button("New button"); btnSem1.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { Window.open( GWT.getModuleBaseURL() + "imgsource?id=" + Long.parseLong(gid[0]), "_blank", null); } }); btnSem1.setEnabled(false); btnSem1.setText("Semester 1"); absolutePanel.add(btnSem1, 10, 70); btnSem2 = new Button("New button"); btnSem2.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { Window.open( GWT.getModuleBaseURL() + "imgsource?id=" + Long.parseLong(gid[1]), "_blank", null); } }); btnSem2.setEnabled(false); btnSem2.setText("Semester 2"); absolutePanel.add(btnSem2, 107, 70); btnSem3 = new Button("New button"); btnSem3.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { Window.open( GWT.getModuleBaseURL() + "imgsource?id=" + Long.parseLong(gid[2]), "_blank", null); } }); btnSem3.setEnabled(false); btnSem3.setText("Semester 3"); absolutePanel.add(btnSem3, 202, 70); btnSem4 = new Button("New button"); btnSem4.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { Window.open( GWT.getModuleBaseURL() + "imgsource?id=" + Long.parseLong(gid[3]), "_blank", null); } }); btnSem4.setEnabled(false); btnSem4.setText("Semester 4"); absolutePanel.add(btnSem4, 298, 70); btnSem5 = new Button("New button"); btnSem5.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { Window.open( GWT.getModuleBaseURL() + "imgsource?id=" + Long.parseLong(gid[4]), "_blank", null); } }); btnSem5.setEnabled(false); btnSem5.setText("Semester 5"); absolutePanel.add(btnSem5, 10, 116); btnSem6 = new Button("New button"); btnSem6.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { Window.open( GWT.getModuleBaseURL() + "imgsource?id=" + Long.parseLong(gid[5]), "_blank", null); } }); btnSem6.setEnabled(false); btnSem6.setText("Semester 6"); absolutePanel.add(btnSem6, 107, 116); btnSem7 = new Button("New button"); btnSem7.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { Window.open( GWT.getModuleBaseURL() + "imgsource?id=" + Long.parseLong(gid[6]), "_blank", null); } }); btnSem7.setEnabled(false); btnSem7.setText("Semester 7"); absolutePanel.add(btnSem7, 202, 116); btnSem8 = new Button("New button"); btnSem8.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { Window.open( GWT.getModuleBaseURL() + "imgsource?id=" + Long.parseLong(gid[7]), "_blank", null); } }); btnSem8.setEnabled(false); btnSem8.setText("Semester 8"); absolutePanel.add(btnSem8, 298, 116); ScrollPanel scrollPanel = new ScrollPanel(); mainForm.add(scrollPanel); String univ = sdata.getAddress(); String dept = sdata.getDepartment(); HTML html = new HTML( "<hr/><br/> <b> Application Status : </b>" + "<font size=" + 3 + " color=red>" + sdata.getApplicationStatus() + "</font>" + "<br/> <b> Summary : </b>" + "<font size=" + 3 + " color=red>" + sdata.getSummary() + "</font>" + "<hr/> <b>School Name: </b>" + "<font size=" + 3 + " color=Black>" + sdata.getAppliedSchoolName() + "</font>" + "<br/> <b> Department: </b>" + "<font size=" + 3 + " color=Black>" + sdata.getDepartment() + "</font>" + "<br/> <b>Major: </b>" + "<font size=" + 3 + " color=Black>" + sdata.getMajor() + "</font>" // +"<br/> <b>Graduation Date: // </b>"+DateTimeFormat.getFormat("MM/dd/yyyy").format(sdata.getDateGraduation()) + "<br/> <b>Graduation Date: </b>" + "<font size=" + 3 + " color=Black>" + sdata.getDateGraduation() + "</font>" + "<br/> <b>Comment: </b>" + "<font size=" + 3 + " color=Black>" + sdata.getTxtComment() + "</font>" + "<hr/> <br/> <b> FirstName: </b>" + "<font size=" + 3 + " color=orange>" + sdata.getFirstName() + "</font>" + "<span style=" + "padding-left:50px><b>MiddleName: </b>" + "<font size=" + 3 + " color=orange>" + sdata.getMiddleName() + "</font>" + "<span>" + "<span style=" + "padding-left:50px><b>LastName: </b>" + "<font size=" + 3 + " color=orange>" + sdata.getLastName() + "</font>" + "<span>" + "<br/> <b> Address: </b>" + "<font size=" + 3 + " color=orange>" + sdata.getAddress() + "</font>" + "<br/> <b> City: </b>" + "<font size=" + 3 + " color=orange>" + sdata.getCity() + "</font>" + "<br/> <b> State: </b>" + "<font size=" + 3 + " color=orange>" + sdata.getState() + "</font>" + "<br/> <b> Zip: </b>" + "<font size=" + 3 + " color=orange>" + sdata.getZip() + "</font>" + "<br/> <b> Country: </b>" + "<font size=" + 3 + " color=orange>" + sdata.getCountry() + "</font>" + "<br/> <b> Email: </b>" + "<font size=" + 3 + " color=orange>" + sdata.getEmail() + "</font>" + "<br/> <b> School Name: </b>" + "<font size=" + 3 + " color=orange>" + sdata.getStudiedSchoolName() + "</font>" + "<br/> <b> City: </b>" + "<font size=" + 3 + " color=orange>" + sdata.getStudiedSchoolCity() + "</font>" + "<br/> <b> Country: </b>" + "<font size=" + 3 + " color=orange>" + sdata.getStudiedSchoolCountry() + "</font>" + "<hr/><table border=" + "1>" + "<tr>" + "<td>" + "<b> Semester 1 </b>" + "</td>" + "<td>" + "<b> Semester 2 </b>" + "</td>" + "<td>" + "<b> Semester 3 </b>" + "</td>" + "<td>" + "<b> Semester 4 </b>" + "</td>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_1_1() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_1_1() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_2_1() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_2_1() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_3_1() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_3_1() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_4_1() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_4_1() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_1_2() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_1_2() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_2_2() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_2_2() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_3_2() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_3_2() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_4_2() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_4_2() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_1_3() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_1_3() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_2_3() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_2_3() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_3_3() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_3_3() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_4_3() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_4_3() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_1_4() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_1_4() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_2_4() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_2_4() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_3_4() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_3_4() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_4_4() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_4_4() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_1_5() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_1_5() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_2_5() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_2_5() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_3_5() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_3_5() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_4_5() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_4_5() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_1_6() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_1_6() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_2_6() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_2_6() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_3_6() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_3_6() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_4_6() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_4_6() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_1_7() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_1_7() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_2_7() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_2_7() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_3_7() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_3_7() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_4_7() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_4_7() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_1_8() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_1_8() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_2_8() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_2_8() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_3_8() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_3_8() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_4_8() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_4_8() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + ":" + "</td>" + "<td>" + ":" + "</td>" + "<td>" + ":" + "</td>" + "<td>" + ":" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<b> Semester 5 </b>" + "</td>" + "<td>" + "<b> Semester 6 </b>" + "</td>" + "<td>" + "<b> Semester 7 </b>" + "</td>" + "<td>" + "<b> Semester 8 </b>" + "</td>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_5_1() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_5_1() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_6_1() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_6_1() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_7_1() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_7_1() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_8_1() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_8_1() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_5_2() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_5_2() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_6_2() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_6_2() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_7_2() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_7_2() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_8_2() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_8_2() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_5_3() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_5_3() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_6_3() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_6_3() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_7_3() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_7_3() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_8_3() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_8_3() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_5_4() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_5_4() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_6_4() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_6_4() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_7_4() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_7_4() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_8_4() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_8_4() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_5_5() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_5_5() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_6_5() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_6_5() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_7_5() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_7_5() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_8_5() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_8_5() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_5_6() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_5_6() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_6_6() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_6_6() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_7_6() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_7_6() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_8_6() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_8_6() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_5_7() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_5_7() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_6_7() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_6_7() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_7_7() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_7_7() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_8_7() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_8_7() + "</font>" + "</td>" + "</tr>" + "<tr>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_5_8() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_5_8() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_6_8() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_6_8() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_7_8() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_7_8() + "</font>" + "</td>" + "<td>" + "<font size=" + 3 + " color=green>" + sdata.getComboBox_8_8() + "</font>" + ":" + "<font size=" + 3 + " color=green>" + sdata.getTextBox_8_8() + "</font>" + "</td>" + "</tr>" + "</table>", true); scrollPanel.setWidget(html); html.setSize("100%", "100%"); }
public LogTextPanel( final String debugId, final TabItemConfig config, final LogTabPanel logTabPanel) { this.debugId = debugId; setHeaderVisible(false); setCollapsible(false); setContextMenu(contextMenu); stop = new MenuItem( "停止运行", new SelectionHandler<MenuItem>() { @Override public void onSelection(final SelectionEvent<MenuItem> se) { final MessageBox box = new MessageBox("停止调试?", "确定要停止调试么?"); box.setPredefinedButtons(PredefinedButton.YES, PredefinedButton.NO); box.setIcon(MessageBox.ICONS.question()); box.addHideHandler( new HideHandler() { @Override public void onHide(HideEvent event) { Dialog btn = (Dialog) event.getSource(); String choice = btn.getHideButton().getItemId(); if (choice.equalsIgnoreCase("yes")) { debugService.cancelDebug( debugId, new AsyncCallback<Void>() { @Override public void onSuccess(Void result) { se.getSelectedItem().setEnabled(false); } @Override public void onFailure(Throwable caught) { Window.alert("取消调试失败!\n原因:" + caught); } }); } } }); box.show(); } }); contextMenu.add(stop); html.addStyleName("console-font"); logTextScrollPanel.setWidget(html); this.add(logTextScrollPanel); timer = new Timer() { public void run() { final LogTextPanel logTextPanel = LogTextPanel.this; debugService.getHistoryModel( debugId, new AsyncCallback<DebugHistoryModel>() { @Override public void onSuccess(DebugHistoryModel result) { // 刷新日志 String[] lines = result.getLog().split("\n"); StringBuffer sb = new StringBuffer(); for (String line : lines) { for (long i = 1; i < 9; i++) { line = line.replace((char) ('\u0000' + i), (char) ('\u245f' + i)); } String job = ToolUtil.extractJobId(line); if (job != null) { String newline = line.replaceFirst( job, "<a target='_blank' href='http://10.249.54.103:50030/jobdetails.jsp?jobid=" + job + "&refresh=30'>" + job + "</a>"); sb.append(newline + "<br/>"); } else { sb.append(line + "<br/>"); } } // 不在底部的时候不自动滚动 boolean needScroll = (logTextScrollPanel.getMaximumVerticalScrollPosition() - logTextScrollPanel.getVerticalScrollPosition() < 14); // 判断后才把新内容填进去 html.setHTML(sb.toString()); if (needScroll) { logTextScrollPanel.scrollToBottom(); } // 更新状态 if (result.getStatus().equals(DebugHistoryModel.Status.SUCCESS)) { config.setIcon(Images.getImageResources().traffic_green()); stop.setEnabled(false); isRunning = false; cancel(); } else if (result.getStatus().equals(DebugHistoryModel.Status.FAILED)) { config.setIcon(Images.getImageResources().traffic_red()); stop.setEnabled(false); isRunning = false; cancel(); } else { config.setIcon(Images.getImageResources().processingIcon()); stop.setEnabled(true); isRunning = true; } logTabPanel.update(logTextPanel, config); } @Override public void onFailure(Throwable caught) { // 忽略日志刷新失败 } }); } }; timer.scheduleRepeating(2000); }
public void onModuleLoad() { RootPanel RootTXOriginal = RootPanel.get(); RootPanel RootMenu = RootPanel.get("Menu"); RootTXOriginal.setSize("100%", "100%"); RootMenu.setStyleName("Root"); RootTXOriginal.setStyleName("Root"); YO = this; MenuBar menuBar = new MenuBar(false); RootMenu.add(menuBar); menuBar.setWidth("100%"); MenuItem menuItem = new MenuItem("GroupAdministration", false, (Command) null); menuItem.setHTML("Users Administrator"); menuItem.setEnabled(false); menuBar.addItem(menuItem); MenuItemSeparator separator = new MenuItemSeparator(); menuBar.addSeparator(separator); MenuItem mntmBack = new MenuItem( "Back", false, new Command() { public void execute() { Controlador.change2Administrator(); } }); menuBar.addItem(mntmBack); MenuItem AddLots = new MenuItem( "Masive add", false, new Command() { public void execute() { PanelAddMasibo PAM = new PanelAddMasibo(YO); PAM.setVisible(true); PAM.center(); } }); AddLots.setHTML("Masive add"); menuBar.addItem(AddLots); HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel(); RootTXOriginal.add(horizontalSplitPanel, 0, 25); horizontalSplitPanel.setSize("100%", "100%"); VerticalPanel verticalPanel = new VerticalPanel(); horizontalSplitPanel.setLeftWidget(verticalPanel); verticalPanel.setSize("100%", ""); SimplePanel simplePanel = new SimplePanel(); verticalPanel.add(simplePanel); HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); simplePanel.setWidget(horizontalPanel); horizontalPanel.setSize("100%", "100%"); textBox = new TextBox(); textBox.setVisibleLength(50); horizontalPanel.add(textBox); textBox.setWidth("90%"); Button btnNewButton = new Button("New button"); btnNewButton.setText("+"); btnNewButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenter"); } }); btnNewButton.addMouseDownHandler( new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterPush"); } }); btnNewButton.addMouseOutHandler( new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenter"); } }); btnNewButton.addMouseOverHandler( new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterOver"); } }); btnNewButton.setStyleName("gwt-ButtonCenter"); btnNewButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { String S = ClearText(textBox.getText()); if (isValidEmail(S)) addText(S); else Window.alert(ErrorConstants.ERROR_NO_EMAIL_VALIDO + S); textBox.setText(""); } private native boolean isValidEmail(String email) /*-{ var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid return !reg1.test(email) && reg2.test(email); }-*/; }); horizontalPanel.add(btnNewButton); btnNewButton.setWidth("66px"); btnNewButton.setHTML("+"); verticalPanel_1 = new VerticalPanel(); verticalPanel.add(verticalPanel_1); verticalPanel_1.setWidth("100%"); SaveNewUsers = new Button("Save New Users"); SaveNewUsers.setVisible(false); SaveNewUsers.addClickHandler( new ClickHandler() { private AsyncCallback<Boolean> callback; public void onClick(ClickEvent event) { Pilallamada = new Stack<UserApp>(); int Elementos_a_salvar = verticalPanel_1.getWidgetCount(); for (int i = 0; i < Elementos_a_salvar; i++) { Widget Uno = verticalPanel_1.getWidget(i); Button Dos = (Button) Uno; String Nombre = Dos.getText(); Pilallamada.add(new UserApp(Nombre, Constants.STUDENT)); } if (!Pilallamada.isEmpty()) { callback = new AsyncCallback<Boolean>() { public void onFailure(Throwable caught) { Window.alert("The user could not be saved at this moment"); LoadingPanel.getInstance().hide(); } public void onSuccess(Boolean result) { LoadingPanel.getInstance().hide(); if (!result) Window.alert( "The user " + Pilallamada.peek().getEmail() + " already exists (if you do not see him/her it's because he may be administrator)"); Pilallamada.pop(); if (!Pilallamada.isEmpty()) { LoadingPanel.getInstance().center(); LoadingPanel.getInstance().setLabelTexto("Saving..."); bookReaderServiceHolder.saveUser(Pilallamada.peek(), callback); } else { refreshPanel(); } } }; LoadingPanel.getInstance().center(); LoadingPanel.getInstance().setLabelTexto("Saving..."); bookReaderServiceHolder.saveUser(Pilallamada.peek(), callback); } verticalPanel_1.clear(); SaveNewUsers.setVisible(false); } }); SaveNewUsers.addMouseDownHandler( new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonBottonSavePush"); } }); SaveNewUsers.addMouseOutHandler( new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonBottonSave"); } }); SaveNewUsers.addMouseOverHandler( new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonBottonSaveOver"); } }); SaveNewUsers.setStyleName("gwt-ButtonBottonSave"); // SaveNewUsers.setStyleName("gwt-MenuItemMio"); verticalPanel.add(SaveNewUsers); SaveNewUsers.setSize("100%", "100%"); ScrollPanel scrollPanel = new ScrollPanel(); horizontalSplitPanel.setRightWidget(scrollPanel); scrollPanel.setSize("100%", "100%"); stackPanel_1 = new StackPanelMio(); scrollPanel.setWidget(stackPanel_1); // simplePanel.add(stackPanel_1); stackPanel_1.setBotonTipo(new BotonesStackPanelUsersMio("prototipo", new VerticalPanel())); stackPanel_1.setBotonClick( new ClickHandler() { public void onClick(ClickEvent event) { Long Nombre = ((BotonesStackPanelUsersMio) event.getSource()).getEntidad().getID(); LoadingPanel.getInstance().center(); LoadingPanel.getInstance().setLabelTexto("Loading..."); bookReaderServiceHolder.loadUserById( Nombre, new AsyncCallback<UserApp>() { public void onFailure(Throwable caught) { LoadingPanel.getInstance().hide(); } public void onSuccess(UserApp result) { LoadingPanel.getInstance().hide(); if (result.getGroupIds() == null) result.setGroupIds(new ArrayList<Long>()); if (!result.getGroupIds().isEmpty()) if (Window.confirm( InformationConstants.ARE_YOU_SURE_DELETE_USER + result.getGroupIds().size() + InformationConstants.ARE_YOU_SURE_DELETE_USER2)) remove(result.getId()); else { } else { if (Window.confirm( "Are you sure you want to delete this user?, he is not a member of any group")) remove(result.getId()); } } }); } private void remove(Long userId) { LoadingPanel.getInstance().center(); LoadingPanel.getInstance().setLabelTexto("Deleting..."); bookReaderServiceHolder.deleteUserApp( userId, new AsyncCallback<Integer>() { public void onFailure(Throwable caught) { LoadingPanel.getInstance().hide(); Window.alert("Sorry but the user could not be removed, try again later"); } public void onSuccess(Integer result) { LoadingPanel.getInstance().hide(); refreshPanel(); } }); } }); LoadingPanel.getInstance().center(); LoadingPanel.getInstance().setLabelTexto("Loading..."); bookReaderServiceHolder.getUsersApp( new AsyncCallback<ArrayList<UserApp>>() { public void onFailure(Throwable caught) { LoadingPanel.getInstance().hide(); } public void onSuccess(ArrayList<UserApp> result) { LoadingPanel.getInstance().hide(); if (result.size() < 10) { for (UserApp User1 : result) { String Bienvenida; if ((User1.getName() != null) && (!User1.getName().isEmpty())) Bienvenida = User1.getName(); else Bienvenida = User1.getEmail(); EntidadUser E = new EntidadUser(Bienvenida, User1.getId()); stackPanel_1.addBotonLessTen(E); } } else { for (UserApp User1 : result) { String Bienvenida; if ((User1.getName() != null) && (!User1.getName().isEmpty())) Bienvenida = User1.getName(); else Bienvenida = User1.getEmail(); EntidadUser E = new EntidadUser(Bienvenida, User1.getId()); stackPanel_1.addBoton(E); } } stackPanel_1.setSize("100%", "100%"); stackPanel_1.ClearEmpty(); } }); stackPanel_1.setSize("100%", "100%"); }