Code Search for Developers
 
 
  

ImageButton.java from MASE: Agile Software Engineering at Krugle


Show ImageButton.java syntax highlighted

package ucalgary.ebe.webui.client.ui;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;

public class ImageButton extends Button {
	
	public ImageButton(String imageUrl, String caption) {
		super();
		this.setHTML(createButtonCaptionHTML(imageUrl, caption));
		this.setStyleName("webui-ImageButton");
	}
	
	public ImageButton(String imageUrl, String caption, ClickListener listener) {
		super();
		this.setHTML(createButtonCaptionHTML(imageUrl, caption));
		this.addClickListener(listener);
		this.addStyleName("webui-ImageButton");
	}
	
	/**
	 * Creates the html for the button
	 * 
	 * @param imageUrl
	 * @param caption
	 * @return
	 */
	private String createButtonCaptionHTML(String imageUrl, String caption) {
//		return "<table align='center'><tr>"
//				+ "<td><img src='"
//				+ imageUrl
//				+ "'></td></tr>"
//				+ "<tr><td style='vertical-align:middle'><b style='white-space:nowrap'>"
//				+ caption + "</b></td>" 
//				+ "</tr></table>";
		return "<table>" +
					"<tr style='height:26px; vertical-align:middle; text-align:center;'>" +
						"<td style='align:center;'><img src='" + imageUrl + "'></td>" +
					"</tr>" +
					"<tr style='text-align=center; vertical-align:bottom;'>" +
						"<td style='white-space:nowrap;'>" + caption + "</td>" +
					"</tr>" +
				"</table>";
	}

}




See more files for this project here

MASE: Agile Software Engineering

The MASE project investigates methods to support the coordination and executable acceptance testing of software projects. Keywords: Agile methods, distributed teams, Extreme Programming. See http://ebe.cpsc.ucalgary.ca/ebe for more information.

Project homepage: http://sourceforge.net/projects/mase
Programming language(s): Java,XML
License: other

  CheckBoxWithID.java
  CreateIterationDialogBox.java
  CreateProjectDialogBox.java
  CreateStoryCardDialogBox.java
  ImageButton.java
  ImageWithID.java
  LoadProjectElement.java
  MoveStoryCardElement.java
  ProjectWhiteBoard.java
  StoryCardGrid.java
  StoryCardParentListBox.java
  TextBoxWithID.java
  WebUIMenu.java