com.google.gwt.user.client.ui.Widget.setStyleName()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(110)

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

Widget.setStyleName介绍

暂无

代码示例

代码示例来源:origin: stephenh/tessell

@Override
public void setStyleName(String styleName) {
 delegate.setStyleName(styleName);
}

代码示例来源:origin: com.extjs/gxt

@Override
public void setStyleName(String style) {
 if (rendered) {
  super.setStyleName(style);
 } else {
  cls = style;
  styleNames = null;
 }
}

代码示例来源:origin: gwtbootstrap/gwt-bootstrap

public void setDefaultOpen(boolean dafaultOpen) {
  this.dafaultOpen = dafaultOpen;
  
  if(widget != null && !widget.isAttached()) {
    widget.setStyleName(Constants.IN , dafaultOpen);
  }
  
}

代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit

public VDDAccordion() {
  spacer = GWT.create(HTML.class);
  spacer.setWidth("100%");
  spacer.setStyleName(CLASSNAME_SPACER);
}

代码示例来源:origin: net.sf.javaprinciples.client/client-presentation

@Override
  public void valueChanged(String value)
  {
    input.setStyleName("propertySheetRequired", StringUtilsShared.isBlank(value));
  }
});

代码示例来源:origin: org.vaadin.addons/dragdroplayouts

public VDDAccordion() {
  spacer = GWT.create(HTML.class);
  spacer.setWidth("100%");
  spacer.setStyleName(CLASSNAME_SPACER);
}

代码示例来源:origin: bedatadriven/activityinfo

public static void setLoadingStyle(Widget widget, LoadingState state) {
  widget.setStyleName(LoadingStylesheet.INSTANCE.loading(), state == LoadingState.LOADING);
  widget.setStyleName(LoadingStylesheet.INSTANCE.failed(), state == LoadingState.FAILED);
  widget.setStyleName(LoadingStylesheet.INSTANCE.loaded(), state == LoadingState.LOADED);
}

代码示例来源:origin: gwtbootstrap3/gwtbootstrap3

@Override
  public void add(final Widget child) {
    if (child instanceof AbstractToggleButton) {
      if (!(child instanceof AnchorButton)) {
        throw new IllegalArgumentException("Only buttons of type AnchorButton can be added to ListDropDown");
      }

      child.setStyleName(Styles.DROPDOWN_TOGGLE);
    }

    add(child, (Element) getElement());
  }
}

代码示例来源:origin: org.gwtbootstrap3/gwtbootstrap3

@Override
  public void add(final Widget child) {
    if (child instanceof AbstractToggleButton) {
      if (!(child instanceof AnchorButton)) {
        throw new IllegalArgumentException("Only buttons of type AnchorButton can be added to ListDropDown");
      }

      child.setStyleName(Styles.DROPDOWN_TOGGLE);
    }

    add(child, (Element) getElement());
  }
}

代码示例来源:origin: gwtbootstrap/gwt-bootstrap

/**
 * Configures prettyprint with optional line numbers.
 * 
 * @param showLineNumber
 *            <code>true</code> if line numbers should be shown
 */
public void configure(boolean showLineNumber) {
  w.setStyleName("prettyprint");
  if (showLineNumber)
    w.addStyleName("linenums");
  setup();
}

代码示例来源:origin: gwtbootstrap/gwt-bootstrap

/**
 * Set is opened on attached.
 * @param defaultOpen true:open false:close
 */
public void setDefaultOpen(boolean defaultOpen) {
  this.defaultOpen = defaultOpen;
  
  if(!isAttached()) {
    collapse.getWidget().setStyleName("in", defaultOpen);
  }
  
}

代码示例来源:origin: jbossas/console

private Widget getExceptionWidget(ExceptionData ex) {
 Widget result = new HTML(String.valueOf(ex));
 result.setStyleName(Utils.style() + "-codePre");
 return result;
}

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

public void setContentWidgetStyleName(String styleName) {
  getContentWidget().asWidget().setStyleName(styleName);
}

代码示例来源:origin: net.sf.javaprinciples.client/client-presentation

protected Widget makeInput(AttributeMetadata attributeMetadata, PropertyView view, String content)
{
  final Widget input = widgetFactory.createWidget(attributeMetadata, view, content);
  input.setStyleName("propertySheetInput");
  if (!attributeMetadata.isOptional() && !attributeMetadata.isReadOnly())
  {
    if (StringUtilsShared.isBlank(content))
    {
      input.setStyleName("propertySheetRequired", true);
    }
    view.addValueChangedListener(new ValueChangeListener()
    {
      @Override
      public void valueChanged(String value)
      {
        input.setStyleName("propertySheetRequired", StringUtilsShared.isBlank(value));
      }
    });
  }
  return input;
}

代码示例来源:origin: net.sf.advanced-gwt/advanced-gwt

