当前位置: 首页>>代码示例>>Java>>正文


Java HTMLPanel.setStylePrimaryName方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.HTMLPanel.setStylePrimaryName方法的典型用法代码示例。如果您正苦于以下问题:Java HTMLPanel.setStylePrimaryName方法的具体用法?Java HTMLPanel.setStylePrimaryName怎么用?Java HTMLPanel.setStylePrimaryName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.HTMLPanel的用法示例。


在下文中一共展示了HTMLPanel.setStylePrimaryName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AuditCSVPopup

import com.google.gwt.user.client.ui.HTMLPanel; //导入方法依赖的package包/类
public AuditCSVPopup(String keyString) {
  super();
  String[] parts = keyString.split("\\?");
  if (parts.length != 2)
    throw new RuntimeException("blobKey missing in keyString");
  String blobKey = parts[1].split("=")[1];

  setTitle("Audit CSV");
  int width = Window.getClientWidth() / 2;
  int height = Window.getClientHeight() / 2;

  final HTMLPanel panel = new HTMLPanel("");
  panel.add(new SimplePanel(new ClosePopupButton(this)));
  panel.add(new HTML("<h2>Audit CSV contents</h2>"));
  panel.setStylePrimaryName(UIConsts.VERTICAL_FLOW_PANEL_STYLENAME);
  panel.getElement().getStyle().setProperty("overflow", "scroll");
  panel.setPixelSize(width + 6, height + 30);
  setWidget(panel);

  AsyncCallback<String> callback = new AsyncCallback<String>() {
    public void onFailure(Throwable caught) {
      AggregateUI.getUI().reportError(caught);
    }

    public void onSuccess(String csvContents) {
      String[] allLines = csvContents.split("\n");

      StringBuilder html = new StringBuilder("<table class=\"dataTable\">");

      html.append("<tr class=\"titleBar\">")
          .append("<td>Event</td><td>Node</td><td>Start</td><td>End</td>")
          .append("</tr>");
      for (int i = 1, max = allLines.length; i < max; i++) {
        html.append(Row.from(allLines[i]).asTr());
      }
      html.append("</table>");

      AggregateUI.getUI().clearError();
      panel.add(new HTML(html.toString()));
      AggregateUI.resize();
    }
  };

  SecureGWT.getSubmissionService().getSubmissionAuditCSV(blobKey, callback);
}
 
开发者ID:opendatakit,项目名称:aggregate,代码行数:46,代码来源:AuditCSVPopup.java

示例2: addPassword

import com.google.gwt.user.client.ui.HTMLPanel; //导入方法依赖的package包/类
@Override
public void addPassword(PasswordCard password, List<PasswordField> fields, boolean open) {
	HTMLPanel li = new HTMLPanel("li", "");
	if (open)
		li.getElement().setAttribute("class", "active");
	HTMLPanel header = new HTMLPanel("div", "<i class='mdi-action-turned-in-not'></i>"+password.getTitre());
	header.setStyleName("collapsible-header");

	HTMLPanel body = new HTMLPanel("div", "");
	HTMLPanel bodyP = new HTMLPanel("p", "");
	
	body.setStyleName("collapsible-body");
	body.add(bodyP);
	
	for (PasswordField lField : fields)
	{
		PasswordWidget.TypePassword type = "PASSWD".equals(lField.getType()) ? PasswordWidget.TypePassword.PASSWD : PasswordWidget.TypePassword.TEXT;
		PasswordWidget wField = new PasswordWidget(type);
		wField.setTitleText(lField.getLibelle());
		wField.setValueText(lField.getValue());
		wField.setType(type);
		bodyP.add(wField);
	}
	
	HTMLPanel actionBar = new HTMLPanel("div", "");
	actionBar.setStylePrimaryName("row");
	
	HTMLPanel actionButtonDel = new HTMLPanel("div", "");
	actionButtonDel.setStylePrimaryName("col s2 left-align");
	Anchor deleteButton = new Anchor("<i class='mdi-content-remove'></i>",true);
	deleteButton.addClickHandler(this.removeHandler);
	deleteButton.setStylePrimaryName("btn-floating tooltipped waves-effect waves-light");
	deleteButton.getElement().setAttribute("data-position", "top");
	deleteButton.getElement().setAttribute("data-delay", "5");
	deleteButton.getElement().setAttribute("data-tooltip", "Supprimer");
	  
	actionButtonDel.add(deleteButton);
	actionBar.add(actionButtonDel);
	
	HTMLPanel actionButtonEdit = new HTMLPanel("div", "");
	actionButtonEdit.setStylePrimaryName("col s2 left-align");
	Anchor editButton = new Anchor("<i class='mdi-editor-mode-edit'></i>",true);
	editButton.addClickHandler(this.updateHandler);
	editButton.setStylePrimaryName("btn-floating tooltipped waves-effect waves-light");
	editButton.getElement().setAttribute("data-position", "top");
	editButton.getElement().setAttribute("data-delay", "5");
	editButton.getElement().setAttribute("data-tooltip", "Modifier");
	actionButtonEdit.add(editButton);
	actionBar.add(actionButtonEdit);
	
	bodyP.add(actionBar);
	
	li.add(header);
	li.add(body);
	li.getElement().setAttribute("id", password.getId()+"");
	data.add(li);
	wPasswords.put(password.getId(), li);
}
 
开发者ID:guiguib,项目名称:yaph,代码行数:59,代码来源:PasswordView.java


注:本文中的com.google.gwt.user.client.ui.HTMLPanel.setStylePrimaryName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。