Code Search for Developers
 
 
  

InfoForm.java from GridBlocks at Krugle


Show InfoForm.java syntax highlighted

/*
 * Copyright (c) 2004
 * Helsinki Institute of Physics
 * see LICENSE file for details
 *
 * InfoForm.java
 * Created on Nov 10, 2004
 */
package fi.hip.gb.client;

import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.StringItem;

import fi.hip.gb.midlet.core.LiteResult;

/**
 * Shows information about results.
 * 
 * @author Juho Karppinen
 */
public class InfoForm extends GenericResultForm {
	public InfoForm(LiteResult res, int index) {
		this(res, "Result #" + (index + 1));
	}
	public InfoForm(LiteResult res, String title) {
		super(title, res);
		boolean midp2 = System.getProperty("microedition.profiles").startsWith("MIDP-2");
		
		StringItem item = new StringItem("File name: ", res.getName());
		if(midp2) {
			item.setLayout(Item.LAYOUT_NEWLINE_AFTER);
		}
		append(item);
		
		item = new StringItem("Size on the server: ", res.getSize() + " bytes");
		if(midp2) {
			item.setLayout(Item.LAYOUT_NEWLINE_AFTER);
		}
		append(item);
		item = new StringItem("Downloaded size: ", res.getPayloadSize() + " bytes");
		if(midp2) {
			item.setLayout(Item.LAYOUT_NEWLINE_AFTER);
		}
		append(item);
		
		// format the description
		String originalDesc = res.getDescription();
        /*
		String desc = "";
		int ls = 0;
		int br = -1;
		while((br = originalDesc.indexOf("<br>", ls)) != -1) {
		    desc += "*" + originalDesc.substring(ls, br) + "\n";
		    ls = br+4;
		}*/
		item = new StringItem("Description: ", originalDesc);
		if(midp2) {
			item.setLayout(Item.LAYOUT_NEWLINE_AFTER);
		}
		append(item);
	}
}




See more files for this project here

GridBlocks

GridBlocks builds a grid application framework via easy-to-use building blocks in distributed environment. The framework offers components for Grid security, distributed storage, computing, and Portlet web interfaces.

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

  BluetoothBrowser.java
  Broadcasts.java
  CameraCanvas.java
  Configs.java
  DispatchForm.java
  GPSForm.java
  GenericImageCanvas.java
  GenericResultForm.java
  GraphicsCanvas.java
  InfoForm.java
  InputUI.java
  JobsForm.java
  Logging.java
  MIDui.java
  MediaPlayer.java
  PictureCanvas.java
  ProgressForm.java
  Results.java
  StatusForm.java
  TextForm.java
  Thumbnails.java