⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 todo.html

📁 J2ME PDA开发PIM的技术规范,可使应用程序查看手机本地联系人列表, 本地文件
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
	<HEAD>
		<TITLE>ToDo (PIM Optional Package 1.0 Spec, Final Release) </TITLE>
		<!-- Generated by javadoc on Wed Oct 29 13:13:41 PST 2003 -->
		<META NAME="keywords" CONTENT="javax.microedition.pim.ToDo,ToDo interface">
		<LINK REL="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
			<SCRIPT>
function asd()
{
parent.document.title="ToDo (PIM Optional Package 1.0 Spec, Final Release)";
}
			</SCRIPT>
	</HEAD>
	<BODY BGCOLOR="white" onload="asd();">
		<!-- ========== START OF NAVBAR ========== -->
		<A NAME="navbar_top"><!-- --></A>
		<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
			<TR>
				<TD COLSPAN="3" BGCOLOR="#eeeeff" CLASS="NavBarCell1">
					<A NAME="navbar_top_firstrow"><!-- --></A>
					<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
						<TR ALIGN="center" VALIGN="top">
							<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
								<A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
							<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
								<A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
							<TD BGCOLOR="#ffffff" CLASS="NavBarCell1Rev">
								&nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
							<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
								<A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
							<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
								<A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
							<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
								<A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
							<TD BGCOLOR="#eeeeff" CLASS="NavBarCell1">
								<A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
						</TR>
					</TABLE>
				</TD>
				<TD ALIGN="right" VALIGN="top" ROWSPAN="3"><EM> PIM Optional Package 1.0<br>
						Final Release</EM>
				</TD>
			</TR>
			<TR>
				<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../javax/microedition/pim/PIMList.html"><B>PREV 
								CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../javax/microedition/pim/ToDoList.html"><B>NEXT 
								CLASS</B></A></FONT></TD>
				<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top">
							<B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="ToDo.html" TARGET="_top"><B>NO FRAMES</B></A>
						&nbsp; &nbsp;
						<SCRIPT>  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');  }  //--></SCRIPT>
						<NOSCRIPT>
							<A HREF="../../../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
						</NOSCRIPT>
					</FONT>
				</TD>
			</TR>
			<TR>
				<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;METHOD</FONT></TD>
				<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;METHOD</FONT></TD>
			</TR>
		</TABLE>
		<!-- =========== END OF NAVBAR =========== -->
		<HR>
		<!-- ======== START OF CLASS DATA ======== -->
		<H2>
			<FONT SIZE="-1">javax.microedition.pim</FONT>
			<BR>
			Interface ToDo</H2>
		<DL>
			<DT><B>All Superinterfaces:</B>
				<DD>
					<A HREF="../../../javax/microedition/pim/PIMItem.html">PIMItem</A></DD>
		</DL>
		<HR>
		<DL>
			<DT>public interface <B>ToDo</B><DT>extends <A HREF="../../../javax/microedition/pim/PIMItem.html">
						PIMItem</A></DT></DL>
		<P>
			Represents a single To Do item in a PIM To Do database. The fields are a subset 
			of the fields in <code>VTODO</code> defined by the vCalendar specification from 
			the Internet Mail Consortium (http://www.imc.org). The subset represents those 
			fields necessary to provide enough information about a ToDo item without 
			compromising platform portability.
		</P>
		<P>The ToDo class has many different field IDs that it can support. However, each 
			individual ToDo object supports only fields valid for its associated list. Its 
			ToDoList restricts what fields in a ToDo are retained. This reflects that some 
			native ToDo databases do not support all of the fields available in a ToDo 
			item. The methods <A HREF="../../../javax/microedition/pim/PIMList.html#isSupportedField(int)">
				<CODE>PIMList.isSupportedField(int)</CODE></A> and <A HREF="../../../javax/microedition/pim/PIMList.html#getSupportedFields()">
				<CODE>PIMList.getSupportedFields()</CODE></A> can be used to determine if a 
			particular ToDo field is supported by a ToDoList and therefore persisted when 
			the ToDo is committed to its list. Attempts to set or get data based on field 
			IDs not supported in the ToDo's ToDoList result in a <A HREF="../../../javax/microedition/pim/UnsupportedFieldException.html">
				<CODE>UnsupportedFieldException</CODE></A>.
		</P>
		<H3>Data</H3>
		<P>
		</P>
		<h4>Table: Standard Fields</h4>
		<table border="1">
			<TR>
				<th>
					Fields
				</th>
				<th>
					Type of Data Associated with Field
				</th>
			</TR>
			<tr>
				<td><code>NOTE, SUMMARY, UID</code></td>
				<td><code>PIMItem.STRING</code></td>
			</tr>
			<tr>
				<td><code>CLASS, PRIORITY</code></td>
				<td><code>PIMItem.INT</code></td>
			</tr>
			<tr>
				<td><code>COMPLETION_DATE, DUE, REVISION </code>
				</td>
				<td><code>PIMItem.DATE</code></td>
			</tr>
			</TR>
			<tr>
				<td><code>COMPLETED</code></td>
				<td><code>PIMItem.BOOLEAN</code></td>
			</tr>
		</table>
		<h3>Required Field Support</h3>
		<P>All ToDo fields may or may not besupported by a particular list. This is due to 
			the fact that underlying native databases may not support all of the fields 
			defined in this API. Support for any of the fields can be determined by the 
			method <A HREF="../../../javax/microedition/pim/PIMList.html#isSupportedField(int)">
				<CODE>PIMList.isSupportedField(int)</CODE></A>.
		</P>
		<P>
			Native ToDo databases may require some of the fields to have values assigned to 
			them in order to be persisted. If an application does not provide values for 
			these fields, default values are provided for the ToDo by the VM when the ToDo 
			is persisted.
		</P>
		<h3>Examples</h3>
		<h4>Explicit Field Use with Field Checking</h4>
		This first example shows explicit field access in which each field and type ID 
		is properly checked for support prior to use. This results in code that is more 
		portable across PIM implementations regardless of which specific fields are 
		supported on particular PIM list implementations. If one of the fields is not 
		supported by the list, the field is not set in the ToDo.
		<pre> ToDoList todos = null;
 try {
    todos = (ToDoList) PIM.getInstance().openPIMList(PIM.TODO_LIST, PIM.READ_WRITE);
 } catch (PIMException e) {
    // An error occurred
    return;
 }
 ToDo todo = todos.createToDo();
 if (todos.isSupportedField(Event.SUMMARY))
      todo.addString(ToDo.SUMMARY, PIMItem.ATTR_NONE, "Buy going away present for Judy");
 if (todos.isSupportedField(Event.DUE))
      todo.addDate(ToDo.DUE, PIMItem.ATTR_NONE, new Date().getTime());
 if (todos.isSupportedField(Event.NOTE))
      todo.addString(ToDo.NOTE, PIMItem.ATTR_NONE, "Judy really likes stained glass and expensive pens");
 if (todos.isSupportedField(Event.PRIORITY))
      todo.addInt(ToDo.PRIORITY, PIMItem.ATTR_NONE, 2);
 if (todos.maxCategories() != 0 &amp;&amp; todos.isCategory("Work"))
      todo.addToCategory("Work");
 }
 try {
      todo.commit();
 } catch (PIMException e) {
      // An error occured
 }
 try {
      todos.close();
 } catch (PIMException e) {
 }
 </pre>
		<h4>Explicit Field Use with Exception Handling</h4>
		This second example also shows explicit field access that properly handles 
		optionally supported fields by use of a try catch block with <code>UnsupportedFieldException</code>. 
		In this case, the setting of the whole ToDo is rejected if any of the fields 
		are not supported in the particular list implementation.
		<PRE>  ToDoList todos = null;
  try {
    todos = (ToDoList) PIM.getInstance().openPIMList(PIM.TODO_LIST, PIM.READ_WRITE);
  } catch (PIMException e) {
      // An error occurred
      return;
  }
  ToDo todo = todos.createToDo();

  try {
      todo.addString(ToDo.SUMMARY, PIMItem.ATTR_NONE, "Buy going away present for Judy");
      todo.addDate(ToDo.DUE, PIMItem.ATTR_NONE, new Date().getTime());
      todo.addString(ToDo.NOTE, PIMItem.ATTR_NONE, "Judy really likes stained glass and expensive pens");
      todo.addInt(ToDo.PRIORITY, PIMItem.ATTR_NONE, 2);
      todo.addToCategory("Work");

  } catch (UnsupportedFieldException e) {
    // In this case, we choose not to save the ToDo at all if any of the
    // fields are not supported on this platform.
    System.out.println("Todo not saved");
    return;
  }

  try {
      todo.commit();
  } catch (PIMException e) {
      // An error occured
  }
  try {
      todos.close();
  } catch (PIMException e) {
  }
 </PRE>
		<P>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -