本文整理汇总了Java中com.google.gwt.user.client.ui.Anchor.setHTML方法的典型用法代码示例。如果您正苦于以下问题:Java Anchor.setHTML方法的具体用法?Java Anchor.setHTML怎么用?Java Anchor.setHTML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.Anchor
的用法示例。
在下文中一共展示了Anchor.setHTML方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: InstructorCell
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public InstructorCell(ArrayList<String> names, ArrayList<String> emails, String separator) {
super(null, separator);
if (names != null && !names.isEmpty()) {
separator = separator.replace(" ", " ");
for (int i = 0; i < names.size(); i++) {
String text = names.get(i) + (i + 1 < names.size() ? separator : "");
String email = (emails != null && i < emails.size() ? emails.get(i) : null);
if (email != null && !email.isEmpty()) {
iText += text;
HorizontalPanel p = new HorizontalPanel();
p.setStyleName("instructor");
Anchor a = new Anchor();
a.setHref("mailto:" + email);
a.setHTML(new Image(RESOURCES.email()).getElement().getString());
a.setTitle(MESSAGES.sendEmail(names.get(i)));
a.setStyleName("unitime-SimpleLink");
a.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
event.stopPropagation();
}
});
p.add(a);
p.setCellVerticalAlignment(a, HasVerticalAlignment.ALIGN_MIDDLE);
HTML h = new HTML(text, false);
h.getElement().getStyle().setMarginLeft(2, Unit.PX);
p.add(h);
iPanel.add(p);
iContent.add(h);
} else
add(text);
}
} else {
add(" ");
}
}
示例2: refreshProposedQueryRow
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* Refresh proposed query row
*
* @param propose
*/
private void refreshProposedQueryRow(final GWTProposedQueryReceived propose, int row) {
boolean seen = (propose.getSeenDate() == null);
// Sets folder object
data.put(new Integer(dataTable.getHTML(row, 5)), propose);
if (propose.isAccepted()) {
dataTable.setWidget(row, 0, new Image(OKMBundleResources.INSTANCE.yes()));
} else {
dataTable.setHTML(row, 0, "");
}
dataTable.setHTML(row, 1, UtilComunicator.getTextAsBoldHTML(propose.getFrom(), seen));
String queryType = "";
if (!propose.getParams().isDashboard()) {
queryType = GeneralComunicator.i18nExtension("messaging.message.type.propose.query");
} else {
queryType = GeneralComunicator.i18nExtension("messaging.message.type.propose.user.query");
}
dataTable.setHTML(row, 2, UtilComunicator.getTextAsBoldHTML(queryType, seen));
DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18nExtension("general.date.pattern"));
dataTable.setHTML(row, 3, UtilComunicator.getTextAsBoldHTML(dtf.format(propose.getSentDate()), seen));
Anchor anchor = new Anchor();
String queryName = propose.getParams().getQueryName();
anchor.setHTML(UtilComunicator.getTextAsBoldHTML(queryName, seen));
anchor.setTitle(queryName);
anchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.SEARCH);
SearchComunicator.setSavedSearch(propose.getParams());
}
});
anchor.setStyleName("okm-KeyMap-ImageHover");
dataTable.setWidget(row, 4, anchor);
}
示例3: populate
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
void populate(int row, GroupInfo k, String toHighlight) {
if (k.url() != null) {
if (isInteralGroup(k)) {
table.setWidget(
row,
1,
new HighlightingInlineHyperlink(
k.name(), Dispatcher.toGroup(k.getGroupId()), toHighlight));
} else {
Anchor link = new Anchor();
link.setHTML(Util.highlight(k.name(), toHighlight));
link.setHref(k.url());
table.setWidget(row, 1, link);
}
} else {
table.setHTML(row, 1, Util.highlight(k.name(), toHighlight));
}
table.setText(row, 2, k.description());
if (k.options().isVisibleToAll()) {
table.setWidget(row, 3, new Image(Gerrit.RESOURCES.greenCheck()));
}
final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().groupName());
for (int i = 1; i <= NUM_COLS; i++) {
fmt.addStyleName(row, i, Gerrit.RESOURCES.css().dataCell());
}
setRowItem(row, k);
}
示例4: initFeedbackPanel
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void initFeedbackPanel() {
playgroundUI.feedbackPanel.setHorizontalAlignment(
HasHorizontalAlignment.ALIGN_RIGHT);
for (Menu menu : Menu.values()) {
Anchor menuItem = new Anchor();
menuItem.setHTML(menu.description);
menuItem.setHref(menu.url);
menuItem.setWordWrap(false);
menuItem.addStyleName("menuItems");
playgroundUI.feedbackPanel.add(menuItem);
playgroundUI.feedbackPanel.setCellWidth(menuItem, "100%");
}
}
示例5: createInfoPanel
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* Creates the action buttons.
* @param situationSummaryBean
*/
private Widget createInfoPanel(SituationSummaryBean situationSummaryBean) {
FlowPanel infoPanel = new FlowPanel();
infoPanel.getElement().setClassName(""); //$NON-NLS-1$
if (!situationSummaryBean.getProperties().isEmpty()) {
final Anchor properties = new Anchor();
properties.setHref("#"); //$NON-NLS-1$
properties.getElement().setAttribute("data-toggle", "popover"); //$NON-NLS-1$ //$NON-NLS-2$
properties.getElement().setAttribute("data-placement", "left"); //$NON-NLS-1$ //$NON-NLS-2$
properties.getElement().setAttribute("data-html", "true"); //$NON-NLS-1$ //$NON-NLS-2$
properties.getElement().setAttribute("data-original-title", i18n.format("situation-table.properties")); //$NON-NLS-1$ //$NON-NLS-2$
properties.getElement().setAttribute("data-trigger", "hover"); //$NON-NLS-1$ //$NON-NLS-2$
properties.getElement().setAttribute("data-content", createPropertiesTableHtml(situationSummaryBean.getProperties())); //$NON-NLS-1$
properties.setHTML("<div class=\"icon icon-properties\"></div>"); //$NON-NLS-1$
properties.addAttachHandler(new Handler() {
@Override
public void onAttachOrDetach(AttachEvent event) {
if (event.isAttached()) {
Element element2 = properties.getElement();
activatePopover(element2);
}
}
});
infoPanel.add(properties);
}
// infoPanel.add(downloadInitialActionButton);
// infoPanel.add(retryActionButton);
return infoPanel;
}
示例6: addDocument
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* addDocument
*/
public static void addDocument(FlexTable table, final GWTStaple staple, final String uuid, boolean enableDelete) {
int row = table.getRowCount();
final GWTDocument doc = staple.getDoc();
if (doc.isCheckedOut()) {
table.setHTML(row, 0, Util.imageItemHTML("img/icon/edit.png"));
} else if (doc.isLocked()) {
table.setHTML(row, 0, Util.imageItemHTML("img/icon/lock.gif"));
} else {
table.setHTML(row, 0, " ");
}
// Subscribed is a special case, must add icon with others
if (doc.isSubscribed()) {
table.setHTML(row, 0, table.getHTML(row, 0) + Util.imageItemHTML("img/icon/subscribed.gif"));
}
if (doc.isHasNotes()) {
table.setHTML(row, 0, table.getHTML(row, 0) + Util.imageItemHTML("img/icon/note.gif"));
}
table.setHTML(row, 1, Util.mimeImageHTML(doc.getMimeType()));
Anchor anchor = new Anchor();
anchor.setHTML(doc.getName());
anchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
String docPath = doc.getPath();
String path = docPath.substring(0, docPath.lastIndexOf("/"));
GeneralComunicator.openPath(path, doc.getPath());
}
});
anchor.setStyleName("okm-KeyMap-ImageHover");
table.setWidget(row, 2, anchor);
table.setHTML(row, 3, Util.formatSize(doc.getActualVersion().getSize()));
if (enableDelete) {
Image delete = new Image(OKMBundleResources.INSTANCE.deleteIcon());
delete.setStyleName("okm-KeyMap-ImageHover");
delete.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
staplingService.removeStaple(String.valueOf(staple.getId()), new AsyncCallback<Object>() {
@Override
public void onSuccess(Object result) {
if (staple.getType().equals(GWTStaple.STAPLE_FOLDER)) {
Stapling.get().refreshFolder(uuid);
} else if (staple.getType().equals(GWTStaple.STAPLE_DOCUMENT)) {
Stapling.get().refreshDocument(uuid);
} else if (staple.getType().equals(GWTStaple.STAPLE_MAIL)) {
Stapling.get().refreshMail(uuid);
}
}
@Override
public void onFailure(Throwable caught) {
GeneralComunicator.showError("remove", caught);
}
});
}
});
table.setWidget(row, 4, delete);
} else {
table.setHTML(row, 4, "");
}
table.getCellFormatter().setWidth(row, 0, "60px");
table.getCellFormatter().setWidth(row, 1, "25px");
table.getCellFormatter().setWidth(row, 4, "25px");
table.getCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT);
table.getCellFormatter().setHorizontalAlignment(row, 1, HasHorizontalAlignment.ALIGN_CENTER);
table.getCellFormatter().setHorizontalAlignment(row, 2, HasHorizontalAlignment.ALIGN_LEFT);
table.getCellFormatter().setHorizontalAlignment(row, 3, HasHorizontalAlignment.ALIGN_CENTER);
table.getCellFormatter().setHorizontalAlignment(row, 4, HasHorizontalAlignment.ALIGN_CENTER);
}
示例7: addMail
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* addMail
*/
public static void addMail(FlexTable table, final GWTStaple staple, final String uuid, boolean enableDelete) {
int row = table.getRowCount();
final GWTMail mail = staple.getMail();
// Mail is never checkout or subscribed ( because can not be changed )
table.setHTML(row, 0, " ");
if (mail.getAttachments().size() > 0) {
table.setHTML(row, 1, Util.imageItemHTML("img/email_attach.gif"));
} else {
table.setHTML(row, 1, Util.imageItemHTML("img/email.gif"));
}
Anchor anchor = new Anchor();
anchor.setHTML(mail.getSubject());
anchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
String docPath = mail.getPath();
String path = docPath.substring(0, docPath.lastIndexOf("/"));
GeneralComunicator.openPath(path, docPath);
}
});
anchor.setStyleName("okm-KeyMap-ImageHover");
table.setWidget(row, 2, anchor);
table.setHTML(row, 3, Util.formatSize(mail.getSize()));
if (enableDelete) {
Image delete = new Image(OKMBundleResources.INSTANCE.deleteIcon());
delete.setStyleName("okm-KeyMap-ImageHover");
delete.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
staplingService.removeStaple(String.valueOf(staple.getId()), new AsyncCallback<Object>() {
@Override
public void onSuccess(Object result) {
if (staple.getType().equals(GWTStaple.STAPLE_FOLDER)) {
Stapling.get().refreshFolder(uuid);
} else if (staple.getType().equals(GWTStaple.STAPLE_DOCUMENT)) {
Stapling.get().refreshDocument(uuid);
} else if (staple.getType().equals(GWTStaple.STAPLE_MAIL)) {
Stapling.get().refreshMail(uuid);
}
}
@Override
public void onFailure(Throwable caught) {
GeneralComunicator.showError("remove", caught);
}
});
}
});
table.setWidget(row, 4, delete);
} else {
table.setHTML(row, 4, "");
}
table.getCellFormatter().setWidth(row, 0, "60px");
table.getCellFormatter().setWidth(row, 1, "25px");
table.getCellFormatter().setWidth(row, 4, "25px");
table.getCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT);
table.getCellFormatter().setHorizontalAlignment(row, 1, HasHorizontalAlignment.ALIGN_CENTER);
table.getCellFormatter().setHorizontalAlignment(row, 2, HasHorizontalAlignment.ALIGN_LEFT);
table.getCellFormatter().setHorizontalAlignment(row, 3, HasHorizontalAlignment.ALIGN_CENTER);
table.getCellFormatter().setHorizontalAlignment(row, 4, HasHorizontalAlignment.ALIGN_CENTER);
}
示例8: addProposedSubscriptionReceivedRow
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* Adding proposed subscription received row
*
* @param propose
*/
private void addProposedSubscriptionReceivedRow(final GWTProposedSubscriptionReceived propose) {
int rows = dataTable.getRowCount();
boolean seen = (propose.getSeenDate() == null);
dataTable.insertRow(rows);
// Sets folder object
data.put(new Integer(dataIndexValue), propose);
if (propose.isAccepted()) {
dataTable.setWidget(rows, 0, new Image(OKMBundleResources.INSTANCE.yes()));
} else {
dataTable.setHTML(rows, 0, "");
}
dataTable.setHTML(rows, 1, UtilComunicator.getTextAsBoldHTML(propose.getFrom(), seen));
String docType = "";
if (propose.getType().equals(GWTFolder.TYPE)) {
docType = GeneralComunicator.i18nExtension("messaging.message.type.propose.folder");
} else {
docType = GeneralComunicator.i18nExtension("messaging.message.type.propose.document");
}
dataTable.setHTML(rows, 2, UtilComunicator.getTextAsBoldHTML(docType, seen));
DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18nExtension("general.date.pattern"));
dataTable.setHTML(rows, 3, UtilComunicator.getTextAsBoldHTML(dtf.format(propose.getSentDate()), seen));
Anchor anchor = new Anchor();
String path = propose.getPath().substring(propose.getPath().lastIndexOf("/") + 1);
anchor.setHTML(UtilComunicator.getTextAsBoldHTML(path, seen));
anchor.setTitle(propose.getPath());
anchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
if (propose.getType().equals(GWTFolder.TYPE)) {
GeneralComunicator.openPath(propose.getPath(), null);
} else if (propose.getType().equals(GWTDocument.TYPE)) {
String fldPath = propose.getPath().substring(0, propose.getPath().lastIndexOf("/"));
GeneralComunicator.openPath(fldPath, propose.getPath());
}
}
});
anchor.setStyleName("okm-KeyMap-ImageHover");
dataTable.setWidget(rows, 4, anchor);
dataTable.setHTML(rows, 5, "" + (dataIndexValue++));
// Format
dataTable.getCellFormatter().setHorizontalAlignment(rows, 0, HasHorizontalAlignment.ALIGN_CENTER);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 1, HasHorizontalAlignment.ALIGN_LEFT);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 2, HasHorizontalAlignment.ALIGN_LEFT);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 3, HasHorizontalAlignment.ALIGN_CENTER);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 4, HasHorizontalAlignment.ALIGN_LEFT);
dataTable.getCellFormatter().setVisible(rows, 5, false);
for (int i = 0; i < 5; i++) {
dataTable.getCellFormatter().addStyleName(rows, i, "okm-DisableSelect");
}
}
示例9: addProposedSubscriptionSentRow
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* Adding proposed subscription sent row
*
* @param propose
*/
private void addProposedSubscriptionSentRow(final GWTProposedSubscriptionSent propose) {
int rows = dataTable.getRowCount();
dataTable.insertRow(rows);
// Sets folder object
data.put(new Integer(dataIndexValue), propose);
dataTable.setHTML(rows, 0, "");
dataTable.setHTML(rows, 1, propose.getFrom());
String docType = "";
if (propose.getType().equals(GWTFolder.TYPE)) {
docType = GeneralComunicator.i18nExtension("messaging.message.type.propose.folder");
} else {
docType = GeneralComunicator.i18nExtension("messaging.message.type.propose.document");
}
dataTable.setHTML(rows, 2, docType);
DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18nExtension("general.date.pattern"));
dataTable.setHTML(rows, 3, dtf.format(propose.getSentDate()));
Anchor anchor = new Anchor();
String path = propose.getPath().substring(propose.getPath().lastIndexOf("/") + 1);
anchor.setHTML(path);
anchor.setTitle(propose.getPath());
anchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
if (propose.getType().equals(GWTFolder.TYPE)) {
GeneralComunicator.openPath(propose.getPath(), null);
} else if (propose.getType().equals(GWTDocument.TYPE)) {
String fldPath = propose.getPath().substring(0, propose.getPath().lastIndexOf("/"));
GeneralComunicator.openPath(fldPath, propose.getPath());
}
}
});
anchor.setStyleName("okm-KeyMap-ImageHover");
dataTable.setWidget(rows, 4, anchor);
dataTable.setHTML(rows, 5, "" + (dataIndexValue++));
// Format
dataTable.getCellFormatter().setHorizontalAlignment(rows, 0, HasHorizontalAlignment.ALIGN_CENTER);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 1, HasHorizontalAlignment.ALIGN_LEFT);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 2, HasHorizontalAlignment.ALIGN_LEFT);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 3, HasHorizontalAlignment.ALIGN_CENTER);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 4, HasHorizontalAlignment.ALIGN_LEFT);
dataTable.getCellFormatter().setVisible(rows, 5, false);
for (int i = 0; i < 5; i++) {
dataTable.getCellFormatter().addStyleName(rows, i, "okm-DisableSelect");
}
}
示例10: refreshProposedSubscriptionRow
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* Refresh proposed subscription row
*
* @param propose
*/
private void refreshProposedSubscriptionRow(final GWTProposedSubscriptionReceived propose, int row) {
boolean seen = (propose.getSeenDate() == null);
// Sets folder object
data.put(new Integer(dataTable.getHTML(row, 5)), propose);
if (propose.isAccepted()) {
dataTable.setWidget(row, 0, new Image(OKMBundleResources.INSTANCE.yes()));
} else {
dataTable.setHTML(row, 0, "");
}
dataTable.setHTML(row, 1, UtilComunicator.getTextAsBoldHTML(propose.getFrom(), seen));
String docType = "";
if (propose.getType().equals(GWTFolder.TYPE)) {
docType = GeneralComunicator.i18nExtension("messaging.message.type.propose.folder");
} else {
docType = GeneralComunicator.i18nExtension("messaging.message.type.propose.document");
}
dataTable.setHTML(row, 2, UtilComunicator.getTextAsBoldHTML(docType, seen));
DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18nExtension("general.date.pattern"));
dataTable.setHTML(row, 3, UtilComunicator.getTextAsBoldHTML(dtf.format(propose.getSentDate()), seen));
Anchor anchor = new Anchor();
String path = propose.getPath().substring(propose.getPath().lastIndexOf("/") + 1);
anchor.setHTML(UtilComunicator.getTextAsBoldHTML(path, seen));
anchor.setTitle(propose.getPath());
anchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
if (propose.getType().equals(GWTFolder.TYPE)) {
GeneralComunicator.openPath(propose.getPath(), null);
} else if (propose.getType().equals(GWTDocument.TYPE)) {
String fldPath = propose.getPath().substring(0, propose.getPath().lastIndexOf("/"));
GeneralComunicator.openPath(fldPath, propose.getPath());
}
}
});
anchor.setStyleName("okm-KeyMap-ImageHover");
dataTable.setWidget(row, 4, anchor);
}
示例11: addProposedQueryReceivedRow
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* Adding proposed query row
*
* @param propose
*/
private void addProposedQueryReceivedRow(final GWTProposedQueryReceived propose) {
int rows = dataTable.getRowCount();
boolean seen = (propose.getSeenDate() == null);
dataTable.insertRow(rows);
// Sets folder object
data.put(new Integer(dataIndexValue), propose);
if (propose.isAccepted()) {
dataTable.setWidget(rows, 0, new Image(OKMBundleResources.INSTANCE.yes()));
} else {
dataTable.setHTML(rows, 0, "");
}
dataTable.setHTML(rows, 1, UtilComunicator.getTextAsBoldHTML(propose.getFrom(), seen));
String queryType = "";
if (!propose.getParams().isDashboard()) {
queryType = GeneralComunicator.i18nExtension("messaging.message.type.propose.query");
} else {
queryType = GeneralComunicator.i18nExtension("messaging.message.type.propose.user.query");
}
dataTable.setHTML(rows, 2, UtilComunicator.getTextAsBoldHTML(queryType, seen));
DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18nExtension("general.date.pattern"));
dataTable.setHTML(rows, 3, UtilComunicator.getTextAsBoldHTML(dtf.format(propose.getSentDate()), seen));
Anchor anchor = new Anchor();
String queryName = propose.getParams().getQueryName();
anchor.setHTML(UtilComunicator.getTextAsBoldHTML(queryName, seen));
anchor.setTitle(queryName);
anchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.SEARCH);
SearchComunicator.setSavedSearch(propose.getParams());
}
});
anchor.setStyleName("okm-KeyMap-ImageHover");
dataTable.setWidget(rows, 4, anchor);
dataTable.setHTML(rows, 5, "" + (dataIndexValue++));
// Format
dataTable.getCellFormatter().setHorizontalAlignment(rows, 0, HasHorizontalAlignment.ALIGN_CENTER);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 1, HasHorizontalAlignment.ALIGN_LEFT);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 2, HasHorizontalAlignment.ALIGN_LEFT);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 3, HasHorizontalAlignment.ALIGN_CENTER);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 4, HasHorizontalAlignment.ALIGN_LEFT);
dataTable.getCellFormatter().setVisible(rows, 5, false);
for (int i = 0; i < 5; i++) {
dataTable.getCellFormatter().addStyleName(rows, i, "okm-DisableSelect");
}
}
示例12: addProposedQuerySentRow
import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
* Adding proposed query sent row
*
* @param propose
*/
private void addProposedQuerySentRow(final GWTProposedQuerySent propose) {
int rows = dataTable.getRowCount();
dataTable.insertRow(rows);
// Sets folder object
data.put(new Integer(dataIndexValue), propose);
dataTable.setHTML(rows, 0, "");
dataTable.setHTML(rows, 1, propose.getFrom());
String queryType = "";
if (!propose.getParams().isDashboard()) {
queryType = GeneralComunicator.i18nExtension("messaging.message.type.propose.query");
} else {
queryType = GeneralComunicator.i18nExtension("messaging.message.type.propose.user.query");
}
dataTable.setHTML(rows, 2, queryType);
DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18nExtension("general.date.pattern"));
dataTable.setHTML(rows, 3, dtf.format(propose.getSentDate()));
Anchor anchor = new Anchor();
String queryName = propose.getParams().getQueryName();
anchor.setHTML(queryName);
anchor.setTitle(queryName);
anchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent arg0) {
WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.SEARCH);
SearchComunicator.setSavedSearch(propose.getParams());
}
});
anchor.setStyleName("okm-KeyMap-ImageHover");
dataTable.setWidget(rows, 4, anchor);
dataTable.setHTML(rows, 5, "" + (dataIndexValue++));
// Format
dataTable.getCellFormatter().setHorizontalAlignment(rows, 0, HasHorizontalAlignment.ALIGN_CENTER);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 1, HasHorizontalAlignment.ALIGN_LEFT);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 2, HasHorizontalAlignment.ALIGN_LEFT);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 3, HasHorizontalAlignment.ALIGN_CENTER);
dataTable.getCellFormatter().setHorizontalAlignment(rows, 4, HasHorizontalAlignment.ALIGN_LEFT);
dataTable.getCellFormatter().setVisible(rows, 5, false);
for (int i = 0; i < 5; i++) {
dataTable.getCellFormatter().addStyleName(rows, i, "okm-DisableSelect");
}
}