List of usage examples for com.google.gwt.user.client.ui HorizontalPanel HorizontalPanel
public HorizontalPanel()
From source file:ca.upei.ic.timetable.client.FindCourseView.java
License:Apache License
public FindCourseView(FindCourseViewController controller) { controller_ = controller;/*from w w w . j ava2 s . com*/ // set up the dialog box dialogBox_ = new DialogBox(false, true); // autohide = false, modal = true dialogBox_.setAnimationEnabled(true); dialogBox_.setText("Find Courses..."); // i have a horizontal panel HorizontalPanel filterPanel = new HorizontalPanel(); // i have a level flex table levelTable_ = controller_.getLevelModel().getWidget(); departmentTable_ = controller_.getDepartmentModel().getWidget(); semesterTable_ = controller_.getSemesterModel().getWidget(); startTimeWidget_ = controller_.getStartTimeModel().getWidget(); // button panel HorizontalPanel buttonPanel = new HorizontalPanel(); buttonPanel.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT); // i have an OK button final Button okButton = new Button("Search"); okButton.addClickListener(new ClickListener() { public void onClick(Widget sender) { // search and close the dialog controller_.search(); hide(); } }); okButton.addKeyboardListener(new KeyboardListener() { public void onKeyDown(Widget sender, char keyCode, int modifiers) { } public void onKeyPress(Widget sender, char keyCode, int modifiers) { } public void onKeyUp(Widget sender, char keyCode, int modifiers) { if (keyCode == KeyboardListener.KEY_ENTER) { okButton.click(); } } }); final Button cancelButton = new Button("Cancel"); cancelButton.addClickListener(new ClickListener() { public void onClick(Widget sender) { hide(); } }); cancelButton.addKeyboardListener(new KeyboardListener() { public void onKeyDown(Widget sender, char keyCode, int modifiers) { } public void onKeyPress(Widget sender, char keyCode, int modifiers) { } public void onKeyUp(Widget sender, char keyCode, int modifiers) { if (keyCode == KeyboardListener.KEY_ESCAPE) cancelButton.click(); } }); SimplePanel empty = new SimplePanel(); empty.setWidth("230px"); buttonPanel.add(empty); buttonPanel.add(cancelButton); buttonPanel.add(okButton); buttonPanel.setSpacing(5); buttonPanel.setWidth("485px"); // add the panel to the dialog box dialogBox_.add(PanelUtils.verticalPanel(PanelUtils.horizontalPanel( PanelUtils.verticalPanel(PanelUtils.scrollPanel(levelTable_, 250, 180), PanelUtils.scrollPanel(semesterTable_, 250, 120), PanelUtils.scrollPanel(startTimeWidget_, 250, 30)), PanelUtils.scrollPanel(departmentTable_, 250, 320)), buttonPanel)); dialogBox_.setPopupPosition(240, 0); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
void buildSummaryPanel() { HorizontalPanel selectionPanel = new HorizontalPanel(); summaryPanel.clear();/*from www. ja v a 2s . com*/ summaryEndDatePanel.add(new Label("Data:")); summaryEndDatePanel.add(summaryEndDate); selectionPanel.add(summaryAccountGrid); selectionPanel.add(summaryAssetGrid); summaryPanel.add(summaryEndDatePanel); summaryPanel.add(summaryUpdateButton); summaryPanel.add(selectionPanel); summaryPanel.add(summaryGrid); summaryPanel.add(summaryFlowGrid); summaryPanel.add(summaryLogConsole); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
void buildTaxPanel() { HorizontalPanel headPanel = new HorizontalPanel(); VerticalPanel prefPanel = new VerticalPanel(); VerticalPanel startLossPanel = new VerticalPanel(); HorizontalPanel lossPanel = new HorizontalPanel(); HorizontalPanel dayTradeLossPanel = new HorizontalPanel(); taxPanel.clear();/*from w ww. java2s . c o m*/ taxEndDatePanel.add(new Label("Data:")); taxEndDatePanel.add(taxEndDate); taxPanel.add(taxEndDatePanel); StockTaxPrefResetButtonHandler stockTaxPrefButtonHandler = new StockTaxPrefResetButtonHandler(); Button stockTaxPrefButton = new Button("Restaurar Recomendacoes", stockTaxPrefButtonHandler); prefPanel.add(stockTaxPrefButton); prefPanel.add(Preference.stockDayTradeAffectExemptionLimit); prefPanel.add(Preference.stockExemptGainsReduceCarriedLoss); prefPanel.add(Preference.stockTaxRatioOverPretaxEarnings); prefPanel.addStyleName("boxedTable"); lossPanel.add(new Label("Perda acumulada inicial:")); lossPanel.add(Preference.startTaxCarryLoss); dayTradeLossPanel.add(new Label("Perda acumulada inicial em Day-trade:")); dayTradeLossPanel.add(Preference.startTaxDayTradeCarryLoss); startLossPanel.add(lossPanel); startLossPanel.add(dayTradeLossPanel); headPanel.add(prefPanel); headPanel.add(startLossPanel); taxPanel.add(headPanel); taxPanel.add(new Label("Apuracao Mensal:")); taxPanel.add(taxGrid); taxPanel.add(new Label("Legenda:")); taxPanel.add(new Label("IR.Devido: Codigo Receita DARF: Pessoa Fisica = 6015, Pessoa Juridica = 3317")); taxPanel.add(new Label("DT.IR.Devido: Codigo Receita DARF: Pessoa Fisica = 6015, Pessoa Juridica = 3317")); taxPanel.add(new Label("Resumo Anual:")); taxPanel.add(taxYearlySummaryGrid); taxPanel.add(new Label("Legenda:")); taxPanel.add(new Label("Repasse BTC: Rendimentos Tributaveis")); taxPanel.add(new Label("Lucro Liquido na Venda de Titulos: Rendimentos Sujeitos a Tributacao Exclusiva")); taxPanel.add(new Label("Cupons de Titulos: Rendimentos Sujeitos a Tributacao Exclusiva")); taxPanel.add(new Label("Aluguel de Acoes: Rendimentos Sujeitos a Tributacao Exclusiva")); taxPanel.add(new Label("Juros Sobre Capital Proprio: Rendimentos Sujeitos a Tributacao Exclusiva")); taxPanel.add(new Label("Dividendos: Rendimentos Isentos e nao Tributaveis")); taxPanel.add(new Label("Ganho Liquido Isento: Rendimentos Isentos e nao Tributaveis")); taxPanel.add(debugPanel); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
void buildPortfolioPanel() { portfolioEndDatePanel.add(new Label("Data:")); portfolioEndDatePanel.add(portfolioEndDate); HorizontalPanel controlPanel = new HorizontalPanel(); FetchQuotesButtonHandler fetchQuotesButtonHandler = new FetchQuotesButtonHandler(); Button fetchQuotesButton = new Button("Buscar Cotacoes", fetchQuotesButtonHandler); controlPanel.add(portfolioHideSoldPositionsCheckBox); controlPanel.add(fetchQuotesButton); portfolioPanel.clear();/*w w w.j a v a2 s . c om*/ portfolioPanel.add(portfolioEndDatePanel); portfolioPanel.add(controlPanel); portfolioPanel.add(portfolioTab); portfolioPanel.add(accountBalanceTab); portfolioPanel.add(portfolioDebugPanel); portfolioDebugPanel.clear(); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
void buildQuotePanel() { HorizontalPanel quoteClearPanel = new HorizontalPanel(); quoteClearPanel.add(clearTodayQuoteButton); quoteClearPanel.add(clearPastQuoteButton); quotePanel.clear();//w w w. j av a2 s . c om quotePanel.add(addQuotePanel); quotePanel.add(quoteClearPanel); quotePanel.add(quoteGrid); }
From source file:carteirainveste.client.DateUtil.java
License:Creative Commons License
void buildPrefPanel() { updatePrefPanel();/* www .j a va 2 s .c o m*/ HorizontalPanel prefSellSpreadPanel = new HorizontalPanel(); HorizontalPanel prefBrokerFeePanel = new HorizontalPanel(); HorizontalPanel prefTaxExemptionPanel = new HorizontalPanel(); HorizontalPanel prefTaxFeePanel = new HorizontalPanel(); HorizontalPanel prefDayTradeTaxFeePanel = new HorizontalPanel(); prefSellSpreadPanel.add(new Label("Spread de venda")); prefBrokerFeePanel.add(new Label("Corretagem fixa")); prefTaxExemptionPanel.add(new Label("Limite de isencao")); prefTaxFeePanel.add(new Label("Taxa de IR sobre lucro")); prefDayTradeTaxFeePanel.add(new Label("Taxa de IR sobre lucro day-trade")); prefSellSpreadPanel.add(prefSellSpreadText); prefBrokerFeePanel.add(prefBrokerFeeText); prefTaxExemptionPanel.add(prefTaxExemptionText); prefTaxFeePanel.add(prefTaxFeeText); prefDayTradeTaxFeePanel.add(prefDayTradeTaxFeeText); prefSellSpreadPanel.add(new Label("%")); prefTaxFeePanel.add(new Label("%")); prefDayTradeTaxFeePanel.add(new Label("%")); //prefPanel.add(new Label("Estimativa de Valor Realizavel para Venda de Acoes no Mercado a Vista")); prefPanel.add(prefSellSpreadPanel); prefPanel.add(prefBrokerFeePanel); prefPanel.add(prefTaxExemptionPanel); prefPanel.add(prefTaxFeePanel); prefPanel.add(prefDayTradeTaxFeePanel); }
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 . j a v a 2 s . c o 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.objecttree.ObjectTreeRenderer.java
License:Apache License
@SuppressWarnings("unchecked") protected void renderToPanel(TreeRenderable renderable, ComplexPanel cp, int depth, boolean soleChild, RenderContext renderContext, TreeRenderer parent) { if (renderable instanceof Permissible) { Permissible permissible = (Permissible) renderable; if (!PermissionsManager.get().isPermissible(permissible)) { return; }/* www. j ava2 s .c om*/ } TreeRenderer node = TreeRenderingInfoProvider.get().getForRenderable(renderable, renderContext); if (parent != null) { parent.childRenderers().add(node); } else { renderContext.setRootRenderer(node); } if (depth == 0 && node.renderCss() != null) { cp.setStyleName(node.renderCss()); } node.parentBinding(op.binding); boolean widgetsAdded = false; Collection<? extends TreeRenderer> children = node.renderableChildren(); // title AbstractBoundWidget customiserWidget = null; RenderInstruction renderInstruction = node.renderInstruction(); IsRenderableFilter renderableFilter = renderContext.getRenderableFilter(); if (renderableFilter != null && !renderableFilter.isRenderable(renderable, node)) { renderInstruction = RenderInstruction.NO_RENDER; } if (renderInstruction != RenderInstruction.NO_RENDER) { customiserWidget = node.renderCustomiser() == null ? null : (AbstractBoundWidget) node.renderCustomiser().get(); } level1ContentRendererMap.put(customiserWidget, node); switch (renderInstruction) { case NO_RENDER: return; case AS_WIDGET_WITH_TITLE_IF_MORE_THAN_ONE_CHILD: if (customiserWidget == null && soleChild) { break; } case AS_TITLE: case AS_WIDGET: String displayName = renderable.getDisplayName(); if (CommonUtils.isNotNullOrEmpty(displayName) && !node.isNoTitle()) { Label label = TextProvider.get() .getInlineLabel(TextProvider.get().getUiObjectText(node.getClass(), TextProvider.DISPLAY_NAME + "-" + displayName, CommonUtils.upperCaseFirstLetterOnly(displayName) + ": ")); label.setStyleName("level-" + ((soleChild) ? Math.max(1, depth - 1) : depth)); cp.add(label); if (depth == 1) { level1LabelMap.put(label, node); } widgetsAdded = true; } default: break; } if (customiserWidget != null) { // note - must be responsible for own detach - cleanup customiserWidget.setModel(renderable); node.setBoundWidget(customiserWidget); if (node.renderCss() != null) { customiserWidget.addStyleName(node.renderCss()); } String customiserStyleName = node.isSingleLineCustomiser() ? "single-line-customiser" : "customiser"; String title = node.title(); if (title != null) { customiserWidget.setTitle(title); title = null; } String hint = node.hint(); if (hint != null) { FlowPanel fp2 = new FlowPanel(); Label label = new Label(hint); label.setStyleName("hint"); fp2.add(customiserWidget); fp2.add(label); fp2.addStyleName(customiserStyleName); cp.add(fp2); } else { customiserWidget.addStyleName(customiserStyleName); cp.add(customiserWidget); } return; } if (node.renderInstruction() == RenderInstruction.AS_WIDGET_WITH_TITLE_IF_MORE_THAN_ONE_CHILD || node.renderInstruction() == RenderInstruction.AS_WIDGET) { AbstractBoundWidget bw = new ObjectTreeBoundWidgetCreator().createBoundWidget(renderable, depth, soleChild, node, op.getBinding()); node.setBoundWidget(bw); cp.add(bw); widgetsAdded = true; } if (children != null && children.size() != 0) { ComplexPanel childPanel = cp; if (depth != 0) { if (node.renderChildrenHorizontally()) { HorizontalPanel hp = new HorizontalPanel(); hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); childPanel = hp; } else { childPanel = new FlowPanel(); } } if (childPanel != cp) { level1ContentRendererMap.put(childPanel, node); cp.add(childPanel); } List<? extends TreeRenderable> childRenderables = new ArrayList<TreeRenderable>( node.renderableChildren()); maybeSortChildRenderables(childRenderables, renderContext); for (TreeRenderable child : childRenderables) { renderToPanel(child, childPanel, depth + 1, node.renderableChildren().size() == 1, renderContext, node); } } return; }
From source file:cc.alcina.framework.gwt.client.stdlayout.MainTabPanel.java
License:Apache License
private HorizontalPanel createButtonsPanel() { HorizontalPanel hp = new HorizontalPanel(); hp.setStyleName("alcina-MainMenuRight"); hp.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT); for (IsWidget button : buttons) { if (button instanceof LoginStateVisibleWithWidget) { button.asWidget().ensureDebugId(((LoginStateVisibleWithWidget) button).getDebugId()); }/*from w ww.j a va2 s . c o m*/ hp.add(button); hp.add(new BarSep()); } return hp; }
From source file:cc.alcina.framework.gwt.client.widget.dialog.CancellableRemoteDialog.java
License:Apache License
public CancellableRemoteDialog(String msg, PermissibleActionListener l, boolean autoShow) { if (l == null) { l = new PermissibleActionListener() { public void vetoableAction(PermissibleActionEvent evt) { CancellableRemoteDialog.this.hide(); }/*from w w w .j a va 2 s .c om*/ }; } final PermissibleActionListener lCopy = l; setText("Please wait..."); setAnimationEnabled(initialAnimationEnabled()); Grid grr = new Grid(2, 1); status = msg; statusLabel = new Label(msg); grr.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER); grr.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_CENTER); grr.setCellPadding(4); cancelButton = new Button("Cancel"); setRetryButton(new Button("Retry")); cancelButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { PermissibleAction action = new PermissibleAction(); action.setActionName(CANCEL_ACTION); lCopy.vetoableAction(new PermissibleActionEvent(this, action)); } }); grr.setWidget(0, 0, statusLabel); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(0); hp.add(cancelButton); hp.add(getRetryButton()); getRetryButton().setVisible(false); grr.setWidget(1, 0, hp); setWidget(grr); if (autoShow) { centerAndShow(); } }