List of usage examples for com.google.gwt.user.client.ui FlexTable FlexTable
public FlexTable()
From source file:com.google.gwt.sample.stockwatcher.client.UserNotificationPage.java
private void renderControllerSubcriptionPanel() { FlexTable wrapper = new FlexTable(); setHeaders(wrapper);/*w ww . j a v a 2 s . c o m*/ for (String controller : controllerSubcriptionList.keySet()) { int row = wrapper.getRowCount(); wrapper.setText(row, 0, controller); wrapper.setText(row, 1, controllerSubcriptionList.get(controller)); } addUnsubscribeControllerColumnAllRow(wrapper); cTable = wrapper; controllerSubscribedPanel.clear(); controllerSubscribedPanel.setStyleName("mainStyle"); controllerSubscribedPanel.setSpacing(10); controllerSubscribedPanel.add(new HTML("Subscribed Controllers")); controllerSubscribedPanel.add(cTable); controllerSubscribedPanel.add(subscribeControllerButton); }
From source file:com.google.gwt.sample.stockwatcher.client.UserNotificationPage.java
private void renderSensorSubcriptionPanel() { FlexTable wrapper = new FlexTable(); setHeaders(wrapper);/*from w ww . j a va 2 s. co m*/ for (String sensor : sensorSubcriptionList.keySet()) { int row = wrapper.getRowCount(); wrapper.setText(row, 0, sensor); wrapper.setText(row, 1, sensorSubcriptionList.get(sensor)); } addUnsubscribeSensorColumnAllRow(wrapper); sTable = wrapper; sensorSubscribedPanel.clear(); sensorSubscribedPanel.setStyleName("mainStyle"); sensorSubscribedPanel.setSpacing(10); sensorSubscribedPanel.add(new HTML("Subscribed Sensors")); sensorSubscribedPanel.add(sTable); sensorSubscribedPanel.add(subscribeSensorButton); }
From source file:com.google.gwt.sample.stockwatcher.client.UserNotificationPage.java
private void renderActuatorSubcriptionPanel() { FlexTable wrapper = new FlexTable(); setHeaders(wrapper);//from w ww. j a va2s.c o m for (String actuator : actuatorSubcriptionList.keySet()) { int row = wrapper.getRowCount(); wrapper.setText(row, 0, actuator); wrapper.setText(row, 1, actuatorSubcriptionList.get(actuator)); } addUnsubscribeActuatorColumnAllRow(wrapper); aTable = wrapper; actuatorSubscribedPanel.clear(); actuatorSubscribedPanel.setStyleName("mainStyle"); actuatorSubscribedPanel.setSpacing(10); actuatorSubscribedPanel.add(new HTML("Subscribed Actuators")); actuatorSubscribedPanel.add(aTable); actuatorSubscribedPanel.add(subscribeActuatorButton); }
From source file:com.google.gwt.sample.stockwatcher.StockWatcher.client.StockWatcher.java
License:Open Source License
public void onModuleLoad() { // setup timer to refresh list automatically Timer refreshTimer = new Timer() { public void run() { refreshWatchList();//from w w w . ja v a2 s . co m } }; refreshTimer.scheduleRepeating(REFRESH_INTERVAL); RootPanel rootPanel = RootPanel.get(); rootPanel.setStyleName("gwt-Label-StockWatcher"); VerticalPanel mainPanel = new VerticalPanel(); rootPanel.add(mainPanel, 10, 147); mainPanel.setSize("311px", "167px"); stocksFlexTable = new FlexTable(); //Aadir valores a la tabla stocksFlexTable.setText(0, 0, "Symbol"); stocksFlexTable.setText(0, 1, "Price"); stocksFlexTable.setText(0, 2, "Change"); stocksFlexTable.setText(0, 3, "Remove"); mainPanel.add(stocksFlexTable); addPanel = new HorizontalPanel(); mainPanel.add(addPanel); addPanel.setSize("272px", "56px"); newSymbolTextBox = new TextBox(); newSymbolTextBox.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(KeyPressEvent event) { if (event.getCharCode() == KeyCodes.KEY_ENTER) { addStock(); } } }); newSymbolTextBox.setFocus(true); addPanel.add(newSymbolTextBox); addButton = new Button("Add"); addButton.setStyleName("gwt-Button-Add"); addButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { addStock(); } }); addPanel.add(addButton); lastUpdatedLabel = new Label("New label"); mainPanel.add(lastUpdatedLabel); image = new Image("images/googlecode.png"); rootPanel.add(image, 10, 10); image.setSize("221px", "84px"); lblNewLabel = new Label("Stock Watcher"); rootPanel.add(lblNewLabel, 20, 100); lblNewLabel.setSize("186px", "16px"); }
From source file:com.google.gwt.sample.stockwatcher2.StockWatcher2.client.StockWatcher2.java
/** * This is the entry point method./*from w ww .ja v a2s.co m*/ */ public void onModuleLoad() { // Add the nameField and sendButton to the RootPanel // Use RootPanel.get() to get the entire body element RootPanel rootPanel = RootPanel.get("stockList"); rootPanel.setStyleName("rootPanel"); mainPanel = new VerticalPanel(); rootPanel.add(mainPanel, 10, 0); mainPanel.setSize("304px", "224px"); Image image = new Image("images/GoogleCode.png"); mainPanel.add(image); Label labelStockWatcher = new Label("Stock Watcher"); labelStockWatcher.setStyleName("gwt-Label-StockWatcher"); mainPanel.add(labelStockWatcher); stocksflexTable = new FlexTable(); stocksflexTable.getRowFormatter().addStyleName(0, "watchListHeader"); stocksflexTable.setCellPadding(6); stocksflexTable.setStyleName("watchList"); stocksflexTable.getCellFormatter().addStyleName(0, 1, "watchListN"); stocksflexTable.getCellFormatter().addStyleName(0, 2, "watchListNumericColumn"); stocksflexTable.setText(0, 0, "Symbol"); stocksflexTable.setText(0, 1, "Price"); stocksflexTable.setText(0, 2, "Change"); stocksflexTable.setText(0, 3, "Remove"); mainPanel.add(stocksflexTable); stocksflexTable.setWidth("222px"); addPanel = new HorizontalPanel(); mainPanel.add(addPanel); newSymbolTextBox = new TextBox(); newSymbolTextBox.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(KeyPressEvent event) { if (event.getCharCode() == KeyCodes.KEY_ENTER) { addStock(); } } }); addPanel.add(newSymbolTextBox); addButton = new Button("New button"); addButton.setStyleName("gwt-Button-Add"); addButton.setHeight("25px"); addButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { addStock(); } }); addButton.setText("Add"); addPanel.add(addButton); lastUpdateLabel = new Label("New label"); mainPanel.add(lastUpdateLabel); // setup timer to refresh list automatically Timer refreshTimer = new Timer() { public void run() { refreshWatchList(); } }; refreshTimer.scheduleRepeating(REFRESH_INTERVAL); }
From source file:com.google.sampling.experiential.client.ExperimentLandingPanel.java
License:Open Source License
public ExperimentLandingPanel(JoinExperimentModule joinExperimentModule) { this.container = joinExperimentModule; loginInfo = container.loginInfo;/*w w w . j a va2 s . co m*/ myConstants = GWT.create(MyConstants.class); myMessages = GWT.create(MyMessages.class); contentPanel = new VerticalPanel(); mainPanel = contentPanel; mainPanel.setSpacing(2); statusLabel = new Label(""); mainPanel.add(statusLabel); initWidget(mainPanel); Label titleLabel = new Label("Welcome to the Daily + End of Day Study Landing Page"); titleLabel.setStyleName("paco-HTML"); mainPanel.add(titleLabel); mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); buttonTable = new FlexTable(); mainPanel.add(buttonTable); mainPanel.add(contentPanel); Button join = new Button("Join Study"); Button leave = new Button("Leave Study"); Button respond = new Button("Respond to End of Day Study"); buttonTable.add(join); buttonTable.add(respond); buttonTable.add(leave); loadExperiment(); join.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { contentPanel.clear(); contentPanel.add(new JoinPanel()); } }); respond.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { contentPanel.clear(); showReferredExperimentExecutor(experiment); } }); leave.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { contentPanel.clear(); contentPanel.add(new LeavePanel()); } }); }
From source file:com.google.sampling.experiential.client.Main.java
License:Open Source License
private void createHomePage() { RootPanel rootPanel = RootPanel.get(); mainPanel = new VerticalPanel(); mainPanel.setSpacing(2);// w w w . j av a 2s . co m rootPanel.add(mainPanel); HorizontalPanel menuPanel = createMenuBar(); createStatusPanelOnMenubar(menuPanel); listTitle = new HTML(""); mainPanel.add(listTitle); listTitle.setStyleName("paco-HTML-Large"); listTitle.setWordWrap(false); listTitle.setSize("270px", "22"); mainPanel.setCellHorizontalAlignment(listTitle, HasHorizontalAlignment.ALIGN_CENTER); HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setSpacing(2); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); mainPanel.add(horizontalPanel); experimentPanel = new VerticalPanel(); leftSidePanel = new ScrollPanel(experimentPanel); horizontalPanel.add(leftSidePanel); experimentPanel.setStyleName("paco-experimentPanel"); experimentPanel.setSpacing(2); experimentPanel.setVisible(false); experimentPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); flexTable = new FlexTable(); String height = (Window.getClientHeight() - 200) + "px"; ScrollPanel sp = new ScrollPanel(flexTable); //flexTable.setSize("400px", height); experimentPanel.add(flexTable); contentPanel = new VerticalPanel(); contentPanel.setSpacing(2); horizontalPanel.add(contentPanel); //contentPanel.setSize("550px", "325px"); rootPanel.add(new HTML( "<div style=\"text-align:center;\"><a href=\"/privacypolicy.html\">Privacy Policy</a></div>")); loadJoinedExperiments(); createCallbackForGviz(); }
From source file:com.googlecode.hmvc4gwt.example.hmvcblog.frontend.authentification.client.register.RegisterController.java
License:Open Source License
public void initView() { Label label = new Label(I18N.constants.labelRegistrationDescription()); getView().setLabelDescription(label); FlexTable flexTable = new FlexTable(); label = new Label(I18N.constants.labelEmailaddress()); getView().setLabelEmailaddress(label); flexTable.setWidget(0, 0, label);// w w w . j av a 2s .co m TextBox textBox = new TextBox(); getView().setTextBoxEmail(textBox); flexTable.setWidget(0, 1, textBox); label = new Label(I18N.constants.labelForename()); getView().setLabelForename(label); flexTable.setWidget(1, 0, label); textBox = new TextBox(); getView().setTextBoxForename(textBox); flexTable.setWidget(1, 1, textBox); label = new Label(I18N.constants.labelSurename()); getView().setLabelSurename(label); flexTable.setWidget(2, 0, label); textBox = new TextBox(); getView().setTextBoxSurename(textBox); flexTable.setWidget(2, 1, textBox); label = new Label(I18N.constants.labelLogin()); getView().setLabelLogin(label); flexTable.setWidget(3, 0, label); textBox = new TextBox(); getView().setTextBoxLogin(textBox); flexTable.setWidget(3, 1, textBox); label = new Label(I18N.constants.labelPassword()); getView().setLabelPassword(label); flexTable.setWidget(4, 0, label); PasswordTextBox passwordTextBox = new PasswordTextBox(); getView().setPasswordTextBox(passwordTextBox); flexTable.setWidget(4, 1, passwordTextBox); Button buttonRegister = new Button(I18N.constants.buttonRegister()); buttonRegister.addClickListener(new ClickListener() { public void onClick(Widget sender) { registerUser(); } }); getView().setButtonRegister(buttonRegister); Button buttonCancel = new Button(I18N.constants.buttonCancel()); buttonCancel.addClickListener(new ClickListener() { public void onClick(Widget sender) { History.back(); } }); getView().setButtonCancel(buttonCancel); HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.add(buttonRegister); horizontalPanel.add(buttonCancel); flexTable.setWidget(5, 1, horizontalPanel); getView().setFlexTableFormular(flexTable); }
From source file:com.googlecode.hmvc4gwt.example.hmvcblog.frontend.blog.client.blog.blogentry.comment.BlogEntryCommentController.java
License:Apache License
private void addComment() { getView().getTreeBlogEntryComment().remove(getView().getButtonAddComment()); Label labelCommentAuthorName = new Label("Author Name"); TextBox textBoxCommentAuthorName = new TextBox(); getView().setTextBoxCommentAuthorName(textBoxCommentAuthorName); Label labelTextAreaComment = new Label("Your Blog-Comment"); TextArea textAreaComment = new TextArea(); getView().setTextAreaComment(textAreaComment); Button buttonCommitComment = new Button(I18N.constants.buttonAddBlogEntryComment()); buttonCommitComment.addClickListener(new ClickListener() { public void onClick(Widget sender) { commitComment();/*from w w w . j a v a 2 s . c om*/ } }); Button buttonCancel = new Button(I18N.constants.buttonCancel()); buttonCancel.addClickListener(new ClickListener() { public void onClick(Widget sender) { getView().getTreeBlogEntryComment().removeItem(getView().getTreeItemComment()); getView().getTreeBlogEntryComment().add(getView().getButtonAddComment()); } }); FlexTable flexTable = new FlexTable(); flexTable.setWidget(0, 0, labelCommentAuthorName); flexTable.setWidget(0, 1, textBoxCommentAuthorName); flexTable.setWidget(1, 0, labelTextAreaComment); flexTable.setWidget(1, 1, textAreaComment); flexTable.setWidget(2, 0, buttonCommitComment); FlexCellFormatter flexCellFormatter = flexTable.getFlexCellFormatter(); flexCellFormatter.setColSpan(2, 0, 2); flexCellFormatter.setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT); TreeItem treeItem = new TreeItem(); getView().setTreeItemComment(treeItem); treeItem.setWidget(flexTable); getView().getTreeBlogEntryComment().addItem(treeItem); }
From source file:com.googlecode.hmvc4gwt.example.hmvcblog.frontend.bloglist.client.bloglist.BloglistController.java
License:Open Source License
private void refreshBloglist(Set<BlogPreviewDTO> setBlogPreviewDTO) { VerticalPanel panel = getView().getVerticalPanelBloglist(); panel.clear();//from w w w. ja va 2 s . c o m if ((setBlogPreviewDTO == null) || (setBlogPreviewDTO.size() == 0)) { getView().getLabelHostedBlogs().setText(I18N.constants.labelNoBlogsFound()); } else { getView().getLabelHostedBlogs().setText(I18N.constants.labelHostedBlogs()); for (BlogPreviewDTO blogPreviewDTO : setBlogPreviewDTO) { Hyperlink hyperlink = new Hyperlink(blogPreviewDTO.getTitle(), HistoryToken.blog + "=" + blogPreviewDTO.getId()); Label labelAuthor = new Label( I18N.constants.labelAuthorName() + " " + blogPreviewDTO.getUsername()); Label labelBlogDescription = new Label(blogPreviewDTO.getDescription()); FlexTable flexTable = new FlexTable(); flexTable.setStylePrimaryName("blogPreview"); flexTable.setWidget(0, 0, hyperlink); flexTable.setWidget(0, 1, labelAuthor); flexTable.setWidget(1, 0, labelBlogDescription); FlexCellFormatter flexCellFormatter = flexTable.getFlexCellFormatter(); flexCellFormatter.setColSpan(1, 0, 2); panel.add(flexTable); } } }