Example usage for com.google.gwt.user.client.ui FocusPanel addClickListener

List of usage examples for com.google.gwt.user.client.ui FocusPanel addClickListener

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui FocusPanel addClickListener.

Prototype

@Deprecated
public void addClickListener(ClickListener listener) 

Source Link

Usage

From source file:ca.upei.ic.timetable.client.PanelUtils.java

License:Apache License

/**
 * Create a Focus Panel//  w w  w .  j a  v  a 2s . c  o m
 * 
 * @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;
}

From source file:com.dimdim.conference.ui.layout.client.widget.ConsoleMiddleLeftPanel.java

License:Open Source License

/**
 *   The resource and invitation widgets are constructed and added to this
 *   panel.//from  w  w w  .j a v a2s. c o m
 *   
 *   @param currentUser
 */

public ConsoleMiddleLeftPanel(NewLayout consoleLayout, UIRosterEntry currentUser, UserCallbacks ucb) {
    //      this.initWidget(basePanel);
    //basePanel.setSize("100%", "100%");
    //basePanel.setBorderWidth(2);

    //this.setStyleName("console-middle-left-panel");
    //this.setStyleName("console-applist-header-row");

    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());

    //usersDropDown = new DisclosurePanel();
    //final DropDownHeaderPanel dropDownHeaderPanel = new DropDownHeaderPanel(UIStrings.getParticipantsLabel()+" (1)", 
    //      ul.getUsersListPanel().getListBrowseControl(), usersDropDown);

    //usersDropDown.setHeader(dropDownHeaderPanel);
    //usersDropDown.setStyleName("tk-DropDownPanel");

    //usersDropDown.setHeaderText(UIStrings.getParticipantsLabel()+" (1)", false);

    //usersDropDown.addHeaderControl(ul.getUsersListPanel().getListBrowseControl());
    //ul.getUsersListPanel().getListBrowseControl().setContainerPanel(usersDropDown);

    consoleLayout.addWidgetToID("participants_navigation", ul.getUsersListPanel().getListBrowseControl());

    ul.getUserList().addListModelListener(new DefaultListModelListener() {
        public void listEntryAdded(ListEntry newEntry) {
            //usersDropDown.setHeaderText(UIStrings.getParticipantsLabel()+
            //      " ("+(ul.getUserList().getListSize())+")", false);
            //dropDownHeaderPanel.setText(UIStrings.getParticipantsLabel()+" ("+(ul.getUserList().getListSize())+")");
            //DropDownHeaderPanel dropDownHeaderPanel = new DropDownHeaderPanel(UIStrings.getParticipantsLabel()+
            //                                 " ("+(ul.getUserList().getListSize())+")");
            //usersDropDown.setHeader(dropDownHeaderPanel);
            addParticpantsHeader(
                    UIStrings.getParticipantsLabel() + " (" + (ul.getUserList().getListSize()) + ")");
        }

        public void listEntryRemoved(ListEntry removedEntry) {
            //usersDropDown.setHeaderText(UIStrings.getParticipantsLabel()+
            //      " ("+(ul.getUserList().getListSize())+")", false);
            //dropDownHeaderPanel.setText(UIStrings.getParticipantsLabel()+
            //      " ("+(ul.getUserList().getListSize())+")");
            //usersDropDown.setHeader(dropDownHeaderPanel);
            addParticpantsHeader(
                    UIStrings.getParticipantsLabel() + " (" + (ul.getUserList().getListSize()) + ")");
        }
    });

    consoleLayout.addWidgetToID("leftpod_middle_users", ul.getListPanel());
    //usersDropDown.add(ul);
    //usersDropDown.setOpen(true);

    //usersDropDownRounded = new RoundedPanel(usersDropDown);
    //basePanel.add(usersDropDownRounded,DockPanel.NORTH);

    //usersDropDownRounded.setSize("100%", "100%");
    //basePanel.setCellHeight(usersDropDownRounded, "100%");
    //basePanel.setCellWidth(usersDropDownRounded, "100%");
    if (null != ul.getLhsLink() && ("true".equalsIgnoreCase(ConferenceGlobals.getShowInviteLinks()))) {
        //consoleLayout.addWidgetToID("users_invite", ul.getLhsLink());

        FocusPanel fp = new FocusPanel();
        fp.add(ul.getLhsLink());
        fp.setWidth("100%");
        //fp.setStyleName("user-list-hover");
        fp.addClickListener(ul.getListPanelLhsLinkClickListener());
        consoleLayout.addWidgetToID("users_invite", fp);
    } else {
        consoleLayout.setIDVisibility("users_invite_btn", false);
    }
    //      consoleLayout.addWidgetToID("participants_manage",  ul.getRhsLink());

    FocusPanel fp1 = new FocusPanel();
    fp1.add(ul.getRhsLink());
    fp1.setWidth("100%");
    //fp.setStyleName("user-list-hover");
    fp1.addClickListener(ul.getListPanelRhsLinkClickListener());
    consoleLayout.addWidgetToID("participants_manage", fp1);

    //      ul.attachClickListeners();

    /*HorizontalPanel h1 = new HorizontalPanel();
    h1.setStyleName("console-middle-left-panel-float");
    h1.add(new HTML(" "));
    basePanel.add(h1,DockPanel.NORTH);*/

    if (!UIGlobals.isPresenter(currentUser)) {
        //hide the div of show items
        consoleLayout.setIDVisibility("main_showitems", false);
    }

    //resourcesDropDown = new DisclosurePanel();
    //resourcesDropDownRounded = new RoundedPanel(resourcesDropDown);
    //basePanel.add(resourcesDropDownRounded,DockPanel.NORTH);

    //final DropDownHeaderPanel resDropDownHeaderPanel = new DropDownHeaderPanel(UIStrings.getParticipantsLabel()+" (1)", 
    //      rl.getResourceListPanel().getListBrowseControl(), resourcesDropDown);

    //resourcesDropDown.setHeader(resDropDownHeaderPanel);
    //resourcesDropDown.setStyleName("tk-DropDownPanel");

    //resourcesDropDown.setHeaderText(UIStrings.getShowItemsLabel(), false);
    //resourcesDropDown.addHeaderControl(rl.getResourceListPanel().getListBrowseControl());
    //rl.getResourceListPanel().getListBrowseControl().setContainerPanel(resourcesDropDown);
    addResourcesHeader(UIStrings.getShowItemsLabel() + " (0)");
    rl.getResourceList().addListModelListener(new DefaultListModelListener() {
        public void listEntryAdded(ListEntry newEntry) {
            //resDropDownHeaderPanel.setText(UIStrings.getShowItemsLabel()+
            //      " ("+(rl.getResourceList().getListSize())+")");
            addResourcesHeader(
                    UIStrings.getShowItemsLabel() + " (" + (rl.getResourceList().getListSize()) + ")");
        }

        public void listEntryRemoved(ListEntry removedEntry) {
            //resDropDownHeaderPanel.setText(UIStrings.getShowItemsLabel()+
            //      " ("+(rl.getResourceList().getListSize())+")");
            addResourcesHeader(
                    UIStrings.getShowItemsLabel() + " (" + (rl.getResourceList().getListSize()) + ")");
        }
    });
    //resourcesDropDown.add(rl);
    //resourcesDropDown.setOpen(true);
    //rl.attachClickListeners();

    setCurrentUser(currentUser);

    /*HorizontalPanel h2 = new HorizontalPanel();
    h2.setStyleName("console-middle-left-panel-float");
    h2.add(new HTML(" "));
    basePanel.add(h2,DockPanel.NORTH);*/

    /*tmp = new TasksManagementPanel(currentUser);
    pendingTasksDropDown = new DisclosurePanel();
    pendingTasksDropDownRounded = new RoundedPanel(pendingTasksDropDown);
    basePanel.add(pendingTasksDropDownRounded,DockPanel.NORTH);
            
    final DropDownHeaderPanel taskDropDownHeaderPanel = new DropDownHeaderPanel(UIStrings.getParticipantsLabel()+" (1)", 
       tmp.getListsBrowseControl(), pendingTasksDropDown);
            
    pendingTasksDropDown.setHeader(taskDropDownHeaderPanel);
    pendingTasksDropDown.setStyleName("tk-DropDownPanel");
            
    taskDropDownHeaderPanel.setText(UIStrings.getPendingTasksLabel());
            
    //pendingTasksDropDown.addHeaderControl(tmp.getListsBrowseControl());
            
    tmp.getListsBrowseControl().setContainerPanel(pendingTasksDropDown);
    pendingTasksDropDown.add(tmp);
    pendingTasksDropDown.setOpen(true);
    pendingTasksDropDown.setOpen(false);
    this.pendingTasksDropDownRounded.setVisible(false);*/

    if (!UIGlobals.isActivePresenter(currentUser)) {
        //this.resourcesDropDownRounded.setVisible(false);
        //this.pendingTasksDropDownRounded.setVisible(false);
        consoleLayout.setIDVisibility("main_showitems", false);
    } else {
        consoleLayout.setIDVisibility("main_showitems", true);
    }

    /*tmp.addListModelListenerToAllLists(new DefaultListModelListener()
    {
       public void listEntryAdded(ListEntry newEntry)
       {
          if (tmp.getNumberOfTasks() > 0)
          {
             pendingTasksDropDownRounded.setVisible(true);
             pendingTasksDropDown.setOpen(true);
          }
       }
       public void listEntryRemoved(ListEntry removedEntry)
       {
          if (tmp.getNumberOfTasks() == 0)
          {
             pendingTasksDropDown.setOpen(false);
             pendingTasksDropDownRounded.setVisible(false);
          }
       }
    });
    */

}

