public void setCurrentUser(UIRosterEntry currentUser) { this.currentUser = currentUser; rl.setCurrentUser(currentUser); // consoleLayout.addWidgetToID("show_items_navigation", // rl.getResourceListPanel().getListBrowseControl()); consoleLayout.addWidgetToID("leftpod_middle_items", rl.getResourceTypeListPanel()); FocusPanel fp = new FocusPanel(); fp.add(rl.getLhsLink()); fp.setWidth("100%"); fp.addClickListener(rl.getListPanelLhsLinkClickListener()); consoleLayout.addWidgetToID("share_button_wrapper", fp); FocusPanel fp1 = new FocusPanel(); fp1.add(rl.getRhsLink()); fp1.setWidth("100%"); fp1.addClickListener(rl.getListPanelRhsLinkClickListener()); consoleLayout.addWidgetToID("items_manage", fp1); }
/** * Create a Focus Panel * * @param widget * @param clickListener * @param focusListener * @param keyboardListener * @param mouseListener * @return */ public static FocusPanel focusPanel( Widget widget, ClickListener clickListener, FocusListener focusListener, KeyboardListener keyboardListener, MouseListener mouseListener) { FocusPanel panel = GWT.create(FocusPanel.class); if (clickListener != null) panel.addClickListener(clickListener); if (focusListener != null) panel.addFocusListener(focusListener); if (keyboardListener != null) panel.addKeyboardListener(keyboardListener); if (mouseListener != null) panel.addMouseListener(mouseListener); panel.setWidget(widget); return panel; }
public ConsoleMiddleLeftPanel( MainLayout consoleLayout, UIRosterEntry currentUser, UserCallbacks ucb) { this.currentUser = currentUser; this.consoleLayout = consoleLayout; ul = new UserRoster(currentUser, ucb); rl = new ResourceRoster(currentUser, ucb); // some resource call backs are required by the user ul.getUserList().setResCallBacks(rl.getResourceManager().getSharingController()); consoleLayout.addWidgetToID( "participants_navigation", ul.getUsersListPanel().getListBrowseControl()); ul.getUserList() .addListModelListener( new DefaultListModelListener() { public void listEntryAdded(ListEntry newEntry) { addParticpantsHeader( UIStrings.getParticipantsLabel() + " (" + (ul.getUserList().getListSize()) + ")"); } public void listEntryRemoved(ListEntry removedEntry) { addParticpantsHeader( UIStrings.getParticipantsLabel() + " (" + (ul.getUserList().getListSize()) + ")"); } }); consoleLayout.addWidgetToID("leftpod_middle_users", ul.getListPanel()); if (null != ul.getLhsLink() && ("true".equalsIgnoreCase(ConferenceGlobals.getShowInviteLinks()))) { FocusPanel fp = new FocusPanel(); fp.add(ul.getLhsLink()); fp.setWidth("100%"); fp.addClickListener(ul.getListPanelLhsLinkClickListener()); consoleLayout.addWidgetToID("users_invite", fp); } else { consoleLayout.setIDVisibility("users_invite_btn", false); } FocusPanel fp1 = new FocusPanel(); fp1.add(ul.getRhsLink()); fp1.setWidth("100%"); fp1.addClickListener(ul.getListPanelRhsLinkClickListener()); consoleLayout.addWidgetToID("participants_manage", fp1); if (!UIGlobals.isPresenter(currentUser)) { // hide the div of show items consoleLayout.setIDVisibility("main_showitems", false); } addResourcesHeader(UIStrings.getShowItemsLabel() + " (0)"); rl.getResourceList() .addListModelListener( new DefaultListModelListener() { public void listEntryAdded(ListEntry newEntry) { addResourcesHeader( UIStrings.getShowItemsLabel() + " (" + (rl.getResourceList().getListSize()) + ")"); } public void listEntryRemoved(ListEntry removedEntry) { addResourcesHeader( UIStrings.getShowItemsLabel() + " (" + (rl.getResourceList().getListSize()) + ")"); } }); setCurrentUser(currentUser); if (!UIGlobals.isActivePresenter(currentUser)) { consoleLayout.setIDVisibility("main_showitems", false); } else { consoleLayout.setIDVisibility("main_showitems", true); } }