List of usage examples for com.google.gwt.user.client.ui HorizontalPanel add
@Override public void add(Widget w)
From source file:com.audata.client.admin.ClassificationPanel.java
License:Open Source License
/** * Public constructor of Classification/*from www.j a v a 2s . c om*/ * Admin panel * */ public ClassificationPanel() { this.setSpacing(5); this.setSize("100%", "100%"); // add section title Label l = new Label(LANG.classification_Text()); l.addStyleName("audoc-sectionTitle"); this.add(l); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(10); hp.setSize("100%", "100%"); // add classification browser this.classBrowser = new ClassBrowser("100%", "100%"); this.classBrowser.onUpdate(); this.classBrowser.classes.addTreeListener(this); this.classBrowser.setStyleName("audoc-browser"); this.classBrowser.setSize("100%", "100%"); hp.add(this.classBrowser); // form VerticalPanel vp = new VerticalPanel(); vp.addStyleName("audoc-form"); vp.setSpacing(5); // name field HorizontalPanel namePanel = new HorizontalPanel(); namePanel.setSpacing(5); Label n = new Label(LANG.name_Text()); n.setWidth("100px"); namePanel.add(n); this.name = new TextBox(); namePanel.add(this.name); vp.add(namePanel); // retention field HorizontalPanel retPanel = new HorizontalPanel(); retPanel.setSpacing(5); Label r = new Label(LANG.retention_Text()); r.setWidth("100px"); retPanel.add(r); this.retention = new NumericTextBox(); retPanel.add(this.retention); vp.add(retPanel); // security level field HorizontalPanel secPanel = new HorizontalPanel(); secPanel.setSpacing(5); Label s = new Label(LANG.security_level_Text()); s.setWidth("100px"); secPanel.add(s); this.secLevel = new ListBox(); secPanel.add(this.secLevel); vp.add(secPanel); // caveats field HorizontalPanel cavPanel = new HorizontalPanel(); cavPanel.setSpacing(5); Label c = new Label(LANG.security_caveat_Text()); c.setWidth("100px"); cavPanel.add(c); this.caveats = new ListBox(); this.caveats.setMultipleSelect(true); this.caveats.setVisibleItemCount(5); cavPanel.add(this.caveats); vp.add(cavPanel); // Buttons HorizontalPanel butPanel = new HorizontalPanel(); butPanel.setSpacing(5); this.save = new Button(LANG.save_Text()); this.save.addClickListener(this); butPanel.add(this.save); this.delete = new Button(LANG.delete_Text()); this.delete.addClickListener(this); butPanel.add(this.delete); this.newTop = new Button(LANG.new_Text()); this.newTop.addClickListener(this); butPanel.add(this.newTop); this.newChild = new Button(LANG.new_child_Text()); this.newChild.addClickListener(this); butPanel.add(this.newChild); vp.add(butPanel); // add it all up! hp.add(vp); hp.setCellWidth(this.classBrowser, "100%"); this.add(hp); this.popLists(); }
From source file:com.audata.client.admin.KeywordPanel.java
License:Open Source License
/** * Public Constructor/*from w w w . j a va 2 s .co m*/ * */ public KeywordPanel() { this.setSpacing(5); this.setSize("100%", "100%"); // add section title Label l = new Label(LANG.admin_keyword_Text()); l.addStyleName("audoc-sectionTitle"); this.add(l); HorizontalPanel kwhs = new HorizontalPanel(); kwhs.setSpacing(5); Label kl = new Label(LANG.keyword_hierarchy_Text()); kwhs.add(kl); this.hierarchies = new ListBox(); this.hierarchies.setWidth("150px"); this.hierarchies.setVisibleItemCount(1); this.hierarchies.addChangeListener(this); kwhs.add(this.hierarchies); this.newHierarchy = new Button(LANG.new_Text()); this.newHierarchy.addClickListener(this); kwhs.add(this.newHierarchy); this.delHierarchy = new Button(LANG.delete_Text()); this.delHierarchy.addClickListener(this); kwhs.add(this.delHierarchy); this.add(kwhs); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(10); hp.setSize("100%", "100%"); // add classification browser this.keywordBrowser = new KeywordBrowser("100%", "100%"); this.keywordBrowser.keywords.addTreeListener(this); this.keywordBrowser.setStyleName("audoc-browser"); this.keywordBrowser.setSize("100%", "100%"); hp.add(this.keywordBrowser); hp.setCellWidth(this.keywordBrowser, "50%"); hp.setCellHeight(this.keywordBrowser, "300px"); // form VerticalPanel vp = new VerticalPanel(); vp.addStyleName("audoc-form"); vp.setSpacing(5); // name field HorizontalPanel namePanel = new HorizontalPanel(); namePanel.setSpacing(5); Label n = new Label(LANG.name_Text()); n.setWidth("100px"); namePanel.add(n); this.name = new TextBox(); namePanel.add(this.name); vp.add(namePanel); // Buttons HorizontalPanel butPanel = new HorizontalPanel(); butPanel.setSpacing(5); this.save = new Button(LANG.save_Text()); this.save.addClickListener(this); butPanel.add(this.save); this.delete = new Button(LANG.delete_Text()); this.delete.addClickListener(this); butPanel.add(this.delete); this.newTop = new Button(LANG.new_Text()); this.newTop.addClickListener(this); butPanel.add(this.newTop); this.newChild = new Button(LANG.new_child_Text()); this.newChild.addClickListener(this); butPanel.add(this.newChild); vp.add(butPanel); // add it all up! hp.add(vp); this.add(hp); this.getHierarchies(); }
From source file:com.audata.client.admin.NewHierarchy.java
License:Open Source License
/** * Public Constructor which take the parent admin panel * so that it can be updated when a new Hierarchy has * been added/*from w w w. j a v a 2 s . c om*/ * @param parent The parent KeywordPanel */ public NewHierarchy(KeywordPanel parent) { this.parent = parent; this.setText(LANG.new_keyword_hierarchy_Text()); VerticalPanel main = new VerticalPanel(); main.setSpacing(4); HorizontalPanel fields = new HorizontalPanel(); fields.setSpacing(4); Label l = new Label(LANG.name_Text()); this.name = new TextBox(); this.name.setWidth("150px"); fields.add(l); fields.add(this.name); main.add(fields); HorizontalPanel buttons = new HorizontalPanel(); buttons.setSpacing(4); this.ok = new Button(LANG.save_Text()); this.ok.addClickListener(this); this.cancel = new Button(LANG.cancel_Text()); this.cancel.addClickListener(this); buttons.add(this.ok); buttons.add(this.cancel); main.add(buttons); this.setWidget(main); }
From source file:com.audata.client.admin.RecTypePanel.java
License:Open Source License
/** * Constructor for the PecTypePanel.//ww w . j a va 2s .com * Builds the UI and gets the content of the * list. */ public RecTypePanel() { this.selectedUUID = null; this.setSize("100%", "100%"); this.setSpacing(5); Label title = new Label(LANG.admin_rectypes_Text()); title.addStyleName("audoc-sectionTitle"); this.add(title); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(5); String template = "<p><span class=\"audoc-rectype-title\">#0</span><br/>" + "<span class=\"audoc-rectype-notes\">#1</span></p>"; this.recTypes = new HTMLButtonList("images/48x48/rectypes.gif", template, false); this.recTypes.addStyleName("audoc-recTypes"); this.recTypes.addClickListener(this); this.recTypes.setPixelSize(300, 300); hp.add(this.recTypes); VerticalPanel form = new VerticalPanel(); form.setSpacing(5); form.addStyleName("audoc-form"); HorizontalPanel namePanel = new HorizontalPanel(); Label nameLabel = new Label(LANG.name_Text()); nameLabel.setWidth("100px"); namePanel.add(nameLabel); this.nameBox = new TextBox(); namePanel.add(this.nameBox); form.add(namePanel); HorizontalPanel descPanel = new HorizontalPanel(); Label descLabel = new Label(LANG.description_Text()); descLabel.setWidth("100px"); descPanel.add(descLabel); this.descBox = new TextArea(); descPanel.add(this.descBox); form.add(descPanel); HorizontalPanel udfPanel = new HorizontalPanel(); Label udfLabel = new Label(LANG.udf_Text()); udfLabel.setWidth("100px"); udfPanel.add(udfLabel); this.udfsBox = new ListBox(); this.udfsBox.setVisibleItemCount(5); this.udfsBox.setMultipleSelect(true); udfPanel.add(this.udfsBox); form.add(udfPanel); HorizontalPanel butPanel = new HorizontalPanel(); butPanel.setSpacing(5); this.newBut = new Button(LANG.new_Text()); this.newBut.addClickListener(this); butPanel.add(this.newBut); 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); this.add(hp); this.getRecTypes(); this.getUDFs(); }
From source file:com.audata.client.admin.ReportingPanel.java
License:Open Source License
/** * public contrcutor//w ww .j a v a2s. c o m */ public ReportingPanel() { this.uuid = ""; this.setSize("100%", "100%"); //section title Label l = new Label(LANG.reports_Text()); l.addStyleName("audoc-sectionTitle"); this.add(l); HorizontalPanel main = new HorizontalPanel(); main.setSpacing(5); //Reports list String rTemplate = "<span class=\"audoc-report-title\">#0</span><br/><span class=\"audoc-report-template\">#1</span><br/><span class=\"audoc-report-criteria\">#2</span>"; this.reports = new HTMLButtonList("images/48x48/reports.gif", rTemplate, false); this.reports.addClickListener(this); this.reports.addStyleName("audoc-udfs"); this.reports.setPixelSize(300, 300); main.add(this.reports); //Form VerticalPanel formPanel = new VerticalPanel(); formPanel.setSpacing(4); HorizontalPanel tPanel = new HorizontalPanel(); Label titleLabel = new Label(LANG.title_Text()); titleLabel.setWidth("100px"); tPanel.add(titleLabel); this.title = new TextBox(); tPanel.add(this.title); formPanel.add(tPanel); HorizontalPanel tempPanel = new HorizontalPanel(); Label tempLabel = new Label(LANG.template_Text()); tempLabel.setWidth("100px"); tempPanel.add(tempLabel); this.template = new TextBox(); tempPanel.add(this.template); formPanel.add(tempPanel); HorizontalPanel cPanel = new HorizontalPanel(); Label cLabel = new Label(LANG.criteria_Text()); cLabel.setWidth("100px"); cPanel.add(cLabel); this.criteria = new TextArea(); this.criteria.setVisibleLines(5); cPanel.add(this.criteria); formPanel.add(cPanel); HorizontalPanel bPanel = new HorizontalPanel(); bPanel.setSpacing(5); this.newButton = new Button(LANG.new_Text()); this.newButton.addClickListener(this); bPanel.add(this.newButton); this.saveButton = new Button(LANG.save_Text()); this.saveButton.addClickListener(this); bPanel.add(this.saveButton); this.delButton = new Button(LANG.delete_Text()); this.delButton.addClickListener(this); bPanel.add(this.delButton); formPanel.add(bPanel); main.add(formPanel); this.add(main); this.onUpdate(); }
From source file:com.audata.client.admin.SecurityPanel.java
License:Open Source License
/** * Creates SecLevel panel/*from w w w. j ava2 s . c om*/ * @return VerticalPanel containing SecLevel admin features */ private VerticalPanel buildLevelPanel() { VerticalPanel lp = new VerticalPanel(); lp.setSpacing(5); lp.addStyleName("audoc-group"); Label levelTitle = new Label(LANG.security_levels_Text()); levelTitle.addStyleName("audoc-sectionTitle"); String levelCaption = "<span class=\"secLevel-title\">#1</span><br/>" + "<span class=\"secLevel-level\">" + LANG.level_Text() + ": #0</span>"; this.levelList = new HTMLButtonList("images/48x48/security.gif", levelCaption, false); this.levelList.addStyleName("audoc-levels"); this.levelList.addClickListener(new SecLevelClickListener(this)); this.levelList.setPixelSize(250, 200); lp.add(levelTitle); lp.add(this.levelList); HorizontalPanel namePanel = new HorizontalPanel(); Label nameLabel = new Label(LANG.name_Text()); nameLabel.setWidth("100px"); nameLabel.addStyleName("audoc-label"); this.levelNameBox = new TextBox(); namePanel.add(nameLabel); namePanel.add(this.levelNameBox); lp.add(namePanel); HorizontalPanel levelPanel = new HorizontalPanel(); Label levelLabel = new Label(LANG.level_Text()); levelLabel.setWidth("100px"); levelLabel.addStyleName("audoc-label"); this.levelBox = new TextBox(); levelPanel.add(levelLabel); levelPanel.add(this.levelBox); lp.add(levelPanel); HorizontalPanel buttonPanel = new HorizontalPanel(); buttonPanel.setSpacing(5); this.newLevButton = new Button(LANG.new_Text()); this.newLevButton.addClickListener(this); this.saveLevButton = new Button(LANG.save_Text()); this.saveLevButton.addClickListener(this); this.delLevButton = new Button(LANG.delete_Text()); this.delLevButton.addClickListener(this); buttonPanel.add(this.newLevButton); buttonPanel.add(this.saveLevButton); buttonPanel.add(this.delLevButton); lp.add(buttonPanel); return lp; }
From source file:com.audata.client.admin.SecurityPanel.java
License:Open Source License
/** * Creates the Caveat admin panel//from ww w . j a v a2 s . 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);//from ww w. j ava 2s . c o 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);//from ww w . j a v a 2 s.com 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 ava 2s.com*/ 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); } }