From source file:com.dimdim.conference.ui.layout.client.widget.ConsoleMiddleLeftPanel.java

License:Open Source License

public void setCurrentUser(UIRosterEntry currentUser) {
    this.currentUser = currentUser;
    rl.setCurrentUser(currentUser);//from w  w  w. ja  v  a 2s .  c om

    consoleLayout.addWidgetToID("show_items_navigation", rl.getResourceListPanel().getListBrowseControl());

    consoleLayout.addWidgetToID("leftpod_middle_items", rl.getListPanel());
    FocusPanel fp = new FocusPanel();
    fp.add(rl.getLhsLink());
    fp.setWidth("100%");
    //fp.setStyleName("user-list-hover");
    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);
    //RootPanel.get("share_wrapper").
    //Element elem = RootPanel.get("share_wrapper").getElement();
    //DOM.setElementProperty(elem, "onClick");
}

From source file:com.dimdim.conference.ui.layout2.client.ConsoleMiddleLeftPanel.java

License:Open Source License

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(/*  ww  w .j a  v  a  2 s.co m*/
                    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);
    }
}

From source file:com.dimdim.conference.ui.layout2.client.ConsoleMiddleLeftPanel.java

License:Open Source License

public void setCurrentUser(UIRosterEntry currentUser) {
    this.currentUser = currentUser;
    rl.setCurrentUser(currentUser);/*from w w  w  .  j av  a  2s  .  c  o  m*/

    //      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);
}

