List of usage examples for com.google.gwt.user.client.ui FlexTable FlexTable
public FlexTable()
From source file:ch.eaternity.client.FlexTableRowDragController.java
License:Apache License
@Override protected Widget newDragProxy(DragContext context) { FlexTable proxy;//w w w . j a v a 2 s .co m proxy = new FlexTable(); proxy.addStyleName(CSS_DEMO_FLEX_TABLE_ROW_EXAMPLE_TABLE_PROXY); draggableTable = (FlexTable) context.draggable.getParent(); dragRow = getWidgetRow(context.draggable, draggableTable); FlexTableUtil.copyRow(draggableTable, proxy, dragRow, 0); return proxy; }
From source file:ch.heftix.mailxel.client.LoginPanel.java
License:Open Source License
public LoginPanel(final MailServiceAsync mailxelService, final MailxelPanel mailxelPanel) { super(true);/*from w w w .jav a 2 s . co m*/ FlexTable grid = new FlexTable(); // header grid.setText(0, 0, "Account"); grid.setText(0, 1, "Password"); // send account grid.setText(1, 0, "Send"); final PasswordTextBox smtb = new PasswordTextBox(); grid.setWidget(1, 1, smtb); LoginButton loginSMTPButton = new LoginButton(mailxelService, MailService.ACCOUNT_SEND, smtb); grid.setWidget(1, 2, loginSMTPButton); // one line per account ConfigTO configTO = mailxelPanel.getConfig(); String[] accounts = configTO.accountNames; for (int i = 0; i < accounts.length; i++) { final String account = accounts[i]; // label grid.setText(i + 2, 0, account); // field final PasswordTextBox tb = new PasswordTextBox(); grid.setWidget(i + 2, 1, tb); // button final LoginButton button = new LoginButton(mailxelService, account, tb); tb.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(KeyPressEvent event) { if (event.getCharCode() == KeyCodes.KEY_ENTER) { button.doLogin(); } } }); grid.setWidget(i + 2, 2, button); } add(grid); }
From source file:ch.heftix.mailxel.client.MailDetailGrid.java
License:Open Source License
private void initWidgets() { clear();/* w ww . j a v a2 s. c o m*/ // bodyPanel = new TabPanel(); grid = new FlexTable(); categoryHistory = new FlexTable(); attachementBar = new AttachmentBar(mailxelService); bodyArea = new OrgTextArea(); bodyArea.setCharacterWidth(80); bodyArea.setVisibleLines(25); bodyArea.setReadOnly(true); HorizontalPanel toolbar = new HorizontalPanel(); toolbar.add(fwd); toolbar.add(replyAll); toolbar.add(reply); toolbar.add(new Label(" ")); toolbar.add(categorizationToolbar); toolbar.add(new Label(" ")); add(toolbar); add(grid); contentTabPanel = new OnDemandTabPanel(); contentTabPanel.add(bodyArea, "mail"); add(contentTabPanel); add(categoryHistory); }
From source file:ch.heftix.mailxel.client.MailOverviewCellTable.java
License:Open Source License
public void fillGrid(List<Envelope> result) { envelopes = result;/*from ww w . j a v a 2 s . co m*/ // checkboxes = new ArrayList<CheckBox>(envelopes.size()); // clean all except header int rows = grid.getRowCount(); for (int i = rows - 1; i >= first_payload_row; i--) { grid.removeRow(i); } int row = first_payload_row; for (final Envelope envelope : result) { grid.setText(row, C_SELECT, Integer.toString(envelope.count)); setTextHelper(grid, row, C_FROM, envelope.from, 12); setTextHelper(grid, row, C_TO, envelope.to, 12); Label dateTime = dateTimeLabel(envelope.date, envelope.time); if (envelope.urgency > 0) { String style = "background-color:#FA5858;"; switch (envelope.urgency) { case 4: style = "background-color:#FA5858;"; break; case 3: style = "background-color:#FAAC58;"; break; case 2: style = "background-color:#F4FA58;"; break; default: style = "background-color:#ACFA58;"; break; } DOM.setElementAttribute(dateTime.getElement(), "style", style); } grid.setWidget(row, C_DATE, dateTime); // GTD label (unless label is 'not categorized') if (990 != envelope.curcatid) { Label gtdLabel = createLabel(envelope.GTD, 16); grid.setWidget(row, C_GTD, gtdLabel); // see if there is an icon for it Image img = setIconForGTD(grid, row, envelope.curcatid, envelope.GTD); img.addMouseOverHandler(new MouseOverHandler() { public void onMouseOver(final MouseOverEvent event) { final PopupPanel pop = new PopupPanel(true); pop.setPopupPosition(event.getClientX(), event.getClientY()); mailxelService.getCategoryHistory(envelope.id, new AsyncCallback<List<AttachedCategoryTO>>() { public void onFailure(Throwable caught) { // } public void onSuccess(List<AttachedCategoryTO> result) { if (null == result || result.size() < 1) { return; } FlexTable ft = new FlexTable(); pop.add(ft); int row = 0; for (AttachedCategoryTO cat : result) { ft.setText(row, 0, cat.date); String url = DirectMailServiceUtil.getIconURL(cat.category.iconid); if (null != url) { Image img = new Image(url); ft.setWidget(row, 1, img); } ft.setText(row, 2, cat.category.name); row++; } pop.show(); } }); } }); } if (envelope.nattach > 0) { Image attach = new Image("img/attach.png"); grid.setWidget(row, C_ATTACHMENT, attach); } Label subject = setTextHelper(grid, row, C_SUBJECT, envelope.subject, 64); // subject.addMouseOverHandler(new MouseOverHandler() { // // public void onMouseOver(MouseOverEvent event) { // // System.out.println("on mouse over:" + event + "/" + // // envelope); // mailxelService.snippet(envelope.id, // new AsyncCallback<String>() { // // public void onFailure(Throwable caught) { // System.out.println("E snippet: " + caught); // } // // public void onSuccess(String result) { // System.out.println("I snippet: " + result); // // } // }); // } // }); if (row % 2 == 0) { rf.setStylePrimaryName(row, "row-bg"); } row++; } cl = new CursoredList<Envelope>(envelopes); cl.setCursorPosition(0); }
From source file:ch.heftix.mailxel.client.MessageQueryEditGrid.java
License:Open Source License
public MessageQueryEditGrid(final MailServiceAsync mailxelService, final MailxelPanel mailxelPanel, final MessageQueryTO mqTO) { HorizontalPanel toolbar = new HorizontalPanel(); Image save = new Image("img/save.png"); save.setTitle("Save"); save.setStylePrimaryName("mailxel-toolbar-item"); save.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { final StatusItem si = mailxelPanel.statusStart("message query save"); if (tbName.isDirty()) { mqTO.nameDirty = true;/* ww w. j a v a 2s . c om*/ mqTO.name = tbName.getTextTrimmed(); } if (tbShortname.isDirty()) { mqTO.shortNameDirty = true; mqTO.shortname = tbShortname.getTextTrimmed(); } if (taSql.isDirty()) { mqTO.sqlDirty = true; mqTO.sql = taSql.getTextTrimmed(); } mailxelService.updateMessageQuery(mqTO, new AsyncCallback<MessageQueryTO>() { public void onFailure(Throwable caught) { si.error(caught); } public void onSuccess(MessageQueryTO result) { si.done(); if (null != mailxelTab) { mailxelTab.setTabText(result.name); } } }); } }); toolbar.add(save); add(toolbar); grid = new FlexTable(); tbName.setText(mqTO.name); tbShortname.setText(mqTO.shortname); taSql.setText(mqTO.sql); grid.setText(0, 0, "Id"); grid.setText(0, 1, Integer.toString(mqTO.id)); grid.setText(1, 0, "Access Count"); grid.setText(1, 1, Integer.toString(mqTO.count)); grid.setText(2, 0, "Shortname"); grid.setWidget(2, 1, tbShortname); grid.setText(3, 0, "Name"); grid.setWidget(3, 1, tbName); add(grid); taSql.setCharacterWidth(80); taSql.setVisibleLines(25); taSql.setText(mqTO.sql); add(taSql); }
From source file:ch.heftix.mailxel.client.WelcomeToMailxelPanel.java
License:Open Source License
public WelcomeToMailxelPanel(final MailServiceAsync mailxelService, final MailxelPanel mailxelPanel) { StringBuffer sb = new StringBuffer(512); sb.append("<div style=\"welcome\"><p><b>Welcome and Thank You</b> for choosing mailxel"); sb.append("<p>This seems to be the first time you start mailxel (*)."); sb.append("<p>For a quick start, use the configuration form below."); sb.append("<p>Note: you can always edit your settings using the preferences"); sb.append("<img src=\"img/preferences-system.png\"/> function of the menu"); HTML html = new HTML(sb.toString()); add(html);/* w w w .java 2s . c o m*/ FlexTable grid = new FlexTable(); int idx = IDX_mail; grid.setText(idx, 0, "your main e-mail address"); boxes[idx] = new TextBox(); boxes[idx].setWidth("200px"); boxes[idx].setText("example: some.body@somewhere.com"); grid.setWidget(idx, 1, boxes[idx]); idx = IDX_data; grid.setText(idx, 0, "mailxel data directory"); boxes[idx] = new TextBox(); boxes[idx].setWidth("200px"); boxes[idx].setText("example: d:/data/mailxel"); grid.setWidget(idx, 1, boxes[idx]); idx = IDX_smtp; grid.setText(idx, 0, "your SMTP host"); boxes[idx] = new TextBox(); boxes[idx].setWidth("200px"); boxes[idx].setText("example: smtp.somewhere.com"); grid.setWidget(idx, 1, boxes[idx]); idx = IDX_imap; grid.setText(idx, 0, "your IMAP host"); boxes[idx] = new TextBox(); boxes[idx].setWidth("200px"); boxes[idx].setText("example: imap.somewhere.com"); grid.setWidget(idx, 1, boxes[idx]); add(grid); Button b = new Button(); add(b); b.setText("Store and Start"); b.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { AccountConfigTO aTO = new AccountConfigTO(); String[] sf = { "inbox", "sent" }; String[] ef = { "trash" }; aTO.name = "main"; aTO.protocol = "imap"; aTO.isSSL = false; aTO.port = "143"; aTO.user = boxes[IDX_mail].getText(); aTO.server = boxes[IDX_imap].getText(); aTO.scannedfolders = sf; aTO.excludedfolders = ef; aTO.reuseSendPassword = false; aTO.reorgRules = new String[0]; String[] accountNames = { "main" }; AccountConfigTO[] aTOs = new AccountConfigTO[1]; aTOs[0] = aTO; final ConfigTO cTO = new ConfigTO(); cTO.localstore = boxes[IDX_data].getText(); cTO.smtpHost = boxes[IDX_smtp].getText(); cTO.smtpPort = "25"; cTO.smtpUser = ""; cTO.smtpPassword = ""; cTO.sentHandlingBCC = false; cTO.sentHandlingStoreLocally = true; cTO.sentHandlingCopySent = true; cTO.sentHandlingCopyAccountName = "main"; cTO.sentHandlingCopyFolderName = "sent"; cTO.logConfiguration = LOGConstants.PRODUCTION; cTO.maxSearchRows = 30; cTO.maxAddressSuggestions = 10; cTO.me = boxes[IDX_mail].getText(); cTO.accountNames = accountNames; cTO.accounts = aTOs; final StatusItem si = mailxelPanel.statusStart("saving welcome configuration"); mailxelService.saveConfig(cTO, new AsyncCallback<Void>() { public void onSuccess(Void result) { si.done(); mailxelPanel.setConfig(cTO); ConfigGrid cg = new ConfigGrid(mailxelService, mailxelPanel); mailxelPanel.addTab(cg, "Settings"); mailxelPanel.closeTab(WelcomeToMailxelPanel.this); } public void onFailure(Throwable caught) { si.error(caught); } }); } }); sb = new StringBuffer(512); sb.append("<p style=\"footnote\">(*) If this is not the case: please "); sb.append("<a href=\"http://code.google.com/p/mailxel/issues/entry\">"); sb.append("report an error</a>."); html = new HTML(sb.toString()); add(html); }
From source file:ch.unifr.pai.twice.comm.serverPush.standalone.client.ServerPushStandalone.java
License:Apache License
/** * This is the entry point method./* w w w .j a v a 2s . c o m*/ */ /* * (non-Javadoc) * @see com.google.gwt.core.client.EntryPoint#onModuleLoad() */ @Override public void onModuleLoad() { // // // // FlexTable table = new FlexTable(); final TextBox message = new TextBox(); table.setWidget(0, 0, new Label("Message")); table.setWidget(0, 1, message); table.setWidget(1, 0, new Label("Event date")); final DatePicker datePicker = new DatePicker(); table.setWidget(1, 1, datePicker); Button undoable = new Button("Send as undoable event", new ClickHandler() { /** * Creates an {@link UndoableTestEvent} and fires it on the event bus. * * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent) */ @Override public void onClick(ClickEvent event) { UndoableTestEvent e = GWT.create(UndoableTestEvent.class); e.setFoo(message.getText()); if (datePicker.getValue() != null) e.setTimestamp(datePicker.getValue().getTime()); eventBus.fireEvent(e); } }); Button blocking = new Button("Send as blocking event", new ClickHandler() { /** * Creates an {@link BlockingTestEvent} and fires it on the event bus. * * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent) */ @Override public void onClick(ClickEvent event) { BlockingTestEvent e = GWT.create(BlockingTestEvent.class); e.foo = message.getText(); if (datePicker.getValue() != null) e.setTimestamp(datePicker.getValue().getTime()); eventBus.fireEvent(e); } }); Button discarding = new Button("Send as discarding event", new ClickHandler() { /** * Creates an {@link DiscardingTestEvent} and fires it on the event bus. * * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent) */ @Override public void onClick(ClickEvent event) { DiscardingTestEvent e = GWT.create(DiscardingTestEvent.class); e.setInstanceId("eventTests"); e.setFoo(message.getText()); if (datePicker.getValue() != null) e.setTimestamp(datePicker.getValue().getTime()); eventBus.fireEvent(e); } }); final HTML html = new HTML(""); final HTML value = new HTML(""); eventBus.addHandler(BlockingTestEvent.TYPE, new BlockingTestHandler() { /** * listens for blocking test events and adds their message to the display * * @param event */ @Override public void onEvent(BlockingTestEvent event) { html.setHTML(html.getHTML() + " [BLOCKING " + event.getTimestamp() + "] " + event.foo); value.setHTML(event.foo); } }); eventBus.addHandler(UndoableTestEvent.TYPE, new UndoableTestHandler() { /** * undo the event in case of a conflict by resetting the display to the values valid before the event has been applied * * @param event */ @Override public void undo(UndoableTestEvent event) { html.setHTML(event.getOldHistory()); value.setHTML(event.getOldValue()); } /** * listens for undoable events and adds their message to the display * * @param event */ @Override public void onEvent(UndoableTestEvent event) { html.setHTML(html.getHTML() + " [UNDOABLE " + event.getTimestamp() + "] " + event.getFoo()); value.setHTML(event.getFoo()); } /** * stores the state of the display before the newly arrived event has arrived * * @param event */ @Override public void saveState(UndoableTestEvent event) { event.setOldHistory(html.getHTML()); event.setOldValue(value.getHTML()); } }); eventBus.addHandler(DiscardingTestEvent.TYPE, new DiscardingTestHandler() { /** * listens for discarding test events and adds their message to the display * * @param event */ @Override public void onEvent(DiscardingTestEvent event) { html.setHTML(html.getHTML() + " [DISCARDING " + event.getTimestamp() + "] " + event.getFoo()); value.setHTML(event.getFoo()); } }); table.setWidget(2, 0, undoable); table.setWidget(2, 1, blocking); table.setWidget(2, 2, discarding); table.setWidget(3, 0, new Label("Current value: ")); table.setWidget(3, 1, value); table.setWidget(4, 0, new Label("Event history: ")); table.setWidget(4, 1, html); Button ping = new Button("Send ping", new ClickHandler() { @Override public void onClick(ClickEvent event) { PingEvent e = GWT.create(PingEvent.class); e.setInstanceId("eventTests"); if (datePicker.getValue() != null) e.setTimestamp(datePicker.getValue().getTime()); eventBus.fireEvent(e); } }); RootPanel.get().add(table); RootPanel.get().add(ping); RootPanel.get().add(new Label("GWTEvent wrapper")); FlexTable table2 = new FlexTable(); final TextBox box = new TextBox(); table2.setWidget(0, 0, new Label("Textbox")); table2.setWidget(0, 1, box); eventBus.addHandlerToSource(RemoteKeyPressEvent.TYPE, "test", new RemoteKeyPressEvent.RemoteKeyPressHandler() { @Override public void onEvent(RemoteKeyPressEvent event) { box.setValue(box.getValue() + event.getCharCode()); } }); box.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { RemoteKeyPressEvent e = GWT.create(RemoteKeyPressEvent.class); e.wrap(event); eventBus.fireEventFromSource(e, "test"); event.preventDefault(); } }); final MyNewTextBox box4 = new MyNewTextBox(eventBus, "myNewTextBox"); table2.setWidget(1, 0, new Label("My new textbox")); table2.setWidget(1, 1, box4); final RemoteKeyRecorder recorder = new RemoteKeyRecorder("multiFocus", eventBus); RootPanel.get().add(recorder); // final RemoteTextBox box3 = new RemoteTextBox("multiFocus", eventBus); // box3.setValue(""); // RootPanel.get().add(box3); // table2.setWidget(2, 0, new Label("Textbox (undoable - other resource)")); // table2.setWidget(2,1,box3); // RootPanel.get().add(table2); // MultiFocusTextBox multiFocus = new RemoteMultiFocusTextBox("multiFocus", eventBus); RootPanel.get().add(multiFocus); }
From source file:cl.uai.client.toolbar.sortpages.FlexTableRowDragController.java
License:Open Source License
@Override protected Widget newDragProxy(DragContext context) { FlexTable proxy;/* w w w . j av a 2 s.c o m*/ proxy = new FlexTable(); proxy.addStyleName(Resources.INSTANCE.css().sortpagestableproxy()); draggableTable = (FlexTable) context.draggable.getParent(); dragRow = getWidgetRow(context.draggable, draggableTable); FlexTableUtil.copyRow(draggableTable, proxy, dragRow, 0); return proxy; }
From source file:client.argon.page.ArgonEndpointCreatePage.java
License:Open Source License
private final Widget getEditPanel() { final VerticalPanel outerPanel = new VerticalPanel(); final FlexTable table = new FlexTable(); outerPanel.setSpacing(5);/*w ww . j av a 2 s .c o m*/ final Label labelSource = new Label(); labelSource.setText("SourceNode: "); table.setWidget(0, 0, labelSource); table.setWidget(0, 1, this.sourceNode); final Label labelDestination = new Label(); labelDestination.setText("DestinationNode: "); table.setWidget(1, 0, labelDestination); table.setWidget(1, 1, this.destinationNode); final Label labelOutgoing = new Label(); labelOutgoing.setText("Outgoing Interface: "); table.setWidget(2, 0, labelOutgoing); table.setWidget(2, 1, this.outgoingInterface); final Label labelIngoing = new Label(); labelIngoing.setText("Ingoing Interface: "); table.setWidget(3, 0, labelIngoing); table.setWidget(3, 1, this.ingoingInterface); final Label labelBw = new Label(); labelBw.setText("Bandwidth: "); this.bandwidth.setText("0"); table.setWidget(4, 0, labelBw); table.setWidget(4, 1, this.bandwidth); final Label labelValidFrom = new Label(); labelValidFrom.setText("Valid From: "); table.setWidget(5, 0, labelValidFrom); this.validFrom.setText(this.dateTimeFormat.format(new Date())); table.setWidget(5, 1, this.validFrom); final Label labelValidTo = new Label(); labelValidTo.setText("Valid To: "); this.validTo.setText(this.dateTimeFormat.format(new Date())); table.setWidget(6, 0, labelValidTo); table.setWidget(6, 1, this.validTo); final Label labelLinkUp = new Label(); labelLinkUp.setText("Link Up: "); table.setWidget(7, 0, labelLinkUp); this.linkUp.addItem("true"); this.linkUp.addItem("false"); table.setWidget(7, 1, this.linkUp); final Label labelDelay = new Label(); labelDelay.setText("Delay: "); this.delay.setText("0"); table.setWidget(8, 0, labelDelay); table.setWidget(8, 1, this.delay); this.button.addClickListener(this); this.button.setText("Create"); table.setWidget(9, 0, this.button); table.setWidget(9, 1, this.activity); // table.getFlexCellFormatter().setColSpan(3, 1, 3); return table; }
From source file:client.argon.page.ArgonRouterCreatePage.java
License:Open Source License
private final Widget getEditPanel() { final VerticalPanel outerPanel = new VerticalPanel(); final FlexTable table = new FlexTable(); outerPanel.setSpacing(5);/* w ww . j ava 2 s . co m*/ final Label labelLoopB = new Label(); labelLoopB.setText("LoopBack: "); table.setWidget(0, 0, labelLoopB); table.setWidget(0, 1, this.loopBackAd); // final Label labelConfig = new Label(); labelConfig.setText("Configuration: "); table.setWidget(1, 0, labelConfig); table.setWidget(1, 1, this.configAd); // final Label labelType = new Label(); labelType.setText("Type: "); table.setWidget(2, 0, labelType); table.setWidget(2, 1, this.type); this.button.addClickListener(this); this.button.setText("Create"); table.setWidget(3, 0, this.button); table.setWidget(3, 1, this.activity); // table.getFlexCellFormatter().setColSpan(3, 1, 3); return table; }