List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setSpacing
public void setSpacing(int spacing)
From source file:com.audata.client.admin.SecurityPanel.java
License:Open Source License
/** * Creates the Caveat admin panel/*from ww w .jav a 2s .c o m*/ * @return VerticalPanel containing Caveat functions */ private VerticalPanel buildCaveatPanel() { VerticalPanel cp = new VerticalPanel(); cp.setSpacing(5); cp.addStyleName("audoc-group"); Label caveatTitle = new Label(LANG.security_caveats_Text()); caveatTitle.addStyleName("audoc-sectionTitle"); String cavCaption = "<span class=\"caveat-title\">#0</span>"; this.caveatList = new HTMLButtonList("images/48x48/security.gif", cavCaption, false); this.caveatList.addStyleName("audoc-caveats"); this.caveatList.addClickListener(new CaveatClickListener(this)); this.caveatList.setPixelSize(250, 200); cp.add(caveatTitle); cp.add(this.caveatList); HorizontalPanel namePanel = new HorizontalPanel(); Label nameLabel = new Label(LANG.name_Text()); nameLabel.setWidth("100px"); nameLabel.addStyleName("audoc-label"); this.cavName = new TextBox(); namePanel.add(nameLabel); namePanel.add(this.cavName); cp.add(namePanel); HorizontalPanel buttonPanel = new HorizontalPanel(); buttonPanel.setSpacing(5); this.newCavButton = new Button(LANG.new_Text()); this.newCavButton.addClickListener(this); this.saveCavButton = new Button(LANG.save_Text()); this.saveCavButton.addClickListener(this); this.delCavButton = new Button(LANG.delete_Text()); this.delCavButton.addClickListener(this); buttonPanel.add(this.newCavButton); buttonPanel.add(this.saveCavButton); buttonPanel.add(this.delCavButton); cp.add(buttonPanel); return cp; }
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);// w w w . j a v a 2 s . c om 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);//from w w w . ja 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. j av a2 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); 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
/** * Builds the menu bar panel//from www . ja v a 2 s . c om * @return HorizontalPanel containing the menu bar */ private HorizontalPanel buildMenu() { HorizontalPanel menu = new HorizontalPanel(); menu.addStyleName("menu"); menu.setWidth("100%"); menu.setHorizontalAlignment(HasAlignment.ALIGN_LEFT); menu.setVerticalAlignment(HasAlignment.ALIGN_BOTTOM); menu.setSpacing(4); CaptionButton cb = new CaptionButton(); cb.setImageUrl("images/48x48/home.gif"); cb.setCaptionText(LANG.home_Text()); cb.setOrientation(DockPanel.SOUTH); cb.addClickListener(new MenuClickListener(this, AuDoc.SECTION_HOME)); cb.setTitle(LANG.home_title_Text()); menu.add(cb); CaptionButton cb_1 = new CaptionButton(); cb_1.setImageUrl("images/48x48/search.gif"); cb_1.setCaptionText(LANG.search_Text()); cb_1.setOrientation(DockPanel.SOUTH); cb_1.addClickListener(new MenuClickListener(this, AuDoc.SECTION_SEARCH)); cb_1.setTitle(LANG.search_title_Text()); menu.add(cb_1); CaptionButton cb_2 = new CaptionButton(); cb_2.addCaptionStyleName("nowrap"); cb_2.setOrientation(DockPanel.SOUTH); cb_2.setImageUrl("images/48x48/newrec.gif"); cb_2.setCaptionText(LANG.newrec_Text()); cb_2.addClickListener(new MenuClickListener(this, AuDoc.SECTION_NEW)); cb_2.setTitle(LANG.newrec_title_Text()); menu.add(cb_2); CaptionButton cb_3 = new CaptionButton(); cb_3.setImageUrl("images/48x48/reports.gif"); cb_3.setCaptionText(LANG.report_Text()); cb_3.setOrientation(DockPanel.SOUTH); cb_3.addClickListener(new MenuClickListener(this, AuDoc.SECTION_REPORT)); cb_3.setTitle(LANG.report_title_Text()); menu.add(cb_3); CaptionButton cb_4 = new CaptionButton(); cb_4.setImageUrl("images/48x48/checkout.gif"); cb_4.setCaptionText(LANG.rapid_title_Text()); cb_4.setOrientation(DockPanel.SOUTH); cb_4.addClickListener(new MenuClickListener(this, AuDoc.SECTION_RAPID)); cb_4.setTitle(LANG.rapid_title_Text()); menu.add(cb_4); this.adminButton = new CaptionButton(); this.adminButton.setImageUrl("images/48x48/admin.gif"); this.adminButton.setCaptionText(LANG.admin_Text()); this.adminButton.setOrientation(DockPanel.SOUTH); this.adminButton.setVisible(false); this.adminButton.addClickListener(new MenuClickListener(this, AuDoc.SECTION_ADMIN)); this.adminButton.setTitle(LANG.admin_title_Text()); menu.add(this.adminButton); menu.setCellWidth(this.adminButton, "100%"); menu.setCellHorizontalAlignment(this.adminButton, HasAlignment.ALIGN_RIGHT); return menu; }
From source file:com.audata.client.AuDoc.java
License:Open Source License
/** * Called when a user logs in//from w w w .j ava 2 s . c om */ 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.checkout.CheckinDialog.java
License:Open Source License
public CheckinDialog(String uuid, String name) { this.uuid = uuid; this.name = name; this.setText(LANG.check_in_msg_Text() + ": " + this.name); VerticalPanel main = new VerticalPanel(); main.setSize("100%", "100%"); main.setSpacing(3);/*from ww w .j av a 2 s .c om*/ main.setHorizontalAlignment(HasAlignment.ALIGN_LEFT); this.undo = new RadioButton("ActionGroup", LANG.check_in_Text()); this.checkin = new RadioButton("ActionGroup", LANG.check_in_version_Text()); this.undo.setChecked(true); this.undo.addClickListener(this); this.checkin.addClickListener(this); main.add(this.undo); main.add(this.checkin); this.upload = new UploadPanel(); String url = AuDoc.jsonCall.getURL(); this.upload.setAction(url + "docIO.php"); this.upload.setEncoding(FormPanel.ENCODING_MULTIPART); this.upload.setMethod(FormPanel.METHOD_POST); this.upload.setVisible(false); main.add(upload); HorizontalPanel buttons = new HorizontalPanel(); buttons.setSpacing(3); this.ok = new Button(LANG.ok_Text()); this.ok.addClickListener(this); buttons.add(this.ok); this.cancel = new Button(LANG.cancel_Text()); this.cancel.addClickListener(this); buttons.add(this.cancel); main.add(buttons); main.setCellHorizontalAlignment(buttons, HasAlignment.ALIGN_RIGHT); this.setWidget(main); }
From source file:com.audata.client.checkout.CheckoutPanel.java
License:Open Source License
public void addRecord(String uuid, String title, String recordType, String cot) { HorizontalPanel hp = new HorizontalPanel(); hp.setWidth("100%"); hp.setSpacing(3); //CaptionButton button = new CaptionButton("images/16x16/treerec.gif",title, CaptionButton.CAPTION_EAST); CaptionButton button = new CaptionButton(); button.setImageUrl("images/16x16/treerec.gif"); button.setCaptionText(title);/*from w ww. j a va 2 s . c o m*/ button.addClickListener(new CheckoutClickListener(this, uuid, recordType, cot)); Image cButton = new Image("images/16x16/checkouts.gif"); cButton.addClickListener(new CheckinClickListener(uuid, title)); cButton.setTitle(LANG.check_in_Text() + " " + title); cButton.addStyleName("hand"); hp.add(button); hp.add(cButton); hp.setCellVerticalAlignment(cButton, HasAlignment.ALIGN_MIDDLE); this.records.add(hp); }
From source file:com.audata.client.feedback.SimpleDialog.java
License:Open Source License
private SimpleDialog(int type, String title, String message, ResponseListener listener) { this.listener = listener; this.type = type; this.setText(title); this.addStyleName("audoc-simpleDialog"); DockPanel main = new DockPanel(); main.setSpacing(4);//from ww w. j a v a2s .c om HorizontalPanel butPanel = new HorizontalPanel(); butPanel.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT); butPanel.setSpacing(4); switch (type) { case SimpleDialog.TYPE_ERROR: main.add(new Image("images/48x48/error.gif"), DockPanel.WEST); this.close = new Button("Close"); this.close.addClickListener(this); butPanel.add(this.close); break; case SimpleDialog.TYPE_MESSAGE: main.add(new Image("images/48x48/udf.gif"), DockPanel.WEST); this.close = new Button("Close"); this.close.addClickListener(this); butPanel.add(this.close); break; case SimpleDialog.TYPE_QUERY: main.add(new Image("images/48x48/help.gif"), DockPanel.WEST); this.ok = new Button("Ok"); this.ok.addClickListener(this); this.cancel = new Button("Cancel"); this.cancel.addClickListener(this); butPanel.add(this.ok); butPanel.add(this.cancel); break; } VerticalPanel p = new VerticalPanel(); p.setSpacing(15); p.add(new Label(message)); p.add(butPanel); p.setCellHorizontalAlignment(butPanel, HasAlignment.ALIGN_RIGHT); main.add(p, DockPanel.EAST); this.setWidget(main); this.setPopupPosition(0, 0); }