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

x33g5p2x  于2022-01-26 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(120)

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

Panel.addStyleName介绍

暂无

代码示例

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

public PreloaderCallback getPreloaderCallback () {
  final Panel preloaderPanel = new VerticalPanel();
  preloaderPanel.setStyleName("gdx-preloader");
  final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
  logo.setStyleName("logo");		
  preloaderPanel.add(logo);
  final Panel meterPanel = new SimplePanel();
  meterPanel.setStyleName("gdx-meter");
  meterPanel.addStyleName("red");
  final InlineHTML meter = new InlineHTML();
  final Style meterStyle = meter.getElement().getStyle();
  meterStyle.setWidth(0, Unit.PCT);
  meterPanel.add(meter);
  preloaderPanel.add(meterPanel);
  getRootPanel().add(preloaderPanel);
  return new PreloaderCallback() {
    @Override
    public void error (String file) {
      System.out.println("error: " + file);
    }
    
    @Override
    public void update (PreloaderState state) {
      meterStyle.setWidth(100f * state.getProgress(), Unit.PCT);
    }            
    
  };
}

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

public PreloaderCallback getPreloaderCallback () {
  final Panel preloaderPanel = new VerticalPanel();
  preloaderPanel.setStyleName("gdx-preloader");
  final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
  logo.setStyleName("logo");		
  preloaderPanel.add(logo);
  final Panel meterPanel = new SimplePanel();
  meterPanel.setStyleName("gdx-meter");
  meterPanel.addStyleName("red");
  final InlineHTML meter = new InlineHTML();
  final Style meterStyle = meter.getElement().getStyle();
  meterStyle.setWidth(0, Unit.PCT);
  meterPanel.add(meter);
  preloaderPanel.add(meterPanel);
  getRootPanel().add(preloaderPanel);
  return new PreloaderCallback() {
    @Override
    public void error (String file) {
      System.out.println("error: " + file);
    }
    
    @Override
    public void update (PreloaderState state) {
      meterStyle.setWidth(100f * state.getProgress(), Unit.PCT);
    }            
    
  };
}

代码示例来源:origin: org.apache.james.hupa/hupa-widgets

public Panel roundPanel(Panel panel) {
  panel.addStyleName(WidgetsCSS.C_hupa_rnd_container);
  return panel;
}

代码示例来源:origin: de.esoco/gewt

/***************************************
   * {@inheritDoc}
   */
  @Override
  public Panel createLayoutContainer(
    Container rContainer,
    StyleData rContainerStyle)
  {
    Panel aPanel = new VerticalPanel();

    aPanel.addStyleName("ewt-ListLayout");

    return aPanel;
  }
}

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

/**
   * Turn on/off styling for warnings on field element
   * 
   * @param warn When true turns on warning styling, when false turns off warning styling
   */
  public void setWarnState(boolean warn){
    if(warn){
      //fieldTitle.addStyleName("invalid");
      if(mainPanel != null){
        mainPanel.addStyleName("warning");
      }

    }
    else{
      //fieldTitle.removeStyleName("invalid");
      if(mainPanel != null){
        mainPanel.removeStyleName("warning");
      }

    }
  }
}

代码示例来源:origin: de.esoco/gewt

aPanel.addStyleName("ewt-FlowLayout");
  aPanel.addStyleName(sLayoutStyleName);

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

/**
 * Turn on/off styling for warnings on field element
 * 
 * @param warn When true turns on warning styling, when false turns off warning styling
 */
public void setWarnState(boolean warn){
  if(warn){
    //fieldTitle.addStyleName("invalid");
    if(parentPanel != null){
      parentPanel.addStyleName("warning");
    }
    else if(parentElement != null){
      parentElement.setClassName("warning");
    }
  }
  else{
    //fieldTitle.removeStyleName("invalid");
    if(parentPanel != null){
      parentPanel.removeStyleName("warning");
    }
    else if(parentElement != null){
      parentElement.setClassName("");
    }
  }
}

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

/**
 * Turn on/off styling for errors on field element
 * 
 * @param error When true turns on error styling, when false turns off error styling
 */
public void setErrorState(boolean error){
  if(error){
    //fieldTitle.addStyleName("invalid");
    if(mainPanel != null){
      mainPanel.addStyleName("error");
    }
    //When there is an error, don't use warning style
    setWarnState(false);
  }
  else{
    //fieldTitle.removeStyleName("invalid");
    if(mainPanel != null){
      mainPanel.removeStyleName("error");
    }
    //Reset earn state, in case there are warnings
    setWarnState(validationPanel.hasWarnings());
  }
}

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

/**
 * Turn on/off styling for errors on field element
 * 
 * @param error When true turns on error styling, when false turns off error styling
 */
public void setErrorState(boolean error){
  if(error){
    fieldTitle.addStyleName("invalid");
    if(parentPanel != null){
      parentPanel.addStyleName("error");
    }
    else if(parentElement != null){
      parentElement.setClassName("error");
    }
    //When there is an error, don't use warning style
    setWarnState(false);
  }
  else{
    fieldTitle.removeStyleName("invalid");
    if(parentPanel != null){
      parentPanel.removeStyleName("error");
    }
    else if(parentElement != null){
      parentElement.setClassName("");
    }
    //Reset earn state, in case there are warnings
    setWarnState(validationPanel.hasWarnings());
  }
}

代码示例来源:origin: org.switchyard.console.wildfly/switchyard-console-wildfly-extension

_layout.addStyleName("fill-layout"); //$NON-NLS-1$

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-gwt

public PreloaderCallback getPreloaderCallback () {
  final Panel preloaderPanel = new VerticalPanel();
  preloaderPanel.setStyleName("gdx-preloader");
  final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
  logo.setStyleName("logo");		
  preloaderPanel.add(logo);
  final Panel meterPanel = new SimplePanel();
  meterPanel.setStyleName("gdx-meter");
  meterPanel.addStyleName("red");
  final InlineHTML meter = new InlineHTML();
  final Style meterStyle = meter.getElement().getStyle();
  meterStyle.setWidth(0, Unit.PCT);
  meterPanel.add(meter);
  preloaderPanel.add(meterPanel);
  getRootPanel().add(preloaderPanel);
  return new PreloaderCallback() {
    @Override
    public void error (String file) {
      System.out.println("error: " + file);
    }
    
    @Override
    public void update (PreloaderState state) {
      meterStyle.setWidth(100f * state.getProgress(), Unit.PCT);
    }            
    
  };
}

相关文章