@Override
 public void changeSelection(SelectionChangedEvent<GPClientProject> se) {
   GPClientProject clientProject = se.getSelectedItem();
   if (clientProject != null) {
     super.selectButton.enable();
     IGPAccountDetail accountInSession =
         Registry.get(UserSessionEnum.ACCOUNT_DETAIL_IN_SESSION.name());
     if (clientProject.getOwner() == null
         || clientProject.getOwner().getId().equals(accountInSession.getId())) {
       deleteButton.enable();
       this.editButton.enable();
       this.shareButton.enable();
     } else {
       this.shareButton.disable();
       this.editButton.disable();
       deleteButton.disable();
     }
   } else {
     selectButton.disable();
     deleteButton.disable();
     editButton.disable();
     this.shareButton.disable();
   }
 }
 @Override
 public void finalizeInitOperations() {
   super.finalizeInitOperations();
   super.selectButton.setText(
       LayerModuleConstants.INSTANCE.GPProjectSearchPanel_selectButtonText());
   super.search.setFieldLabel(
       LayerModuleConstants.INSTANCE.GPProjectSearchPanel_searchlabelText());
   GPProjectAction action = new GPProjectAction(GPTrustedLevel.HIGH, this);
   GPSecureButton addProjectButton =
       new GPSecureButton(
           ButtonsConstants.INSTANCE.addText(),
           AbstractImagePrototype.create(LayerResources.ICONS.projectAdd()),
           action);
   super.addButton(1, addProjectButton);
   addProjectButton.disable();
   this.editButton =
       new GPSecureButton(
           ButtonsConstants.INSTANCE.editText(),
           AbstractImagePrototype.create(BasicWidgetResources.ICONS.edit()),
           action);
   this.editButton.disable();
   super.addButton(2, this.editButton);
   this.deleteButton =
       new GPSecureButton(
           ButtonsConstants.INSTANCE.deleteText(),
           AbstractImagePrototype.create(LayerResources.ICONS.projectDelete()),
           new DeleteProjectAction(GPTrustedLevel.FULL, this));
   this.deleteButton.disable();
   super.addButton(3, this.deleteButton);
   ShareProjectAction shareProjectAction = new ShareProjectAction(GPTrustedLevel.HIGH, this);
   this.shareButton =
       new GPSecureButton(
           ButtonsConstants.INSTANCE.shareText(),
           AbstractImagePrototype.create(LayerResources.ICONS.arrowRefresh()),
           shareProjectAction);
   this.shareButton.disable();
   super.addButton(4, this.shareButton);
 }
  @Override
  public void createStore() {
    super.toolBar = new PagingToolBar(super.getPageSize());
    super.proxy =
        new RpcProxy<PagingLoadResult<GPClientProject>>() {

          @Override
          protected void load(
              final Object loadConfig,
              final AsyncCallback<PagingLoadResult<GPClientProject>> callback) {

            final SearchProjectsRequest searchProjectsRequest =
                GWT.<SearchProjectsRequest>create(SearchProjectsRequest.class);

            searchProjectsRequest.setConfig((PagingLoadConfig) loadConfig);
            searchProjectsRequest.setSearchText(searchText);
            searchProjectsRequest.setImageURL(
                AbstractImagePrototype.create(LayerResources.ICONS.gpProject()).getHTML());

            ClientCommandDispatcher.getInstance()
                .execute(
                    new GPClientCommand<SearchProjectsResponse>() {

                      private static final long serialVersionUID = 3109256773218160485L;

                      {
                        super.setCommandRequest(searchProjectsRequest);
                      }

                      @Override
                      public void onCommandSuccess(SearchProjectsResponse response) {
                        callback.onSuccess(response.getResult());
                      }

                      @Override
                      public void onCommandFailure(Throwable caught) {
                        if (caught.getCause() instanceof GPSessionTimeout) {
                          GPHandlerManager.fireEvent(new GPLoginEvent(null));
                        } else {
                          LayoutManager.getInstance()
                              .getStatusMap()
                              .setStatus(
                                  LayerModuleConstants.INSTANCE
                                      .GPProjectManagementWidget_headingText(),
                                  SearchStatus.EnumSearchStatus.STATUS_NO_SEARCH.toString());
                        }
                      }
                    });
            //
            //                LayerRemote.Util.getInstance().searchProjects(
            //                        (PagingLoadConfig) loadConfig,
            //                        searchText, LayerResources.ICONS.gpProject().getHTML(),
            //                        callback);
          }
        };
    super.loader = new BasePagingLoader<PagingLoadResult<ModelData>>(proxy);
    super.loader.setRemoteSort(false);
    super.store = new ListStore<GPClientProject>(loader);
    super.store.setMonitorChanges(true);
    super.toolBar.bind(loader);
  }
 public void loadData() {
   super.init();
   searchText = "";
   loader.load(0, getPageSize());
 }
 @Override
 public void setPanelProperties() {
   super.setHeaderVisible(Boolean.FALSE);
   super.setSize(
       GPProjectManagementWidget.COMPONENT_WIDTH, GPProjectManagementWidget.COMPONENT_HEIGHT);
 }