本文整理匯總了Java中com.google.gwt.user.client.ui.HorizontalPanel.setCellHorizontalAlignment方法的典型用法代碼示例。如果您正苦於以下問題:Java HorizontalPanel.setCellHorizontalAlignment方法的具體用法?Java HorizontalPanel.setCellHorizontalAlignment怎麽用?Java HorizontalPanel.setCellHorizontalAlignment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.HorizontalPanel
的用法示例。
在下文中一共展示了HorizontalPanel.setCellHorizontalAlignment方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Toolbar
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
/**
* Initializes and assembles all commands into buttons in the toolbar.
*/
public Toolbar() {
buttonMap = new HashMap<String, TextButton>();
dropDownButtonMap = new HashMap<String, DropDownButton>();
leftButtons = new HorizontalPanel();
leftButtons.setSpacing(4);
rightButtons = new HorizontalPanel();
rightButtons.setSpacing(4);
rightButtons.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
HorizontalPanel toolbar = new HorizontalPanel();
toolbar.add(leftButtons); // this nesting keeps buttons left aligned
toolbar.add(rightButtons);
toolbar.setCellHorizontalAlignment(rightButtons, HorizontalPanel.ALIGN_RIGHT);
toolbar.setWidth("100%");
toolbar.setStylePrimaryName("ya-Toolbar");
initWidget(toolbar);
}
示例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: FooterScreen
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的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);
}
示例6: load
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
public void load() {
if (this.currentTemplate == null) {
setErrorText("No Template to show!");
return;
}
setErrorText("");
setTitleText("Attributes for ");
setTitleWidget(new CIIconDisplayNameWidget(this.currentTemplate));
vPanel.clear();
HTML add = new HTML("[<a href='javascript:;'>new</a>]");
add.setTitle("Add a new attribute to this template");
add.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
OneCMDBModelCreator.get().showScreen(OneCMDBModelCreator.ADD_ATTRIBUTE_SCREEN, currentTemplate.getAlias(), new Long(0));
}
});
HorizontalPanel hPanel = new HorizontalPanel();
hPanel.add(add);
hPanel.setCellHorizontalAlignment(add, HorizontalPanel.ALIGN_RIGHT);
hPanel.setWidth("100%");
vPanel.add(hPanel);
vPanel.add(getAttributeTable());
}
示例7: setNavigationBar
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
private void setNavigationBar() {
navBarTable.getCellFormatter().setWidth(0, 1, "30%");
navBarTable.getCellFormatter().setWidth(0, 2, "10%");
navBarTable.getCellFormatter().setWidth(0, 3, "10%");
navBarTable.getCellFormatter().setWidth(0, 4, "22%");
navBarTable.getCellFormatter().setWidth(0, 5, "23%");
Label displayText = new Label(navBar.getCountString());
Label searchPageText = new Label(LocaleDictionary.get().getConstantValue(LocaleCommonConstants.TITLE_GO_TO_PAGE));
Label totalPageCountText = new Label(" /" + navBar.getTotalPageCount());
HorizontalPanel searchPagePanel = new HorizontalPanel();
displayText.setStyleName(selectionStyle.boldText());
searchPageText.setStyleName(selectionStyle.boldText());
totalPageCountText.setStyleName(selectionStyle.boldText());
searchPagePanel.add(searchPageText);
searchPagePanel.add(navBar.getSearchPageTextBox());
searchPagePanel.add(totalPageCountText);
searchPagePanel.setCellHorizontalAlignment(searchPageText, HasHorizontalAlignment.ALIGN_RIGHT);
searchPagePanel.setCellHorizontalAlignment(navBar.getSearchPageTextBox(), HasHorizontalAlignment.ALIGN_RIGHT);
searchPagePanel.setCellHorizontalAlignment(totalPageCountText, HasHorizontalAlignment.ALIGN_RIGHT);
if (this.navBar.getOrderingListner() != null) {
navBarTable.setWidget(0, 2, navBar.getOrderingPanel());
navBarTable.getCellFormatter().setHorizontalAlignment(0, 2, HasHorizontalAlignment.ALIGN_RIGHT);
}
if (this.navBar.getListner() != null) {
navBarTable.setWidget(0, 3, navBar.getPaginationPanel());
navBarTable.getCellFormatter().setHorizontalAlignment(0, 3, HasHorizontalAlignment.ALIGN_RIGHT);
navBarTable.setWidget(0, 4, searchPagePanel);
}
navBarTable.setWidget(0, 5, displayText);
navBarTable.getCellFormatter().setHorizontalAlignment(0, 4, HasHorizontalAlignment.ALIGN_RIGHT);
navBarTable.getCellFormatter().setHorizontalAlignment(0, 5, HasHorizontalAlignment.ALIGN_RIGHT);
}
示例8: 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);
}
示例9: load
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
public void load(GWT_CiBean bean) {
vPanel.clear();
HorizontalPanel cipanel = new HorizontalPanel();
cipanel.add(new Image(OneCMDBUtils.getIconForCI(bean)));
CIDisplayNameWidget display = new CIDisplayNameWidget(bean, clickListener);
cipanel.add(display);
cipanel.setCellWidth(display, "100%");
cipanel.setCellHorizontalAlignment(display, HorizontalPanel.ALIGN_LEFT);
vPanel.add(cipanel);
}
示例10: TitlePanel
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
public TitlePanel(String title, Widget body, boolean showTitle) {
titleWrapper = new HorizontalPanel();
makeTitleLabel(titleWrapper);
titleWrapper.add(titleLabel);
titleWrapper.add(titleBar);
titleWrapper.add(GwtUtil.getFiller(10, 1));
titleWrapper.setCellWidth(titleBar, "100%");
titleWrapper.setCellHorizontalAlignment(titleBar, HorizontalPanel.ALIGN_RIGHT);
dlp = new DockLayoutPanel(Style.Unit.PX);
if (showTitle) {
dlp.addNorth(titleWrapper, 23);
dlp.addNorth(GwtUtil.getFiller(1,2), 2);
}
dlp.add(body);
dlp.setSize("100%", "100%");
//
//
// FlowPanel vp = new FlowPanel();
// vp.add(titleWrapper);
// vp.add(body);
// vp.setSize("100%", "100%");
initWidget(dlp);
this.body = body;
// dlp.setStyleName("standard-border");
setTitle(title);
if (BrowserUtil.isIE()) {
DOM.setStyleAttribute(titleLabel.getElement(), "whiteSpace", "nowrap");
}
}
示例11: SimplePaletteItem
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
/**
* Creates a new palette item.
*
* @param scd component descriptor for palette item
* @param dropTargetProvider provider of targets that palette items can be dropped on
*/
public SimplePaletteItem(SimpleComponentDescriptor scd, DropTargetProvider dropTargetProvider) {
this.dropTargetProvider = dropTargetProvider;
this.scd = scd;
componentPrototype = null;
// Initialize palette item UI
HorizontalPanel panel = new HorizontalPanel();
panel.setStylePrimaryName("ode-SimplePaletteItem");
Image image = scd.getImage();
image.setStylePrimaryName("ode-SimplePaletteItem-icon");
panel.add(image);
panel.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_LEFT);
panel.setCellWidth(image, "30px");
Label label = new Label(ComponentsTranslation.getComponentName(scd.getName()));
label.setHorizontalAlignment(Label.ALIGN_LEFT);
label.addStyleName("ode-SimplePaletteItem-caption");
panel.add(label);
HorizontalPanel optPanel = new HorizontalPanel();
ComponentHelpWidget helpImage = new ComponentHelpWidget(scd);
helpImage.addStyleName("ode-SimplePalleteItem-button");
optPanel.add(helpImage);
optPanel.setCellHorizontalAlignment(helpImage, HorizontalPanel.ALIGN_LEFT);
if (scd.getExternal()) {
ComponentRemoveWidget deleteImage = new ComponentRemoveWidget(scd);
deleteImage.addStyleName("ode-SimplePalleteItem-button");
optPanel.add(deleteImage);
optPanel.setCellHorizontalAlignment(deleteImage, HorizontalPanel.ALIGN_RIGHT);
}
panel.add(optPanel);
panel.setCellHorizontalAlignment(optPanel, HorizontalPanel.ALIGN_RIGHT);
panel.setWidth("100%");
add(panel);
setWidth("100%");
addHandlers();
}
示例12: HeaderScreen
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
public HeaderScreen() {
HorizontalPanel outer = new HorizontalPanel();
VerticalPanel inner = new VerticalPanel();
outer.setWidth("100%");
outer.setHeight("3em");
//outer.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
inner.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
inner.setWidth("100%");
inner.setHeight("100%");
HorizontalPanel authInfo = new HorizontalPanel();
//authInfo.setSpacing(4);
logout.setStyleName("logout-style");
authInfo.add(welcomeString);
authInfo.add(logout);
logout.setVisible(false);
logout.addClickListener(this);
inner.add(authInfo);
HorizontalPanel actionPanel = new HorizontalPanel();
actionPanel.setStyleName("onecmdb-header-label");
actionPanel.setSpacing(10);
actionPanel.add(getFeedbackWidget());
actionPanel.add(getCheckUpdateWidget());
actionPanel.add(getHomeWidegt());
actionPanel.add(getHelpWidget());
inner.add(actionPanel);
inner.setCellVerticalAlignment(actionPanel, VerticalPanel.ALIGN_BOTTOM);
inner.setCellVerticalAlignment(authInfo, VerticalPanel.ALIGN_TOP);
//DockPanel iconPanel = new DockPanel();
//iconPanel.setWidth("100%");
//welcomePanel.setSpacing(10);
//iconPanel.add(icon,DockPanel.EAST);
// welcomePanel.add(new HTML("<b> </b>"),DockPanel.CENTER);
outer.add(icon);
outer.setCellHorizontalAlignment(icon, HorizontalPanel.ALIGN_LEFT);
outer.add(inner);
outer.setCellHorizontalAlignment(inner, HorizontalPanel.ALIGN_RIGHT);
// Show welcome page.
icon.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
getBaseEntryScreen().showScreen(OneCMDBApplication.WELCOME_SCREEN);
}
});
initWidget(outer);
//outer.setStyleName("one-top-panel");
}
示例13: setupTable
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
protected void setupTable() {
if (this.template == null) {
return;
}
setTitleText("Instances of ");
setTitleWidget(new CIIconDisplayNameWidget(this.template));
vPanel.clear();
table = null;
if (isNewSupport()) {
HorizontalPanel actionPanel = new HorizontalPanel();
HTML add = new HTML("[<a href='javascript:;'>new</a>]");
add.setTitle("Create a new instance");
actionPanel.add(add);
add.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
getBaseEntryScreen().showScreen(OneCMDBApplication.NEW_CI_SCREEN, template.getAlias(), new Long(0));
}
});
actionPanel.add(add);
actionPanel.setCellHorizontalAlignment(add, HorizontalPanel.ALIGN_RIGHT);
actionPanel.setWidth("100%");
vPanel.add(actionPanel);
}
VerticalPanel tablePanel = new VerticalPanel();
tablePanel.setStyleName("onecmdb-table-panel");
if (table == null) {
table = new CITablePanel();
table.addTableListener(ListCIScreen.this);
table.addLoadListener(ListCIScreen.this);
CITablePageControlPanel tablePageControl = new CITablePageControlPanel(table);
tablePanel.add(tablePageControl);
tablePanel.add(table);
tablePanel.setCellVerticalAlignment(tablePageControl, VerticalPanel.ALIGN_TOP);
tablePanel.setCellVerticalAlignment(table, VerticalPanel.ALIGN_TOP);
}
vPanel.add(tablePanel);
table.setAttributeRender(getAttributeRender());
table.setTabelControl(getTableControl(this.template));
table.load();
}
示例14: buildGUI
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
@Override
public void buildGUI() {
add( ClientUtils.createVerticalEmptyWidget( 30 ) );
final HorizontalPanel greetingsPanel = new HorizontalPanel();
add( greetingsPanel );
if ( sharedApiAccountUserInfo == null ) {
// Greeting
if ( apiUserInfo.getLastVisit() == null ) {
greetingsPanel.add( new Label( "Welcome " ) );
greetingsPanel.add( ClientUtils.createHorizontalEmptyWidget( 5 ) );
greetingsPanel.add( ClientUtils.styledWidget( new Label( apiUserInfo.getUserName() ), "strong" ) );
greetingsPanel.add( new Label( "!" ) );
}
else {
greetingsPanel.add( new Label( "Welcome back" ) );
greetingsPanel.add( ClientUtils.createHorizontalEmptyWidget( 5 ) );
greetingsPanel.add( ClientUtils.styledWidget( new Label( apiUserInfo.getUserName() ), "strong" ) );
greetingsPanel.add( new Label( "! Your last visit was at:" ) );
greetingsPanel.add( ClientUtils.createHorizontalEmptyWidget( 5 ) );
greetingsPanel.add( ClientUtils.createTimestampWidget( apiUserInfo.getLastVisit() ) );
}
}
else {
if ( sharedApiAccountUserInfo.isHasApiAccount() )
greetingsPanel.add( new Label( "You are now viewing the" ) );
else
greetingsPanel.add( new Label( "You do NOT have access to the" ) );
greetingsPanel.add( ClientUtils.createHorizontalEmptyWidget( 9 ) );
greetingsPanel.add( ClientUtils.styledWidget( new Label( sharedApiAccountUserInfo.getSharedApiAccount() ), "strong" ) );
greetingsPanel.add( ClientUtils.createHorizontalEmptyWidget( 9 ) );
greetingsPanel.add( new Label( "API account!" ) );
}
// Replay parser engine version
if ( apiUserInfo.getRepParserEngineVer() != null ) {
add( ClientUtils.createVerticalEmptyWidget( 30 ) );
final HorizontalPanel rowPanel = new HorizontalPanel();
rowPanel.add( new Label( "Replay parser engine version:" ) );
rowPanel.add( ClientUtils.createHorizontalEmptyWidget( 5 ) );
rowPanel.add( ClientUtils.styledWidget( new Label( apiUserInfo.getRepParserEngineVer() ), "strong" ) );
add( rowPanel );
}
// Parsing service tester page
add( ClientUtils.createVerticalEmptyWidget( 30 ) );
add( new Anchor( "Parsing Service Tester page", "/parsing_service_tester.html", "_blank" ) );
add( ClientUtils.createVerticalEmptyWidget( 70 ) );
// Footer
final HorizontalPanel linksPanel = new HorizontalPanel();
linksPanel.setWidth( "500px" );
DOM.setStyleAttribute( linksPanel.getElement(), "padding", "2px" );
DOM.setStyleAttribute( linksPanel.getElement(), "borderTop", "1px solid #555555" );
linksPanel.addStyleName( "noWrap" );
linksPanel.add( new Anchor( "About the Service", "https://sites.google.com/site/sc2gears/parsing-service", "_blank" ) );
linksPanel.add( ClientUtils.createHorizontalEmptyWidget( 10 ) );
linksPanel.add( new Anchor( "Terms of Service", "https://sites.google.com/site/sc2gears/parsing-service#TOC-Terms-of-Service", "_blank" ) );
linksPanel.add( ClientUtils.createHorizontalEmptyWidget( 10 ) );
linksPanel.add( new Anchor( "Privacy Policy", "https://sites.google.com/site/sc2gears/parsing-service#TOC-Privacy-Policy", "_blank" ) );
linksPanel.add( ClientUtils.createHorizontalEmptyWidget( 15 ) );
final Label lastLabel = new Label( "© András Belicza, 2011-2014, Icons: Fugue" );
DOM.setStyleAttribute( lastLabel.getElement(), "color", "#555555" );
DOM.setStyleAttribute( lastLabel.getElement(), "paddingTop", "3px" );
linksPanel.add( lastLabel );
linksPanel.setCellWidth( lastLabel, "100%" );
linksPanel.setCellHorizontalAlignment( lastLabel, HasHorizontalAlignment.ALIGN_RIGHT );
for ( int i = linksPanel.getWidgetCount() - 1; i >= 0; i-- )
DOM.setStyleAttribute( linksPanel.getWidget( i ).getElement(), "fontSize", "80%" );
add( linksPanel );
}