本文整理汇总了Java中com.google.gwt.user.client.ui.Image.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java Image.setTitle方法的具体用法?Java Image.setTitle怎么用?Java Image.setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Image
的用法示例。
在下文中一共展示了Image.setTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: IconCell
import com.google.gwt.user.client.ui.Image; //导入方法依赖的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);
}
});
}
示例2: add
import com.google.gwt.user.client.ui.Image; //导入方法依赖的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;
}
示例3: NoteCell
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public NoteCell(String text, final String title) {
super(null);
if (Window.getClientWidth() <= 800 && title != null && !title.isEmpty()) {
iIcon = new Image(RESOURCES.note());
iIcon.setTitle(title);
iIcon.setAltText(title);
iIcon.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
event.stopPropagation();
UniTimeConfirmationDialog.info(title);
}
});
} else {
iNote = new P("unitime-Note");
iNote.setHTML(text);
if (title != null) iNote.setTitle(title);
}
}
示例4: setImage
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public void setImage(String image_url, String link_url) {
final String url = link_url;
Image image = new Image(image_url);
image.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
Window.open(url, "_blank", "scrollbars=1");
}
});
image.setTitle(" Click to Enlarge. Images will size with browser.");
grid.setWidget(plotRow, 0, image);
}
示例5: 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;
}
示例6: makeLinkIcon
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public Widget makeLinkIcon(String iconUrl, String text, String tip, ClickHandler handler) {
HorizontalPanel hp = new HorizontalPanel();
Image image = new Image(iconUrl);
image.setHeight("16px");
makeIntoLinkButton(image);
hp.add(image);
if (!StringUtils.isEmpty(text)) {
Label label = new Label(text);
if (tip != null) {
label.setTitle(tip);
}
label.addClickHandler(handler);
makeIntoLinkButton(label);
hp.add(GwtUtil.getFiller(3, 1));
hp.add(label);
}
if (tip != null) {
image.setTitle(tip);
}
image.addClickHandler(handler);
return hp;
}
示例7: setPlatforms
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
@Override
public void setPlatforms(List<Platform> platforms) {
for (int i=0;i<platforms.size();i++) {
Platform platform = platforms.get(i);
Image image = new Image(Utils.getPlatformIcon(platform));
image.setTitle(Utils.getPlatformText(platform));
image.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
Label label = new Label(Utils.getPlatformText(platform));
platformsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
platformsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
platformsPanel.add(image);
platformsPanel.setCellWidth(image, "32px");
platformsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
platformsPanel.add(label);
if (i < platforms.size()-1) {
label.getElement().getStyle().setPaddingRight(10, Unit.PX);
}
label.getElement().getStyle().setPaddingLeft(8, Unit.PX);
}
}
示例8: setFeatures
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
@Override
public void setFeatures(List<Feature> features) {
for (int i=0;i<features.size();i++) {
Feature feature = features.get(i);
Image image = new Image(Utils.getFeatureIcon(feature));
image.setTitle(Utils.getFeatureText(feature));
image.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
Label label = new Label(Utils.getFeatureText(feature));
featuresPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
featuresPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
featuresPanel.add(image);
featuresPanel.setCellWidth(image, "32px");
featuresPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
featuresPanel.add(label);
if (i < features.size()-1) {
label.getElement().getStyle().setPaddingRight(10, Unit.PX);
}
label.getElement().getStyle().setPaddingLeft(8, Unit.PX);
}
}
示例9: populateState
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
protected void populateState(int row, ProjectInfo k) {
Image state = new Image();
switch (k.state()) {
case HIDDEN:
state.setResource(Gerrit.RESOURCES.redNot());
state.setTitle(com.google.gerrit.client.admin.Util.toLongString(k.state()));
table.setWidget(row, ProjectsTable.C_STATE, state);
break;
case READ_ONLY:
state.setResource(Gerrit.RESOURCES.readOnly());
state.setTitle(com.google.gerrit.client.admin.Util.toLongString(k.state()));
table.setWidget(row, ProjectsTable.C_STATE, state);
break;
case ACTIVE:
default:
// Intentionally left blank, do not show an icon when active.
break;
}
}
示例10: setPlatforms
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
@Override
public void setPlatforms(List<Platform> platforms) {
for (int i=0;i<platforms.size();i++) {
Platform platform = platforms.get(i);
Image image = new Image(Utils.getPlatformIcon(platform));
image.setTitle(Utils.getPlatformText(platform));
image.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
Label label = new Label(Utils.getPlatformText(platform));
platformsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
platformsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
platformsPanel.add(image);
platformsPanel.setCellWidth(image, "32px");
platformsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
platformsPanel.add(label);
if (i < platforms.size()-1) {
label.getElement().getStyle().setPaddingRight(10, Unit.PX);
}
label.getElement().getStyle().setPaddingLeft(8, Unit.PX);
}
}
示例11: renderCheckBox
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
private CheckBox renderCheckBox(LabeledWidgetsGrid g, ConfigParameterInfo param) {
CheckBox checkBox = new CheckBox(getDisplayName(param));
checkBox.setValue(Boolean.parseBoolean(param.value()));
HorizontalPanel p = new HorizontalPanel();
p.add(checkBox);
if (param.description() != null) {
Image infoImg = new Image(Gerrit.RESOURCES.info());
infoImg.setTitle(param.description());
p.add(infoImg);
}
if (param.warning() != null) {
Image warningImg = new Image(Gerrit.RESOURCES.warning());
warningImg.setTitle(param.warning());
p.add(warningImg);
}
g.add((String) null, p);
saveEnabler.listenTo(checkBox);
return checkBox;
}
示例12: getCell
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
protected Widget getCell(final InstructorInterface instructor, final InstructorsColumn column, final int idx) {
switch (column) {
case ID:
if (instructor.getExternalId() == null) {
Image warning = new Image(RESOURCES.warning());
warning.setTitle(MESSAGES.warnInstructorHasNoExternalId(instructor.getFormattedName()));
return warning;
} else {
return new Label(instructor.getExternalId());
}
case NAME:
return new Label(instructor.getFormattedName());
case POSITION:
return new Label(instructor.getPosition() == null ? "" : instructor.getPosition().getLabel());
case TEACHING_PREF:
if (instructor.getTeachingPreference() == null) {
return new Label("");
} else {
Label pref = new Label(instructor.getTeachingPreference().getName());
if (instructor.getTeachingPreference().getColor() != null)
pref.getElement().getStyle().setColor(instructor.getTeachingPreference().getColor());
return pref;
}
case MAX_LOAD:
return new Label(instructor.hasMaxLoad() ? NumberFormat.getFormat(CONSTANTS.teachingLoadFormat()).format(instructor.getMaxLoad()) : "");
case SELECTION:
return new SelectableCell(instructor);
case ATTRIBUTES:
AttributeTypeInterface type = iProperties.getAttributeTypes().get(idx);
List<AttributeInterface> attributes = instructor.getAttributes(type);
if (!attributes.isEmpty() && !isColumnVisible(getCellIndex(column) + idx)) {
setColumnVisible(getCellIndex(column) + idx, true);
}
return new AttributesCell(attributes);
default:
return null;
}
}
示例13: open
import com.google.gwt.user.client.ui.Image; //导入方法依赖的package包/类
public void open(List<DegreePlanInterface> plans) {
iTable.clearTable(1);
int select = -1;
for (DegreePlanInterface plan: plans) {
List<Widget> row = new ArrayList<Widget>();
P p = new P("icons");
if (plan.isLocked()) {
Image lock = new Image(RESOURCES.locked());
lock.setTitle(MESSAGES.hintLockedPlan());
p.add(lock);
} else if (plan.isActive()) {
Image active = new Image(RESOURCES.activePlan());
active.setTitle(MESSAGES.hintActivePlan());
p.add(active);
}
row.add(p);
row.add(new Label(plan.getName() == null ? "" : plan.getName()));
row.add(new Label(plan.getDegree() == null ? "" : plan.getDegree()));
row.add(new Label(plan.getLastModified() == null ? "" : sModifiedDateFormat.format(plan.getLastModified())));
row.add(new Label(plan.getModifiedWho() == null ? "" : plan.getModifiedWho()));
if (plan.getId().equals(iLastSubmit))
select = iTable.getRowCount();
else if (select < 0 && plan.isActive())
select = iTable.getRowCount();
iTable.addRow(plan, row);
}
iTable.setSelected(select < 0 ? 1 : select, true);
center();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
iFooter.setFocus("select", true);
}
});
updateAriaStatus(true);
}
示例14: 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);
}
示例15: 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);
}