コード例 #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);
     }
   }
 }
コード例 #3
0
  @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());
  }
コード例 #6
0
  @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());
 }
コード例 #11
0
  @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));
    }
  }
コード例 #12
0
  @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());
          }
        });
  }
コード例 #15
0
  @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);
    }
  }
コード例 #17
0
 @Override
 public void onTabSelected(int index) {
   placeManager.revealPlace(
       new PlaceRequest.Builder().nameToken(elements.get(index).getToken()).build());
 }
コード例 #18
0
ファイル: HeaderPresenter.java プロジェクト: imrabti/myschool
 @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
ファイル: ProjectView.java プロジェクト: regnou/TGM
 @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());
 }
コード例 #24
0
  public void editEmpDetails(Integer empId) {

    PlaceRequest placerequest =
        new PlaceRequest(NameTokens.editdetails).with("Param", empId.toString());
    placemanager.revealPlace(placerequest);
  }
コード例 #25
0
ファイル: HelpView.java プロジェクト: timeu/GWAPP
  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());
 }