當前位置: 首頁>>代碼示例>>Java>>正文


Java HTML.addClickListener方法代碼示例

本文整理匯總了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 &copy; 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);
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:20,代碼來源:FooterScreen.java

示例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());
	
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:27,代碼來源:ListAttributeScreen.java

示例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, "&nbsp;");
			} 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);
			}
		}
	}
}
 
開發者ID:kuzavas,項目名稱:ephesoft,代碼行數:40,代碼來源:CalendarWidget.java

示例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);
 }
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:13,代碼來源:HeaderScreen.java

示例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(""));
	}
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:33,代碼來源:CIDisplayNameWidget.java

示例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);
	}
	
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:33,代碼來源:NewURIFieldWidget.java

示例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);
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:10,代碼來源:ViewProblemScreen.java

示例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();
}
 
開發者ID:luox12,項目名稱:onecmdb,代碼行數:47,代碼來源:ListCIScreen.java


注:本文中的com.google.gwt.user.client.ui.HTML.addClickListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。