当前位置: 首页>>代码示例>>Java>>正文


Java Image.setStylePrimaryName方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.Image.setStylePrimaryName方法的典型用法代码示例。如果您正苦于以下问题:Java Image.setStylePrimaryName方法的具体用法?Java Image.setStylePrimaryName怎么用?Java Image.setStylePrimaryName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.Image的用法示例。


在下文中一共展示了Image.setStylePrimaryName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SimplePaletteItem

import com.google.gwt.user.client.ui.Image; //导入方法依赖的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();
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:51,代码来源:SimplePaletteItem.java

示例2: addRowToTable

import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected void addRowToTable(int row, int index, Object result) {
	//The column index
	int column = 0;
	
	//Convert the object data
	OnePageViewData<ShortUserData> data = (OnePageViewData<ShortUserData>) result;
	final ShortUserData shortUserData = data.entries.get( index );

	//Set the index of the entry
	int userNumber = ( ( getCurrentPageNumber() - 1 ) * NUMBER_OF_ROWS_PER_PAGE) + ( index + 1);
	dataTable.setWidget( row, column++, new Label( Integer.toString( userNumber ) ) );
	
	//Add the check box into the rom/column, it should mark the 
	//data entry (short user data) with the given ID and name. 
	if( doNeedSelectColumn ) {
		addSelectorIntoDataTableRow(row, column++, index, new Integer(shortUserData.getUID()), shortUserData.getUserLoginName());
	}

	//Add the gender column
	final String genderURL, genderTipStr;
	if( shortUserData.isMale() ) {
		genderURL = ServerSideAccessManager.getUserMaleGenderImageURL();
		genderTipStr = titlesI18N.genderMaleValue();
	} else {
		genderURL = ServerSideAccessManager.getUserFemaleGenderImageURL();
		genderTipStr = titlesI18N.genderFemaleValue();
	}
	Image genderImage = new Image(genderURL);
	genderImage.setTitle( genderTipStr );
	genderImage.setStylePrimaryName( CommonResourcesContainer.USER_SEARCH_DIALOG_STATUS_IMAGE_STYLE_NAME );
	dataTable.setWidget( row, column++, genderImage );
	
	//Add the online/offline status column
	final String statusURL, statusTipStr;
	if( shortUserData.isOnline() ) {
		statusURL = ServerSideAccessManager.getUserOnlineStatusImageURL();
		statusTipStr = titlesI18N.userOnlineStatus();
	} else {
		statusURL = ServerSideAccessManager.getUserOfflineStatusImageURL();
		statusTipStr = titlesI18N.userOfflineStatus();
	}
	Image statusImage = new Image(statusURL);
	statusImage.setTitle( statusTipStr );
	statusImage.setStylePrimaryName( CommonResourcesContainer.USER_SEARCH_DIALOG_STATUS_IMAGE_STYLE_NAME );
	dataTable.setWidget( row, column++, statusImage );
	
	//Add the last online column value
	Label lastOnlineDataLabel = new Label();
	if( shortUserData.isOnline() ) {
		lastOnlineDataLabel.setText( titlesI18N.userOnlineStatus() );
	} else {
		setDateLabelValue( lastOnlineDataLabel, shortUserData.getUserLastOnlineDate() );
	}
	lastOnlineDataLabel.setStyleName( CommonResourcesContainer.CONST_FIELD_VALUE_DEFAULT_STYLE_NAME );
	dataTable.setWidget( row, column++, lastOnlineDataLabel );
	
	//Set the user name/link here, depending o whether we browse by and admin or not we open different dialogs
	Label userNameLink = new Label( shortUserData.getUserLoginName() );
	userNameLink.setStyleName( CommonResourcesContainer.DIALOG_LINK_BLUE_STYLE );
	userNameLink.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent e){
			//Ensure lazy loading
			final SplitLoad executor = new SplitLoad( true ) {
				@Override
				public void execute() {
					//Show the user profile
					ViewUserProfileDialogUI userProfile = new ViewUserProfileDialogUI( shortUserData.getUID(),
																						shortUserData.getUserLoginName(),
																						thisDialog, false );
					userProfile.show();
					userProfile.center();
				}
			};
			executor.loadAndExecute();
		}
	});
	dataTable.setWidget( row, column++, userNameLink );
}
 
开发者ID:ivan-zapreev,项目名称:x-cure-chat,代码行数:81,代码来源:UserSearchDialog.java


注:本文中的com.google.gwt.user.client.ui.Image.setStylePrimaryName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。