本文整理汇总了Java中com.google.gwt.user.client.ui.HasVerticalAlignment类的典型用法代码示例。如果您正苦于以下问题:Java HasVerticalAlignment类的具体用法?Java HasVerticalAlignment怎么用?Java HasVerticalAlignment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HasVerticalAlignment类属于com.google.gwt.user.client.ui包,在下文中一共展示了HasVerticalAlignment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的package包/类
public void init() {
uploader.setButtonImageURL("img/uploadimg.png").setButtonWidth(32)
.setButtonHeight(32)
.setButtonCursor(Uploader.Cursor.HAND);
horizontalPanel.setStyleName("bda-fileupload-bottom-hpanel");
horizontalPanel.setSpacing(10);
horizontalPanel.add(uploader);
if (Uploader.isAjaxUploadWithProgressEventsSupported()) {
dropFilesLabel.getElement().getStyle().setCursor(Cursor.POINTER);
dropFilesLabel.setSize("32px", "32px");
dropFilesLabel.setTitle("File dragable upload area");
}
horizontalPanel.add(dropFilesLabel);
horizontalPanel.add(progressBarPanel);
horizontalPanel.setCellVerticalAlignment(progressBarPanel,
HasVerticalAlignment.ALIGN_MIDDLE);
this.add(horizontalPanel);
initFacet();
}
示例2: IconCell
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的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);
}
});
}
示例3: add
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的package包/类
public IconsCell add(ImageResource resource, final String title) {
if (resource == null) return this;
Image icon = new Image(resource);
icon.setTitle(title);
icon.setAltText(title);
if (iPanel.getWidgetCount() > 0)
icon.getElement().getStyle().setPaddingLeft(3, Unit.PX);
iPanel.add(icon);
iPanel.setCellVerticalAlignment(icon, HasVerticalAlignment.ALIGN_MIDDLE);
if (title != null && !title.isEmpty()) {
icon.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
event.stopPropagation();
UniTimeConfirmationDialog.info(title);
}
});
}
return this;
}
示例4: createSeparatorPanel
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的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);
}
示例5: createColumnList
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的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);
}
示例6: CancelButton
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的package包/类
public CancelButton(String panel_id) {
final String id = panel_id;
cancel.setWidth("75px");
cancel.addStyleDependentName("SMALLER");
cancel.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent click) {
eventBus.fireEvent(new CancelEvent(id));
}
});
CellFormatter f = interior.getCellFormatter();
f.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
f.setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);
f.setVerticalAlignment(2, 0, HasVerticalAlignment.ALIGN_TOP);
interior.setWidget(0, 0, batch);
interior.setWidget(1, 0, message);
interior.setWidget(2, 0, cancel);
sizePanel.add(interior);
initWidget(sizePanel);
}
示例7: setTopLeftAlignment
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的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: handleDoubleClick
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的package包/类
protected void handleDoubleClick(TableData.Row row) {
VerticalPanel vp = new VerticalPanel();
final Image previewImage = new Image(getFullSizeUrl(row));
final HTML caption = new HTML(getPopUpCaption(row));
String title = getThumbnailDesc(row).replace("<em>", "").replace("</em>", "");
caption.setWidth("320px");
previewImage.addLoadHandler(new LoadHandler() {
public void onLoad(LoadEvent ev) {
caption.setWidth(previewImage.getWidth() + "px");
}
});
GwtUtil.setStyle(vp, "margin", "8px");
vp.setCellHorizontalAlignment(previewImage, HasHorizontalAlignment.ALIGN_CENTER);
vp.setCellVerticalAlignment(previewImage, HasVerticalAlignment.ALIGN_MIDDLE);
vp.add(previewImage);
vp.add(caption);
PopupPane popupPane = new PopupPane(title, vp, PopupType.STANDARD, false, false);
popupPane.show();
}
示例9: addNewFieldValuePair
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的package包/类
protected void addNewFieldValuePair( final FlowPanel content, final String fieldName,
final Date dateValue, final boolean addEndCommaDelimiter ) {
final Label fieldLabel = new Label( fieldName );
fieldLabel.setStyleName( CommonResourcesContainer.USER_DIALOG_REGULAR_FIELD_STYLE );
final DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat( PredefinedFormat.DATE_TIME_SHORT );
final Label dateTimeLabel = new Label( dateTimeFormat.format( dateValue ) );
dateTimeLabel.setStyleName( CommonResourcesContainer.CONST_FIELD_VALUE_DEFAULT_STYLE_NAME );
final int width = ( dateTimeLabel.getOffsetWidth() == 0 ? DEFAULT_PROGRESS_BAR_WIDTH_PIXELS : dateTimeLabel.getOffsetWidth() );
DateOldProgressBarUI progressBarUI= new DateOldProgressBarUI( width, DEFAULT_PROGRESS_BAR_HEIGHT_PIXELS, dateValue );
//If there are replies to this message
VerticalPanel dateTimePanel = new VerticalPanel();
dateTimePanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
dateTimePanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
dateTimePanel.add( dateTimeLabel );
dateTimePanel.add( progressBarUI );
//Add the widgets to the panel
addNewFieldValuePair( content, fieldLabel, dateTimePanel, addEndCommaDelimiter );
}
示例10: populate
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的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);
}
示例11: getYoutubeEmbeddedFlashObject
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的package包/类
/**
* Allows to get a flash object for the youtube video url
* @param yutubeMediaUrl the youtube video url
* @param youtubeURL the original youtube link url
* @param isInitiallyBlocked is true if the flash should be initially blocked
* @return the corresponding flash object widget
*/
public static Widget getYoutubeEmbeddedFlashObject( final String yutubeMediaUrl, final String youtubeURL, final boolean isInitiallyBlocked ) {
//Construct the youtube embedded object descriptor
FlashEmbeddedObject flashObject = new FlashEmbeddedObject( null );
flashObject.setMovieUrl( yutubeMediaUrl );
flashObject.completeEmbedFlash();
//Make the widget out of a wrapped youtube video plus the video URL.
VerticalPanel mainPanel = new VerticalPanel();
mainPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
mainPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
mainPanel.add( new FlashObjectWrapperUI( flashObject.toString(), isInitiallyBlocked, null ) );
mainPanel.add( new URLWidget( youtubeURL, false, false ) );
return mainPanel;
}
示例12: createColumnList
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的package包/类
protected ColumnModel<VectorFeature> createColumnList(List<VectorFeature> features) {
List<ColumnConfig<VectorFeature, ?>> columns = new ArrayList<ColumnConfig<VectorFeature, ?>>();
if(features != null && features.size() > 0) {
VectorFeature feature = features.get(0);
if(feature.getAttributes() != null) {
for(String attributeName : feature.getAttributes().getAttributeNames()) {
AttributeValueProvider attributeProvider = new AttributeValueProvider(attributeName);
ColumnConfig<VectorFeature, String> attributeColumn = new ColumnConfig<VectorFeature, String>(
attributeProvider, 100, attributeName);
attributeColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
if(isEnableCellRender()) {
attributeColumn.setCell(new FeatureGridCellRenderer());
}
columns.add(attributeColumn);
}
}
}
return new ColumnModel<VectorFeature>(columns);
}
示例13: createWidget
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的package包/类
@Override
protected Widget createWidget() {
HorizontalPanel mainPanel = new HorizontalPanel();
save.setValue( true );
mainPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
mainPanel.add( new Label( "Products :" ) );
mainPanel.add( products );
mainPanel.add( showProduct );
mainPanel.add( new Label( "Deals :" ) );
mainPanel.add( deals );
mainPanel.add( showDeal );
mainPanel.add( save );
mainPanel.setStyleName( "bar" );
return mainPanel;
}
示例14: populateDialog
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的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 );
}
}
示例15: addViewUserProfileLink
import com.google.gwt.user.client.ui.HasVerticalAlignment; //导入依赖的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 );
}