List of usage examples for com.google.gwt.user.client.ui Label Label
protected Label(Element element)
From source file:com.audata.client.admin.SetPasswordDialog.java
License:Open Source License
public SetPasswordDialog(UserPanel parent) { this.setText(LANG.set_password_Text()); DockPanel outer = new DockPanel(); outer.setSpacing(4);//from w ww . j a va2s . co m outer.add(new Image("images/48x48/security.gif"), DockPanel.WEST); VerticalPanel formPanel = new VerticalPanel(); HorizontalPanel pass1Panel = new HorizontalPanel(); Label l1 = new Label(LANG.password_Text()); l1.addStyleName("audoc-label"); l1.setWidth("120px"); pass1Panel.add(l1); this.pass1 = new PasswordTextBox(); pass1Panel.add(this.pass1); formPanel.add(pass1Panel); HorizontalPanel pass2Panel = new HorizontalPanel(); Label l2 = new Label(LANG.password_reenter_Text()); l2.addStyleName("audoc-label"); l2.setWidth("120px"); pass2Panel.add(l2); this.pass2 = new PasswordTextBox(); pass2Panel.add(this.pass2); formPanel.add(pass2Panel); HorizontalPanel buttonPanel = new HorizontalPanel(); buttonPanel.setSpacing(5); this.setButton = new Button(LANG.set_password_Text()); this.setButton.addClickListener(this); buttonPanel.add(this.setButton); this.cancelButton = new Button(LANG.cancel_Text()); this.cancelButton.addClickListener(this); buttonPanel.add(this.cancelButton); formPanel.add(buttonPanel); formPanel.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT); outer.add(formPanel, DockPanel.SOUTH); formPanel.setSpacing(4); outer.setSpacing(8); setWidget(outer); }
From source file:com.audata.client.admin.UDFPanel.java
License:Open Source License
public UDFPanel() { this.setSize("100%", "100%"); //section title Label l = new Label(LANG.udf_Text()); l.addStyleName("audoc-sectionTitle"); this.add(l);/* w w w . j a v a 2 s .c o m*/ HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(5); //add UDF list String template = "<span class=\"audoc-udf-title\">#0</span><br/><span class=\"audoc-udf-type\">#1</span>"; this.userDFs = new HTMLButtonList("images/48x48/udf.gif", template, false); this.userDFs.addClickListener(this); this.userDFs.addStyleName("audoc-udfs"); this.userDFs.setPixelSize(200, 300); hp.add(this.userDFs); VerticalPanel form = new VerticalPanel(); form.addStyleName("audoc-form"); //name HorizontalPanel namePanel = new HorizontalPanel(); Label nameLabel = new Label(LANG.name_Text()); nameLabel.setWidth("100px"); namePanel.add(nameLabel); this.name = new TextBox(); namePanel.add(this.name); form.add(namePanel); //type HorizontalPanel typePanel = new HorizontalPanel(); Label typeLabel = new Label(LANG.type_Text()); typeLabel.setWidth("100px"); typePanel.add(typeLabel); this.types = new ListBox(); this.types.addChangeListener(this); this.popTypes(); typePanel.add(this.types); form.add(typePanel); //Keyword this.kwp = new HorizontalPanel(); this.kwp.setVisible(false); Label kwl = new Label(LANG.keywords_Text()); kwl.setWidth("100px"); this.kwp.add(kwl); this.keywords = new ListBox(); this.keywords.setVisibleItemCount(1); this.kwp.add(this.keywords); form.add(this.kwp); //buttons HorizontalPanel butPanel = new HorizontalPanel(); butPanel.setSpacing(5); this.addBut = new Button(LANG.new_Text()); this.addBut.addClickListener(this); butPanel.add(this.addBut); this.saveBut = new Button(LANG.save_Text()); this.saveBut.addClickListener(this); butPanel.add(this.saveBut); this.delBut = new Button(LANG.delete_Text()); this.delBut.addClickListener(this); butPanel.add(this.delBut); form.add(butPanel); hp.add(form); //Add hp to panel this.add(hp); //populate lists this.getUDFs(); this.getKWHs(); }
From source file:com.audata.client.admin.UserDialog.java
License:Open Source License
public UserDialog(UserPanel parent, String uuid, HashMap details) { this.parent = parent; this.uuid = uuid; if (this.uuid != "") { this.setText(LANG.edit_user_Text()); //call details } else {/*from w w w . jav a 2 s . c o m*/ this.setText(LANG.new_user_Text()); } //build empty VerticalPanel main = new VerticalPanel(); HorizontalPanel fname = new HorizontalPanel(); fname.setSpacing(5); Label flabel = new Label(LANG.forename_Text()); flabel.setWidth("150px"); fname.add(flabel); this.forename = new TextBox(); fname.add(this.forename); main.add(fname); HorizontalPanel sname = new HorizontalPanel(); sname.setSpacing(5); Label slabel = new Label(LANG.surname_Text()); slabel.setWidth("150px"); sname.add(slabel); this.surname = new TextBox(); sname.add(this.surname); main.add(sname); HorizontalPanel uname = new HorizontalPanel(); uname.setSpacing(5); Label ulabel = new Label(LANG.username_Text()); ulabel.setWidth("150px"); uname.add(ulabel); this.username = new TextBox(); uname.add(this.username); main.add(uname); if (this.uuid.equals("")) { HorizontalPanel p1 = new HorizontalPanel(); p1.setSpacing(5); Label p1label = new Label(LANG.password_Text()); p1label.setWidth("150px"); p1.add(p1label); this.pass1 = new PasswordTextBox(); p1.add(this.pass1); main.add(p1); HorizontalPanel p2 = new HorizontalPanel(); p2.setSpacing(5); Label p2label = new Label(LANG.password_reenter_Text()); p2label.setWidth("150px"); p2.add(p2label); this.pass2 = new PasswordTextBox(); p2.add(this.pass2); main.add(p2); } HorizontalPanel adminPanel = new HorizontalPanel(); adminPanel.setSpacing(5); Label adminlabel = new Label(LANG.is_admin_Text()); adminlabel.setWidth("150px"); adminPanel.add(adminlabel); this.isAdmin = new CheckBox(); adminPanel.add(this.isAdmin); main.add(adminPanel); HorizontalPanel levPanel = new HorizontalPanel(); levPanel.setSpacing(5); Label levlabel = new Label(LANG.security_level_Text()); levlabel.setWidth("150px"); levPanel.add(levlabel); this.secLevel = new ListBox(); levPanel.add(this.secLevel); main.add(levPanel); HorizontalPanel cavPanel = new HorizontalPanel(); cavPanel.setSpacing(5); Label cavlabel = new Label(LANG.security_caveats_Text()); cavlabel.setWidth("150px"); cavPanel.add(cavlabel); this.caveats = new ListBox(); this.caveats.setMultipleSelect(true); this.caveats.setVisibleItemCount(5); cavPanel.add(this.caveats); main.add(cavPanel); HorizontalPanel butPanel = new HorizontalPanel(); butPanel.setSpacing(5); this.saveBut = new Button(LANG.save_Text()); this.saveBut.addClickListener(this); butPanel.add(this.saveBut); this.cancelBut = new Button(LANG.cancel_Text()); this.cancelBut.addClickListener(this); butPanel.add(this.cancelBut); main.add(butPanel); this.popLists(); this.setWidget(main); //this.show(); int left = (Window.getClientWidth() - this.getOffsetWidth()) / 2; int top = (Window.getClientHeight() - this.getOffsetHeight()) / 2; this.setPopupPosition(left, top); if (details != null) { this.setValues(details); } }
From source file:com.audata.client.admin.UserPanel.java
License:Open Source License
public UserPanel() { this.dialog = new SetPasswordDialog(this); this.setSpacing(5); Label title = new Label(LANG.admin_user_Text()); title.addStyleName("audoc-sectionTitle"); this.add(title); String caption = "<span class=\"user-name\">#0 #1</span><br/>" + "<span class=\"user-username\">#2</span>"; this.usersBox = new HTMLButtonList("images/48x48/users.gif", caption, false); this.usersBox.addStyleName("audoc-users"); this.usersBox.setPixelSize(300, 250); this.usersBox.addClickListener(new UserClickListener(this)); this.add(this.usersBox); HorizontalPanel buttons = new HorizontalPanel(); buttons.setSpacing(5);//from w w w.j a va 2 s . c o m this.newUser = new Button(LANG.new_Text()); this.newUser.addClickListener(this); this.editUser = new Button(LANG.edit_Text()); this.editUser.addClickListener(this); this.delUser = new Button(LANG.delete_Text()); this.delUser.addClickListener(this); this.setPassword = new Button(LANG.set_password_Text()); this.setPassword.addClickListener(this); buttons.add(this.newUser); buttons.add(this.editUser); buttons.add(this.delUser); buttons.add(this.setPassword); this.add(buttons); this.getUsers(); }
From source file:com.audata.client.AuDoc.java
License:Open Source License
/** * Called when a user logs in/*from ww w . ja v a 2s. c o m*/ */ public void onLogin() { SecLoader.cacheCaveats(); SecLoader.cacheSecLevels(); HorizontalPanel panel = new HorizontalPanel(); panel.setSpacing(2); panel.setWidth("150px"); panel.add(new Image("images/16x16/users.gif")); Label name = new Label(AuDoc.state.getItem("surname") + ", " + AuDoc.state.getItem("forename")); name.setWidth("116px"); name.setHorizontalAlignment(HasAlignment.ALIGN_CENTER); name.addStyleName("audoc-userNote"); panel.add(name); Image logout = new Image("images/16x16/logout.gif"); logout.addStyleName("audoc-logoutButton"); logout.addClickListener(new LogoutListener(this)); panel.add(logout); RootPanel.get("user").add(panel); if (AuDoc.state.getItem("isAdmin") == "true") { this.adminButton.setVisible(true); } this.classBrowser.onUpdate(); this.trayPanel.onUpdate(); this.checkoutsPanel.onUpdate(); this.savedSearchPanel.onUpdate(); }
From source file:com.audata.client.AuDoc.java
License:Open Source License
/** * Adds a message to the debug panel/*from w ww .j a v a2 s . com*/ * @param msg the message to add */ public void setDebug(String msg) { RootPanel.get("Debug").add(new Label(msg)); }
From source file:com.audata.client.authentication.LoginDialog.java
License:Open Source License
public LoginDialog(AuDoc parent) { this.parent = parent; setText(CONSTANTS.welcome_Text()); // Create a DockPanel to contain the 'about' label and the 'OK' button. DockPanel outer = new DockPanel(); outer.setSpacing(4);//from w w w. j a va 2s . co m outer.add(new Image("images/48x48/security.gif"), DockPanel.WEST); VerticalPanel formPanel = new VerticalPanel(); formPanel.setSpacing(1); HorizontalPanel userPanel = new HorizontalPanel(); this.username = new TextBox(); Label l = new Label(CONSTANTS.username_Text()); l.addStyleName("audoc-label"); l.setWidth("85px"); userPanel.add(l); userPanel.add(this.username); formPanel.add(userPanel); HorizontalPanel passPanel = new HorizontalPanel(); this.password = new PasswordTextBox(); l = new Label(CONSTANTS.password_Text()); l.addStyleName("audoc-label"); l.setWidth("85px"); passPanel.add(l); passPanel.add(this.password); formPanel.add(passPanel); HorizontalPanel langPanel = new HorizontalPanel(); l = new Label(CONSTANTS.lang_Text()); l.addStyleName("audoc-label"); l.setWidth("85px"); langPanel.add(l); formPanel.add(langPanel); this.languages = new ListBox(); this.populateLocales(); this.languages.setWidth("146px"); langPanel.add(this.languages); this.languages.addChangeListener(new ChangeListener() { public void onChange(Widget sender) { //refreshes the browser in the selected locale Location loc = WindowUtils.getLocation(); String path = loc.getProtocol() + "//" + loc.getHost() + loc.getPath(); String locale = languages.getValue(languages.getSelectedIndex()); Window.open(path + "?locale=" + locale, "_self", ""); } }); this.loginButton = new Button(CONSTANTS.login_Text(), this); formPanel.add(loginButton); formPanel.setCellHorizontalAlignment(this.loginButton, HasAlignment.ALIGN_RIGHT); outer.add(formPanel, DockPanel.SOUTH); HTML text = new HTML(CONSTANTS.message_Text()); text.setStyleName("audoc-LoginDialogText"); outer.add(text, DockPanel.CENTER); // Add a bit of spacing and margin to the dock to keep the components from // being placed too closely together. outer.setSpacing(8); this.setWidget(outer); }
From source file:com.audata.client.checkout.CheckoutPanel.java
License:Open Source License
public CheckoutPanel(AuDoc parent) { this.setHorizontalAlignment(HasAlignment.ALIGN_CENTER); this.setWidth("100%"); this.records = new ArrayList(); Label l = new Label(LANG.no_rec_checkout_msg_Text()); l.addStyleName("audoc-treeLabel"); this.add(l);/*from ww w. j ava 2s . c o m*/ }
From source file:com.audata.client.checkout.CheckoutPanel.java
License:Open Source License
public void onLogout() { this.records.clear(); this.clear(); Label l = new Label(LANG.no_rec_checkout_msg_Text()); l.addStyleName("audoc-treeLabel"); this.add(l);//w w w.j a va 2 s . c o m }
From source file:com.audata.client.checkout.CheckoutPanel.java
License:Open Source License
public void paint() { this.clear(); if (this.records.size() > 0) { for (int i = 0; i < this.records.size(); i++) { this.add((HorizontalPanel) this.records.get(i)); }// w w w . ja v a 2 s .c o m } else { Label l = new Label(LANG.no_rec_checkout_msg_Text()); l.addStyleName("audoc-treeLabel"); this.add(l); } }