本文整理汇总了Java中com.google.gwt.user.client.ui.HTML.setStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java HTML.setStyleName方法的具体用法?Java HTML.setStyleName怎么用?Java HTML.setStyleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.HTML
的用法示例。
在下文中一共展示了HTML.setStyleName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ChipPanel
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
public ChipPanel(Chip chip, String color) {
iChip = chip;
setStyleName("chip");
addStyleName(color);
iLabel = new Label(chip.getTranslatedValue());
iLabel.setStyleName("text");
add(iLabel);
iButton = new HTML("×");
iButton.setStyleName("button");
add(iButton);
if (chip.hasToolTip())
setTitle(toString() + "\n" + chip.getToolTip());
else
setTitle(toString());
Roles.getDocumentRole().setAriaHiddenState(getElement(), true);
}
示例2: BusyPanel
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
public BusyPanel(String text, int dayOfWeek, int startSlot, int length) {
super();
iText = text;
iDayOfWeek = dayOfWeek;
iStartSlot = startSlot;
iLength = length;
if (iText != null || !iText.isEmpty()) {
setTitle(iText);
boolean empty = true;
for (int i = 0; i < 3; i++) {
if (iMeetingTable[iDayOfWeek].length <= iStartSlot + i) { empty = false; break; }
if (iMeetingTable[iDayOfWeek][iStartSlot + i] != null && !iMeetingTable[iDayOfWeek][iStartSlot + i].isEmpty()) {
empty = false; break;
}
}
if (empty) {
HTML widget = new HTML(text, false);
widget.setStyleName("text");
setWidget(widget);
}
}
setStyleName("busy");
getElement().getStyle().setWidth(iCellWidth + (iPrint ? 3 : iDayOfWeek + 1 < iNrDays ? 3 : 0), Unit.PX);
getElement().getStyle().setHeight(125 * iLength / 30, Unit.PX);
iGrid.insert(this, iCellWidth * iDayOfWeek, 125 * iStartSlot / 30 - 50 * iStart, 1);
}
示例3: SimpleDayCell
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
public SimpleDayCell(VCalendar calendar, int row, int cell) {
this.calendar = calendar;
this.row = row;
this.cell = cell;
setStylePrimaryName("v-calendar-month-day");
caption = new Label();
caption.setStyleName("v-calendar-day-number");
caption.addMouseDownHandler(this);
caption.addMouseUpHandler(this);
add(caption);
bottomspacer = new HTML();
bottomspacer.setStyleName("v-calendar-bottom-spacer-empty");
bottomspacer.setWidth(3 + "em");
add(bottomspacer);
}
示例4: upgradeWarnDialog
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
private static void upgradeWarnDialog(String aMessage) {
final DialogBox dialogBox = new DialogBox(false, true);
dialogBox.setStylePrimaryName("ode-DialogBox");
dialogBox.setText(MESSAGES.warningDialogTitle());
dialogBox.setGlassEnabled(true);
dialogBox.setAnimationEnabled(true);
final HTML message = new HTML(aMessage);
message.setStyleName("DialogBox-message");
VerticalPanel vPanel = new VerticalPanel();
Button okButton = new Button("OK");
okButton.addClickListener(new ClickListener() {
@Override
public void onClick(Widget sender) {
dialogBox.hide();
}
});
vPanel.add(message);
vPanel.add(okButton);
dialogBox.setWidget(vPanel);
dialogBox.center();
dialogBox.show();
}
示例5: finalDialog
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
/**
* The "Final" Dialog box. When a user chooses to end their session
* due to a conflicting login, we should show this dialog which is modal
* and has no exit! My preference would have been to close the window
* altogether, but the browsers won't let javascript code close windows
* that it didn't open itself (like the main window). I also tried to
* use document.write() to write replacement HTML but that caused errors
* in Firefox and strange behavior in Chrome. So we do this...
*
* We are called from invalidSessionDialog() (above).
*/
private void finalDialog() {
// Create the UI elements of the DialogBox
final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
dialogBox.setStylePrimaryName("ode-DialogBox");
dialogBox.setText(MESSAGES.finalDialogText());
dialogBox.setHeight("100px");
dialogBox.setWidth("400px");
dialogBox.setGlassEnabled(true);
dialogBox.setAnimationEnabled(true);
dialogBox.center();
VerticalPanel DialogBoxContents = new VerticalPanel();
HTML message = new HTML(MESSAGES.finalDialogMessage());
message.setStyleName("DialogBox-message");
DialogBoxContents.add(message);
dialogBox.setWidget(DialogBoxContents);
dialogBox.show();
}
示例6: corruptionDialog
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
/**
* corruptionDialog -- Put up a dialog box explaining that we detected corruption
* while reading in a project file. There is no continuing once this happens.
*
*/
void corruptionDialog() {
// Create the UI elements of the DialogBox
final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
dialogBox.setStylePrimaryName("ode-DialogBox");
dialogBox.setText(MESSAGES.corruptionDialogText());
dialogBox.setHeight("100px");
dialogBox.setWidth("400px");
dialogBox.setGlassEnabled(true);
dialogBox.setAnimationEnabled(true);
dialogBox.center();
VerticalPanel DialogBoxContents = new VerticalPanel();
HTML message = new HTML(MESSAGES.corruptionDialogMessage());
message.setStyleName("DialogBox-message");
DialogBoxContents.add(message);
dialogBox.setWidget(DialogBoxContents);
dialogBox.show();
}
示例7: disabledAccountDialog
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
/**
* This dialog is showned if an account is disabled. It is
* completely modal with no escape. The provided URL is displayed in
* an iframe, so it can be tailored to each person whose account is
* disabled.
*
* @param Url the Url to display in the dialog box.
*/
public void disabledAccountDialog(String Url) {
// Create the UI elements of the DialogBox
final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
dialogBox.setStylePrimaryName("ode-DialogBox");
dialogBox.setText(MESSAGES.accountDisabledMessage());
dialogBox.setHeight("700px");
dialogBox.setWidth("700px");
dialogBox.setGlassEnabled(true);
dialogBox.setAnimationEnabled(true);
dialogBox.center();
VerticalPanel DialogBoxContents = new VerticalPanel();
HTML message = new HTML("<iframe src=\"" + Url + "\" style=\"border: 0; width: 680px; height: 660px;\"></iframe>");
message.setStyleName("DialogBox-message");
DialogBoxContents.add(message);
dialogBox.setWidget(DialogBoxContents);
dialogBox.show();
}
示例8: Status
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
/**
* The status
*/
public Status() {
super(false, true);
hPanel = new HorizontalPanel();
image = new Image(OKMBundleResources.INSTANCE.indicator());
msg = new HTML("");
space = new HTML("");
hPanel.add(image);
hPanel.add(msg);
hPanel.add(space);
hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
hPanel.setCellWidth(image, "30px");
hPanel.setCellWidth(space, "7px");
hPanel.setHeight("25px");
msg.setStyleName("okm-NoWrap");
super.hide();
setWidget(hPanel);
}
示例9: drawTagCloud
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
/**
* Draws a tag cloud
*/
public static void drawTagCloud(final TagCloud keywordsCloud, Collection<String> keywords) {
// Deletes all tag clouds keys
keywordsCloud.clear();
keywordsCloud.setMinFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMinFrequency());
keywordsCloud.setMaxFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMaxFrequency());
for (Iterator<String> it = keywords.iterator(); it.hasNext(); ) {
String keyword = it.next();
HTML tagKey = new HTML(keyword);
tagKey.setStyleName("okm-cloudTags");
Style linkStyle = tagKey.getElement().getStyle();
int fontSize = keywordsCloud.getLabelSize(Main.get().mainPanel.dashboard.keyMapDashboard.getKeywordRate(keyword));
linkStyle.setProperty("fontSize", fontSize + "pt");
linkStyle.setProperty("color", keywordsCloud.getColor(fontSize));
if (fontSize > 0) {
linkStyle.setProperty("top", (keywordsCloud.getMaxFontSize() - fontSize) / 2 + "px");
}
keywordsCloud.add(tagKey);
}
}
示例10: Status
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
/**
* Status
*/
public Status() {
super(false, true);
hPanel = new HorizontalPanel();
image = new Image(OKMBundleResources.INSTANCE.indicator());
msg = new HTML("");
space = new HTML("");
hPanel.add(image);
hPanel.add(msg);
hPanel.add(space);
hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
hPanel.setCellWidth(image, "30px");
hPanel.setCellWidth(space, "7px");
hPanel.setHeight("25px");
msg.setStyleName("okm-NoWrap");
super.hide();
setWidget(hPanel);
}
示例11: enableAddAllBtn
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
protected void enableAddAllBtn() {
HTML br1 = new HTML("<span/>");
br1.setStyleName(CLASSNAME + "-deco");
buttons.add(br1);
buttons.insert(br1, buttons.getWidgetIndex(add) + 1);
addAll = new VButton();
addAll.setText(">>");
addAll.addStyleName("addAll");
addAllHandlerRegistration = addAll.addClickHandler(this);
buttons.insert(addAll, buttons.getWidgetIndex(br1) + 1);
HTML br2 = new HTML("<span/>");
br2.setStyleName(CLASSNAME + "-deco");
buttons.add(br2);
removeAll = new VButton();
removeAll.setText("<<");
removeAll.addStyleName("removeAll");
removeAllHandlerRegistration = removeAll.addClickHandler(this);
buttons.add(removeAll);
}
示例12: render
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
@Override
public void render(RendererCellReference cell, double[] data,
FlowPanel widget) {
SparklinesGWT s = (SparklinesGWT) widget.getWidget(0);
updateSettings(s);
HTML html = (HTML) widget.getWidget(1);
double change = data[data.length - 1] - data[0];
double min = data[0];
double max = data[1];
for (int i = 1; i < data.length; i++) {
if (data[i] < min) {
min = data[i];
}
if (data[i] > max) {
max = data[i];
}
}
s.setData(data);
s.setDisplayRange((int) (min - 5), (int) (max + 5));
if (change >= 0) {
html.setStyleName("going-up");
} else {
html.setStyleName("going-down");
}
}
示例13: init
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
/**
* Initialize this widget by creating the elements that should be added to the
* page.
*/
public void init() {
if(!_initialized) {
_initialized = true;
VerticalPanel vPanel = new VerticalPanel();
HTML nameWidget = new HTML(getName());
nameWidget.setStyleName(STYLE + "-name");
vPanel.add(nameWidget);
HTML descWidget = new HTML(getDescription());
descWidget.setStyleName(STYLE + "-description");
vPanel.add(descWidget);
Widget widget = onInit();
if(widget != null) vPanel.add(widget);
_panel.add(vPanel);
}
}
示例14: FooterScreen
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
public FooterScreen() {
HorizontalPanel panel = new HorizontalPanel();
HTML label = new HTML("OneCMDB 1.4.0 Beta © Lokomo Systems <<a href='javascript:;'>about</a>>");
label.setTitle("Show about screen");
label.setStyleName("onecmdb-footer-label");
panel.add(label);
panel.setCellHorizontalAlignment(label, HorizontalPanel.ALIGN_RIGHT);
panel.setStyleName("onecmdb-footer");
label.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
getBaseEntryScreen().showScreen(OneCMDBApplication.SHOW_STATIC_CONTENT,
"about.html",
new Long(0));
}
});
initWidget(panel);
}
示例15: SshHostKeyPanel
import com.google.gwt.user.client.ui.HTML; //导入方法依赖的package包/类
SshHostKeyPanel(SshHostKey info) {
final FlowPanel body = new FlowPanel();
body.setStyleName(Gerrit.RESOURCES.css().sshHostKeyPanel());
body.add(new SmallHeading(Util.C.sshHostKeyTitle()));
{
final Label fpLbl = new Label(Util.C.sshHostKeyFingerprint());
fpLbl.setStyleName(Gerrit.RESOURCES.css().sshHostKeyPanelHeading());
body.add(fpLbl);
final Label fpVal = new Label(info.getFingerprint());
fpVal.setStyleName(Gerrit.RESOURCES.css().sshHostKeyPanelFingerprintData());
body.add(fpVal);
}
{
final HTML hdr = new HTML(Util.C.sshHostKeyKnownHostEntry());
hdr.setStyleName(Gerrit.RESOURCES.css().sshHostKeyPanelHeading());
body.add(hdr);
final CopyableLabel lbl;
lbl = new CopyableLabel(info.getHostIdent() + " " + info.getHostKey());
lbl.setPreviewText(SshPanel.elide(lbl.getText(), 80));
lbl.addStyleName(Gerrit.RESOURCES.css().sshHostKeyPanelKnownHostEntry());
body.add(lbl);
}
initWidget(body);
}