Пример #1
0
  @Override
  protected void onReset() {
    super.onReset();

    Console.MODULES.getHeader().highlight(NameTokens.DomainRuntimePresenter);

    String currentToken = placeManager.getCurrentPlaceRequest().getNameToken();
    if (!currentToken.equals(getProxy().getNameToken())) {
      lastSubPlace = currentToken;
    } else if (lastSubPlace != null) {
      placeManager.revealPlace(new PlaceRequest(lastSubPlace));
    }

    // first request, select default contents
    if (!hasBeenRevealed
        && NameTokens.DomainRuntimePresenter.equals(
            placeManager.getCurrentPlaceRequest().getNameToken())) {
      placeManager.revealPlace(new PlaceRequest(NameTokens.InstancesPresenter));
      hasBeenRevealed = true;
    } else if (!NameTokens.DomainRuntimePresenter.equals(
        placeManager.getCurrentPlaceRequest().getNameToken())) {
      Scheduler.get()
          .scheduleDeferred(
              new Scheduler.ScheduledCommand() {
                @Override
                public void execute() {
                  loadHostData();
                }
              });
    }
  }
Пример #2
0
 @Override
 protected void onReset() {
   super.onReset();
   PlaceRequest currentPlace = placeManager.getCurrentPlaceRequest();
   if (phenotype != null) {
     getView().showPhenotypeInfo(phenotype);
     if (currentPlace.getParameterNames().size() == 1) {
       phenotypeOverviewPresenter.setData(phenotype, mRNAHistogramDataTable, bsHistogramDataTable);
       setInSlot(TYPE_SetMainContent, phenotypeOverviewPresenter);
       getView().setActiveLink(NAV_ITEMS.Overview, SUB_NAV_ITEMS.mRNA);
     } else {
       Dataset dataset =
           phenotype.getDatasetFromName(
               Dataset.TYPE.valueOf(currentPlace.getParameter("dataset", "")));
       String env = currentPlace.getParameter("env", "");
       if (env.equals("GxE")) {
         gxeDetailPresenter.setData(phenotype, dataset);
         setInSlot(TYPE_SetMainContent, gxeDetailPresenter);
       } else {
         phenotypeDetailPresenter.setData(
             phenotype,
             dataset.getEnvironmentFromName(env),
             getSingleHistogramDataTable(env, dataset.getType()));
         setInSlot(TYPE_SetMainContent, phenotypeDetailPresenter);
       }
       getView().setActiveLink(NAV_ITEMS.valueOf(env), SUB_NAV_ITEMS.mRNA);
     }
   }
 }
  @Override
  protected void onReset() {
    super.onReset();

    String nameToken = placeManager.getCurrentPlaceRequest().getNameToken();
    getView().selectProduct(nameToken);
  }
Пример #4
0
  @Override
  public void prepareFromRequest(PlaceRequest request) {
    super.prepareFromRequest(request);
    PlaceRequest currentPlace = placeManager.getCurrentPlaceRequest();
    String phenotype_id = currentPlace.getParameter("id", "");
    if (phenotype_id.equals("")) getProxy().manualReveal(PhenotypePresenter.this);
    else {
      dispatch.execute(
          new GetPhenotypeDataAction(phenotype_id, phenotypeReader),
          new CustomCallback<GetPhenotypeDataActionResult>(getEventBus()) {

            @Override
            public void onSuccess(GetPhenotypeDataActionResult result) {
              PhenotypePresenter.this.phenotype = result.getPhenotype();
              PhenotypePresenter.this.mRNAHistogramDataTable = result.getmRNAHistogramDataTable();
              PhenotypePresenter.this.bsHistogramDataTable = result.getBsHistogramDataTable();
              getProxy().manualReveal(PhenotypePresenter.this);
            }

            @Override
            public void onFailure(Throwable caught) {
              getProxy().manualReveal(PhenotypePresenter.this);
              super.onFailure(caught);
              // getProxy().manualRevealFailed();
            }
          });
    }
  }