/** {@inheritDoc} */
public Border create() {
  Border inner = new SingleBorder();
  Border outer = new OuterBorder();
  outer.setWidget((Widget)inner);
  ((Widget)outer).setWidth("100%");
  ((Widget)outer).setHeight("100%");
  ((Widget)inner).setWidth("100%");
  ((Widget)inner).setHeight("100%");
  ((Widget)inner).setStyleName("inner-border");
  ((Widget)outer).setStyleName("outer-border");
  DOM.setStyleAttribute(outer.getContentElement(), "height", "100%");
  DOM.setStyleAttribute(inner.getContentElement(), "height", "100%");
  return outer;
}

代码示例来源:origin: org.jboss.ballroom/widgets

public DisclosureStackPanel(String title, boolean first) {
  panel = new DisclosurePanel(Icons.INSTANCE.stack_opened(), Icons.INSTANCE.stack_closed(), title);
  panel.setOpen(true);
  panel.getElement().setAttribute("style", "width:100%;");
  panel.getHeader().setStyleName("stack-section-header");
  if(first) panel.getHeader().addStyleName("stack-section-first");
  panel.setWidth("100%"); // IE 7
}

代码示例来源:origin: org.eagle-i/eagle-i-datatools-sweet-gwt

private void setDelete() {
  if ( ClientSweetProxy.getInstance().canDelete( instance ) ) {
    formActions[DELETE_POSITION] = new Anchor( DELETE_LABEL );
    formActions[DELETE_POSITION].setStyleName( LIVE_LINK );
    ((Anchor)formActions[DELETE_POSITION]).addClickHandler( new ClickHandler() {
      @Override
      public void onClick(final ClickEvent event) {
        if ( Window.confirm( UIMessages.DELETE_CONFIRM_MESSAGE ) ) {
          ClientSweetProxy.getInstance().claimAndDeleteInstance( instance.getInstanceURI(), new RootAsyncCallback<Void>() {
            @Override
            public void onSuccess(final Void result) {
              if ( listener != null ) {
                listener.onRowDeletion( instance );
              }
            }
          } );
        }
      }
    } );
  } else if (ClientSweetProxy.getInstance().canEdit( instance )) {
    //If the user can edit, show a disabled delete so that there is no funny space
    formActions[DELETE_POSITION] = new Label("delete");
  } else {
    formActions[DELETE_POSITION] = new Label("");
  }
}

代码示例来源:origin: org.kuali.student.lum/ks-lum-ui-common

public void setOutlineNode(OutlineNode aNode) {
  currentNode = aNode;
  for (int i = 0; i < aNode.getIndentLevel(); i++) {
    Label label = new Label();
    label.setStyleName("KS-LONodeIndent");
    horitonalPanel.add(label);
    // space for toolbar
    label = new Label();
    label.setStyleName("KS-LONodeIndentToolbar");
    toolbar.insert(label, 0);
  }
  Widget userWidget = (Widget) aNode.getUserObject();
  userWidget.setStyleName("KS-LOaNode");
  horitonalPanel.add(userWidget);
  add(horitonalPanel);
}

代码示例来源:origin: org.eagle-i/eagle-i-datatools-sweet-gwt

private void setEdit() {
  if ( ClientSweetProxy.getInstance().canEdit( instance ) ) {
    //Set the target so that we can handle right click
    formActions[EDIT_POSITION] = new Anchor( EDIT_LABEL, "#"+ ApplicationState.getInstance().getHistoryTokenString( Mode.edit, instance.getEntity(), instance.getInstanceType(), getUpdatedProviderEntity( instance.getEntity() )));
    formActions[EDIT_POSITION].setStyleName( LIVE_LINK );
    ((Anchor)formActions[EDIT_POSITION]).addClickHandler( new ClickHandler() {
      @Override
      public void onClick(final ClickEvent event) {
        if(WidgetUtils.clickHasModifiers( event )) {
        //no-op - let the browser handle
        } else {
          //Prevent regular behavior of Anchor
          event.preventDefault();
          ApplicationState.getInstance().updateApplicationState( Mode.edit, instance.getEntity(), instance.getInstanceType(), getUpdatedProviderEntity( instance.getEntity() ) );
        }
      }
    } );
  } else {
    formActions[EDIT_POSITION] = new Label("");
  }
}

代码示例来源:origin: sk.seges.acris/acris-widgets-beantable

@Override
public void setWidget(Widget widget) {
 String treeNodeWrapper = treeTable.getResources().getStyle().css().treeNodeWrapper();
 if (getCellIndex() == 0 && !treeTable.isFlattened()) {
  HorizontalPanel treeNode = renderTreeNode(getRowIndex());
  treeNode.add(widget);
  treeNode.setCellWidth(widget, "100%");
  treeNode.setStyleName(treeNodeWrapper);
  treeTable.getDataTable().setWidget(getRowIndex(), getCellIndex(),
    treeNode);
 } else {
  widget.setStyleName(treeNodeWrapper);
  super.setWidget(widget);
 }
}

相关文章