本文整理汇总了Java中com.google.gwt.user.client.ui.Image.setStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java Image.setStyleName方法的具体用法?Java Image.setStyleName怎么用?Java Image.setStyleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Image
的用法示例。
在下文中一共展示了Image.setStyleName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: refresh
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
@Override
public void refresh() {
clear();
RoomCookie cookie = RoomCookie.getInstance();
if (iPattern != null && !iPattern.isEmpty() && !cookie.isGridAsText()) {
final Image availability = new Image(GWT.getHostPageBaseURL() + "pattern?pref=" + iPattern + "&v=" + (cookie.areRoomsHorizontal() ? "0" : "1") + (cookie.hasMode() ? "&s=" + cookie.getMode() : ""));
availability.setStyleName("grid");
add(availability);
} else {
for (PreferenceInfo p: iPreferences) {
P prf = new P("prf");
prf.setText(p.getOwnerName());
PreferenceInterface preference = iProperties.getPreference(p.getPreference());
if (preference != null) {
prf.getElement().getStyle().setColor(preference.getColor());
prf.setTitle(preference.getName() + " " + p.getOwnerName());
}
add(prf);
}
}
}
示例2: addLogo
import com.google.gwt.user.client.ui.Image; //导入方法依赖的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: UserTreeItem
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* To create an entry for this user who is hidden in the given room
* @param userData
*/
public UserTreeItem( final String userLoginName ) {
this.userData = null;
final Label userNameLabel = new Label( );
userNameLabel.setText( ShortUserData.getShortLoginName( userLoginName ) );
userNameLabel.setTitle( userLoginName );
Image userImage = new Image( ServerSideAccessManager.getHiddenUserImageIconURL() );
userImage.setStyleName( CommonResourcesContainer.CHAT_USER_IMAGE_STYLE_NAME );
blockImagePlaceHolder.setStyleName( CommonResourcesContainer.CHAT_ROOM_IMAGE_PLACE_HOLDER_STYLE );
theMainHorizontalPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
theMainHorizontalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
theMainHorizontalPanel.add( blockImagePlaceHolder );
theMainHorizontalPanel.add( userImage );
userStatusImage.setStyleName( CommonResourcesContainer.CHAT_USER_IMAGE_STYLE_NAME );
userStatusImage.setUrl( UserStatusHelper.getUserStatusImgURL( UserStatusManager.getUserStatusQueue().getCurrentUserStatus() ) );
theMainHorizontalPanel.add( userStatusImage );
theMainHorizontalPanel.add( userNameLabel );
theMainHorizontalPanel.setTitle( i18nTitles.hiddenUserTip() );
theItemPanel.setStyleName( CommonResourcesContainer.CHAT_ROOM_HIDDEN_TREE_ITEM_STYLE_NAME );
theItemPanel.add( theMainHorizontalPanel );
initWidget(theItemPanel);
}
示例4: constructThumbnailImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* Allows to create an image thumbnail for the given file descriptor
* @param fileDescriptors the list of file descriptors
* @param index the index of this file descriptor
* @return the image
*/
private Image constructThumbnailImage( final List<ShortUserFileDescriptor> fileDescriptors, final int index ){
final ShortUserFileDescriptor fileDescr = fileDescriptors.get( index );
Image image = new Image( ServerSideAccessManager.getProfileFileURL( fileDescr.ownerID, fileDescr, true ) );
image.setTitle( titlesI18N.userFileThumbnailManagementTip() );
image.addClickHandler( new ClickHandler(){
@Override
public void onClick(ClickEvent event) {
//Ensure lazy loading
( new SplitLoad( true ) {
@Override
public void execute() {
ViewTop10ProfileFilesDialogUI dialog = new ViewTop10ProfileFilesDialogUI( parentDialog, fileDescriptors, index );
dialog.show();
dialog.center();
}
}).loadAndExecute();
}
});
image.setStyleName( CommonResourcesContainer.USER_DIALOG_USER_IMAGE_STYLE );
return image;
}
示例5: getReadAllStatusImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* This method creates the room-user read-all access status image for the admin interface
* @param isReadAll if the read all access is on
* @param isReadAllExpired if the read all access is expired
* @return the proper Image to put into the room-users table
*/
protected Image getReadAllStatusImage( final boolean isReadAll, final boolean isReadAllExpired ) {
String url, title;
if( isReadAll ) {
if( isReadAllExpired ) {
url = ServerSideAccessManager.getReadAllExpiredImageURL();
title = titlesI18N.readAllExpiredHintTitle();
} else {
url = ServerSideAccessManager.getReadAllActiveImageURL();
title = titlesI18N.readAllActiveHintTitle();
}
} else {
url = ServerSideAccessManager.getReadAllNotOnImageURL();
title = titlesI18N.readAllNotOnHintTitle();
}
Image readAllStatusImage = new Image( url );
readAllStatusImage.setTitle( title );
readAllStatusImage.setStyleName( CommonResourcesContainer.PAGED_DIALOG_STATUS_IMAGE_STYLE_NAME );
return readAllStatusImage;
}
示例6: CodeListView
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public CodeListView(EventBus eventBus, OntoBrowserServiceAsync service) {
super(eventBus,service);
Image emptyListWidget = new Image(ImageResources.INSTANCE.spinner());
emptyListWidget.setStyleName("float-right");
list.setEmptyListWidget(emptyListWidget);
list.setKeyboardPagingPolicy(KeyboardPagingPolicy.CURRENT_PAGE);
list.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);
list.setSelectionModel(selection);
selection.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
public void onSelectionChange(SelectionChangeEvent event) {
Term selected = selection.getSelectedObject();
if(selected != null) {
History.newItem(selected.getReferenceId());
}
}
});
codelistContainer.add(list);
initWidget(codelistContainer);
addStyleName("padded-border vert-scroll");
eventBus.addHandler(ViewTermEvent.TYPE, this);
}
示例7: setChildCount
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public void setChildCount(int value) {
if (value > 0) {
final Image image = new Image("images/plus.gif");
image.setStyleName("onecmdb-reverse-expand");
image.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
open = !open;
if (open) {
image.setUrl("images/minus.gif");
} else {
image.setUrl("images/plus.gif");
}
expandListener.onClick(WidgetItem.this);
}
});
widgetPanel.add(image);
widgetPanel.setCellVerticalAlignment(image, VerticalPanel.ALIGN_MIDDLE);
}
}
示例8: getPopupWidget
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
protected P getPopupWidget() {
if (iPopupWidget == null) {
iPopupWidget = new P("unitime-RoomPictureHint");
Image image = new Image(GWT.getHostPageBaseURL() + "picture?id=" + iPicture.getUniqueId());
image.setStyleName("picture");
iPopupWidget.add(image);
P caption = new P("caption");
caption.setText(iPicture.getName() + (iPicture.getPictureType() == null ? "" : " (" + iPicture.getPictureType().getAbbreviation() + ")"));
iPopupWidget.add(caption);
}
return iPopupWidget;
}
示例9: ScheduleStatus
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public ScheduleStatus() {
super("unitime-ScheduleStatus");
setVisible(false);
iImage = new Image(); iImage.setStyleName("image");
iMessage = new P("message");
add(iImage); add(iMessage);
}
示例10: createImageDialog
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* Enlarges image on page
*/
private static void createImageDialog(String img) {
// Create the UI elements of the DialogBox
final DialogBox dialogBox = new DialogBox(true, true); // DialogBox(autohide, modal)
dialogBox.setStylePrimaryName("ode-DialogBox");
dialogBox.setGlassEnabled(true);
dialogBox.setAnimationEnabled(true);
VerticalPanel DialogBoxContents = new VerticalPanel();
FlowPanel holder = new FlowPanel();
Button ok = new Button("Close");
ok.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
dialogBox.hide();
}
});
ok.setStyleName("DialogBox-button");
// Adds Image
Image image = new Image(img);
image.addLoadHandler(new LoadHandler() {
public void onLoad(LoadEvent evt) {
dialogBox.center();
}
});
image.setStyleName("DialogBox-image");
holder.add(ok);
DialogBoxContents.add(image);
DialogBoxContents.add(holder);
dialogBox.setWidget(DialogBoxContents);
dialogBox.center();
dialogBox.show();
}
示例11: ProposedQueryReceivedUserInfoImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* ProposedSubscriptionUserInfoImage
*/
public ProposedQueryReceivedUserInfoImage() {
image = new Image(OKMBundleResources.INSTANCE.shareQuery());
image.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.DASHBOARD);
DashboardComunicator.showToolBoxExtension(MessagingToolBarBox.get().messagingToolBarBox);
MessagingToolBarBox.get().messageDashboard.messageStack.stackPanel.showWidget(MessageStack.STACK_QUERY_RECEIVED);
}
});
image.setTitle(GeneralComunicator.i18nExtension("messaging.user.info.new.proposed.query"));
image.setStyleName("okm-Hyperlink");
initWidget(image);
}
示例12: MessageReceivedUserInfoImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* MessageReceivedUserInfoImage
*/
public MessageReceivedUserInfoImage() {
image = new Image(OKMBundleResources.INSTANCE.messageReceived());
image.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.DASHBOARD);
DashboardComunicator.showToolBoxExtension(MessagingToolBarBox.get().messagingToolBarBox);
MessagingToolBarBox.get().messageDashboard.messageStack.stackPanel.showWidget(MessageStack.STACK_MESSAGES_RECEIVED);
}
});
image.setTitle(GeneralComunicator.i18nExtension("messaging.user.info.new.message.received"));
image.setStyleName("okm-Hyperlink");
initWidget(image);
}
示例13: ProposedSubscriptionReceivedUserInfoImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* ProposedSubscriptionUserInfoImage
*/
public ProposedSubscriptionReceivedUserInfoImage() {
image = new Image(OKMBundleResources.INSTANCE.proposeSubscription());
image.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.DASHBOARD);
DashboardComunicator.showToolBoxExtension(MessagingToolBarBox.get().messagingToolBarBox);
MessagingToolBarBox.get().messageDashboard.messageStack.stackPanel.showWidget(MessageStack.STACK_SUBSCRIPTION_RECEIVED);
}
});
image.setTitle(GeneralComunicator.i18nExtension("messaging.user.info.new.proposed.subscription"));
image.setStyleName("okm-Hyperlink");
initWidget(image);
}
开发者ID:openkm,项目名称:document-management-system,代码行数:18,代码来源:ProposedSubscriptionReceivedUserInfoImage.java
示例14: getRoomTypeImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public static String getRoomTypeImage(final int type, boolean isMain, final Image roomImage) {
String roomImageURL = "";
String roomTypeName = "";
if( isMain ) {
roomImageURL = ServerSideAccessManager.getMainRoomImageURL();
roomTypeName = I18NManager.getTitles().roomTypeNamePublic();
} else {
switch( type ){
default:
case PUBLIC_ROOM_TYPE :
roomImageURL = ServerSideAccessManager.getPublicRoomImageURL();
roomTypeName = I18NManager.getTitles().roomTypeNamePublic();
break;
case PROTECTED_ROOM_TYPE :
roomImageURL = ServerSideAccessManager.getProtectedRoomImageURL();
roomTypeName = I18NManager.getTitles().roomTypeNameProtected();
break;
case PRIVATE_ROOM_TYPE :
roomImageURL = ServerSideAccessManager.getPrivateRoomImageURL();
roomTypeName = I18NManager.getTitles().roomTypeNamePrivate();
break;
}
}
//Just in case, we check that the room image is provided
if( roomImage != null ) {
roomImage.setUrl( roomImageURL );
roomImage.setTitle( I18NManager.getTitles().accessOrTypeColumnTitle() + ": " + roomTypeName );
roomImage.setStyleName( CommonResourcesContainer.CHAT_ROOM_IMAGE_STYLE_NAME );
}
return roomTypeName;
}
示例15: constructThumbnailImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
/**
* Allows to create an image thumbnail for the given file descriptor
* @param fileDescriptors the list of file descriptors
* @param index the index of this file descriptor
* @return the image
*/
private Image constructThumbnailImage( final List<ShortFileDescriptor> fileDescriptors, final int index ){
final ShortFileDescriptor fileDescr = fileDescriptors.get( index );
Image image = new Image( ServerSideAccessManager.getProfileFileURL( userID, fileDescr, true ) );
image.setTitle( titlesI18N.userFileThumbnailManagementTip() );
image.addClickHandler( new ClickHandler(){
@Override
public void onClick(ClickEvent event) {
//First invert the list to have the desired order of files and the index
final List<ShortFileDescriptor> invertedFileSequence = new ArrayList<ShortFileDescriptor>();
final Iterator<ShortFileDescriptor> iter = fileDescriptors.iterator();
while( iter.hasNext() ) {
invertedFileSequence.add(0, iter.next());
}
final int inverted_index = ( fileDescriptors.size() - 1 ) - index;
//Ensure lazy loading
final SplitLoad executor = new SplitLoad( true ) {
@Override
public void execute() {
//Second open the dialog
ViewUserProfileFilesDialogUI dialog = new ViewUserProfileFilesDialogUI( parentDialog, invertedFileSequence,
inverted_index, userLoginName, userID);
dialog.show();
dialog.center();
}
};
executor.loadAndExecute();
}
});
image.setStyleName( CommonResourcesContainer.USER_DIALOG_USER_IMAGE_STYLE );
return image;
}