Пример #5
0
  @Override
  public void onBootstrap() {
    if (appConfig.isUseCookieDomainNone()) {
      analytics.create().cookieDomain("none");
    } else {
      analytics.create();
    }

    placeManager.revealPlace(new PlaceRequest.Builder().nameToken(NameTokens.visualizer).build());
  }
  @Override
  protected void onReset() {

    header.highlight(getProxy().getNameToken());

    if (getProxy().getNameToken().equals(placeManager.getCurrentPlaceRequest().getNameToken()))
      loadServer();

    if (!hasBeenLoaded) hasBeenLoaded = true;
  }
Пример #7
0
 private void initUserSession() {
   String username = requestCredentials.getUsername();
   if (!requestCredentials.hasCredentials()) {
     placeManager.revealUnauthorizedPlace(Places.LOGIN);
   } else if (Strings.isNullOrEmpty(username) || "undefined".equals(username)) {
     initUsernameFromSession();
   } else {
     revealCurrentPlace();
   }
 }
Пример #8
0
  @Override
  public void openCard(boolean addContent) {
    cachingService.putCachedObject(
        StorySummary.class,
        CachedObjectKeys.OPENED_STORY,
        editedStorySummary == null ? storySummary : editedStorySummary);

    PlaceRequest place = getStoryDetailsPlaceRequestBuilder(addContent, true).build();
    placeManager.revealRelativePlace(place);
  }
Пример #9
0
  @Override
  public void onSearchTag(String tag) {
    PlaceRequest placeRequest =
        new PlaceRequest.Builder()
            .nameToken(NameTokens.stories)
            .with(ParameterTokens.search, "tag:(" + tag + ")")
            .build();

    placeManager.revealPlace(placeRequest);
  }
Пример #10
0
 public void requestHostIndex(int hostIndex) {
   // TODO Use the in-memory model of the topology for paging
   PlaceRequest.Builder builder =
       new PlaceRequest.Builder()
           .nameToken(NameTokens.Topology)
           .with("hostIndex", String.valueOf(hostIndex));
   if (fake) {
     builder.with("fake", "true");
   }
   placeManager.revealPlace(builder.build());
 }
  @Override
  protected void onReveal() {
    super.onReveal();

    PlaceRequest currentPlaceRequest = placeManager.getCurrentPlaceRequest();
    if (!hasBeenRevealed
        && NameTokens.ServerGroupMgmtPresenter.equals(currentPlaceRequest.getNameToken())) {
      hasBeenRevealed = true;

      // update LHS
      serverGroupStore.loadServerGroups(
          new SimpleCallback<List<ServerGroupRecord>>() {
            @Override
            public void onSuccess(List<ServerGroupRecord> result) {
              getView().updateServerGroups(result);
            }
          });

      // forward default to ServerGroupPresenter, this presenter doesn't have a default view
      placeManager.revealRelativePlace(new PlaceRequest(NameTokens.ServerGroupPresenter));
    }
  }
  @Override
  public void onCloseTab(NavigationTab element) {
    int index = elements.indexOf(element);
    getView().removeTab(index);
    elements.remove(index);
    if (index >= elements.size()) {
      index = (elements.size() - 1) >= 0 ? (elements.size() - 1) : 0;
    }

    if (index == 0 && elements.size() == 0) {
      placeManager.revealPlace(new PlaceRequest.Builder().nameToken(NameTokens.getCars()).build());
    } else {
      onTabSelected(index);
    }
  }
Пример #13
0
 @Override
 public void render(Context context, CandidateGeneListProxy value, SafeHtmlBuilder sb) {
   if (value == null) return;
   placeRequest.with("id", value.getId().toString());
   SafeUri link =
       UriUtils.fromTrustedString("#" + placeManager.buildHistoryToken(placeRequest.build()));
   SafeHtml name = SafeHtmlUtils.fromString(value.getName());
   SafeHtmlBuilder builder = new SafeHtmlBuilder();
   builder
       .append(SafeHtmlUtils.fromSafeConstant("created on "))
       .append(
           SafeHtmlUtils.fromString(
               DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.DATE_SHORT)
                   .format(value.getCreated())))
       .append(SafeHtmlUtils.fromSafeConstant(" by "))
       .append(
           SafeHtmlUtils.fromString(
               value.getOwnerUser().getFirstname() + " " + value.getOwnerUser().getLastname()));
   sb.append(templates.cell(link, name, builder.toSafeHtml()));
 }
