本文整理汇总了Java中com.google.gwt.user.client.ui.HorizontalPanel.setCellVerticalAlignment方法的典型用法代码示例。如果您正苦于以下问题:Java HorizontalPanel.setCellVerticalAlignment方法的具体用法?Java HorizontalPanel.setCellVerticalAlignment怎么用?Java HorizontalPanel.setCellVerticalAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.HorizontalPanel
的用法示例。
在下文中一共展示了HorizontalPanel.setCellVerticalAlignment方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IconCell
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
public IconCell(ImageResource resource, final String title, String text) {
super(null);
iIcon = new Image(resource);
iIcon.setTitle(title);
iIcon.setAltText(title);
if (text != null && !text.isEmpty()) {
iLabel = new HTML(text, false);
iPanel = new HorizontalPanel();
iPanel.setStyleName("icon");
iPanel.add(iIcon);
iPanel.add(iLabel);
iIcon.getElement().getStyle().setPaddingRight(3, Unit.PX);
iPanel.setCellVerticalAlignment(iIcon, HasVerticalAlignment.ALIGN_MIDDLE);
}
iIcon.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
event.stopPropagation();
UniTimeConfirmationDialog.info(title);
}
});
}
示例2: addLogo
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
private void addLogo(HorizontalPanel panel) {
// Logo should be a link to App Inv homepage. Currently, after the user
// has logged in, the top level *is* ODE; so for now don't make it a link.
// Add timestamp to logo url to get around browsers that agressively cache
// the image! This same trick is used in StorageUtil.getFilePath().
Image logo = new Image(LOGO_IMAGE_URL + "?t=" + System.currentTimeMillis());
logo.setSize("40px", "40px");
logo.setStyleName("ode-Logo");
String logoUrl = ode.getSystemConfig().getLogoUrl();
if (!Strings.isNullOrEmpty(logoUrl)) {
logo.addClickHandler(new WindowOpenClickHandler(logoUrl));
}
panel.add(logo);
panel.setCellWidth(logo, "50px");
Label title = new Label("MIT App Inventor");
title.setStyleName("ode-LogoText");
VerticalPanel titleContainer = new VerticalPanel();
titleContainer.add(title);
panel.add(titleContainer);
panel.setCellWidth(titleContainer, "180px");
panel.setCellHorizontalAlignment(logo, HorizontalPanel.ALIGN_LEFT);
panel.setCellVerticalAlignment(logo, HorizontalPanel.ALIGN_MIDDLE);
}
示例3: Status
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的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);
}
示例4: Status
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的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);
}
示例5: addHeaderColumns
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
private void addHeaderColumns(final List<Column> columnList, final FlexTable flexTable) {
tableNameVsCheckBoxMap.get(selectedDataTableName).clear();
int columnNumber = 0;
for (Column headerColumn : columnList) {
HorizontalPanel headerRowPanel = new HorizontalPanel();
Label headerText = new Label(headerColumn.getName());
headerRowPanel.add(headerText);
headerRowPanel.setWidth("80px");
CheckBox validationCheckBox = new CheckBox();
validationCheckBox.setVisible(Boolean.FALSE);
headerRowPanel.add(validationCheckBox);
headerRowPanel.setCellVerticalAlignment(validationCheckBox, HasVerticalAlignment.ALIGN_MIDDLE);
tableNameVsCheckBoxMap.get(selectedDataTableName).add(validationCheckBox);
flexTable.setWidget(0, columnNumber, headerRowPanel);
flexTable.getCellFormatter().addStyleName(0, columnNumber, "wordWrap");
columnNumber++;
}
}
示例6: MyCell
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
public MyCell(CurriculumInterface curriculum, CurriculumClassificationInterface classification) {
iCurriculum = curriculum;
iClasf = classification;
iPanel = new HorizontalPanel();
iTextBox = new UniTimeTextBox(6, ValueBoxBase.TextAlignment.RIGHT);
iTextBox.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
try {
if (iTextBox.getText().isEmpty()) {
iClasf.setExpected(null);
} else {
iClasf.setExpected(Integer.valueOf(iTextBox.getText()));
}
} catch (Exception e) {
iClasf.setExpected(null);
}
update();
for (MySumCell sum: iSums)
sum.update();
}
});
iRearLabel = new HTML("", false);
iRearLabel.setWidth("50px");
iRearLabel.setStyleName("unitime-Label");
iRearLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
iPanel.add(iTextBox);
iPanel.setCellVerticalAlignment(iTextBox, HasVerticalAlignment.ALIGN_MIDDLE);
iPanel.add(iRearLabel);
iPanel.setCellVerticalAlignment(iRearLabel, HasVerticalAlignment.ALIGN_MIDDLE);
initWidget(iPanel);
update();
}
示例7: MySumCell
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
public MySumCell(List<MyCell> cells) {
iCells = cells;
for (MyCell cell: iCells)
cell.iSums.add(this);
iPanel = new HorizontalPanel();
iTextBox = new HTML("", false);
iTextBox.setWidth("60px");
iTextBox.setStyleName("unitime-Label");
iTextBox.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
iRearLabel = new HTML("", false);
iRearLabel.setWidth("55px");
iRearLabel.setStyleName("unitime-Label");
iRearLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
iPanel.add(iTextBox);
iPanel.setCellVerticalAlignment(iTextBox, HasVerticalAlignment.ALIGN_MIDDLE);
iPanel.add(iRearLabel);
iPanel.setCellVerticalAlignment(iRearLabel, HasVerticalAlignment.ALIGN_MIDDLE);
initWidget(iPanel);
update();
}
示例8: InstructorCell
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
public InstructorCell(ArrayList<String> names, ArrayList<String> emails, String separator) {
super(null, separator);
if (names != null && !names.isEmpty()) {
separator = separator.replace(" ", " ");
for (int i = 0; i < names.size(); i++) {
String text = names.get(i) + (i + 1 < names.size() ? separator : "");
String email = (emails != null && i < emails.size() ? emails.get(i) : null);
if (email != null && !email.isEmpty()) {
iText += text;
HorizontalPanel p = new HorizontalPanel();
p.setStyleName("instructor");
Anchor a = new Anchor();
a.setHref("mailto:" + email);
a.setHTML(new Image(RESOURCES.email()).getElement().getString());
a.setTitle(MESSAGES.sendEmail(names.get(i)));
a.setStyleName("unitime-SimpleLink");
a.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
event.stopPropagation();
}
});
p.add(a);
p.setCellVerticalAlignment(a, HasVerticalAlignment.ALIGN_MIDDLE);
HTML h = new HTML(text, false);
h.getElement().getStyle().setMarginLeft(2, Unit.PX);
p.add(h);
iPanel.add(p);
iContent.add(h);
} else
add(text);
}
} else {
add(" ");
}
}
示例9: WidgetItem
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
public WidgetItem(ClickListener expandListener) {
HorizontalPanel root = new HorizontalPanel();
widgetPanel = new HorizontalPanel();
childPanel = new VerticalPanel();
root.add(childPanel);
root.add(widgetPanel);
root.setCellVerticalAlignment(widgetPanel, VerticalPanel.ALIGN_MIDDLE);
this.expandListener = expandListener;
initWidget(root);
}
示例10: load
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
public void load() {
VerticalPanel panel = new VerticalPanel();
HorizontalPanel header = new HorizontalPanel();
header.setStyleName("one-select-popup-header");
header.setWidth("100%");
Label headerLabel = new Label(title);
Image close = new Image("images/eclipse/close.gif");
header.add(headerLabel);
header.add(close);
header.setCellHorizontalAlignment(headerLabel, HorizontalPanel.ALIGN_LEFT);
header.setCellHorizontalAlignment(close, HorizontalPanel.ALIGN_RIGHT);
header.setCellVerticalAlignment(close, HorizontalPanel.ALIGN_MIDDLE);
// Add drag control.
new DragControl(this, headerLabel);
close.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
hide();
}
});
panel.add(header);
panel.add(content);
panel.setCellVerticalAlignment(header, VerticalPanel.ALIGN_TOP);
panel.setCellVerticalAlignment(content, VerticalPanel.ALIGN_TOP);
panel.setCellHeight(content, "100%");
setWidget(panel);
}
示例11: setupStatusRegion
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
public static void setupStatusRegion(LayoutManager lm) {
final HorizontalPanel hp = new HorizontalPanel();
Region statusBar = new BaseRegion(STATUS) {
@Override
public void setDisplay(Widget display) {
GwtUtil.setStyles(display, "fontSize", "12px", "lineHeight", "40px");
super.setDisplay(display);
}
@Override
public void hide() {
hp.setVisible(false);
}
@Override
public void show() {
hp.setVisible(true);
}
};
Image im = new Image("images/gxt/attention.gif");
im.setSize("16px", "16px");
GwtUtil.setStyle(im, "marginLeft", "20px");
hp.add(im);
hp.add(statusBar.getDisplay());
hp.getElement().setId("app-status");
hp.setSize("99%", "40px");
hp.setCellVerticalAlignment(im, VerticalPanel.ALIGN_MIDDLE);
hp.setCellVerticalAlignment(statusBar.getDisplay(), VerticalPanel.ALIGN_MIDDLE);
hp.setVisible(false);
RootPanel.get("application").add(hp);
lm.addRegion(statusBar);
}
示例12: init
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
/**
* Initialize
*
* @param path Result root address
*/
protected void init(String path) {
this.setSize("650px", "400px");
this.setGlassEnabled(true);
this.setModal(true);
closeButton.setSize("10px", "10px");
closeButton.setStyleName("closebtn");
closeButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
PreviewPopupPanel.this.hide();
}
});
VerticalPanel verticalPanel = new VerticalPanel();
verticalPanel.add(closeButton);
verticalPanel.setCellHeight(closeButton, "13px");
verticalPanel.setStyleName("vpanel");
desc.setStyleName("popupTitle");
verticalPanel.add(desc);
verticalPanel.setCellHeight(desc, "30px");
HorizontalPanel hPanel = new HorizontalPanel();
savebtn.setStyleName("popupsavebtn");
savebtn.setVisible(false);
refreshBtn.setStyleName("popuprefreshbtn");
refreshBtn.setVisible(false);
uploadSubmitButton.setVisible(false);
hPanel.add(uploadSubmitButton);
hPanel.add(savebtn);
hPanel.add(refreshBtn);
hPanel.setCellVerticalAlignment(uploadSubmitButton,
HasVerticalAlignment.ALIGN_BOTTOM);
tabPanel.getElement().getStyle().setMarginBottom(10.0, Unit.PX);
tabPanel.setSize("650px", "355px");
dirPanel = new HorizontalPanel();
resultDirTree = PopupRetDirTreeLoad.load(path);
resultDirTree.getRoot().setState(false);
ScrollPanel dirScrollPanel = new ScrollPanel();
dirScrollPanel.add(resultDirTree);
dirScrollPanel.setAlwaysShowScrollBars(true);
dirScrollPanel.setSize("300px", "320px");
VerticalPanel fileViewPanel = new VerticalPanel();
fileLabel.setText("Please select a file to view!");
fileLabel.setStyleName("popupFileSelectName");
fileViewPanel.add(fileLabel);
fileTextArea.setStyleName("popupMsg");
fileTextArea.setSize("342px", "298px");
fileTextArea.getElement().setAttribute("wrap", "off");
fileTextArea.setReadOnly(true);
fileViewPanel.add(fileTextArea);
dirPanel.add(dirScrollPanel);
dirPanel.add(fileViewPanel);
tabPanel.add(dirPanel,"Results directory");
AbsolutePanel bottomPanel = new AbsolutePanel();
bottomPanel.setSize("650px", "360px");
bottomPanel.add(tabPanel, 0, 0);
bottomPanel.add(hPanel,460,3);
fileSizeLabel.setStyleName("popupFileSelectName");
verticalPanel.add(bottomPanel);
verticalPanel.add(fileSizeLabel);
this.add(verticalPanel);
this.setStyleName("loading_container");
}
示例13: getWidget
import com.google.gwt.user.client.ui.HorizontalPanel; //导入方法依赖的package包/类
public Widget getWidget(final Object data) {
HorizontalPanel hpanel = (HorizontalPanel) super.getWidget(data);
if (data instanceof GWT_CiBean) {
final GWT_CiBean bean = (GWT_CiBean)data;
final Image popup = new Image("images/eclipse/tree_menu2.gif");
hpanel.add(popup);
hpanel.setCellVerticalAlignment(popup, VerticalPanel.ALIGN_MIDDLE);
popup.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
System.out.println("Menu popup...");
final PopupPanel p = new PopupPanel(true);
//p.setStyleName("popup-menu");
Command newInstance = new Command() {
public void execute() {
p.hide();
OneCMDBModelCreator.get().showScreen(OneCMDBModelCreator.NEW_INSTANCE_SCREEN, bean.getAlias(), new Long(0));
}
};
Command newTemplate = new Command() {
public void execute() {
p.hide();
OneCMDBModelCreator.get().showScreen(OneCMDBModelCreator.NEW_TEMPLATE_SCREEN, bean.getAlias(), new Long(0));
}
};
Command delete = new Command() {
public void execute() {
p.hide();
delete(bean);
}
};
// Make some sub-menus that we will cascade from the top menu.
MenuBar fooMenu = new MenuBar(true);
if (bean.isTemplate()) {
fooMenu.addItem("New Instance", newInstance);
fooMenu.addItem("New Template", newTemplate);
}
fooMenu.addItem("Delete", delete);
p.setPopupPosition(popup.getAbsoluteLeft(), popup.getAbsoluteTop());
p.setWidget(fooMenu);
p.show();
}
});
}
return(hpanel);
}