List of usage examples for com.google.gwt.user.client.ui HorizontalPanel HorizontalPanel
public HorizontalPanel()
From source file:com.apress.progwt.client.forum.CreatePostWidget.java
License:Apache License
public CreatePostWidget(final ForumApp app, boolean isReply, final CreatePostDialog createPostDialog, final User author, String selection) { VerticalPanel mainP = new VerticalPanel(); titleBox = new TextBox(); textArea = new RichTextArea(); textArea.setSize("35em", "15em"); RichTextToolbar toolbar = new RichTextToolbar(textArea); HorizontalPanel hp = new HorizontalPanel(); hp.add(new Label("Title:")); hp.add(titleBox);//from ww w .j a v a 2 s . c o m mainP.add(hp); mainP.add(toolbar); mainP.add(textArea); Button cancelB = new Button("Cancel"); Button submitB = new Button("Create Thread"); if (isReply) { submitB.setText("Post Reply"); } submitB.addClickListener(new ClickListener() { public void onClick(Widget sender) { app.create(author, titleBox.getText(), textArea.getHTML()); createPostDialog.hide(); } }); cancelB.addClickListener(new ClickListener() { public void onClick(Widget sender) { createPostDialog.hide(); } }); mainP.add(cancelB); mainP.add(submitB); initWidget(mainP); setHTML(makeReplyFromString(selection)); }
From source file:com.apress.progwt.client.forum.ForumControlPanel.java
License:Apache License
public ForumControlPanel(ForumTopic topic, PostsList result, int start, int maxperpage) { HorizontalPanel mainP = new HorizontalPanel(); nav = new HorizontalPanel(); nav.setStylePrimaryName("ForumControl"); mainP.add(nav);/*from w ww.j a v a2 s.c om*/ initWidget(mainP); setControls(topic, start, maxperpage, result.getTotalCount()); }
From source file:com.apress.progwt.client.gui.timeline.TLOWrapper.java
License:Apache License
public TLOWrapper(ZoomableTimeline<T> timeline, final TimeLineObj<T> tlo, Image dragImage, Widget mainWidget, Label mainLabel) {// w w w.jav a2s.c o m this.tlo = tlo; this.top = 0; this.dragImage = dragImage; this.mainWidget = mainWidget; HorizontalPanel panel = new HorizontalPanel(); if (mainLabel == null) { label = new Label("", false); } else { label = mainLabel; } TLORangeEdge edge = new TLORangeEdge(timeline, tlo, this, true, dragImage); panel.add(edge); panel.add(label); if (mainWidget != null) { panel.add(mainWidget); } addClickListener(timeline); addDblClickListener(timeline); setWidget(panel); label.setStyleName("H-TLOWrapper"); JSUtil.disableSelect(getElement()); }
From source file:com.apress.progwt.client.widget.datepicker.CalendarTraversalPanel.java
License:Apache License
private void init() { this.setHeight(18 + "px"); drawTitle();//from w w w . j a v a 2 s.com this.prevMonth.setWidth(23 + "px"); this.nextMonth.setWidth(23 + "px"); DOM.setAttribute(prevMonth.getElement(), "title", "Previous Month"); DOM.setAttribute(prevYear.getElement(), "title", "Previous Year"); DOM.setAttribute(nextMonth.getElement(), "title", "Next Month"); DOM.setAttribute(nextYear.getElement(), "title", "Next Year"); HorizontalPanel prevButtons = new HorizontalPanel(); prevMonth.setStyleName("monthYearTraversorBtn"); prevYear.setStyleName("monthYearTraversorBtn"); prevButtons.add(prevYear); prevButtons.add(prevMonth); HorizontalPanel nextButtons = new HorizontalPanel(); nextMonth.setStyleName("monthYearTraversorBtn"); nextYear.setStyleName("monthYearTraversorBtn"); nextButtons.add(nextMonth); nextButtons.add(nextYear); this.add(prevButtons, DockPanel.WEST); this.setCellHorizontalAlignment(prevButtons, DockPanel.ALIGN_LEFT); this.add(nextButtons, DockPanel.EAST); this.setCellHorizontalAlignment(nextButtons, DockPanel.ALIGN_RIGHT); this.add(monthYearDesc, DockPanel.CENTER); this.setVerticalAlignment(DockPanel.ALIGN_MIDDLE); this.setCellHorizontalAlignment(this.monthYearDesc, HasAlignment.ALIGN_CENTER); this.setCellVerticalAlignment(this.monthYearDesc, HasAlignment.ALIGN_MIDDLE); this.setCellWidth(monthYearDesc, "100%"); monthYearDesc.setStyleName("monthYearTraversor"); this.setStyleName("monthYearTraversor"); }
From source file:com.areahomeschoolers.baconbits.client.content.calendar.monthview.MonthView.java
License:Open Source License
/** * Configures a single day in the month grid of this <code>MonthView</code>. * /* w w w. ja v a2 s .c o m*/ * @param row * The row in the grid on which the day will be set * @param col * The col in the grid on which the day will be set * @param date * The Date in the grid * @param isToday * Indicates whether the day corresponds to today in the month view * @param notInCurrentMonth * Indicates whether the day is in the current visualized month or belongs to any of the two adjacent months of the current month * @param weekNumber * The weekNumber to show in the cell, only appears in the first col. */ private void configureDayInGrid(int row, int col, Date date, boolean isToday, boolean notInCurrentMonth, int weekNumber) { HorizontalPanel panel = new HorizontalPanel(); String text = Integer.toString(ClientDateUtils.getDayInMonth(date)); Label label = new Label(text); StringBuilder headerStyle = new StringBuilder(CELL_HEADER_STYLE); StringBuilder cellStyle = new StringBuilder(CELL_STYLE); for (Date day : getSettings().getHolidays()) { if (DateUtils.areOnTheSameDay(day, date)) { headerStyle.append("-holiday"); cellStyle.append("-holiday"); break; } } if (isToday) { headerStyle.append("-today"); cellStyle.append("-today"); } label.setStyleName(headerStyle.toString()); if (notInCurrentMonth) { label.addStyleName("fadedText"); } addDayClickHandler(label, (Date) date.clone()); if (col == 0 && getSettings().isShowingWeekNumbers()) { Label weekLabel = new Label(String.valueOf(weekNumber)); weekLabel.setStyleName(WEEKNUMBER_LABEL_STYLE); panel.add(weekLabel); panel.setCellWidth(weekLabel, "25px"); DOM.setStyleAttribute(label.getElement(), "paddingLeft", "5px"); addWeekClickHandler(weekLabel, (Date) date.clone()); } panel.add(label); appointmentCanvas.add(panel); dayLabels.add(label); dayPanels.add(panel); monthCalendarGrid.getCellFormatter().setVerticalAlignment(row, col, HasVerticalAlignment.ALIGN_TOP); monthCalendarGrid.getCellFormatter().setStyleName(row, col, cellStyle.toString()); }
From source file:com.arondor.common.reflection.gwt.client.view.ReflectionDesignerMenuView.java
License:Apache License
public ReflectionDesignerMenuView() { if (false) {/*from ww w . j a v a2s . c om*/ loadConfigContext.setText( "file:///home/francois/ARender-Rendition-2.2.0/conf/arender-rendition-alterdocumentcontent.xml"); loadLibsContext.setText("/home/francois/ARender-Rendition-2.2.0/lib"); } loadConfigContext.setWidth("300px"); loadLibsContext.setWidth("300px"); VerticalPanel verticalPanel = new VerticalPanel(); { HorizontalPanel hz = new HorizontalPanel(); hz.add(loadLibsContext); hz.add(loadLibsButton); verticalPanel.add(hz); } { HorizontalPanel hz = new HorizontalPanel(); hz.add(loadConfigContext); hz.add(loadConfigButton); verticalPanel.add(hz); } verticalPanel.add(saveConfigButton); initWidget(verticalPanel); }
From source file:com.audata.client.admin.ClassificationPanel.java
License:Open Source License
/** * Public constructor of Classification//from w w w . j ava 2 s .c o m * 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 . ja va2 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 va2s .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./*from ww w. j av a 2 s .c o m*/ * 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(); }