Пример #14
0
  @Override
  protected void onReset() {
    super.onReset();

    getView().setMessage("Loading...");
    getView().setBackLinkHistoryToken(placeManager.buildRelativeHistoryToken(-1));
    dispatcher.execute(
        new GetProductAction(id),
        new AsyncCallback<GetProductResult>() {
          @Override
          public void onFailure(Throwable caught) {
            getView().setMessage("Unknown product");
          }

          @Override
          public void onSuccess(GetProductResult result) {
            getView().setProductDetails(result.getProduct());
          }
        });
  }
  @Override
  public void execute() {
    String initialToken = History.getToken();
    if (!initialToken.isEmpty() && !isBlackListed(initialToken)) {
      List<PlaceRequest> hierarchy = formatter.toPlaceRequestHierarchy(initialToken);
      final PlaceRequest placeRequest = hierarchy.get(hierarchy.size() - 1);

      Scheduler.get()
          .scheduleDeferred(
              new Scheduler.ScheduledCommand() {
                @Override
                public void execute() {
                  placeManager.revealPlace(placeRequest, true);
                }
              });
      bootstrapContext.setInitialPlace(placeRequest.getNameToken());
    } else {
      placeManager.revealDefaultPlace();
    }
  }
Пример #16
0
  @Override
  protected void onReveal() {
    super.onReveal();

    if (isStoryDetails) {
      tagsPresenter.setSearchTagHandler(this);
      addVisibleHandler(CreateContentEvent.TYPE, this);
      getView().setForStoryDetails();
    } else {
      tagsPresenter.setSearchTagHandler(null);
      String historyToken =
          placeManager.buildHistoryToken(getStoryDetailsPlaceRequestBuilder(false, false).build());
      getView().setForStoryCard(historyToken);
    }

    if (isEditMode) {
      StorySummary openedStoryData =
          cachingService.getCachedObject(StorySummary.class, CachedObjectKeys.OPENED_STORY);
      doEdit(openedStoryData);
    }
  }
 @Override
 public void onTabSelected(int index) {
   placeManager.revealPlace(
       new PlaceRequest.Builder().nameToken(elements.get(index).getToken()).build());
 }
Пример #18
0
 @Override
 public void logout() {
   securityUtils.clearCredentials();
   placeManager.revealPlace(new PlaceRequest(NameTokens.getLogin()));
 }
Пример #19
0
 private void setHistoryTokens() {
   getView()
       .setTaxonomiesHistoryToken(
           placeManager.buildRelativeHistoryToken(
               new PlaceRequest.Builder().nameToken(Places.TAXONOMIES).build(), 1));
 }
Пример #20
0
 @UiHandler("contact")
 public void onButtonClick2(final ClickEvent event) {
   PlaceRequest myRequest = new PlaceRequest(NameTokens.CONTACT);
   place.revealPlace(myRequest);
 }
Пример #21
0
 @Override
 protected void onReset() {
   super.onReset();
   if (placeManager.getCurrentPlaceRequest().matchesNameToken(getProxy().getNameToken()))
     refreshServerList();
 }
Пример #22
0
 @Override
 public void onPreviousVariable() {
   placeManager.revealPlace(
       ProjectPlacesHelper.getVariablePlace(
           table.getDatasourceName(), table.getName(), previousVariable.getName()));
 }
Пример #23
0
 @UiHandler("menuBar")
 void onMenuItemChanged(ValueChangeEvent<MenuItem> event) {
   placeManager.revealPlace(
       new PlaceRequest.Builder().nameToken(menuBar.getValue().getPlaceToken()).build());
 }
  public void editEmpDetails(Integer empId) {

    PlaceRequest placerequest =
        new PlaceRequest(NameTokens.editdetails).with("Param", empId.toString());
    placemanager.revealPlace(placerequest);
  }
