code: protected void openPopup() {
  
          m_popup.setWidth(475);
          m_popup.setAutoHideEnabled(true);
          m_popup.addCloseHandler(new CloseHandler<PopupPanel>() {
  
              public void onClose(CloseEvent<PopupPanel> event) {
  
                  closePopupDefault();
  
              }
          });
  
          m_popup.addDialogClose(new Command() {
  
              public void execute() {
  
                  // nothing to do all will be done in onClose();
  
              }
          });
  
          if (m_previewHandlerRegistration != null) {
              m_previewHandlerRegistration.removeHandler();
  
          }
          m_previewHandlerRegistration = Event.addNativePreviewHandler(new CloseEventPreviewHandler());
          m_popup.showRelativeTo(m_colorField);
  
          m_popup.setModal(false);
          if (m_popup.getWidgetCount() != 0) {
              m_popup.remove(m_popup.getWidget(0));
          }
          CmsColorSelector picker = new CmsColorSelector();
          try {
              picker.setHex(m_textboxColorValue.getText().replace("#", ""));
          } catch (Exception e) {
              // TODO: Auto-generated catch block
          }
          m_popup.add(picker);
          if (m_count == 0) {
              CmsPushButton close = new CmsPushButton();
              CmsPushButton cancel = new CmsPushButton();
              cancel.setText(Messages.get().key(Messages.GUI_CANCEL_0));
              cancel.setTitle(Messages.get().key(Messages.GUI_CANCEL_0));
              close.setText(Messages.get().key(Messages.GUI_OK_0));
              close.setTitle(Messages.get().key(Messages.GUI_OK_0));
              close.addClickHandler(new ClickHandler() {
  
                  public void onClick(ClickEvent event) {
  
                      closePopup();
  
                  }
              });
              cancel.addClickHandler(new ClickHandler() {
  
                  public void onClick(ClickEvent event) {
  
                      closePopupDefault();
  
                  }
              });
              m_popup.addButton(cancel);
              m_popup.addButton(close);
              m_count = 1;
          }
  
          m_xcoordspopup = m_popup.getPopupLeft();
          m_ycoordspopup = m_popup.getPopupTop();
  
      }
docs: Helper function  to open the popup.<p>