code: protected void saveCategories() {
  
          final List<String> categories = m_categoryTree.getAllSelected();
          CmsRpcAction<Void> action = new CmsRpcAction<Void>() {
  
              @Override
              public void execute() {
  
                  start(0, true);
                  CmsCoreProvider.getService().setResourceCategories(m_structureId, categories, this);
              }
  
              @Override
              protected void onResponse(Void result) {
  
                  stop(false);
                  hide();
                  if (m_onSave != null) {
                      m_onSave.execute();
                  }
              }
          };
          action.execute();
      }
docs: Saves the selected categories and hides the dialog.<p>