本文整理匯總了Java中com.google.gwt.user.client.ui.HTMLPanel.setStyleName方法的典型用法代碼示例。如果您正苦於以下問題:Java HTMLPanel.setStyleName方法的具體用法?Java HTMLPanel.setStyleName怎麽用?Java HTMLPanel.setStyleName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.HTMLPanel
的用法示例。
在下文中一共展示了HTMLPanel.setStyleName方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: View
import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
View(Window.Resources res, boolean showBottomPanel) {
this.res = res;
this.css = res.windowCss();
windowWidth = com.google.gwt.user.client.Window.getClientWidth();
clientLeft = Document.get().getBodyOffsetLeft();
clientTop = Document.get().getBodyOffsetTop();
initWidget(uiBinder.createAndBindUi(this));
footer = new HTMLPanel("");
if (showBottomPanel) {
footer.setStyleName(res.windowCss().footer());
contentContainer.add(footer);
}
handleEvents();
FocusPanel dummyFocusElement = new FocusPanel();
dummyFocusElement.setTabIndex(0);
dummyFocusElement.addFocusHandler(
new FocusHandler() {
@Override
public void onFocus(FocusEvent event) {
setFocus();
}
});
contentContainer.add(dummyFocusElement);
}
示例2: create
import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
public HTMLPanel create()
{
FormCreatorBundle.CSS.ensureInjected();
HTMLPanel panel = new HTMLPanel( sb.toString() );
panel.setStyleName( FormCreatorBundle.CSS.form() );
panel.setWidth( totalWidth + "px" );
for( Entry<String, Widget> e : wMap.entrySet() )
{
e.getValue().setWidth( "100%" );
panel.add( e.getValue(), e.getKey() );
}
return panel;
}
示例3: error
import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
/**
* <p>error</p>
*
* @param err a {@link java.lang.String} object.
*/
public void error(String err) {
final DialogBox dialog = new DialogBox();
dialog.setText("Error Occurred");
VerticalPanel panel = new VerticalPanel();
HTMLPanel html = new HTMLPanel(err);
html.setStyleName("Message");
panel.add(html);
Button ok = new Button("OK");
SimplePanel buttonPanel = new SimplePanel();
buttonPanel.setWidget(ok);
buttonPanel.setStyleName("Button");
panel.add(buttonPanel);
dialog.setPopupPosition(Window.getScrollLeft() + 100, Window.getScrollTop() + 100);
dialog.setWidget(panel);
ok.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent arg0) {
dialog.hide();
}
});
dialog.show();
}
示例4: setError
import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
@Override
public void setError(String description, Throwable throwable) {
String error = "";
if (throwable != null) {
error = throwable.toString();
}
final DialogBox dialog = new DialogBox();
dialog.setText(description);
VerticalPanel panel = new VerticalPanel();
HTMLPanel html = new HTMLPanel(error);
html.setStyleName("Message");
panel.add(html);
Button ok = new Button("OK");
SimplePanel buttonPanel = new SimplePanel();
buttonPanel.setWidget(ok);
buttonPanel.setStyleName("Button");
panel.add(buttonPanel);
dialog.setPopupPosition(Window.getScrollLeft() + 100, Window.getScrollTop() + 100);
dialog.setWidget(panel);
ok.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
dialog.hide();
}
});
dialog.show();
}
示例5: setError
import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
@Override
public void setError(String description, Throwable throwable) {
String error = "";
if (throwable != null) {
error = throwable.toString();
}
final DialogBox dialog = new DialogBox();
dialog.setText(description);
VerticalPanel panel = new VerticalPanel();
HTMLPanel html = new HTMLPanel(error);
html.setStyleName("Message");
panel.add(html);
Button ok = new Button("OK");
SimplePanel buttonPanel = new SimplePanel();
buttonPanel.setWidget(ok);
buttonPanel.setStyleName("Button");
panel.add(buttonPanel);
dialog.setPopupPosition(Window.getScrollLeft() + 100, Window.getScrollTop() + 100);
dialog.setWidget(panel);
ok.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
dialog.hide();
}
});
dialog.show();
}
示例6: 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);
}