本文整理汇总了Java中com.google.gwt.user.client.ui.HasHorizontalAlignment类的典型用法代码示例。如果您正苦于以下问题:Java HasHorizontalAlignment类的具体用法?Java HasHorizontalAlignment怎么用?Java HasHorizontalAlignment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HasHorizontalAlignment类属于com.google.gwt.user.client.ui包,在下文中一共展示了HasHorizontalAlignment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getColumnAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的package包/类
public HorizontalAlignmentConstant getColumnAlignment(CurriculumColumn column) {
switch (column) {
case SELECT:
return HasHorizontalAlignment.ALIGN_CENTER;
case LAST_LIKE:
case PROJECTION:
case REQUESTED:
case ENROLLED:
case SNAPSHOT_REQUESTED:
case SNAPSHOT_PROJECTION:
case REGISTERED:
return HasHorizontalAlignment.ALIGN_RIGHT;
default:
return HasHorizontalAlignment.ALIGN_LEFT;
}
}
示例2: initializew3wPanel
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的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);
}
示例3: createSeparatorPanel
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的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);
}
示例4: createColumnList
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的package包/类
private ColumnModel<LayerDef> createColumnList(LayerDefProperties props,
RowExpander<LayerDef> rowExpander) {
rowExpander.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
rowExpander.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
ColumnConfig<LayerDef, String> nameColumn = new ColumnConfig<LayerDef, String>(
props.name(), 200, SafeHtmlUtils.fromTrustedString("<b>"
+ UIMessages.INSTANCE.layerManagerToolText() + "</b>"));
nameColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
ColumnConfig<LayerDef, String> typeColumn = new ColumnConfig<LayerDef, String>(
props.type(), 75, UICatalogMessages.INSTANCE.type());
typeColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
typeColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
ColumnConfig<LayerDef, ImageResource> iconColumn = new ColumnConfig<LayerDef, ImageResource>(
props.icon(), 32, "");
iconColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
iconColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
iconColumn.setCell(new ImageResourceCell() {
@Override
public void render(Context context, ImageResource value, SafeHtmlBuilder sb) {
super.render(context, value, sb);
}
});
List<ColumnConfig<LayerDef, ?>> columns = new ArrayList<ColumnConfig<LayerDef, ?>>();
columns.add(rowExpander);
columns.add(iconColumn);
columns.add(nameColumn);
columns.add(typeColumn);
return new ColumnModel<LayerDef>(columns);
}
示例5: initializeStatusPanel
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的package包/类
private void initializeStatusPanel() {
String comboWidth = "125px";
statusPanel = new VerticalPanel();
StyleInjector.inject(".statusPanelStyle { " + "background: #E0ECF8;"
+ "border-radius: 5px 10px;" + "opacity: 0.8}");
statusPanel.setStyleName("statusPanelStyle");
statusPanel.setSpacing(5);
statusPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
initializeLayerCombo(comboWidth);
initializeEpsgCombo(comboWidth);
initializeStatusGrid();
statusPanel.add(new FieldLabel(layerCombo, UIMessages.INSTANCE
.sbSelectLayerLabel()));
statusPanel.add(new FieldLabel(epsgCombo, UIMessages.INSTANCE
.sbEpsgLabel()));
statusPanel.add(statusGrid);
statusPanel.setVisible(false);
}
示例6: LASAnnotationsPanel
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的package包/类
public LASAnnotationsPanel() {
super();
layoutPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
borderPanel.add(layoutPanel, DockPanel.CENTER);
layoutPanel.setSize("100%", "100%");
initWidget(borderPanel);
borderPanel.setBorderWidth(1);
layoutPanel.setBorderWidth(0);
// setWidth(CONSTANTS.DEFAULT_ANNOTATION_PANEL_WIDTH());
layoutPanel.setTitle(DEFAULT_TOOLTIP);
closeButton.setTitle(DEFAULT_CLOSE_BUTTON_TOOLTIP);
closeButton.getElement().getStyle().setProperty("textAlign", "center");
closeButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
setOpenAndPublish(false);
}
});
layoutPanel.add(closeButton, DockPanel.EAST);
layoutPanel.setCellHeight(closeButton, "1em");
layoutPanel.setCellWidth(closeButton, "1em");
closeButton.setSize("1em", "1em");
layoutPanel.setCellHorizontalAlignment(closeButton,
HasHorizontalAlignment.ALIGN_RIGHT);
}
示例7: setTopLeftAlignment
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的package包/类
/**
* @param flexTable
*
*/
void setTopLeftAlignment(FlexTable flexTable) {
if (flexTable != null) {
int rows = flexTable.getRowCount();
for (int row = 0; row < rows; row++) {
int cellCount = flexTable.getCellCount(row);
for (int col = 0; col < cellCount; col++) {
if (flexTable.isCellPresent(row, col)) {
flexTable.getCellFormatter().setHorizontalAlignment(row, col, HasHorizontalAlignment.ALIGN_LEFT);
flexTable.getCellFormatter().setVerticalAlignment(row, col, HasVerticalAlignment.ALIGN_TOP);
Widget widget = flexTable.getWidget(row, col);
if ((widget != null) && (widget.getClass().getName().equals("FlexTable"))) {
try {
setTopLeftAlignment((FlexTable) widget);
} catch (Exception e) {
// e.printStackTrace();
}
}
}
}
}
}
}
示例8: SourceCodePopupPanel
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的package包/类
public SourceCodePopupPanel() {
// PopupPanel's constructor takes 'auto-hide' as its boolean parameter.
// If this is set, the panel closes itself automatically when the user
// clicks outside of it.
super(true);
// Set the dialog box's caption.
setText("Source Code");
// Enable animation.
setAnimationEnabled(true);
// Enable glass background.
setGlassEnabled(true);
Button btnClose = new Button("Close");
btnClose.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
}
});
VerticalPanel panel = new VerticalPanel();
panel.add(html);
panel.add(btnClose);
panel.setCellHorizontalAlignment(btnClose, HasHorizontalAlignment.ALIGN_RIGHT);
setWidget(panel);
}
示例9: create
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的package包/类
/**
* Creates dialog box.
*
* @param popup - UniversalPopup on which the dialog is based
* @param title - title placed in the title bar
* @param innerWidget - the inner widget of the dialog
* @param dialogButtons - buttons
*/
public static void create(UniversalPopup popup, String title, Widget innerWidget,
DialogButton[] dialogButtons) {
// Title
popup.getTitleBar().setTitleText(title);
VerticalPanel contents = new VerticalPanel();
popup.add(contents);
// Message
contents.add(innerWidget);
// Buttons
HorizontalPanel buttonPanel = new HorizontalPanel();
for (DialogButton dialogButton : dialogButtons) {
Button button = new Button(dialogButton.getTitle());
button.setStyleName(Dialog.getCss().dialogButton());
buttonPanel.add(button);
dialogButton.link(button);
}
contents.add(buttonPanel);
buttonPanel.setStyleName(Dialog.getCss().dialogButtonPanel());
contents.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT);
}
示例10: PackageReadyWidget
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的package包/类
PackageReadyWidget(MonitorItem monItem, int idx, boolean markAlreadyActivated) {
_monItem= monItem;
_idx= idx;
BackgroundStatus bgStat= monItem.getStatus();
PackageProgress bundle= bgStat.getPartProgress(idx);
FlexTable fp= new FlexTable();
HTMLTable.CellFormatter formatter= fp.getCellFormatter();
String desc= bgStat.getPackageCount()==1 ? "" : ZIP_ROOT_TXT + (idx+1);
fp.setWidget(0,0,makeDownloadNowButton(bundle.getURL(),desc,idx));
formatter.setWidth(0,0,"100px");
fp.setWidget(0,4,_icon);
setShowRetrivedIcon(markAlreadyActivated ? FileDownloadStatus.DONE : FileDownloadStatus.NONE);
formatter.setWidth(0,4,"20px");
formatter.setHorizontalAlignment(0,4, HasHorizontalAlignment.ALIGN_RIGHT);
Label dSize= new Label(StringUtils.getSizeAsString(bundle.getFinalCompressedBytes(),true));
fp.setWidget(0,2,dSize);
formatter.setWidth(0,2,"65px");
formatter.setHorizontalAlignment(0,2, HasHorizontalAlignment.ALIGN_RIGHT);
initWidget(fp);
}
示例11: addForumMessageSharingLinks
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的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 );
}
示例12: populate
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的package包/类
private void populate() {
//Add the scroll panel
elementPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
elementPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
scrollPanel.add( elementPanel );
//Initialize the widget
scrollPanel.setWidth("100%");
scrollPanel.setStyleName( CommonResourcesContainer.SCROLLABLE_SIMPLE_PANEL );
scrollPanel.addStyleName( CommonResourcesContainer.STACK_NAVIGATOR_SCROLL_PANEL_ELEMENT_STYLE );
//Set the simple panel
setComponentWidget( scrollPanel );
//Set the height of the panel to be 40 pixels
addDecPanelStyle(CommonResourcesContainer.STACK_NAVIGATOR_DEC_PANEL_ELEMENT_STYLE);
}
示例13: makeHoriPanel
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的package包/类
public static HorizontalPanel makeHoriPanel(HasHorizontalAlignment.HorizontalAlignmentConstant halign,
HasVerticalAlignment.VerticalAlignmentConstant valign,
Widget... widgets) {
HorizontalPanel hp = new HorizontalPanel();
for (Widget w : widgets) {
hp.add(w);
}
if (halign != null) {
hp.setHorizontalAlignment(halign);
hp.setWidth("100%");
}
if (valign != null) {
hp.setVerticalAlignment(valign);
}
return hp;
}
示例14: SimpleHorizontalProgressBarUI
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的package包/类
/**
* This constructor should be only visible inside of the package.
* Note that to initialize the progress bar one has to bind it to the text base object.
* This should be done using the method bindProgressBar(...).
*/
public SimpleHorizontalProgressBarUI( final int progressBarWidthPixels, final int progressBarHeightPixels,
final int maximumProgressBarCapacity, final int currentProgressBarValue ) {
//Initialize the progress bar content first
progressBarPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
progressBarPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
progressBarPanel.add( leftBar );
progressBarPanel.add( rightBar );
PROGRESS_BAR_WIDTH_IN_PIXELS = progressBarWidthPixels;
progressBarPanel.setWidth( PROGRESS_BAR_WIDTH_IN_PIXELS + "px");
MAX_PROGRESSBAR_CAPACITY = maximumProgressBarCapacity;
HEIGHT_INNER_IN_PIXELS = progressBarHeightPixels;
//Update the progress bar
forceProgressUpdate( currentProgressBarValue );
//Initialize the composite
initWidget( progressBarPanel );
}
示例15: populateDialog
import com.google.gwt.user.client.ui.HasHorizontalAlignment; //导入依赖的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 );
}
}