code: private void initModeSwitch(final EditMode current) {
  
          FormLayout modes = new FormLayout();
          modes.setHeight("100%");
          modes.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
  
          m_modeSelect = new ComboBox();
          m_modeSelect.setCaption(m_messages.key(Messages.GUI_VIEW_SWITCHER_LABEL_0));
  
          // add Modes
          m_modeSelect.addItem(CmsMessageBundleEditorTypes.EditMode.DEFAULT);
          m_modeSelect.setItemCaption(
              CmsMessageBundleEditorTypes.EditMode.DEFAULT,
              m_messages.key(Messages.GUI_VIEW_SWITCHER_EDITMODE_DEFAULT_0));
          m_modeSelect.addItem(CmsMessageBundleEditorTypes.EditMode.MASTER);
          m_modeSelect.setItemCaption(
              CmsMessageBundleEditorTypes.EditMode.MASTER,
              m_messages.key(Messages.GUI_VIEW_SWITCHER_EDITMODE_MASTER_0));
  
          // set current mode as selected
          m_modeSelect.setValue(current);
  
          m_modeSelect.setNewItemsAllowed(false);
          m_modeSelect.setTextInputAllowed(false);
          m_modeSelect.setNullSelectionAllowed(false);
  
          m_modeSelect.addValueChangeListener(new ValueChangeListener() {
  
              private static final long serialVersionUID = 1L;
  
              public void valueChange(ValueChangeEvent event) {
  
                  m_listener.handleModeChange((EditMode)event.getProperty().getValue());
  
              }
          });
  
          modes.addComponent(m_modeSelect);
          m_modeSwitch = modes;
      }
docs: Initializes the mode switcher.
  @param current the current edit mode