org.gwtbootstrap3.client.ui.Button.getElement()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(164)

本文整理了Java中org.gwtbootstrap3.client.ui.Button.getElement()方法的一些代码示例,展示了Button.getElement()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.getElement()方法的具体详情如下:
包路径:org.gwtbootstrap3.client.ui.Button
类名称:Button
方法名:getElement

Button.getElement介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

Image img = new Image("whatever.jpg");
Button button = new Button();
button.getElement().appendChild(img.getElement());

代码示例来源:origin: stackoverflow.com

Button b = new Button("Calcular");
b.setPixelSize(200, 127);
DOM.setStyleAttribute(b.getElement(), "background", "transparent url('http://www.greenthumbgraphics.com/images/buttons/shapes/oval.png')");
DOM.setStyleAttribute(b.getElement(), "border", "solid 0px white");
DOM.setStyleAttribute(b.getElement(), "textAlign", "center");
RootPanel.get().add(b);

代码示例来源:origin: org.optaplanner/optaplanner-wb-solver-editor-client

@Override
public void setRoot(boolean root) {
  if (root) {
    removeTerminationButton.getElement().getStyle().setProperty("display",
                                  "none");
  }
}

代码示例来源:origin: stackoverflow.com

Button button = new Button("Original"); 
RootPanel.get().add(button);

Element buttonCloneElement = DOM.clone(button.getElement(), true);
Widget buttonClone;

buttonClone = Button.wrap(buttonCloneElement)

代码示例来源:origin: oVirt/ovirt-engine

public void setTabIndex(int tabIndex) {
  button.getElement().setTabIndex(tabIndex);
}

代码示例来源:origin: stackoverflow.com

Button b = new Button();
DOM.setElementAttribute(b.getElement(), "id", "my-button-id");

代码示例来源:origin: stackoverflow.com

Button b = new Button();
b.getElement().setId("mycustomid");

代码示例来源:origin: oVirt/ovirt-engine

/**
 * Set the element id directly on the refresh button itself and ignore the dropdown bits.
 */
@Override
public void setElementId(String elementId) {
  refreshButton.getElement().setId(
      ElementIdUtils.createElementId(elementId, "refreshButton")); //$NON-NLS-1$
}

代码示例来源:origin: kiegroup/appformer

