List of usage examples for com.google.gwt.user.client.ui HTML HTML
protected HTML(Element element)
From source file:ca.upei.ic.timetable.client.DepartmentModelView.java
License:Apache License
public DepartmentModelView(FindCourseViewController controller) { controller_ = controller;/* w ww.ja va 2 s.c o m*/ selectAllLink_ = GWT.create(com.google.gwt.user.client.ui.Hyperlink.class); deselectAllLink_ = GWT.create(com.google.gwt.user.client.ui.Hyperlink.class); selectAllLink_.setText("Select All"); selectAllLink_.addClickListener(new ClickListener() { public void onClick(Widget sender) { for (int index = 0; index < panel_.getWidgetCount(); index++) { CheckBox box = (CheckBox) panel_.getWidget(index); box.setChecked(true); controller_.setDepartmentCriteria(box.getName(), true); } } }); deselectAllLink_.setText("Select None"); deselectAllLink_.addClickListener(new ClickListener() { public void onClick(Widget sender) { for (int index = 0; index < panel_.getWidgetCount(); index++) { CheckBox box = (CheckBox) panel_.getWidget(index); box.setChecked(false); controller_.setDepartmentCriteria(box.getName(), false); } } }); panel_ = GWT.create(VerticalPanel.class); panel_.setSpacing(3); outerPanel_ = PanelUtils.verticalPanel( PanelUtils.horizontalPanel(selectAllLink_, new HTML(" / "), deselectAllLink_), panel_); }
From source file:ca.upei.ic.timetable.client.MessageView.java
License:Apache License
public void log(String msg) { panel_.add(new HTML(msg)); dialogBox_.show(); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
Carteira() { accountList.add("--"); // built-in account NONE aboutPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); aboutPanel.add(new Label("Carteira Investe")); aboutPanel.add(new Label(Constant.VERSION + ": " + Constant.V_NUMBER)); aboutPanel.add(new HTML(Constant.LICENSE)); portfolioEndDate.setFormat(new DateBox.DefaultFormat(Preference.dateFormat)); portfolioEndDate.setValue(new Date()); portfolioEndDate.addValueChangeHandler(portfolioEndDateHandler); summaryEndDate.setFormat(new DateBox.DefaultFormat(Preference.dateFormat)); summaryEndDate.setValue(new Date()); summaryEndDate.addValueChangeHandler(summaryEndDateHandler); evolutionEndDate.setFormat(new DateBox.DefaultFormat(Preference.dateFormat)); evolutionEndDate.setValue(new Date()); evolutionEndDate.addValueChangeHandler(evolutionEndDateHandler); taxEndDate.setFormat(new DateBox.DefaultFormat(Preference.dateFormat)); taxEndDate.setValue(new Date()); taxEndDate.addValueChangeHandler(taxEndDateHandler); tabPanel.addSelectionHandler(mainTabSelectionHandler); addYieldAsset.addChangeHandler(assetHandler); addAssetName.addChangeHandler(assetHandler); addAssetAmount.addChangeHandler(addAssetAmountHandler); addAssetGrossValue.addChangeHandler(addAssetGrossValueCurrencyHandler); addAssetCost.addChangeHandler(addAssetCostCurrencyHandler); addAssetExpense.addChangeHandler(addAssetExpenseCurrencyHandler); addAssetRetainedTax.addChangeHandler(addAssetRetainedTaxCurrencyHandler); addAccountValue.addChangeHandler(currencyHandler); addAccountExpense.addChangeHandler(currencyHandler); addYieldGrossValue.addChangeHandler(currencyHandler); addYieldNetValue.addChangeHandler(currencyHandler); addAssetDtBuyGross.addChangeHandler(addAssetDtBuyGrossCurrencyHandler); addAssetDtSellGross.addChangeHandler(addAssetDtSellGrossCurrencyHandler); addAssetDtSellNet.addChangeHandler(addAssetDtSellNetCurrencyHandler); assetAccountDropBox.setSelectedIndex(addAssetPanelCurrAccountIndex); assetAccountDropBox.addChangeHandler(assetAccountHandler); tradeFilterYear.addChangeHandler(tradeFilterHandler); tradeFilterAssetSuggest.getValueBox().addChangeHandler(tradeFilterHandler); tradeFilterAccountSuggest.getValueBox().addChangeHandler(tradeFilterHandler); tradeFilterAssetSuggest.addSelectionHandler(tradeFilterHandler); tradeFilterAccountSuggest.addSelectionHandler(tradeFilterHandler); portfolioHideSoldPositionsCheckBox.setValue(false); portfolioHideSoldPositionsCheckBox.addValueChangeHandler(portfolioHideSoldPositionsHandler); prefSellSpreadText.addChangeHandler(prefChangeHandler); prefBrokerFeeText.addChangeHandler(prefChangeHandler); prefTaxExemptionText.addChangeHandler(prefChangeHandler); prefTaxFeeText.addChangeHandler(prefChangeHandler); prefDayTradeTaxFeeText.addChangeHandler(prefChangeHandler); Preference.stockDayTradeAffectExemptionLimit.addValueChangeHandler(dayTradeAffectExemptionHandler); Preference.stockExemptGainsReduceCarriedLoss.addValueChangeHandler(exemptGainReduceLossHandler); Preference.stockTaxRatioOverPretaxEarnings.addValueChangeHandler(taxRatioOverPretaxHandler); Preference.startTaxCarryLoss.addChangeHandler(startTaxCarryLossHandler); Preference.startTaxDayTradeCarryLoss.addChangeHandler(startTaxDayTradeCarryLossHandler); taxGrid.addStyleName("taxGrid"); taxYearlySummaryGrid.addStyleName("taxGrid"); summaryAccountGrid.addStyleName("boxedTable"); summaryAssetGrid.addStyleName("boxedTable"); summaryGrid.addStyleName("boxedTable"); summaryFlowGrid.addStyleName("boxedTable"); evolutionGrid.addStyleName("boxedTable"); build();//from w w w .j av a 2 s. c om }
From source file:cc.alcina.framework.gwt.client.ClientNotificationsImpl.java
License:Apache License
@Override public void showDialog(String captionHTML, Widget captionWidget, String msg, MessageType messageType, List<Button> extraButtons, String containerStyle) { ensureImages();//from ww w .jav a 2 s . co m HorizontalAlignmentConstant align = messageType == MessageType.ERROR ? HasHorizontalAlignment.ALIGN_LEFT : HasHorizontalAlignment.ALIGN_CENTER; if (dialogBox != null) { dialogBox.hide(); } String title = CommonUtils.friendlyConstant(messageType); dialogBox = new GlassDialogBox(); dialogBox.setAnimationEnabled(dialogAnimationEnabled); AbstractImagePrototype aip = null; String text = ""; switch (messageType) { case INFO: aip = AbstractImagePrototype.create(images.info()); text = "Information"; break; case WARN: aip = AbstractImagePrototype.create(images.warning()); text = "Warning"; break; case ERROR: aip = AbstractImagePrototype.create(images.error()); text = "Problem notification"; break; } dialogBox.setText(text); FlexTable ft = new FlexTable(); containerStyle = containerStyle != null ? containerStyle : (messageType == MessageType.ERROR || !CommonUtils.isNullOrEmpty(msg)) ? "medium" : "narrow"; ft.setCellSpacing(4); ft.setStyleName("alcina-Notification"); ft.addStyleName(containerStyle); FlexCellFormatter cf = (FlexCellFormatter) ft.getCellFormatter(); ft.setWidget(0, 0, aip.createImage()); cf.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP); cf.setWidth(0, 0, "40px"); FlowPanel fp = new FlowPanel(); fp.setStyleName("text"); Widget capWidget = captionHTML != null ? new HTML(captionHTML) : captionWidget; if (captionHTML != null) { capWidget.setStyleName("caption"); } fp.add(capWidget); if (!CommonUtils.isNullOrEmpty(msg)) { Link nh = new Link("View detail"); nh.addStyleName("pad-5"); dialogHtml = new HTML("<span class='logboxpre'>" + msg.replace("\n", "<br>") + "</span>", true); final ScrollPanel sp = new ScrollPanel(dialogHtml); sp.setStyleName("logbox"); sp.setVisible(containerStyle.equals("wide")); nh.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { sp.setVisible(!sp.isVisible()); } }); if (LooseContext.getBoolean(ClientNotifications.CONTEXT_AUTOSHOW_DIALOG_DETAIL)) { sp.setVisible(true); } fp.add(nh); fp.add(sp); } ft.setWidget(0, 1, fp); cf.setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_MIDDLE); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(8); Button closeButton = new Button("Close"); hp.add(closeButton); if (extraButtons != null) { for (Button b : extraButtons) { hp.add(b); } } ft.setWidget(1, 0, hp); cf.setColSpan(1, 0, 2); cf.setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_CENTER); closeButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { dialogBox.hide(); } }); dialogBox.setWidget(ft); dialogBox.center(); dialogBox.show(); Scheduler.get().scheduleDeferred(() -> closeButton.setFocus(true)); }
From source file:cc.alcina.framework.gwt.client.gwittir.widget.BoundTableExt.java
License:Open Source License
public boolean renderCheck() { try {/*from www. j av a2 s.co m*/ RenderContext.get().pushContext(renderContext); if (this.value == null || this.value.isEmpty()) { this.clear(); HTML l = new HTML(inChunk && !(this.provider instanceof CollectionDataProvider) ? searchingMessage : noContentMessage); l.setStyleName("no-content"); this.table.setWidget(0, 0, l); return false; } return true; } finally { RenderContext.get().pop(); } }
From source file:cc.alcina.framework.gwt.client.gwittir.widget.BoundTableExt.java
License:Open Source License
public void renderTop() { setVisible(false);//from w ww . j a va 2 s. c o m this.clear(); int startColumn = 0; if ((this.masks & BoundTableExt.ROW_HANDLE_MASK) > 0) { this.table.setWidget(0, 0, this.allRowsHandle); startColumn = 1; } if ((this.masks & BoundTableExt.HEADER_MASK) > 0) { for (int i = 0; i < this.columns.length; i++) { this.table.setWidget(0, i + startColumn, new HTML(this.columns[i].getLabel())); } if (this.provider instanceof SortableDataProvider && (this.masks & BoundTableExt.SORT_MASK) > 0) { SortableDataProvider sdp = (SortableDataProvider) this.provider; String[] sortableProperties = sdp.getSortableProperties(); for (int i = 0; (i < sortableProperties.length); i++) { for (int index = 0; index < this.columns.length; index++) { if (sortableProperties[i].equals(this.columns[index].getPropertyName())) { this.table.getCellFormatter().addStyleName(0, index + startColumn, "sortable"); } } } } this.table.getRowFormatter().setStyleName(0, "header"); } if ((this.masks & BoundTableExt.END_ROW_BUTTON) > 0) { this.table.setWidget(0, this.columns.length + startColumn, new HTML("\u00A0")); } if (sortedColumn != -1) { if ((this.masks & BoundTableExt.HEADER_MASK) > 0) { table.getCellFormatter().addStyleName(0, sortedColumn + startColumn, this.ascending[sortedColumn] ? "ascending" : "descending"); } } rowIterator = this.value == null ? null : this.value.iterator(); }
From source file:cc.alcina.framework.gwt.client.ide.provider.ContentProvider.java
License:Apache License
public static HTML getWidget(String key, String styleClassName) { if (provider != null) { if (provider instanceof AsyncContentProvider) { return ((AsyncContentProvider) provider).getWidget(key, styleClassName); } else {//from ww w. ja v a 2 s.c o m String content = provider.getContent(key); content = content == null ? "[" + key + "]" : content; HTML html = new HTML(content); if (styleClassName != null) { html.setStyleName(styleClassName); } return html; } } throw new WrappedRuntimeException("No content provider registered", SuggestedAction.NOTIFY_ERROR); }
From source file:cc.alcina.framework.gwt.client.util.ClientUtils.java
License:Apache License
public static EditContentViewWidgets createEditContentViewWidgets(final PermissibleActionListener pal, String caption, String messageHtml, PaneWrapperWithObjects view, boolean noGlass, boolean hideOnClick, boolean inDialog, boolean withOk, boolean withCancel, String okButtonName, String cancelButtonName, String panelClassName) {/*from w w w . j a va 2s. c om*/ FlowPanel fp = new FlowPanel(); if (Ax.notBlank(panelClassName)) { fp.setStyleName(panelClassName); } final GlassDialogBox gdb = new GlassDialogBox(); if (noGlass) { gdb.setGlassHidden(true); } PermissibleActionListener closeWrapper = new PermissibleActionListener() { @Override public void vetoableAction(PermissibleActionEvent evt) { if (hideOnClick) { gdb.hide(); } if (pal != null) { pal.vetoableAction(evt); } } }; PermissibleActionListener closeListener = inDialog ? closeWrapper : pal; view.addVetoableActionListener(closeListener); view.addStyleName("pwo-center-buttons"); if (withOk) { OkCancelPanel okCancelPanel = new OkCancelPanel(okButtonName, cancelButtonName, view, withCancel, false); view.add(okCancelPanel); if (withOk && withCancel) { view.setOkButton(okCancelPanel.getOkButton()); view.setFireOkButtonClickAsOkActionEvent(true); } } List<Binding> bindings = view.getBoundWidget().getBinding().getChildren(); for (Binding b : bindings) { RelativePopupValidationFeedback feedback = new RelativePopupValidationFeedback( RelativePopupValidationFeedback.BOTTOM, b.getLeft().feedback); feedback.setCss("withBkg"); b.getLeft().feedback = feedback; } gdb.setText(caption); if (messageHtml != null) { HTML message = new HTML(messageHtml); message.setStyleName("bean-panel-message"); fp.add(message); } fp.add(view); if (inDialog) { gdb.add(fp); gdb.center(); gdb.show(); } return new EditContentViewWidgets(view, inDialog ? gdb : null); }
From source file:cc.alcina.framework.gwt.client.util.WidgetUtils.java
License:Apache License
public static void copyTextToClipboard(String text) { FlowPanel fp = new FlowPanel(); TextArea ta = new TextArea(); ta.setSize("600px", "300px"); ta.setText(text);//from w ww. j a va2s .c o m fp.add(ta); PopupPanel pp = new PopupPanel(); pp.add(fp); pp.setAnimationEnabled(false); pp.show(); ta.setSelectionRange(0, text.length()); try { execCopy(); } catch (JavaScriptException e) { pp.hide(); if (e.getMessage().contains("NS_ERROR_XPC_NOT_ENOUGH_ARGS")) { Registry.impl(ClientNotifications.class) .showMessage(new HTML("<div class='info'>Sorry, clipboard operations" + " are disabled by Mozilla/Firefox" + " security settings. <br><br> Please see " + "<a href='http://www.mozilla.org/editor/midasdemo/securityprefs.html'>" + "http://www.mozilla.org/editor/midasdemo/securityprefs.html</a></div> ")); } else { throw e; } } pp.hide(); }
From source file:cc.alcina.framework.gwt.client.widget.complex.EmailPreviewDisplayer.java
License:Apache License
public EmailPreviewDisplayer(EmailPreview model) { FlowPanel fp = new FlowPanel(); Grid g = new Grid(2, 2); g.setWidget(0, 0, UsefulWidgetFactory.boldInline("To:")); g.setWidget(0, 1, new Label(model.getToAddresses())); g.setWidget(1, 0, UsefulWidgetFactory.boldInline("Subject:")); g.setWidget(1, 1, new Label(model.getSubject())); fp.add(g);/*from www . j a v a 2 s.c om*/ fp.add(new HTML("<hr />")); frame = new Frame(); frame.setUrl(model.getBody()); fp.add(frame); initWidget(fp); }