本文整理匯總了Java中com.google.gwt.user.client.ui.HTML.addClickListener方法的典型用法代碼示例。如果您正苦於以下問題:Java HTML.addClickListener方法的具體用法?Java HTML.addClickListener怎麽用?Java HTML.addClickListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.HTML
的用法示例。
在下文中一共展示了HTML.addClickListener方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: FooterScreen
import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public FooterScreen() {
HorizontalPanel panel = new HorizontalPanel();
HTML label = new HTML("OneCMDB 1.4.0 Beta © Lokomo Systems <<a href='javascript:;'>about</a>>");
label.setTitle("Show about screen");
label.setStyleName("onecmdb-footer-label");
panel.add(label);
panel.setCellHorizontalAlignment(label, HorizontalPanel.ALIGN_RIGHT);
panel.setStyleName("onecmdb-footer");
label.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
getBaseEntryScreen().showScreen(OneCMDBApplication.SHOW_STATIC_CONTENT,
"about.html",
new Long(0));
}
});
initWidget(panel);
}
示例2: load
import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public void load() {
if (this.currentTemplate == null) {
setErrorText("No Template to show!");
return;
}
setErrorText("");
setTitleText("Attributes for ");
setTitleWidget(new CIIconDisplayNameWidget(this.currentTemplate));
vPanel.clear();
HTML add = new HTML("[<a href='javascript:;'>new</a>]");
add.setTitle("Add a new attribute to this template");
add.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
OneCMDBModelCreator.get().showScreen(OneCMDBModelCreator.ADD_ATTRIBUTE_SCREEN, currentTemplate.getAlias(), new Long(0));
}
});
HorizontalPanel hPanel = new HorizontalPanel();
hPanel.add(add);
hPanel.setCellHorizontalAlignment(add, HorizontalPanel.ALIGN_RIGHT);
hPanel.setWidth("100%");
vPanel.add(hPanel);
vPanel.add(getAttributeTable());
}
示例3: drawCalendar
import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
private void drawCalendar() {
int year = getYear();
int month = getMonth();
// int day = getDay();
setHeaderText(year, month);
grid.getRowFormatter().setStyleName(0, "weekheader");
for (int i = 0; i < days.length; i++) {
grid.getCellFormatter().setStyleName(0, i, "days");
grid.setText(0, i, days[i].substring(0, 3));
}
Date now = new Date();
int sameDay = now.getDate();
int today = (now.getMonth() == month && now.getYear() + 1900 == year) ? sameDay : 0;
int firstDay = new Date(year - 1900, month, 1).getDay();
int numOfDays = getDaysInMonth(year, month);
int colCount = 0;
for (int rowCount = 1; rowCount < 6; rowCount++) {
for (int colIterator = 0; colIterator < 7; colIterator++, colCount++) {
int displayNum = (colCount - firstDay + 1);
if (colCount < firstDay || displayNum > numOfDays) {
grid.getCellFormatter().setStyleName(rowCount, colIterator, "empty");
grid.setHTML(rowCount, colIterator, " ");
} else {
HTML html = new CellHTML("<span>" + displayNum + "</span>", displayNum);
html.addClickListener(this);
grid.getCellFormatter().setStyleName(rowCount, colIterator, "cell");
if (displayNum == today) {
grid.getCellFormatter().addStyleName(rowCount, colIterator, "today");
} else if (displayNum == sameDay) {
grid.getCellFormatter().addStyleName(rowCount, colIterator, "day");
}
grid.setWidget(rowCount, colIterator, html);
}
}
}
}
示例4: getCheckUpdateWidget
import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public Widget getCheckUpdateWidget() {
HTML html = new HTML("<a href='javascript:;'>[Check for updates]</a>");
html.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
Window.open("http://sourceforge.net/project/showfiles.php?group_id=176340",
"_blank", "");
}
});
return(html);
}
示例5: load
import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public void load(GWT_CiBean bean) {
vPanel.clear();
if (bean != null) {
String displayName = bean.getDisplayName();
if ((displayName == null || displayName.length() == 0)) {
displayName = "[" + bean.getAlias() + "]";
}
Widget l = null;
if (this.listener != null) {
HTML h = new HTML("<a href='javascript:;'>" + displayName +"</a>", false);
// Replace sender....
h.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
listener.onClick(CIDisplayNameWidget.this);
}
});
l = h;
} else {
l = new Label(displayName, false);
}
vPanel.add(l);
// Add title.
new TooltipPopup(l, getTitle(bean));
vPanel.setCellHorizontalAlignment(l, HorizontalPanel.ALIGN_LEFT);
} else {
// Add null value...
vPanel.add(new Label(""));
}
}
示例6: NewURIFieldWidget
import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
public NewURIFieldWidget(AttributeValue v) {
super(v.getLabel());
this.value = v;
if (value.getCtrl().isReadonly()) {
HTML html = new HTML();
if (!this.value.isNullValue()) {
html.setHTML("<a href='javascript:;'>" + this.value.getStringValue() +"</a>");
}
html.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
Window.open(value.getStringValue(), "_blank", "");
}
});
html.setWordWrap(true);
html.setTitle(this.value.getStringValue());
addField(html);
html.setStyleName("mdv-form-input-readonly");
setRequired(false);
} else {
box = new TextBox();
box.setText(value.getStringValue());
box.addKeyboardListener(this);
setRequired(value.getCtrl().isRequiered());
addField(box);
}
}
示例7: getButtonPanel
import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
protected Widget getButtonPanel() {
HTML back = new HTML("<a href='javascript:;'>[back]</a>");
back.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
History.back();
}
});
return(back);
}
示例8: setupTable
import com.google.gwt.user.client.ui.HTML; //導入方法依賴的package包/類
protected void setupTable() {
if (this.template == null) {
return;
}
setTitleText("Instances of ");
setTitleWidget(new CIIconDisplayNameWidget(this.template));
vPanel.clear();
table = null;
if (isNewSupport()) {
HorizontalPanel actionPanel = new HorizontalPanel();
HTML add = new HTML("[<a href='javascript:;'>new</a>]");
add.setTitle("Create a new instance");
actionPanel.add(add);
add.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
getBaseEntryScreen().showScreen(OneCMDBApplication.NEW_CI_SCREEN, template.getAlias(), new Long(0));
}
});
actionPanel.add(add);
actionPanel.setCellHorizontalAlignment(add, HorizontalPanel.ALIGN_RIGHT);
actionPanel.setWidth("100%");
vPanel.add(actionPanel);
}
VerticalPanel tablePanel = new VerticalPanel();
tablePanel.setStyleName("onecmdb-table-panel");
if (table == null) {
table = new CITablePanel();
table.addTableListener(ListCIScreen.this);
table.addLoadListener(ListCIScreen.this);
CITablePageControlPanel tablePageControl = new CITablePageControlPanel(table);
tablePanel.add(tablePageControl);
tablePanel.add(table);
tablePanel.setCellVerticalAlignment(tablePageControl, VerticalPanel.ALIGN_TOP);
tablePanel.setCellVerticalAlignment(table, VerticalPanel.ALIGN_TOP);
}
vPanel.add(tablePanel);
table.setAttributeRender(getAttributeRender());
table.setTabelControl(getTableControl(this.template));
table.load();
}