@Override
public void closeColumnsFilterPanel(final String title) {
  filterAndColumnsPanelToggleButton.setTitle(title);
  filterAndColumnsPanelToggleButton.setIcon(IconType.STEP_FORWARD);
  filterAndColumnsPanelToggleButton.getElement().getStyle().setBorderStyle(Style.BorderStyle.NONE);
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-widgets

@Override
public void init(final AbstractToolbarItem presenter) {
  this.presenter = presenter;
  initWidget(uiBinder.createAndBindUi(this));
  button.getElement().getStyle().setMargin(5,
                       Style.Unit.PX);
}

代码示例来源:origin: org.dashbuilder/dashbuilder-widgets

@Override
public void closeColumnsFilterPanel(final String title) {
  filterAndColumnsPanelToggleButton.setTitle(title);
  filterAndColumnsPanelToggleButton.setIcon(IconType.STEP_FORWARD);
  filterAndColumnsPanelToggleButton.getElement().getStyle().setBorderStyle(Style.BorderStyle.NONE);
}

代码示例来源:origin: org.dashbuilder/dashbuilder-widgets

@Override
public void openColumnsFilterPanel(final String title) {
  filterAndColumnsPanelToggleButton.setTitle(title);
  filterAndColumnsPanelToggleButton.setIcon(IconType.STEP_BACKWARD);
  filterAndColumnsPanelToggleButton.getElement().getStyle().setBorderStyle(Style.BorderStyle.SOLID);
}

代码示例来源:origin: kiegroup/appformer

@Override
public void openColumnsFilterPanel(final String title) {
  filterAndColumnsPanelToggleButton.setTitle(title);
  filterAndColumnsPanelToggleButton.setIcon(IconType.STEP_BACKWARD);
  filterAndColumnsPanelToggleButton.getElement().getStyle().setBorderStyle(Style.BorderStyle.SOLID);
}

代码示例来源:origin: oVirt/ovirt-engine

private void styleAndPositionMenuContainer(final int eventX, final int eventY) {
  menuContainer.addStyleName(OPEN);
  clickButton.getElement().setAttribute(ARIA_EXPANDED, Boolean.TRUE.toString());
  menuContainer.getElement().getStyle().setPosition(Position.ABSOLUTE);
  menuContainer.getElement().getStyle().setTop(Window.getScrollTop() + eventY, Unit.PX);
  menuContainer.getElement().getStyle().setLeft(eventX, Unit.PX);
}

代码示例来源:origin: org.jbpm/jbpm-console-ng-generic-client

public void render( final Cell.Context context, final T value, final SafeHtmlBuilder sb ) {
  final SafeHtmlBuilder mysb = new SafeHtmlBuilder();
  final Button btn = GWT.create( Button.class );
  btn.setText( getText( value ) );
  btn.setTitle( getText( value ) );
  btn.setType( ButtonType.DEFAULT );
  btn.setSize( ButtonSize.SMALL );
  btn.getElement().getStyle().setMarginRight( 5, Style.Unit.PX );
  mysb.appendHtmlConstant( btn.getElement().getString() );
  sb.append( mysb.toSafeHtml() );
}

代码示例来源:origin: kiegroup/jbpm-wb

public void render(final Cell.Context context,
          final T value,
          final SafeHtmlBuilder sb) {
  final SafeHtmlBuilder mysb = new SafeHtmlBuilder();
  final Button btn = GWT.create(Button.class);
  btn.setText(getText(value));
  btn.setTitle(getText(value));
  btn.setType(ButtonType.DEFAULT);
  btn.setSize(size);
  btn.getElement().getStyle().setMarginRight(5,
                        Style.Unit.PX);
  mysb.appendHtmlConstant(btn.getElement().getString());
  sb.append(mysb.toSafeHtml());
}

代码示例来源:origin: kiegroup/appformer

@Test
public void testRemoveTab() throws Exception {
  final Element element = mock(Element.class);
  when(element.getStyle()).thenReturn(mock(Style.class));
  when(button.getElement()).thenReturn(element);
  when(button.addClickHandler(any(ClickHandler.class))).thenAnswer(new Answer() {
    public Object answer(InvocationOnMock aInvocation) throws Throwable {
      clickHandler = (ClickHandler) aInvocation.getArguments()[0];
      return null;
    }
  });
  final YesNoCancelPopup yesNoCancelPopup = mock(YesNoCancelPopup.class);
  doReturn(yesNoCancelPopup).when(filterPagedTable).getYesNoCancelPopup(anyString(), anyString());
  filterPagedTable.addTab(mock(PagedTable.class), "", mock(Command.class));
  clickHandler.onClick(new ClickEvent() {
  });
  verify(yesNoCancelPopup).show();
  verify(filterPagedTable, never()).removeTab(anyInt());
  verify(filterPagedTable, never()).removeTab(anyString());
}

代码示例来源:origin: kiegroup/appformer

@Test
  public void testScapeHtmlCodeInDescriptionRemoveTab() throws Exception {
    String key = "test";
    String header = "*<h1>test</h1>*";
    String title = "*<h1>test</h1>*";

    final Element element = mock(Element.class);
    when(element.getStyle()).thenReturn(mock(Style.class));
    when(button.getElement()).thenReturn(element);
    when(button.addClickHandler(any(ClickHandler.class))).thenAnswer(new Answer() {
      public Object answer(InvocationOnMock aInvocation) throws Throwable {
        clickHandler = (ClickHandler) aInvocation.getArguments()[0];
        return null;
      }
    });

    doReturn(yesNoCancelPopupMock).when(filterPagedTable).getYesNoCancelPopup(eq(SafeHtmlUtils.htmlEscape(header)), anyString());

    when(multiGridPreferencesStoreMock.getGridSettingParam(eq(key),eq(NewTabFilterPopup.FILTER_TAB_NAME_PARAM))).thenReturn(header);
    when(multiGridPreferencesStoreMock.getGridSettingParam(eq(key),eq(NewTabFilterPopup.FILTER_TAB_DESC_PARAM))).thenReturn(title);

    filterPagedTable.addTab(pagedTableMock, key, mock(Command.class));

    clickHandler.onClick(new ClickEvent() {
    });

    verify(pagedTableMock).addTableTitle(eq(SafeHtmlUtils.htmlEscape(title)));
    verify(yesNoCancelPopupMock).show();
  }
}

代码示例来源:origin: kiegroup/appformer

void createButton() {
  itemButton.setSize(ButtonSize.SMALL);
  itemButton.setType(ButtonType.LINK);
  configureText(itemButton,
         getDock().getLabel());
  configureIcon(itemButton,
         getDock().getImageIcon());
  itemButton.getElement().addClassName(CSS.CSS().southDockItem());
  itemButton.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      if (!opened) {
        open();
        openCommand.execute(getIdentifier());
      } else {
        close();
        closeCommand.execute(getIdentifier());
      }
    }
  });
}

代码示例来源:origin: org.uberfire/uberfire-simple-docks-client

void createButton() {
  itemButton.setSize(ButtonSize.SMALL);
  itemButton.setType(ButtonType.LINK);
  configureText(itemButton,
         getDock().getLabel());
  configureIcon(itemButton,
         getDock().getImageIcon());
  itemButton.getElement().addClassName(CSS.CSS().southDockItem());
  itemButton.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      if (!opened) {
        open();
        openCommand.execute(getIdentifier());
      } else {
        close();
        closeCommand.execute(getIdentifier());
      }
    }
  });
}

相关文章