本文整理汇总了Java中com.google.gwt.user.client.ui.HasAlignment类的典型用法代码示例。如果您正苦于以下问题:Java HasAlignment类的具体用法?Java HasAlignment怎么用?Java HasAlignment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HasAlignment类属于com.google.gwt.user.client.ui包,在下文中一共展示了HasAlignment类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: NavBar
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
public NavBar(CalendarWidget calendar) {
super();
this.calendar = calendar;
setWidget(bar);
bar.setStyleName("navbar");
title.setStyleName("header");
HorizontalPanel prevButtons = new HorizontalPanel();
prevButtons.add(prevMonth);
prevButtons.add(prevYear);
HorizontalPanel nextButtons = new HorizontalPanel();
nextButtons.add(nextYear);
nextButtons.add(nextMonth);
bar.add(prevButtons, DockPanel.WEST);
bar.setCellHorizontalAlignment(prevButtons, DockPanel.ALIGN_LEFT);
bar.add(nextButtons, DockPanel.EAST);
bar.setCellHorizontalAlignment(nextButtons, DockPanel.ALIGN_RIGHT);
bar.add(title, DockPanel.CENTER);
bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE);
bar.setCellHorizontalAlignment(title, HasAlignment.ALIGN_CENTER);
bar.setCellVerticalAlignment(title, HasAlignment.ALIGN_MIDDLE);
bar.setCellWidth(title, "100%");
}
开发者ID:kuzavas,项目名称:ephesoft,代码行数:27,代码来源:CalendarWidget.java
示例2: Status
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的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);
}
开发者ID:openkm,项目名称:document-management-system,代码行数:28,代码来源:Status.java
示例3: Status
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的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);
}
开发者ID:openkm,项目名称:document-management-system,代码行数:28,代码来源:Status.java
示例4: NavBar
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
public NavBar() {
initWidget(bar);
bar.setStyleName("navbar");
status.setStyleName("status");
HorizontalPanel buttons = new HorizontalPanel();
buttons.add(gotoFirst);
buttons.add(gotoPrev);
buttons.add(gotoNext);
bar.add(buttons, DockPanel.EAST);
bar.setCellHorizontalAlignment(buttons, DockPanel.ALIGN_RIGHT);
bar.add(status, DockPanel.CENTER);
bar.setVerticalAlignment(DockPanel.ALIGN_MIDDLE);
bar.setCellHorizontalAlignment(status, HasAlignment.ALIGN_RIGHT);
bar.setCellVerticalAlignment(status, HasAlignment.ALIGN_MIDDLE);
bar.setCellWidth(status, "100%");
// Initialize prev & first button to disabled.
//
gotoPrev.setEnabled(false);
gotoFirst.setEnabled(false);
}
开发者ID:Peergos,项目名称:Peergos,代码行数:23,代码来源:DynaTableWidget.java
示例5: AbsolutePanelComponent
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
public AbsolutePanelComponent() {
componentContainer = new HorizontalPanel();
componentContainer.setWidth("100%");
componentContainer.setHeight("100%");
componentContainer.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
componentContainer.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE);
setPanelWidget(componentContainer);
}
开发者ID:openremote,项目名称:WebConsole,代码行数:10,代码来源:AbsolutePanelComponent.java
示例6: addRow
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
/**
* Adds new user name row
*
* @param userName The user name value
*/
public void addRow(GWTActivity activity) {
int rows = dataTable.getRowCount();
dataTable.insertRow(rows);
dataTable.setHTML(rows, 0, activity.getAction());
dataTable.setHTML(rows, 1, activity.getUser());
DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18n("general.date.pattern"));
dataTable.setHTML(rows, 2, dtf.format(activity.getDate()));
dataTable.setHTML(rows, 3, activity.getParams());
dataTable.getCellFormatter().setHorizontalAlignment(rows, 1, HasAlignment.ALIGN_CENTER);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 2, HasAlignment.ALIGN_CENTER);
}
开发者ID:openkm,项目名称:document-management-system,代码行数:17,代码来源:LogScrollTable.java
示例7: addRow
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
/**
* addRow
*
* @param instanceLogEntry
*/
public void addRow(GWTProcessInstanceLogEntry instanceLogEntry) {
int rows = dataTable.getRowCount();
dataTable.insertRow(rows);
dataTable.setHTML(rows, 0, String.valueOf(instanceLogEntry.getProcessDefinitionId()));
dataTable.setHTML(rows, 1, instanceLogEntry.getProcessDefinitionName());
dataTable.setHTML(rows, 2, instanceLogEntry.getToken());
DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18n("general.date.pattern"));
dataTable.setHTML(rows, 3, dtf.format(instanceLogEntry.getDate()));
dataTable.setHTML(rows, 4, instanceLogEntry.getType());
dataTable.setHTML(rows, 5, instanceLogEntry.getInfo());
dataTable.getCellFormatter().setHorizontalAlignment(rows, 0, HasAlignment.ALIGN_CENTER);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 3, HasAlignment.ALIGN_CENTER);
}
开发者ID:openkm,项目名称:document-management-system,代码行数:19,代码来源:WorkflowDetailTable.java
示例8: ToolBarButton
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
public ToolBarButton(Image image, String title, ClickHandler handler) {
super();
this.image = image;
this.image.setTitle(title);
addClickHandler(handler); // Adding clickhandler to widget
add(image);
setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
setSize("24", "24");
setCellHeight(image, "24");
setCellWidth(image, "24");
sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS);
}
开发者ID:openkm,项目名称:document-management-system,代码行数:16,代码来源:ToolBarButton.java
示例9: addRow
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
/**
* Adds a new row
*
* @param search The search value
*/
public void addRow(GWTQueryParams search) {
int rows = table.getRowCount();
data.put(dataIndexValue, search);
if (!search.isShared()) {
table.setHTML(rows, 0, " ");
} else {
table.setWidget(rows, 0, new Image(OKMBundleResources.INSTANCE.sharedQuery()));
}
table.setHTML(rows, 1, search.getQueryName());
table.setHTML(rows, 2, "" + dataIndexValue++);
table.setHTML(rows, 3, "");
table.getFlexCellFormatter().setVisible(rows, 2, false);
// The hidden column extends table to 100% width
CellFormatter cellFormatter = table.getCellFormatter();
cellFormatter.setWidth(rows, 0, "30px");
cellFormatter.setHeight(rows, 0, "20px");
cellFormatter.setHorizontalAlignment(rows, 0, HasAlignment.ALIGN_CENTER);
cellFormatter.setVerticalAlignment(rows, 0, HasAlignment.ALIGN_MIDDLE);
cellFormatter.setWidth(rows, 3, "100%");
table.getRowFormatter().setStyleName(rows, "okm-userNews");
setRowWordWarp(rows, 4, false);
}
开发者ID:openkm,项目名称:document-management-system,代码行数:33,代码来源:UserNews.java
示例10: addRow
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
/**
* Adds a new row
*
* @param search Search parameters to be added.
*/
private void addRow(GWTQueryParams search) {
int rows = table.getRowCount();
data.put(new Long(dataIndexValue), search);
if (!search.isShared()) {
table.setHTML(rows, 0, " ");
} else {
table.setWidget(rows, 0, new Image(OKMBundleResources.INSTANCE.sharedQuery()));
}
table.setHTML(rows, 1, search.getQueryName());
table.setHTML(rows, 2, "" + dataIndexValue++);
table.setHTML(rows, 3, "");
table.getCellFormatter().setVisible(rows, 2, false);
// The hidden column extends table to 100% width
CellFormatter cellFormatter = table.getCellFormatter();
cellFormatter.setWidth(rows, 0, "30px");
cellFormatter.setHeight(rows, 0, "20px");
cellFormatter.setHorizontalAlignment(rows, 0, HasAlignment.ALIGN_CENTER);
cellFormatter.setVerticalAlignment(rows, 0, HasAlignment.ALIGN_MIDDLE);
cellFormatter.setWidth(rows, 3, "100%");
table.getRowFormatter().setStyleName(rows, "okm-SearchSaved");
setRowWordWarp(rows, 4, false);
}
开发者ID:openkm,项目名称:document-management-system,代码行数:33,代码来源:SearchSaved.java
示例11: alertWidget
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
public static DialogBox alertWidget(final String header, final String content) {
final DialogBox dialogBox = new DialogBox();
final VerticalPanel verticalPanel = new VerticalPanel();
final Label emptyLabel = new Label("");
emptyLabel.setSize("auto", "25px");
dialogBox.setText(header);
verticalPanel.add(emptyLabel);
verticalPanel.add(new Label(content));
verticalPanel.add(emptyLabel);
final Button buttonClose = new Button("Close", new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
dialogBox.hide();
}
});
buttonClose.setWidth("100px");
verticalPanel.add(buttonClose);
verticalPanel.setCellHorizontalAlignment(buttonClose, HasAlignment.ALIGN_CENTER);
dialogBox.add(verticalPanel);
dialogBox.setWidth("400px");
return dialogBox;
}
开发者ID:palantir,项目名称:gerrit-ci,代码行数:29,代码来源:ProjectConfigurationScreen.java
示例12: alertWidget
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
/**
* Creates a DialogBox object with the specified header and content and
* returns it to be displayed.
*
* @param header
* Title for the alert dialog
* @param content
* Inner message content to display
* @return A DialogBox object configured with the specified strings
*/
public static DialogBox alertWidget(final String header,
final String content) {
final DialogBox dialogBox = new DialogBox();
final VerticalPanel verticalPanel = new VerticalPanel();
final Label emptyLabel = new Label("");
emptyLabel.setSize("auto", "25px");
dialogBox.setText(header);
verticalPanel.add(emptyLabel);
verticalPanel.add(new Label(content));
verticalPanel.add(emptyLabel);
final Button buttonClose = new Button("Close", new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
dialogBox.hide();
}
});
buttonClose.setWidth("100px");
verticalPanel.add(buttonClose);
verticalPanel.setCellHorizontalAlignment(buttonClose,
HasAlignment.ALIGN_CENTER);
dialogBox.add(verticalPanel);
return dialogBox;
}
开发者ID:palantir,项目名称:gerrit-ci,代码行数:40,代码来源:ConfigurationScreen.java
示例13: initializeColumns
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
/**
* Defines the columns in the custom table. Maps the data in the
* PasswordCard for each row into the appropriate column in the table, and
* defines handlers for each column.
*/
private void initializeColumns(ListHandler<PasswordCard> sortHandler) {
// Title.
titleColumn = new Column<PasswordCard, String>(new TextCell()) {
@Override
public String getValue(PasswordCard object) {
return object.getTitre();
}
};
titleColumn.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
titleColumn.setSortable(true);
sortHandler.setComparator(titleColumn, new Comparator<PasswordCard>() {
@Override
public int compare(PasswordCard o1, PasswordCard o2) {
return o1.getTitre().compareTo(o2.getTitre());
}
});
titleColumn.setFieldUpdater(new FieldUpdater<PasswordCard, String>() {
@Override
public void update(int index, PasswordCard object, String value) {
// Called when the user changes the value.
object.setTitre(value);
dataProvider.refresh();
}
});
dataGrid.setColumnWidth(0, 25, Unit.PCT);
}
开发者ID:guiguib,项目名称:yaph,代码行数:34,代码来源:PasswordView.java
示例14: onModuleLoad
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
/**
* This is the entry point method.
*/
public void onModuleLoad() {
// Set up guest entries tables, first row for headers.
guestEntries.setHTML(0, 0, "<b>Guest Name</b>");
guestEntries.setHTML(0, 1, "<b>Message</b>");
// Style the entries table.
guestEntries.addStyleName("gb-GuestEntries");
guestEntries.getRowFormatter().addStyleName(0, "gb-GuestEntriesHeader");
guestEntries.getCellFormatter().addStyleName(0, 0, "gb-GuestHeader");
guestEntries.getCellFormatter().addStyleName(0, 1, "gb-MessageHeader");
// Attach components together.
mainPanel.add(errorLabel);
mainPanel.add(guestSignaturePanel);
mainPanel.add(guestEntries);
// Align the signature panel and entries table.
mainPanel.setWidth("100%");
mainPanel.setCellHorizontalAlignment(guestSignaturePanel,
HasAlignment.ALIGN_CENTER);
mainPanel.setCellHorizontalAlignment(guestEntries,
HasAlignment.ALIGN_CENTER);
mainPanel.setCellWidth(guestEntries, "550px");
// Load and display existing guest entries.
loadGuestEntries();
// Attach handlers onto UI components.
guestSignaturePanel.addEntryUpdateHandler(this);
// Attach main panel to host HTML page.
RootPanel.get().add(mainPanel);
}
开发者ID:googlearchive,项目名称:appengine-gwtguestbook-namespaces-java,代码行数:37,代码来源:Guestbook.java
示例15: TabWorkspace
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
/**
* TabWorkspace
*/
public TabWorkspace() {
vPanel = new VerticalPanel();
iframe = new Frame("about:blank");
DOM.setElementProperty(iframe.getElement(), "frameborder", "0");
DOM.setElementProperty(iframe.getElement(), "marginwidth", "0");
DOM.setElementProperty(iframe.getElement(), "marginheight", "0");
// Commented because on IE show clear if allowtransparency=true
DOM.setElementProperty(iframe.getElement(), "allowtransparency", "false");
DOM.setElementProperty(iframe.getElement(), "scrolling", "auto");
iframe.setUrl(Main.CONTEXT + "/extra/index.jsp");
iframe.setStyleName("okm-Iframe");
vPanel.add(iframe);
vPanel.setCellHorizontalAlignment(iframe, HasAlignment.ALIGN_CENTER);
vPanel.setWidth("100%");
vPanel.setHeight("100%");
// User workspace values
if (GeneralComunicator.getWorkspace() == null) {
timer = new Timer() {
@Override
public void run() {
if (GeneralComunicator.getWorkspace() == null) {
firstTimeLoadingWorkspace();
} else {
init();
}
}
};
firstTimeLoadingWorkspace();
} else {
init();
}
initWidget(vPanel);
}
开发者ID:openkm,项目名称:document-management-system,代码行数:45,代码来源:TabWorkspace.java
示例16: add
import com.google.gwt.user.client.ui.HasAlignment; //导入依赖的package包/类
@Override
public ImageListEditorView<T> add(final SafeUri uri, final String width, final String height,
final SafeHtml heading, final SafeHtml text,
final boolean selected, final Command clickCommand) {
final VerticalPanel panel = new VerticalPanel();
panel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE);
panel.setHeight("100%");
final Image image = new Image(uri);
image.setWidth(width);
image.setHeight(height);
image.addStyleName(style.image());
final double alpha = selected ? 1 : 0.2;
image.getElement().setAttribute("style", "filter: alpha(opacity=5);opacity: " + alpha);
final Tooltip tooltip = new Tooltip();
tooltip.setTitle( text.asString() );
tooltip.setWidget(image);
tooltip.setContainer("body");
tooltip.setPlacement(Placement.BOTTOM);
tooltip.setIsAnimated(false);
tooltip.setShowDelayMs(100);
final HTML label = new HTML(heading.asString());
final HorizontalPanel labelPanel = new HorizontalPanel();
labelPanel.setWidth("100%");
labelPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
labelPanel.add(label);
panel.add(tooltip);
panel.add(labelPanel);
mainPanel.add(panel);
image.addClickHandler(e -> {
tooltip.hide();
tooltip.destroy();
clickCommand.execute();
});
return this;
}
开发者ID:kiegroup,项目名称:appformer,代码行数:42,代码来源:HorizImageListEditorView.java
注:本文中的com.google.gwt.user.client.ui.HasAlignment类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论