Search in sources :

Example 1 with Hyperlink

use of com.google.gwt.user.client.ui.Hyperlink in project perun by CESNET.

the class GetFacility method onFinished.

/**
 * When successfully finishes
 *
 * @param jso javascript objects (array) returned from RPC
 */
public void onFinished(JavaScriptObject jso) {
    this.facility = (Facility) jso;
    session.getUiElements().setLogText("Loading facility for resource : " + this.resourceId + " finished.");
    // creates the link
    Hyperlink link = new Hyperlink(facility.getName(), session.getTabManager().getLinkForTab(new FacilityDetailTabItem(facility)));
    facilityLinkWrapper.setWidget(link);
    // custom on finished
    events.onFinished(facility);
}
Also used : FacilityDetailTabItem(cz.metacentrum.perun.webgui.tabs.facilitiestabs.FacilityDetailTabItem) Hyperlink(com.google.gwt.user.client.ui.Hyperlink)

Example 2 with Hyperlink

use of com.google.gwt.user.client.ui.Hyperlink in project gwt-test-utils by gwt-test-utils.

the class HyperlinkTest method constructor_Text_Token.

@Test
public void constructor_Text_Token() {
    // When
    Hyperlink link = new Hyperlink("test-text", "test-history-token");
    // Then
    assertThat(link.getText()).isEqualTo("test-text");
    assertThat(link.getTargetHistoryToken()).isEqualTo("test-history-token");
}
Also used : Hyperlink(com.google.gwt.user.client.ui.Hyperlink) Test(org.junit.Test)

Example 3 with Hyperlink

use of com.google.gwt.user.client.ui.Hyperlink in project gwt-test-utils by gwt-test-utils.

the class HyperlinkTest method title.

@Test
public void title() {
    // When
    Hyperlink link = new Hyperlink();
    // When
    link.setTitle("title");
    // Then
    assertThat(link.getTitle()).isEqualTo("title");
}
Also used : Hyperlink(com.google.gwt.user.client.ui.Hyperlink) Test(org.junit.Test)

Example 4 with Hyperlink

use of com.google.gwt.user.client.ui.Hyperlink in project gwt-test-utils by gwt-test-utils.

the class HyperlinkTest method checkVisible.

@Test
public void checkVisible() {
    // When
    Hyperlink link = new Hyperlink();
    // Preconditions
    assertThat(link.isVisible()).isEqualTo(true);
    // When
    link.setVisible(false);
    // Then
    assertThat(link.isVisible()).isEqualTo(false);
}
Also used : Hyperlink(com.google.gwt.user.client.ui.Hyperlink) Test(org.junit.Test)

Example 5 with Hyperlink

use of com.google.gwt.user.client.ui.Hyperlink in project gwt-test-utils by gwt-test-utils.

the class HyperlinkTest method html.

@Test
public void html() {
    // Given
    Hyperlink link = new Hyperlink();
    // When
    link.setHTML("<h1>test</h1>");
    // Then
    assertThat(link.getHTML()).isEqualTo("<h1>test</h1>");
    assertThat(link.getElement().getChild(0).getChildCount()).isEqualTo(1);
    HeadingElement h1 = link.getElement().getChild(0).getChild(0).cast();
    assertThat(h1.getTagName()).isEqualTo("H1");
    assertThat(h1.getInnerText()).isEqualTo("test");
}
Also used : HeadingElement(com.google.gwt.dom.client.HeadingElement) Hyperlink(com.google.gwt.user.client.ui.Hyperlink) Test(org.junit.Test)

Aggregations

Hyperlink (com.google.gwt.user.client.ui.Hyperlink)8 Test (org.junit.Test)6 HeadingElement (com.google.gwt.dom.client.HeadingElement)1 HTML (com.google.gwt.user.client.ui.HTML)1 Widget (com.google.gwt.user.client.ui.Widget)1 TabItemWithUrl (cz.metacentrum.perun.webgui.tabs.TabItemWithUrl)1 FacilityDetailTabItem (cz.metacentrum.perun.webgui.tabs.facilitiestabs.FacilityDetailTabItem)1