List of usage examples for com.google.gwt.user.client.ui Label Label
protected Label(Element element)
From source file:com.areahomeschoolers.baconbits.client.content.calendar.dayview.DayViewTimeline.java
License:Open Source License
public final void prepare() { timelinePanel.clear();/*from w w w .j a v a 2s. c o m*/ float labelHeight = settings.getSettings().getIntervalsPerHour() * settings.getSettings().getPixelsPerInterval(); int i = 0; if (settings.getSettings().isOffsetHourLabels()) { i = 1; SimplePanel sp = new SimplePanel(); sp.setHeight((labelHeight / 2) + "px"); timelinePanel.add(sp); } int dayStartsAt = settings.getSettings().getDayStartsAt(); while (i < CalendarFormat.HOURS_IN_DAY) { int index = i + dayStartsAt; if (index >= CalendarFormat.HOURS_IN_DAY) { index = index - CalendarFormat.HOURS_IN_DAY; } String hour = CalendarFormat.INSTANCE.getHourLabels()[index]; index++; i++; //block SimplePanel hourWrapper = new SimplePanel(); hourWrapper.setStylePrimaryName(TIME_LABEL_STYLE); hourWrapper.setHeight((labelHeight + FormattingUtil.getBorderOffset()) + "px"); FlowPanel flowPanel = new FlowPanel(); flowPanel.setStyleName("hour-layout"); String amPm = " "; if (index < 13) amPm += CalendarFormat.INSTANCE.getAm(); else if (index > 13) amPm += CalendarFormat.INSTANCE.getPm(); else { if (CalendarFormat.INSTANCE.isUseNoonLabel()) { hour = CalendarFormat.INSTANCE.getNoon(); amPm = ""; } else { amPm += CalendarFormat.INSTANCE.getPm(); } } Label hourLabel = new Label(hour); hourLabel.setStylePrimaryName("hour-text"); flowPanel.add(hourLabel); Label amPmLabel = new Label(amPm); amPmLabel.setStylePrimaryName("ampm-text"); flowPanel.add(amPmLabel); hourWrapper.add(flowPanel); timelinePanel.add(hourWrapper); } }
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>. * //from w w w. j a va 2s.c om * @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.areahomeschoolers.baconbits.client.content.calendar.monthview.MonthView.java
License:Open Source License
private void layOnNMoreLabel(int moreCount, int dayOfWeek, int weekOfMonth) { Label more = new Label(CalendarFormat.MESSAGES.more(moreCount)); more.setStyleName(MORE_LABEL_STYLE); placeItemInGrid(more, dayOfWeek, dayOfWeek, weekOfMonth, calculatedCellAppointments); appointmentCanvas.add(more);/* www .ja v a 2 s .c o m*/ moreLabels.put(more.getElement(), (dayOfWeek) + (weekOfMonth * 7)); }
From source file:com.audata.client.admin.ClassificationPanel.java
License:Open Source License
/** * Public constructor of Classification//from ww w. j a va2 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 ww. j ava 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 www.j av a 2s .co m * @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 w ww . j av a 2 s. co 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(); }
From source file:com.audata.client.admin.ReportingPanel.java
License:Open Source License
/** * public contrcutor/*from www .j ava2s .c om*/ */ 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// ww w . ja v a 2 s . com * @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/* w ww . j a va2 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; }