List of usage examples for com.vaadin.ui Panel addClickListener
public Registration addClickListener(ClickListener listener)
From source file:com.squadd.chat.ChatController.java
public Panel createPhotoPanel(Embedded image) { Panel photoPanel = new Panel(); photoPanel.setContent(image);//ww w. jav a 2 s .c om //photoPanel.setWidth("50px"); //photoPanel.setHeight("50px"); UserInfoBean use = man.get(userTo.getId(), UserInfo.class, UserInfoBean.class); MouseEvents.ClickListener showUserButtonListener = new MouseEvents.ClickListener() { @Override public void click(MouseEvents.ClickEvent event) { if (use != null) { System.out.println(use.getId()); view.setAnotherUser(use); UI.getCurrent().getNavigator().navigateTo(UserPageView.NAME); } } }; if (use != null) { photoPanel.addClickListener(showUserButtonListener); } return photoPanel; }
From source file:com.squadd.chat.DialogController.java
public void updateChatLog(Integer amount) { ArrayList mess = getLastMessagesFromDB(amount); if (mess.size() > 0) { Panel add = new Panel("add 50 messages"); add.setId("add"); add.addClickListener(more); content.addComponent(add);// w ww .j a va 2s.co m for (int i = mess.size(); i > 0; i--) { print((ChatMessage) mess.get(mess.size() - i)); } } }
From source file:com.squadd.chat.UserInfoFace.java
public Panel getUserPanel() { Panel contactPanel = new Panel(); FormLayout contactLine = new FormLayout(); contactPanel.addClickListener(upd); Label nameLabel = new Label(user.getName()); nameLabel.setStyleName("userPanel"); contactLine.addComponent(nameLabel); contactPanel.setContent(contactLine); contactPanel.setId(user.getId().toString()); return contactPanel; //contactsContent.addComponent(look); //contactsPanel.setContent(contactsContent); }
From source file:com.squadd.chat.UserInfoFace.java
public Panel getUserPanel(Integer userId) { Panel contactPanel = new Panel(); FormLayout contactLine = new FormLayout(); user = new UserInfoBean(); user.setId(userId);// w ww .j a v a 2s. co m user.setName("id" + userId); contactPanel.addClickListener(upd); Label nameLabel = new Label(user.getName()); nameLabel.setStyleName("userPanel"); contactLine.addComponent(nameLabel); contactPanel.setContent(contactLine); contactPanel.setId(userId.toString()); return contactPanel; //contactsContent.addComponent(look); //contactsPanel.setContent(contactsContent); }