本文整理匯總了Java中com.google.gwt.user.client.ui.HorizontalPanel.setHorizontalAlignment方法的典型用法代碼示例。如果您正苦於以下問題:Java HorizontalPanel.setHorizontalAlignment方法的具體用法?Java HorizontalPanel.setHorizontalAlignment怎麽用?Java HorizontalPanel.setHorizontalAlignment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.HorizontalPanel
的用法示例。
在下文中一共展示了HorizontalPanel.setHorizontalAlignment方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initializew3wPanel
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
private void initializew3wPanel() {
w3wPanel = new HorizontalPanel();
w3wPanel.setSpacing(5);
w3wPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
StyleInjector.inject(".w3wPanel { " + "background: #E0ECF8;"
+ "border-radius: 5px 10px;" + "opacity: 0.8}");
w3wPanel.setStyleName("w3wPanel");
w3wPanel.setWidth("415px");
wordsLabel = new Label();
w3wAnchor = new AnchorBuilder().setHref("https://what3words.com/")
.setText(UIMessages.INSTANCE.what3Words())
.setTitle("https://what3words.com/").build();
w3wAnchor.getElement().getStyle().setColor("#FF0000");
w3wAnchor.setVisible(false);
w3wPanel.add(w3wAnchor);
w3wPanel.add(wordsLabel);
}
示例2: createSeparatorPanel
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
private void createSeparatorPanel() {
separatorPanel = new HorizontalPanel();
separatorPanel.setSpacing(1);
separatorPanel.setWidth("100%");
separatorPanel.addStyleName(ThemeStyles.get().style().borderTop());
separatorPanel.addStyleName(ThemeStyles.get().style().borderBottom());
separatorPanel
.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
separatorPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
separatorPanel.add(new Label(UIMessages.INSTANCE
.separator(DEFAULT_CSV_SEPARATOR)));
separatorTextField = new TextField();
separatorTextField.setText(DEFAULT_CSV_SEPARATOR);
separatorTextField.setWidth(30);
separatorPanel.add(separatorTextField);
}
示例3: 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);
}
示例4: GalleryAppBox
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
/**
* Creates new Gallery app box.
*/
private GalleryAppBox() {
gContainer = new FlowPanel();
final HorizontalPanel container = new HorizontalPanel();
container.setWidth("100%");
container.setSpacing(0);
container.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
HorizontalPanel panel = new HorizontalPanel();
Image image = new Image();
image.setResource(Ode.getImageBundle().waitingIcon());
panel.add(image);
Label label = new Label();
label.setText(Ode.getMessages().defaultRpcMessage());
panel.add(label);
gContainer.add(panel);
this.add(gContainer);
}
示例5: StatusPanel
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
/**
* Initializes and assembles all UI elements shown in the status panel.
*/
public StatusPanel() {
HorizontalPanel hpanel = new HorizontalPanel();
hpanel.setWidth("100%");
hpanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
String tosUrl = Ode.getInstance().getSystemConfig().getTosUrl();
if (!Strings.isNullOrEmpty(tosUrl)) {
String appInventorFooter =
"<a href=\"" + tosUrl + "\" target=\"_blank\">" + MESSAGES.privacyTermsLink() + "</a>";
hpanel.add(new HTML(appInventorFooter));
}
// This shows the git version and the date of the build
// String version = GitBuildId.getVersion();
// String date = GitBuildId.getDate();
// if (version != null && date != null) {
// Label buildId = new Label(MESSAGES.gitBuildId(date, version));
// hpanel.add(buildId);
// hpanel.setCellHorizontalAlignment(buildId, HorizontalPanel.ALIGN_RIGHT);
// }
initWidget(hpanel);
setStyleName("ode-StatusPanel");
}
示例6: addForumMessageSharingLinks
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
/**
* Allows to add a horizontal panel with various sharing links to the forum messages.
* All of the forum messages get a web link to the post.
* THe regular posts get also sharing links for Twitter, Mail.ru and Facebook.
* @param panel the panel to add the panel to.
*/
private void addForumMessageSharingLinks( HorizontalPanel panel ) {
final String forumMessageURL = getForumMessageURL( messageData );
final String forumMessageTitle = messageData.messageTitle;
HorizontalPanel linksPanel = new HorizontalPanel();
linksPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
linksPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT );
//Add the post link
linksPanel.add( new ShareMessageLinkURL( forumMessageURL, forumMessageTitle, i18nTitles.forumPostLinkTitle() ) );
//If it is a regular forum post then add the sharing links
if( ! messageData.isForumSectionMessage() && ! messageData.isForumTopicMessage() ) {
linksPanel.add( new HTML(" ") );
linksPanel.add( new ShareMessageTwitterURL( forumMessageURL, forumMessageTitle, i18nTitles.shareInTwitterLinkTitle() ) );
linksPanel.add( new HTML(" ") );
linksPanel.add( new ShareMessageVKontakteURL( forumMessageURL, forumMessageTitle, i18nTitles.shareInVKontakteLinkTitle() ) );
linksPanel.add( new HTML(" ") );
linksPanel.add( new ShareMessageMailRuURL( forumMessageURL, forumMessageTitle, i18nTitles.shareInMyWorldLinkTitle() ) );
linksPanel.add( new HTML(" ") );
linksPanel.add( new ShareMessageFacebookURL( forumMessageURL, forumMessageTitle, i18nTitles.shareInInFacebookLinkTitle() ) );
}
panel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT );
panel.add( linksPanel );
}
示例7: PageListWidget
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
/**
* The basic constructor
* @param siteSectionPrefix the history token site section prefix
*/
public PageListWidget( final String siteSectionPrefix ) {
this.siteSectionPrefix = siteSectionPrefix;
final HorizontalPanel mainPanel = new HorizontalPanel();
mainPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER);
mainPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM);
indexesPanel = new HorizontalPanel();
indexesPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER);
indexesPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM);
Label pageLabel = new Label( I18NManager.getTitles().pageString() );
pageLabel.setStyleName( CommonResourcesContainer.REGULAR_FIELD_STYLE );
mainPanel.add( pageLabel );
mainPanel.add( new HTML(": ") );
mainPanel.add( indexesPanel );
//The wrapper panel
HorizontalPanel wrapPanel = new HorizontalPanel();
wrapPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
wrapPanel.add( mainPanel );
initWidget( wrapPanel );
}
示例8: ButtonBar
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
public ButtonBar() {
HorizontalPanel hp = new HorizontalPanel();
hp.setWidth("100%");
hp.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
left = new HorizontalPanel();
left.setSpacing(3);
left.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
left.setWidth("100%");
right = new HorizontalPanel();
right.setSpacing(3);
right.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
right.setWidth("100%");
Label spacerRight = new Label();
right.add(spacerRight);
right.setCellWidth(spacerRight, "100%");
hic.setPixelSize(16,16);
hp.add(left);
hp.add(right);
hp.setCellWidth(right, "100%");
hp.add(GwtUtil.getFiller(10,1));
hp.add(hic);
initWidget(hp);
}
示例9: populateDialog
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
/**
* Fills the main grid data
*/
protected void populateDialog(){
addMainDataFields();
addImagesDataGrid();
addOptionalDataFields();
addAboutMyselfPanel();
//Add send message and is friend grid if we are not browsing ourselves
if( SiteManager.getUserID() != userID ) {
addSendMsgAddRemoveFriendActionFields();
} else {
//Add the progress bar for viewing ourselve's profile
addNewGrid( 1, 1, false, "", false);
HorizontalPanel progressBarPanel = new HorizontalPanel();
progressBarPanel.setWidth("100%");
progressBarPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
progressBarPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
progressBarPanel.add( progressBarUI );
addToGrid( FIRST_COLUMN_INDEX, progressBarPanel, false , false );
}
}
示例10: addViewUserProfileLink
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
/**
* Allows to add a small panel containing the "View Full Profile" link,
* this is made for those who are not smart enough to click on the login
* name in this dialog again, to get to a full profile view
*/
private void addViewUserProfileLink() {
//Initialize the link
Label userProfileLink = new Label(I18NManager.getTitles().viewFullUserProfileLinkTitle());
userProfileLink.setWordWrap(false);
userProfileLink.setStyleName( CommonResourcesContainer.DIALOG_LINK_RED_STYLE );
userProfileLink.addClickHandler( this.userProfileShowHandler );
//Initialize the panel
HorizontalPanel userProfileLinkPanel = new HorizontalPanel();
userProfileLinkPanel.setStyleName( CommonResourcesContainer.VIEW_USER_PROFILE_LINK_PANEL_STYLE );
userProfileLinkPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
userProfileLinkPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
userProfileLinkPanel.add( userProfileLink );
//Add the profile view link panel to the main panel
mainInfoVPanel.add( userProfileLinkPanel );
}
示例11: addCreateFilterButton
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
private void addCreateFilterButton(final Command addfilterCommand) {
HorizontalPanel buttonPanel = new HorizontalPanel();
buttonPanel.setWidth("100%");
buttonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
Button createFilterButton = new Button();
createFilterButton.setText(CommonConstants.INSTANCE.Add_New_Filter());
createFilterButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
getFormValues(filterControlGroups);
if (validateForm()) {
addfilterCommand.execute();
refreshGrid();
cleanFormValues(filterControlGroups);
tabAdd.showTab();
}
}
});
buttonPanel.add(createFilterButton);
horizontalForm.add(buttonPanel);
}
示例12: createUrlToShareAnchor
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
private Widget createUrlToShareAnchor() {
urlPanel = new HorizontalPanel();
urlPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
urlPanel.setSpacing(1);
urlToShareAnchor = new AnchorBuilder().build();
urlPanel.add(urlToShareAnchor);
Image img = new Image(ImageProvider.INSTANCE.externalLink16());
urlPanel.add(img);
urlPanel.setVisible(false);
return urlPanel;
}
示例13: AbsolutePanelComponent
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
public AbsolutePanelComponent() {
componentContainer = new HorizontalPanel();
componentContainer.setWidth("100%");
componentContainer.setHeight("100%");
componentContainer.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
componentContainer.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE);
setPanelWidget(componentContainer);
}
示例14: ScreenIndicator
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
public ScreenIndicator(List<Integer> screenIds) {
super(new HorizontalPanel(), CLASS_NAME);
HorizontalPanel container = (HorizontalPanel)getWidget();
DOM.setIntStyleAttribute(getElement(), "zIndex", 1000 );
DOM.setStyleAttribute(getElement(), "overflow", "hidden");
container.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
this.screenIds = screenIds;
screenIndicators = new ArrayList<Widget>();
if (screenIds != null) {
width = INDICATOR_SIZE * ((screenIds.size()*2) - 1);
setWidth(width + "px");
setHeight(INDICATOR_SIZE + "px");
height = INDICATOR_SIZE;
// Add a simple div for each screen
for (int i=0; i<screenIds.size(); i++) {
int cellWidth = INDICATOR_SIZE;
//cellWidth = i != screenIds.size()-1 ? cellWidth + INDICATOR_SPACING : cellWidth;
Widget screenIndicator = new SimplePanel();
screenIndicator.setWidth(INDICATOR_SIZE + "px");
screenIndicator.setHeight(INDICATOR_SIZE + "px");
screenIndicator.setStylePrimaryName(ITEM_CLASS_NAME);
screenIndicators.add(screenIndicator);
container.add(screenIndicator);
container.setCellWidth(screenIndicator, cellWidth + "px");
if (i<screenIds.size()-1) {
// Add a spacer
Widget spacer = new SimplePanel();
spacer.setWidth(INDICATOR_SIZE + "px");
spacer.setHeight(INDICATOR_SIZE + "px");
spacer.setStylePrimaryName(SPACER_CLASS_NAME);
container.add(spacer);
container.setCellWidth(spacer, cellWidth + "px");
}
}
}
}
示例15: ThreeLevelSiteMenu
import com.google.gwt.user.client.ui.HorizontalPanel; //導入方法依賴的package包/類
/**
* The leveled site menu. It has the user status manager
* that has to be instantiated prior to instantiating this class
*/
public ThreeLevelSiteMenu( ) {
//Position the choice of locale and the menu one above another
final VerticalPanel menuLevelsPanel = new VerticalPanel();
menuLevelsPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT );
//Add the user statistics menu level
final HorizontalPanel topLevel = new HorizontalPanel();
topLevel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
topLevel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
SiteInfoWidget statisticsWidget = new SiteInfoWidget();
statisticsWidget.startUpdates(); //Start the updates
topLevel.add( statisticsWidget ); //Add the user statistics widget
topLevel.add( InterfaceUtils.getLocaleSelectionPanel() ); //Add the locale selector
menuLevelsPanel.add( topLevel );
//Add the user info menu level
final HorizontalPanel userAndLocalePanel = new HorizontalPanel();
userAndLocalePanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
userAndLocalePanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
userAndLocalePanel.add( userStatusPanel ); //Add the user status panel
userAndLocalePanel.add( userTreasurePanel ); //The user treasure wallet panel
userAndLocalePanel.add( alertWidgetPanel ); //Add the sound notifier button panel
userAndLocalePanel.add( helpItemPanel ); //Add the help link panel
menuLevelsPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT );
menuLevelsPanel.add( userAndLocalePanel );
//Add the main menu level
theMainMenuUI.setLoggedOutMenu();
menuLevelsPanel.add( theMainMenuUI );
menuLevelsPanel.setWidth("100%");
//Initialize the composite
initWidget( menuLevelsPanel );
}