本文整理汇总了Java中com.google.gwt.user.client.ui.Anchor.addClickHandler方法的典型用法代码示例。如果您正苦于以下问题:Java Anchor.addClickHandler方法的具体用法?Java Anchor.addClickHandler怎么用?Java Anchor.addClickHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Anchor
的用法示例。
在下文中一共展示了Anchor.addClickHandler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: UniTimeDialogBox
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public UniTimeDialogBox(boolean autoHide, boolean modal) {
super(autoHide, modal);
setAnimationEnabled(true);
setGlassEnabled(true);
iContainer = new FlowPanel();
iContainer.addStyleName("dialogContainer");
iClose = new Anchor();
iClose.setTitle(MESSAGES.hintCloseDialog());
iClose.setStyleName("close");
iClose.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
onCloseClick(event);
}
});
iClose.setVisible(autoHide);
iControls = new FlowPanel();
iControls.setStyleName("dialogControls");
iControls.add(iClose);
}
示例2: buildClick
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public Anchor buildClick() {
Anchor anchor = new Anchor();
if (image != null) {
anchor.getElement().appendChild(image.getElement());
}
if (text != null) {
anchor.setText(text);
}
if (title != null) {
anchor.setTitle(title);
}
if (clickHandler != null) {
anchor.addClickHandler(clickHandler);
}
return anchor;
}
示例3: appendChilds
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void appendChilds(TreeWidget rootEnt, JSONArray children) {
for (int i = 0; i < children.size(); ++i) {
nextEntityName = children.get(i).isString().stringValue();
Anchor a = new Anchor(nextEntityName + " (" + entities.get(nextEntityName).getLeft() + ")");
a.setWidth("100%");
a.setStyleName("font");
a.addClickHandler(new ClickHandler() {
String name = nextEntityName;
@Override
public void onClick(ClickEvent event) {
module.setSelectedEntity(name);
}
});
HorizontalPanel cPanel = new HorizontalPanel();
cPanel.setStyleName("tree");
cPanel.setWidth("100%");
cPanel.add(a);
TreeWidget c = new TreeWidget(cPanel);
rootEnt.addChild(c);
if (children.size() > 0) appendChilds(c, entities.get(nextEntityName).getRight());
}
}
示例4: appendChilds
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void appendChilds(TreeWidget rootEnt, JSONArray children) {
for (int i = 0; i < children.size(); ++i) {
nextEntityName = children.get(i).isString().stringValue();
Anchor a = new Anchor(nextEntityName + " (" + entities.get(nextEntityName).getLeft() + ")");
a.setWidth("100%");
a.setStyleName("font");
a.addClickHandler(new ClickHandler() {
String name = nextEntityName;
@Override
public void onClick(ClickEvent event) {
setSelectedEntity(name);
}
});
HorizontalPanel cPanel = new HorizontalPanel();
cPanel.setStyleName("tree");
cPanel.setWidth("100%");
cPanel.add(a);
TreeWidget c = new TreeWidget(cPanel);
rootEnt.addChild(c);
if (children.size() > 0) appendChilds(c, entities.get(nextEntityName).getRight());
}
}
示例5: AlertStackWidget
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public AlertStackWidget() {
alertWidgets = new ArrayList<AlertWidget>();
VerticalPanel rootPanel = new VerticalPanel();
rootPanel.setWidth("100%");
alertsPanel = new VerticalPanel();
alertsPanel.setWidth("100%");
rootPanel.add(alertsPanel);
showHideAnchor = new Anchor(
I18nUtils.tr(visible ? "hide.alerts" : "show.alerts"));
showHideAnchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
visible = !visible;
alertsPanel.setVisible(visible);
showHideAnchor.setText(
I18nUtils.tr(visible ? "hide.alerts" : "show.alerts"));
}
});
showHideAnchor.addStyleName("alert-showhide-link");
showHideAnchor.setVisible(false);
rootPanel.add(showHideAnchor);
initWidget(rootPanel);
}
示例6: setUpBlame
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
void setUpBlame(final CodeMirror cm, boolean isBase, PatchSet.Id rev, String path) {
if (!Patch.isMagic(path) && Gerrit.isSignedIn() && Gerrit.info().change().allowBlame()) {
Anchor blameIcon = createBlameIcon();
blameIcon.addClickHandler(
new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
if (cm.extras().getBlameInfo() != null) {
cm.extras().toggleAnnotation();
} else {
ChangeApi.blame(Project.NameKey.asStringOrNull(project), rev, path, isBase)
.get(
new GerritCallback<JsArray<BlameInfo>>() {
@Override
public void onSuccess(JsArray<BlameInfo> lines) {
cm.extras().toggleAnnotation(lines);
}
});
}
}
});
linkPanel.add(blameIcon);
}
}
示例7: addLink
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public void addLink(String label, final String target) {
final Anchor anchor = new Anchor(new SafeHtmlBuilder().appendEscapedLines(label).toSafeHtml());
// this link relies on the org.apache.cordova.inappbrowser which offers secure viewing of external html pages and handles user navigation such as back navigation.
// in this case the link will be opend in the system browser rather than in the cordova application.
outerPanel.add(anchor);
final SingleShotEventListner singleShotEventListner = new SingleShotEventListner() {
@Override
protected void singleShotFired() {
Window.open(target, "_system", "");
}
};
anchor.addClickHandler(singleShotEventListner);
anchor.addTouchStartHandler(singleShotEventListner);
anchor.addTouchMoveHandler(singleShotEventListner);
anchor.addTouchEndHandler(singleShotEventListner);
anchor.addStyleName("pageLink");
}
示例8: createLuckyTwitterButton
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void createLuckyTwitterButton()
{
Anchor rndWikiButton = Anchor.wrap(Document.get().getElementById("btn_rnd_twitter"));
final TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text"));
rndWikiButton.addClickHandler(new ClickHandler()
{
public void onClick(ClickEvent event)
{
wcService.getRandomTwitterUrl(new AsyncCallback<String>()
{
public void onSuccess(String result)
{
textArea.setText(result);
}
public void onFailure(Throwable caught)
{
textArea.setText("twitter: hot trend");
}
});
}
});
}
示例9: createLuckyYoutubeButton
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void createLuckyYoutubeButton()
{
Anchor rndWikiButton = Anchor.wrap(Document.get().getElementById("btn_rnd_youtube"));
final TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text"));
rndWikiButton.addClickHandler(new ClickHandler()
{
public void onClick(ClickEvent event)
{
wcService.getRandomYoutubeUrl(new AsyncCallback<String>()
{
public void onSuccess(String result)
{
textArea.setText(result);
}
public void onFailure(Throwable caught)
{
textArea.setText("https://www.youtube.com");
}
});
}
});
}
示例10: ApplicationFilter
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public ApplicationFilter(final ApplicationInfo app) {
Image appIcon = new Image(new GWTMarkerState("filter", null, app.getStatusDetails().getStatus()).getImageURL());
appIcon.addStyleName(filterStyles.panelIcon());
super.add(appIcon);
Label appName = new Label(app.getName());
appName.addStyleName(filterStyles.panelCaption());
super.add(appName);
Anchor removeLink = new Anchor("remove");
removeLink.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
m_eventBus.fireEvent(new ApplicationDeselectedEvent(app));
}
});
super.add(removeLink);
super.addStyleName(filterStyles.panelEntry());
}
示例11: TractionDialogBox
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public TractionDialogBox(boolean autoHide, boolean modal, boolean showCloseIcon) {
super(autoHide, modal, new TractionCaption());
container = new SimplePanel();
container.addStyleName("dialogContainer");
close = new Anchor();
close.setStyleName("x");
close.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
onCloseClick(event);
}
});
setCloseIconVisible(showCloseIcon);
controls = new FlowPanel();
controls.setStyleName("dialogControls");
controls.add(close);
// add the controls to the end of the caption
TractionCaption caption = (TractionCaption) getCaption();
caption.add(controls);
}
示例12: TimeBoxMenuOption
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public TimeBoxMenuOption(long offsetFromMidnight) {
this.offsetFromMidnight = offsetFromMidnight;
// format the time in the local time zone
long time = UTCDateBox.timezoneOffsetMillis(new Date(0)) + offsetFromMidnight;
value = timeFormat.format(new Date(time));
Anchor anchor = new Anchor(value);
anchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
acceptValue();
hideMenu();
clearInvalidStyle();
}
});
setWidget(anchor);
}
示例13: addButton
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
void addButton( final NodeWidget<String, CriteriaSwitch> nodeWidget, final ICriteriaMng mng )
{
Anchor a = new Anchor( mng.getDisplayName() );
a.getElement().setClassName( Css.CSS.anchorButton() );
nodeWidget.addButton( a );
a.addClickHandler( new ClickHandler()
{
@Override
public void onClick( ClickEvent event )
{
event.preventDefault();
event.stopPropagation();
createSwitchAndAddChild( mng, nodeWidget, null, fReadOnly );
}
} );
}
示例14: InstructorCell
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public InstructorCell(ArrayList<String> names, ArrayList<String> emails, String separator) {
super(null, separator);
if (names != null && !names.isEmpty()) {
separator = separator.replace(" ", " ");
for (int i = 0; i < names.size(); i++) {
String text = names.get(i) + (i + 1 < names.size() ? separator : "");
String email = (emails != null && i < emails.size() ? emails.get(i) : null);
if (email != null && !email.isEmpty()) {
iText += text;
HorizontalPanel p = new HorizontalPanel();
p.setStyleName("instructor");
Anchor a = new Anchor();
a.setHref("mailto:" + email);
a.setHTML(new Image(RESOURCES.email()).getElement().getString());
a.setTitle(MESSAGES.sendEmail(names.get(i)));
a.setStyleName("unitime-SimpleLink");
a.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
event.stopPropagation();
}
});
p.add(a);
p.setCellVerticalAlignment(a, HasVerticalAlignment.ALIGN_MIDDLE);
HTML h = new HTML(text, false);
h.getElement().getStyle().setMarginLeft(2, Unit.PX);
p.add(h);
iPanel.add(p);
iContent.add(h);
} else
add(text);
}
} else {
add(" ");
}
}
示例15: initExtensionPanel
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void initExtensionPanel() {
Anchor addComponentAnchor = new Anchor(MESSAGES.importExtensionMenuItem());
addComponentAnchor.setStylePrimaryName("ode-ExtensionAnchor");
addComponentAnchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
new ComponentImportWizard().center();
}
});
categoryPanels.get(ComponentCategory.EXTENSION).add(addComponentAnchor);
categoryPanels.get(ComponentCategory.EXTENSION).setCellHorizontalAlignment(
addComponentAnchor, HasHorizontalAlignment.ALIGN_CENTER);
}