detailsTable.setWidget(row++, 1, sdkDateCreated); sdkConfigurationVersion = new Anchor(); sdkConfigurationVersion.getElement().getStyle().setCursor(Style.Cursor.POINTER); sdkConfigurationVersion.setWidth("100%"); detailsTable.setWidget(row++, 1, sdkConfigurationVersion); sdkProfileVersion = new Anchor(); sdkProfileVersion.getElement().getStyle().setCursor(Style.Cursor.POINTER); sdkProfileVersion.setWidth("100%"); detailsTable.setWidget(row++, 1, sdkProfileVersion); sdkNotificationVersion = new Anchor(); sdkNotificationVersion.getElement().getStyle().setCursor(Style.Cursor.POINTER); sdkNotificationVersion.setWidth("100%"); detailsTable.setWidget(row++, 1, sdkNotificationVersion); sdkLoggingVersion = new Anchor(); sdkLoggingVersion.getElement().getStyle().setCursor(Style.Cursor.POINTER); sdkLoggingVersion.setWidth("100%");
userInfoList.add(userExternalId); sdkAnchor = new Anchor(); sdkAnchor.getElement().getStyle().setCursor(Style.Cursor.POINTER); sdkAnchor.setWidth("100%"); recordTable.setWidth("100%"); endpointProfSchemaName = new Anchor(); endpointProfSchemaName.getElement().getStyle().setCursor(Style.Cursor.POINTER); serverRecordTable.setWidth("100%"); serverProfSchemaName = new Anchor(); serverProfSchemaName.getElement().getStyle().setCursor(Style.Cursor.POINTER); endpointConfigSchemaName = new Anchor(); endpointConfigSchemaName.getElement().getStyle().setCursor(Style.Cursor.POINTER); endpointConfigSchemaName.setWidth("100%");
/** * Creates an Anchor widget that wraps an existing <a> element. * * This element must already be attached to the document. If the element is * removed from the document, you must call * {@link RootPanel#detachNow(Widget)}. * * @param element the element to be wrapped */ public static Anchor wrap(Element element) { // Assert that the element is attached. assert Document.get().getBody().isOrHasChild(element); Anchor anchor = new Anchor(element); // Mark it attached and remember it for cleanup. anchor.onAttach(); RootPanel.detachOnWindowClose(anchor); return anchor; }
Anchor anchor = new Anchor("Click me!"); // At this point clicking it won't do a thing anchor.addClickHandler(new ClickHandler() { @Override public void onClick (ClickEvent event){ Window.open("http://www.example.com/", "_blank", ""); // Or open a PopupPanel // or sth similar } });
Anchor anchor = new Anchor(); anchor.getElement().getStyle().setCursor(Cursor.POINTER); anchor.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent ev) { Window.Location.assign("http://url.com"); } }); Image img = new Image("image/path.jpg"); anchor.getElement().appendChild(img.getElement());
/** * Create a {@link JQMButton} with the given text that does not link to * anything. This button would only react to events if a link is added or * a click handler is attached. * * @param text the text to display on the button */ public @UiConstructor JQMButton(String text) { this(new Anchor(text)); }
final Anchor a = new Anchor("text", false); a.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { newWindow(); } native void newWindow() /*-{ window.open("http://www.google.com", "_blank","status=0,toolbar=0"); }-*/; }); RootPanel.get().add(a);
class HrefVerticalPanel extends VerticalPanel { public void add(Widget w) { Anchor surrounding = new Anchor(); surrounding.add(w); super.add(surrounding); handleAnchorUrl(surrounding); } protected void handleAnchorUrl(Anchor toBeClicked) {...} }
@Override public void addFilterReset() { Anchor anchor = new Anchor(LienzoDisplayerConstants.INSTANCE.resetAnchor()); filterPanel.add(anchor); anchor.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { getPresenter().onFilterResetClicked(); } }); }
Anchor fileDownloadLink = new Anchor(); fileDownloadLink.setStyleName(ViewConstants.STYLE_LINK_FILE_DOWNLOAD); fileDownloadLink.setText(subSubStructure.getName()); fileDownloadLink.setHref(ViewConstants.HREF_DOWNLOAD_FILE_EXTRACTED_DATA + subSubStructure.getPath()); treeItem.addItem(fileDownloadLink); StyleCorrector.correctStyle(fileDownloadLink);
Anchor nameLink = new Anchor(); nameLink.setText(rec.get("userSeq") + " / " + rec.get("userName")); nameLink.getElement().setAttribute("style", "padding: 5px;"); String url = GWT.getHostPageBaseURL() + GWT.getModuleName() + ".html"; if (GWT.getHostPageBaseURL().contains("localhost") || GWT.getHostPageBaseURL().contains("127.0.0.1")) { url = url + "?gwt.codesvr=127.0.0.1:9997"; } nameLink.getElement().setAttribute("style", "padding: 10px;"); nameLink.getElement().setAttribute("href", url + "#customer");
protected Widget handleReadOnlyTextProperty(final String value, final boolean isExchangeFacilitator) { if ( value.startsWith( "www" ) || value.startsWith( "http" ) ) { // For values that have external URIs Anchor anchor = new Anchor( InstanceWidgetUtils.formatText( value ), InstanceWidgetUtils.formatText( value ), "_blank" ); return anchor; } else { final String humanReadableValue = InstanceWidgetUtils.convertBooleanToHumanReadable(value); final HTML valueField = new HTML( InstanceWidgetUtils.formatText( InstanceWidgetUtils.insertBreaks( humanReadableValue ) ) ); valueField.setStyleName( "formLabelValue" ); return valueField; } }
/** * Adds an option to the dropdown. * @param label * @param value */ public Anchor addOption(String label, String value) { Anchor a = new Anchor(label); a.getElement().setClassName(""); //$NON-NLS-1$ a.getElement().setAttribute("data-value", value); //$NON-NLS-1$ actions.add(a); return a; }
public void addModule(final IAppModule module) { // add to nav final NavClickHandler handler = new NavClickHandler(module); final Anchor navItem = new Anchor(module.getName()); navItem.addClickHandler(handler); navBar.add(navItem); final HTMLPanel tab = new HTMLPanel(Uis.NOTHING); tab.setStyleName("moduleTab" + module.getModuleId()); moduleContainer.add(tab); eventMap.put(module.getModuleId(), tab); modules.put(module.getModuleId(), module); }
private Anchor createDateLink() { final Anchor result = new Anchor(String.valueOf(getStartDate().getDay())); result.addClickHandler(e -> bus.fire(new ShowDayViewEvent(getStartDate()))); result.addDomHandler(MouseDownEvent::stopPropagation, MouseDownEvent.getType()); return result; }
private void displayResults(final List<EIInstanceMinimal> page, final FlowPanel innerPanel) { innerPanel.clear(); Anchor instanceLink; EIEntity instanceEntity; String displayValue; for (EIInstanceMinimal instance : page) { instanceEntity = instance.getEntity(); displayValue = InstanceWidgetUtils.formatText( instance.getInstanceLabel() ); instanceLink = new Anchor(displayValue, "#" + INSTANCE_PAGE_TOKEN + "?" + URI_KEY + "=" + instanceEntity.getURI().toString()); innerPanel.add( instanceLink ); } }
public RequiredContainer() { super(); label = new KSLabel(context.getMessage("showingRequiredFields")); link = new Anchor(context.getMessage("showAllFields")); this.showWarningLayout(true); this.addHandler(); this.addWarnWidget(label); this.addWarnWidget(link); }
/** * @return */ private void configureTributaryContactButton(String buttonText, Anchor contactButton) { contactButton.setText( buttonText ); final Anchor anchor = new Anchor(); anchor.setName( "contactPanel" ); formPanel.add( anchor ); final TributaryContactPanel contactPanel = new TributaryContactPanel( eiInstance.getEntity() ); formPanel.add( contactPanel ); contactButton.addClickHandler( createContactButtonHandler(contactPanel) ); }
public ShowAllLink(ClickHandler handler) { layout.addStyleName("ks-message-static-margin"); add(new KSLabel(context.getMessage("requiredFields"))); // Link Anchor link = new Anchor(context.getMessage("allFields")); link.addClickHandler(handler); add(link); this.initWidget(layout); }