Пример #25
0
  private void initTree() {
    String section_key = "section";
    String subsection_key = "subsection";
    TreeItem root = new TreeItem("Help");
    PlaceRequest rootPlace = new PlaceRequest(NameTokens.helpPage);

    tree.addItem(
            new Hyperlink(
                "Introduction",
                placeManager.buildHistoryToken(rootPlace.with(section_key, "introduction"))))
        .setUserObject("introduction");

    // Phenotypes
    TreeItem phenotypes_item =
        new TreeItem(
            new Hyperlink(
                "Phenotypes",
                placeManager.buildHistoryToken(rootPlace.with(section_key, "phenotypes"))));
    phenotypes_item.setUserObject("phenotypes");
    phenotypes_item
        .addItem(
            new Hyperlink(
                "Uploading Phenotypes",
                placeManager.buildHistoryToken(
                    rootPlace.with(section_key, "phenotypes").with(subsection_key, "upload"))))
        .setUserObject("phenotypes_upload");
    phenotypes_item
        .addItem(
            new Hyperlink(
                "Phenotype Format",
                placeManager.buildHistoryToken(
                    rootPlace.with(section_key, "phenotypes").with(subsection_key, "format"))))
        .setUserObject("phenotypes_format");
    tree.addItem(phenotypes_item);

    // Accessions
    TreeItem accession_item =
        new TreeItem(
            new Hyperlink(
                "Accessions",
                placeManager.buildHistoryToken(rootPlace.with(section_key, "accessions"))));
    accession_item.setUserObject("accessions");
    tree.addItem(accession_item);

    // Analysis
    TreeItem analysis_item =
        new TreeItem(
            new Hyperlink(
                "Analysis",
                placeManager.buildHistoryToken(rootPlace.with(section_key, "analysis"))));
    analysis_item.setUserObject("analysis");
    analysis_item
        .addItem(
            new Hyperlink(
                "Navigation",
                placeManager.buildHistoryToken(
                    rootPlace.with(section_key, "analysis").with(subsection_key, "navigation"))))
        .setUserObject("analysis_navigation");
    analysis_item
        .addItem(
            new Hyperlink(
                "Phenotypes",
                placeManager.buildHistoryToken(
                    rootPlace.with(section_key, "analysis").with(subsection_key, "phenotypes"))))
        .setUserObject("analysis_phenotypes");
    analysis_item
        .addItem(
            new Hyperlink(
                "Datasets",
                placeManager.buildHistoryToken(
                    rootPlace.with(section_key, "analysis").with(subsection_key, "datasets"))))
        .setUserObject("analysis_datasets");
    analysis_item
        .addItem(
            new Hyperlink(
                "Transformations",
                placeManager.buildHistoryToken(
                    rootPlace
                        .with(section_key, "analysis")
                        .with(subsection_key, "transformations"))))
        .setUserObject("analysis_transformations");
    analysis_item
        .addItem(
            new Hyperlink(
                "Results",
                placeManager.buildHistoryToken(
                    rootPlace.with(section_key, "analysis").with(subsection_key, "results"))))
        .setUserObject("analysis_results");
    tree.addItem(analysis_item);

    // Tutorial
    /*TreeItem tutorial_item = new TreeItem(new Hyperlink("Tutorial",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial"))));
    tutorial_item.setUserObject("tutorial");
    tutorial_item.addItem(new Hyperlink("1.) Uploading Phenotypes",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial").with(subsection_key, "uploading")))).setUserObject("tutorial_uploading");
    tutorial_item.addItem(new Hyperlink("2.) Creating subset",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial").with(subsection_key, "subset")))).setUserObject("tutorial_subset");
    tutorial_item.addItem(new Hyperlink("3.) Changing transformation",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial").with(subsection_key, "transformation")))).setUserObject("tutorial_transformation");
    tutorial_item.addItem(new Hyperlink("4.) Running GWAS",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial").with(subsection_key, "gwas")))).setUserObject("tutorial_gwas");
    tutorial_item.addItem(new Hyperlink("5.) Viewing Results",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial").with(subsection_key, "results")))).setUserObject("tutorial_results");
    tutorial_item.addItem(new Hyperlink("6.) Running Step-Wise GWAS",placeManager.buildHistoryToken(rootPlace.with(section_key, "tutorial").with(subsection_key, "gwas_step")))).setUserObject("tutorial_gwas_step");
    tree.addItem(tutorial_item);*/
    Iterator<TreeItem> iterator = tree.treeItemIterator();
    while (iterator.hasNext()) {
      iterator.next().setState(true, false);
    }
  }
Пример #26
0
 @Override
 public void onGoBack(GoBackEvent event) {
   placeManager.revealPlace(new Builder().nameToken(NameTokens.getRating()).build());
 }