本文整理汇总了Java中com.google.gwt.dom.client.Style.FontStyle类的典型用法代码示例。如果您正苦于以下问题:Java FontStyle类的具体用法?Java FontStyle怎么用?Java FontStyle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FontStyle类属于com.google.gwt.dom.client.Style包,在下文中一共展示了FontStyle类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: styleToElementBackgroundToTd
import com.google.gwt.dom.client.Style.FontStyle; //导入依赖的package包/类
public final void styleToElementBackgroundToTd(Element aElement) {
if (aElement != null) {
Style eStyle = aElement.getStyle();
if (getBackground() != null){
Element td = aElement;
while(td != null && !"td".equalsIgnoreCase(td.getTagName())){
td = td.getParentElement();
}
if(td != null){
td.getStyle().setBackgroundColor(getBackground().toStyled());
}
}
if (getForeground() != null) {
eStyle.setColor(getForeground().toStyled());
}
if (getFont() != null) {
eStyle.setFontSize(getFont().getSize(), Unit.PT);
eStyle.setFontStyle(getFont().isItalic() ? FontStyle.ITALIC : FontStyle.NORMAL);
eStyle.setFontWeight(getFont().isBold() ? FontWeight.BOLD : FontWeight.NORMAL);
}
}
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:23,代码来源:PublishedCell.java
示例2: RequestConflicts
import com.google.gwt.dom.client.Style.FontStyle; //导入依赖的package包/类
public RequestConflicts(List<AssignmentInfo> conflicts, int column) {
super("conflicts");
for (AssignmentInfo conflict: conflicts) {
int idx = 0;
for (SectionInfo section: conflict.getRequest().getSections()) {
P conf = new P("conflict");
switch (column) {
case 0:
if (idx == 0) conf.setText(conflict.getRequest().getCourse().getCourseName());
else conf.setHTML("<br>");
break;
case 1:
conf.setText(section.getSectionType() + (section.getExternalId() == null ? "" : " " + section.getExternalId()));
break;
case 2:
conf.setHTML(section.getTime() == null ? SECTMSG.arrangeHours() : section.getTime());
break;
case 3:
conf.setHTML(section.getDate() == null ? SECTMSG.noDate() : section.getDate());
break;
case 4:
conf.setHTML(section.getRoom() == null ? SECTMSG.noRoom() : section.getRoom());
break;
case 5:
if (idx == 0 && conflict.hasConflicts()) conf.setText(conflict.getConflicts(", "));
else conf.setHTML("<br>");
break;
}
if (section.isCommon()) conf.getElement().getStyle().setFontStyle(FontStyle.ITALIC);
idx ++;
add(conf);
}
}
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:35,代码来源:TeachingRequestDetailPage.java
示例3: InstructorConflicts
import com.google.gwt.dom.client.Style.FontStyle; //导入依赖的package包/类
public InstructorConflicts(List<AssignmentInfo> conflicts, int column) {
super("conflicts");
for (AssignmentInfo conflict: conflicts) {
P conf = new P("conflict");
int idx = 0;
for (Iterator<SectionInfo> i = conflict.getRequest().getSections().iterator(); i.hasNext(); ) {
SectionInfo section = i.next();
P sct = new P("section");
switch (column) {
case 0:
if (idx == 0) sct.setText(conflict.getRequest().getCourse().getCourseName());
break;
case 1:
sct.setText(section.getSectionType() + (section.getExternalId() == null ? "" : " " + section.getExternalId()) + (i.hasNext() ? "," : ""));
break;
case 2:
if (idx == 0) {
InstructorInfo instructor = conflict.getRequest().getInstructor(conflict.getIndex());
if (instructor != null) sct.setText(instructor.getInstructorName());
}
break;
}
if (section.isCommon()) sct.getElement().getStyle().setFontStyle(FontStyle.ITALIC);
idx ++;
conf.add(sct);
}
add(conf);
}
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:30,代码来源:TeachingRequestDetailPage.java
示例4: Group
import com.google.gwt.dom.client.Style.FontStyle; //导入依赖的package包/类
public Group(String name, int type, boolean editable) {
super(name, false);
iName = name;
iType = type;
iGroupEditable = editable;
setStylePrimaryName("unitime-TinyLabel" + (iType == 1 ? "White" : ""));
if (iEditable && !iGroupEditable)
getElement().getStyle().setFontStyle(FontStyle.ITALIC);
if (iEditable && iGroupEditable) {
addClickHandler(iNewGroupDialog.getClickHandler());
getElement().getStyle().setCursor(Cursor.POINTER);
}
iOperation = new Operation() {
@Override
public String getName() {
return getElement().getString();
}
@Override
public boolean hasSeparator() {
return false;
}
@Override
public boolean isApplicable() {
return iEditable && iGroupEditable && iVisibleCourses == null;
}
@Override
public void execute() {
assignGroup(null, iName, iType);
}
};
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:34,代码来源:CurriculaCourses.java
示例5: Meeting
import com.google.gwt.dom.client.Style.FontStyle; //导入依赖的package包/类
private Meeting(TimetableGridCell cell, boolean showRoom, boolean showInstructor, boolean showTime, boolean showPreference, boolean showDate) {
super();
iCell = cell;
setStyleName("meeting");
if (cell.hasBackground())
getElement().getStyle().setBackgroundColor(cell.getBackground());
P header = new P("header", "label");
header.setHeight(sLineHeight * cell.getNrNames());
header.setHTML(cell.getName("<br>"));
header.getElement().getStyle().setWhiteSpace(WhiteSpace.NOWRAP);
if (cell.isItalics())
header.getElement().getStyle().setFontStyle(FontStyle.ITALIC);
add(header);
P footer = new P("footer");
String notes = "";
if (showTime && cell.hasTime()) notes += (notes.isEmpty() ? "" : "<br>") + cell.getTime();
if (showDate && cell.hasDate()) notes += (notes.isEmpty() ? "" : "<br>") + cell.getDate();
if (showRoom && cell.getNrRooms() > 0) notes += (notes.isEmpty() ? "" : "<br>") + cell.getRoom("<br>");
if (showInstructor && cell.getNrInstructors() > 0) notes += (notes.isEmpty() ? "" : "<br>") + cell.getInstructor("<br>");
if (showPreference && cell.hasPreference()) notes += (notes.isEmpty() ? "" : "<br>") + "<span style='color:rgb(200,200,200)'>" + cell.getPreference() + "</span>";
footer.setHTML(notes);
footer.getElement().getStyle().setWhiteSpace(WhiteSpace.NOWRAP);
add(footer);
sinkEvents(Event.ONCLICK);
sinkEvents(Event.ONMOUSEOVER);
sinkEvents(Event.ONMOUSEOUT);
getElement().getStyle().setPosition(Position.ABSOLUTE);
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:34,代码来源:TimetableGrid.java
示例6: styleToElement
import com.google.gwt.dom.client.Style.FontStyle; //导入依赖的package包/类
public final void styleToElement(Element aElement) {
if (aElement != null) {
Style eStyle = aElement.getStyle();
if (getBackground() != null)
eStyle.setBackgroundColor(getBackground().toStyled());
if (getForeground() != null) {
eStyle.setColor(getForeground().toStyled());
}
if (getFont() != null) {
eStyle.setFontSize(getFont().getSize(), Unit.PT);
eStyle.setFontStyle(getFont().isItalic() ? FontStyle.ITALIC : FontStyle.NORMAL);
eStyle.setFontWeight(getFont().isBold() ? FontWeight.BOLD : FontWeight.NORMAL);
}
}
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:16,代码来源:PublishedCell.java
示例7: applyStyle
import com.google.gwt.dom.client.Style.FontStyle; //导入依赖的package包/类
void applyStyle( Element element )
{
element.getStyle().setPadding( 5, Unit.PX );
element.getStyle().setBorderColor( "black" );
element.getStyle().setBorderStyle( BorderStyle.SOLID );
element.getStyle().setBorderWidth( 1, Unit.PX );
element.getStyle().setProperty( "fontFamily", "Arial Unicode MS,Arial,sans-serif" );
element.getStyle().setFontSize( 12, Unit.PT );
element.getStyle().setFontStyle( FontStyle.NORMAL );
element.getStyle().setFontWeight( FontWeight.NORMAL );
}
开发者ID:ltearno,项目名称:hexa.tools,代码行数:14,代码来源:GrowingTextArea.java
示例8: EmptyTableCell
import com.google.gwt.dom.client.Style.FontStyle; //导入依赖的package包/类
EmptyTableCell(String text) {
super(text, false);
getElement().getStyle().setFontStyle(FontStyle.ITALIC);
}
开发者ID:Jenner4S,项目名称:unitimes,代码行数:5,代码来源:AcademicSessionSelector.java
示例9: withFontStyle
import com.google.gwt.dom.client.Style.FontStyle; //导入依赖的package包/类
public Builder withFontStyle(FontStyle fontStyle) {
this.fontStyle = fontStyle;
return this;
}
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:StyleConfigurator.java
示例10: show
import com.google.gwt.dom.client.Style.FontStyle; //导入依赖的package包/类
public static void show(String message, final ActionEntry ae) {
if (!_visible) {
WindowProperties wp = new WindowProperties();
wp.setModal(true);
wp.setCanBeResized(false);
wp.setCanBeClosed(false);
wp.setCanBeMoved(false);
wp.setSize(0.4, 0.4);
wp.setTitle("DaRIS Portal");
wp.setShowHeader(false);
wp.setShowFooter(false);
_win = Window.create(wp);
}
HTML content = new HTML();
content.setFontStyle(FontStyle.NORMAL);
content.setFontSize(12);
content.setFontWeight(FontWeight.BOLD);
content.setHTML(message);
content.setMargin(20);
CenteringPanel cp = new CenteringPanel();
cp.setContent(content);
cp.setBackgroundColour(new RGB(0xb2, 0xb2, 0xb2));
VerticalPanel vp = new VerticalPanel();
vp.fitToParent();
vp.add(cp);
if (ae != null) {
ButtonBar bb = ButtonUtil.createButtonBar(Position.BOTTOM, Alignment.RIGHT, 28);
Button b = bb.addButton(ae.label());
b.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
if (ae.action() != null) {
ae.action().execute();
}
}
});
b.setMarginRight(15);
vp.add(bb);
}
_win.setContent(vp);
_win.centerInPage();
_win.show();
_visible = true;
}
开发者ID:uom-daris,项目名称:daris,代码行数:53,代码来源:SplashWindow.java
示例11: buildNodes
import com.google.gwt.dom.client.Style.FontStyle; //导入依赖的package包/类
protected void buildNodes(List<HeaderNode<T>> aHeaders, Map<Column<T, ?>, ColumnSortList.ColumnSortInfo> sortedColumns) {
// AbstractCellTable<T> table = getTable();
List<HeaderNode<T>> children = new ArrayList<>();
boolean isFooter = isBuildingFooter();
// Get the common style names.
String className = isBuildingFooter() ? ThemedGridResources.instance.cellTableStyle().cellTableFooter() : ThemedGridResources.instance.cellTableStyle().cellTableHeader();
String sortableStyle = ThemedGridResources.instance.cellTableStyle().cellTableSortableHeader();
String sortedAscStyle = ThemedGridResources.instance.cellTableStyle().cellTableSortedHeaderAscending();
String sortedDescStyle = ThemedGridResources.instance.cellTableStyle().cellTableSortedHeaderDescending();
TableRowBuilder tr = startRow();
// Loop through all column header nodes.
for (int i = 0; i < aHeaders.size(); i++) {
HeaderNode<T> headerNode = aHeaders.get(i);
children.addAll(headerNode.getChildren());
Header<?> headerOrFooter = headerNode.getHeader();
Column<T, ?> column = null;
if (headerOrFooter instanceof HasColumn<?>)
column = ((HasColumn<T>) headerOrFooter).getColumn();
boolean isSortable = !isFooter && column != null && column.isSortable();
ColumnSortList.ColumnSortInfo sortedInfo = sortedColumns.get(column);
boolean isSorted = sortedInfo != null;
StringBuilder classesBuilder = new StringBuilder(className);
boolean isSortAscending = isSortable && sortedInfo != null ? sortedInfo.isAscending() : false;
if (isSortable) {
if (classesBuilder.length() > 0) {
classesBuilder.append(" ");
}
classesBuilder.append(sortableStyle);
if (isSorted) {
if (classesBuilder.length() > 0) {
classesBuilder.append(" ");
}
classesBuilder.append(isSortAscending ? sortedAscStyle : sortedDescStyle);
}
}
// Render the header or footer.
TableCellBuilder th = tr.startTH();
if (headerNode.getDepthRemainder() > 0)
th.rowSpan(headerNode.getDepthRemainder() + 1);
if (headerNode.getLeavesCount() > 1)
th.colSpan(headerNode.getLeavesCount());
th.className(classesBuilder.toString());
StylesBuilder thStyles = th.style();
if (headerNode.getBackground() != null) {
thStyles.trustedBackgroundColor(headerNode.getBackground().toStyled());
}
if (headerNode.getForeground() != null) {
thStyles.trustedColor(headerNode.getForeground().toStyled());
}
if (headerNode.getFont() != null) {
thStyles.trustedProperty("font-family", headerNode.getFont().getFamily());
thStyles.fontSize(headerNode.getFont().getSize(), Style.Unit.PX);
thStyles.fontStyle(headerNode.getFont().isItalic() ? FontStyle.ITALIC : FontStyle.NORMAL);
thStyles.fontWeight(headerNode.getFont().isBold() ? FontWeight.BOLD : FontWeight.NORMAL);
}
if (headerOrFooter != null) {
appendExtraStyles(headerOrFooter, classesBuilder);
if (column != null) {
enableColumnHandlers(th, column);
}
// Build the header.
Cell.Context context = new Cell.Context(0, i, headerOrFooter.getKey());
// Add div element with aria button role
if (isSortable) {
// TODO: Figure out aria-label and translation
// of label text
th.attribute("role", "button");
th.tabIndex(-1);
}
renderSortableHeader(th, context, headerOrFooter, isSorted, isSortAscending);
}
th.endTH();
}
// End the row.
tr.endTR();
if (!children.isEmpty()) {
buildNodes(children, sortedColumns);
}
}
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:80,代码来源:ThemedHeaderOrFooterBuilder.java
示例12: LoginWidget
import com.google.gwt.dom.client.Style.FontStyle; //导入依赖的package包/类
public LoginWidget(ConfigurationServiceAsync<CC> service) {
if (!GWT.isScript()) {
userName.setText("admin");
password.setText("password");
}
initWidget(fp);
fp.setStyleName("login");
Label un = new Label("User Name:");
un.getElement().setId("label");
fp.add(un);
fp.add(userName);
Label pw = new Label("Password:");
pw.getElement().setId("label");
fp.add(pw);
fp.add(password);
fp.add(login);
fp.add(staySignedIn);
fp.add(errorMsg);
errorMsg.getElement().getStyle().setColor("red");
errorMsg.getElement().getStyle().setFontStyle(FontStyle.ITALIC);
password.addKeyPressHandler(enterhandler);
password.getElement().setId("input");
userName.addKeyPressHandler(enterhandler);
userName.getElement().setId("input");
login.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
login.setEnabled(false);
login();
}
});
final HTML version = new HTML();
version.getElement().setId("version");
fp.add(version);
service.getClientConfigurations(new AsyncCallback<CC>() {
@Override
public void onSuccess(CC result) {
version.setText("Env:" + result.getTitle() + ", Version:" + result.getVersion());
Window.setTitle(result.getTitle() + ", v:" + result.getVersion());
cc = result;
staySignedIn.setValue(LocalStorage.readStoredItem(SSICH) != null && LocalStorage.readStoredItem(SSICH).equals("on"));
String user = StringFormatter.Base64Decode(LocalStorage.readStoredItem(SSIU));
String pass = StringFormatter.Base64Decode(LocalStorage.readStoredItem(SSIP));
if (staySignedIn.getValue() && user != null && pass != null) {
userName.setText(user);
password.setText(pass);
login();
}
}
@Override
public void onFailure(Throwable caught) {
version.setText("Error getting version:" + caught.getMessage());
}
});
}
开发者ID:armangal,项目名称:SmartMonitoring,代码行数:68,代码来源:LoginWidget.java
注:本文中的com.google.gwt.dom.client.Style.FontStyle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论