From source file:com.dimdim.conference.ui.panels.client.ChatWidget.java

License:Open Source License

private void fillContent(WorkspacePanel workSpace) {
    chatWidget = new DiscussionWidget(ClientModel.getClientModel().getRosterModel().getCurrentUser(),
            workSpace);//from w w w .j a  v a  2 s.co m
    chatWidget.setSize("100%", "100%");
    chatPanel.add(chatWidget);
    chatPanel.setCellHorizontalAlignment(chatWidget, HorizontalPanel.ALIGN_CENTER);
    FocusPanel otherLinksPanel = new FocusPanel();
    HorizontalPanel h1 = new HorizontalPanel();

    chatLink = new Label(ConferenceGlobals.getDisplayString("workspace.hide.chat.label", "Public Chat"));
    chatLink.setStyleName("common-text");
    chatLink.addStyleName("common-bold-text");

    h1.setWidth("100%");
    h1.add(chatLink);
    h1.setCellWidth(chatLink, "100%");
    h1.setCellHorizontalAlignment(chatLink, HorizontalPanel.ALIGN_CENTER);
    Image img = getPublicChatCloseImage();
    h1.add(img);
    Label l = new Label(" ");
    l.setWidth("10px");
    h1.add(l);

    otherLinksPanel.add(h1);
    otherLinksPanel
            .setTitle(ConferenceGlobals.getDisplayString("workspace.hide.chat.title", "Click to hide Chat"));

    verticalPanel.add(chatWidget);

    otherLinksPanel.setWidth("100%");
    otherLinksPanel.addStyleName("anchor-cursor");
    otherLinksPanel.addClickListener(this);

    workspaceLayout.addPanelToLayout("chat_pod_header", otherLinksPanel);
    workspaceLayout.addPanelToLayout("chat_pod_content", verticalPanel);

    addChatWidget();
}

From source file:com.xpn.xwiki.wysiwyg.client.widget.ListBox.java

License:Open Source License

/**
 * Creates a new list box./*from  ww w  .  j  a v a2  s .  c o  m*/
 */
public ListBox() {
    FocusPanel panel = new FocusPanel(list);
    panel.addClickListener(this);
    panel.addKeyboardListener(this);

    initWidget(panel);
    setStylePrimaryName("xListBox");
}