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

📄 todo.html

📁 J2ME手机编程规范JSR-75文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Mon Feb 10 18:18:41 PST 2003 -->
<TITLE>
ToDo (PIM Optional Package 1.0 Spec, Proposed Final Draft)
</TITLE>
<META NAME="keywords" CONTENT="javax.microedition.pim.ToDo,ToDo interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<SCRIPT>
function asd()
{
parent.document.title="ToDo (PIM Optional Package 1.0 Spec, Proposed Final Draft)";
}
</SCRIPT>
<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>Proposed Final Draft</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></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.  In these scenarios, default values will be provided for the ToDo by the VM when persisting the ToDo. </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 && 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>

<P>
<DL>
<DT><B>Since:</B></DT>  <DD>PIM 1.0</DD><DT><B>See Also:</B><DD><A target=_top href="http://www.imc.org/pdi">Internet Mail Consortium PDI</A>, <A HREF="../../../javax/microedition/pim/ToDoList.html"><CODE>ToDoList</CODE></A></DL>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/ToDo.html#CLASS">CLASS</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Field specifying the desired access class for this contact.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/ToDo.html#CLASS_CONFIDENTIAL">CLASS_CONFIDENTIAL</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constant indicating this todo's class of access is confidential.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/ToDo.html#CLASS_PRIVATE">CLASS_PRIVATE</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constant indicating this todo's class of access is private.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/ToDo.html#CLASS_PUBLIC">CLASS_PUBLIC</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constant indicating this todo's class of access is public.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/ToDo.html#COMPLETED">COMPLETED</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Field ID indicating a ToDo has been completed.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/ToDo.html#COMPLETION_DATE">COMPLETION_DATE</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Field ID indicating a ToDo has been completed on the date indicated by this field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/ToDo.html#DUE">DUE</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The date a ToDo is due.The data for this field is expressed in the same long value format as java.util.Date, which is milliseconds since the epoch (00:00:00 GMT, January 1, 1970).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/ToDo.html#NOTE">NOTE</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Field specifying a more complete description than the SUMMARY for this ToDo.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/ToDo.html#PRIORITY">PRIORITY</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Field specifying the priority of this ToDo.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/pim/ToDo.html#REVISION">REVISION</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Field specifying the last modification date and time of a ToDo

⌨️ 快捷键说明

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