Java 类com.google.gwt.user.client.ui.InlineHyperlink 实例源码

项目:ontobrowser    文件:HyperlinkCell.java   
@Override
@SuppressWarnings("deprecation")
public void onBrowserEvent(Context context,
        Element parent, InlineHyperlink value, NativeEvent nativeEvent,
        ValueUpdater<InlineHyperlink> valueUpdater) {
    super.onBrowserEvent(context, parent, value, nativeEvent, valueUpdater);
    Event event = Event.as(nativeEvent);
    if(DOM.eventGetType(event) == Event.ONCLICK && impl.handleAsClick(event)) {
        Element target = Element.as(event.getEventTarget());
        Element child = parent.getFirstChildElement();
        if(child.isOrHasChild(target)) {
            History.newItem(value.getTargetHistoryToken());
            DOM.eventPreventDefault(event);
        }
    }
}
项目:google-apis-explorer    文件:FullView.java   
/**
 * Generate breadcrumbs into the specified container using the format link > link > text where the
 * last breadcrumb is always plain text.
 */
private void generateBreadcrumbs(Panel container, List<Title> titles) {
  container.clear();

  // For all of the titles previous to the last, add a link and a separator.
  for (Title notLast : titles.subList(0, titles.size() - 1)) {
    container.add(new InlineHyperlink(notLast.getTitle(), notLast.getFragment()));
    container.add(new InlineLabel(" > "));
  }

  // Append only the text for the last title.
  Title lastTitle = Iterables.getLast(titles);
  container.add(new InlineLabel(lastTitle.getTitle()));
  if (lastTitle.getSubtitle() != null) {
    Label subtitle = new InlineLabel(" - " + lastTitle.getSubtitle());
    subtitle.addStyleName(style.methodSubtitle());
    container.add(subtitle);
  }
}
项目:ontobrowser    文件:HistoryPopup.java   
@Override
public InlineHyperlink getValue(CuratorAction action) {
    Term term = getTerm(action.getEntity());

    return term != null ? 
            new InlineHyperlink(term.getName(), term.getReferenceId()) : null;
}
项目:gharonda    文件:AppView.java   
@Override
public void initBreadcrumbs(int breadcrumbSize, String _heading) {
    breadCrumbPanel.setVisible(true);
    breadcrumbs.clear();
    heading.setHTML("<h1>" + _heading + "</h1>");
    for (int i = 0; i < breadcrumbSize; ++i) {
        if (i > 0) {
            breadcrumbs.add(new InlineLabel(" > "));
        }
        breadcrumbs.add(new InlineHyperlink("Loading title...", placeManager.buildRelativeHistoryToken(i + 1)));
    }

}
项目:gharonda    文件:AppView.java   
@Override
public void setBreadcrumbs(int index, String title) {
    InlineHyperlink hyperlink = (InlineHyperlink) breadcrumbs.getWidget(index * 2);
    if (title == null) {
        hyperlink.setHTML("Unknown title");
    } else {
        hyperlink.setHTML(title);
    }

}
项目:ontobrowser    文件:HyperlinkCell.java   
@Override
public void render(Context context, InlineHyperlink h, SafeHtmlBuilder sb) {
    if(h != null) {
        sb.append(SafeHtmlUtils.fromTrustedString(h.toString()));
    }
}
项目:ontobrowser    文件:ApproveRejectTermComposite.java   
@Override
public InlineHyperlink getValue(Term term) {
    return new InlineHyperlink(term.getName(), term.getReferenceId());
}
项目:ontobrowser    文件:AddRelationshipPopup.java   
@Override
public InlineHyperlink getValue(Term term) {
    return new InlineHyperlink(term.getName(), term.getReferenceId());
}
项目:ontobrowser    文件:ApproveRejectRelationshipComposite.java   
@Override
public InlineHyperlink getValue(Relationship relationship) {
    Term term = relationship.getTerm();
    return new InlineHyperlink(term.getName(), term.getReferenceId());
}
项目:ontobrowser    文件:ApproveRejectRelationshipComposite.java   
@Override
public InlineHyperlink getValue(Relationship relationship) {
    Term term = relationship.getRelatedTerm();
    return new InlineHyperlink(term.getName(), term.getReferenceId());
}
项目:ontobrowser    文件:ReplaceTermPopup.java   
@Override
public InlineHyperlink getValue(Term term) {
    return new InlineHyperlink(term.getName(), term.getReferenceId());
}
项目:ontobrowser    文件:SearchResultsView.java   
@Override
public void onSearch(SearchEvent event) {
    final String pattern = event.getPattern();
    final Object source = event.getSource(); 
    lastPattern = pattern;

    if(source != null && busyIndicator == null && source instanceof Widget) {
        busyIndicator = new WidgetBusyIndicatorHandler((Widget)source, "busy-icon-left", "error-icon-left");
    }

    if(pattern != null && pattern.length() > 1) {
        if(busyIndicator != null) { 
            busyIndicator.busy();
        }

        service.search(pattern, searchOptions.includeSynonyms(), 
                new AsyncCallback<List<HTMLSearchResult>>() {
            public void onFailure(Throwable caught) {
                ul.clear();
                if(busyIndicator != null) {
                    busyIndicator.idle();
                }
                if(caught instanceof InvalidQuerySyntaxException) {
                    if(busyIndicator != null) {
                        busyIndicator.error();
                    }
                } else {
                    GWT.log("Failed to load search results", caught);
                    ErrorView.instance().onUncaughtException(caught);
                }
            }

            public void onSuccess(List<HTMLSearchResult> results) {
                if (pattern == lastPattern) {
                    String filterByOntology = searchOptions.filterByOntology();
                    ul.clear();
                    for (HTMLSearchResult result : results) {
                        if(filterByOntology == null 
                                || filterByOntology.equals(result.getOntology())) {
                            ListItem li = new ListItem();
                            InlineHyperlink hyperlink = new InlineHyperlink(
                                    SafeHtmlUtils.fromTrustedString(result.getHtml()), 
                                    result.getReferenceId());
                            li.add(hyperlink);

                            if(filterByOntology == null) {
                                InlineLabel ontology = new InlineLabel(result.getOntology());
                                ontology.addStyleName("search-result-tag");
                                li.add(ontology);
                            }

                            if(result.isSynonym()) {
                                InlineLabel synonym = new InlineLabel("synonym");
                                synonym.addStyleName("search-result-tag");
                                li.add(synonym);
                            }

                            ul.add(li);
                        }
                    }
                } else {
                    GWT.log("Ignoring results from previous search: " + pattern);
                }
                if(busyIndicator != null) {
                    busyIndicator.idle();
                }
            }
        });
    } else {
        ul.clear();
    }
}
项目:ontobrowser    文件:RelatedTermsView.java   
@Override
public InlineHyperlink getValue(Relationship relationship) {
    Term term = relationship.getRelatedTerm();
    return new InlineHyperlink(term.getName(), term.getReferenceId()); 
}
项目:ontobrowser    文件:ApproveRejectSynonymComposite.java   
@Override
public InlineHyperlink getValue(Synonym synonym) {
    Term term = synonym.getTerm();
    return new InlineHyperlink(term.getName(), term.getReferenceId());
}
项目:google-apis-explorer    文件:JsonPrettifier.java   
@Override
public Widget generateAnchor(String embeddingText, String fragment) {
  return new InlineHyperlink(embeddingText, fragment);
}