Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.ide.todo
Class AbstractToDoItem

java.lang.Object
  extended by oracle.javatools.data.HashStructureAdapter
      extended by oracle.ide.config.ChangeEventSource
          extended by oracle.ide.todo.AbstractToDoItem
All Implemented Interfaces:
Displayable, Element, Locatable, LocatableItem, ToDoItem, Copyable

public abstract class AbstractToDoItem
extends ChangeEventSource
implements Copyable, ToDoItem

A AbstractToDoItem represents a task the user wants to track. ToDoItems can be private to a user or they can be shared among users. In order to share to do items, the user needs to put a to do tag into the source code, for example, TODO might be used to indicate a to do item.

To do items can also be associated with a file by adding a ToDoItem to a source file through the editor's line gutter context menu. These to do items will not be shared among users.

Finally, the user can create to do items that have no association with a file by creating new ToDoItems in the ToDoWindow. These to do items are not shared.


Field Summary
static java.lang.String ITEM_ATTRIBUTES
           
static java.lang.String ITEM_COLUMN
           
static java.lang.String ITEM_DATE
           
static java.lang.String ITEM_DONE
           
static java.lang.String ITEM_LINE
           
static java.lang.String ITEM_PRIORITYID
           
static java.lang.String ITEM_TEXT
           
static java.lang.String ITEM_URL
           
static java.lang.String ITEM_USERDATA
           
 
Fields inherited from class oracle.javatools.data.HashStructureAdapter
_hash
 
Constructor Summary
AbstractToDoItem()
          Constructor
AbstractToDoItem(java.lang.String text, int priorityId, int line, int column, java.net.URL url, boolean done, java.util.Date date)
           
 
Method Summary
 HashStructure asHash()
           
 boolean canGoTo()
          Called to determine if the to do item allows goTo navigation.
abstract  void dispose()
          Called when the to do item is being deleted.
 boolean equals(java.lang.Object object)
          Equals support.
 Attributes getAttributes()
          Provides an attribute set
 java.util.Iterator<Element> getChildren()
          Provides an iterator over the children, always returns null
 int getColumn()
          Gets the column this to do item is associated with in a code editor
 java.lang.Object getData()
          Provides the ToDoItem that is being wrapped
 java.util.Date getDate()
          Gets the Date associated with the to do item
 javax.swing.Icon getIcon()
          Returns an icon to represent the to do item
 int getLine()
          Gets the line this to do item is associated with in a code editor
 java.lang.String getLongLabel()
          Returns a long label
 int getPriorityId()
          Gets the unique id associated with the priority
 java.lang.String getShortLabel()
          Returns a short label
 java.lang.String getText()
          Gets the descriptive text of the to do item
 java.lang.String getTooltip()
          Returns a text string that can be used for a tooltip, typically in a file overview margin.
 java.lang.String getToolTipText()
          Returns a tooltip
 java.net.URL getURL()
          Gets the URL this to do item is associated with
 java.lang.Object getUserData()
          Gets the user-specified data object
abstract  void goTo()
          Called when a to do item is double-clicked on in the To Do Log page If the item is linked to a url and line, this should navigate to the editor and position the cursor on that line.
 boolean isDone()
          Gets whether the to do item has been marked as complete or not
 boolean isEditable()
          Determines whether the to do item can be edited.
 boolean mayHaveChildren()
          Whether or not the item can have children.
 void setColumn(int column)
          Sets the column this to do item is associated with in a code editor
 void setDate(java.util.Date date)
          Sets the Date associated with the to do item
 void setDone(boolean done)
          Sets whether the to do item is completed or not
 void setLine(int line)
          Sets the line this to do item is associated with in a code editor
 void setPriorityId(int priorityId)
          Sets the unique id associated with the priority
 void setText(java.lang.String text)
          Sets the descriptive text of the to do item
 void setURL(java.net.URL url)
          Sets the URL this to do item is associated with
 void setUserData(java.lang.Object userData)
          Sets the user-specified data object
 boolean shouldPersist()
          By default the expectation is that the ToDoItem should be persisted in the IDE's data file.
abstract  void stateChanged()
          Called when the state of the ToDoItem has changed
 java.lang.String toString()
          Returns the Short Label displayed to a user.
 
Methods inherited from class oracle.ide.config.ChangeEventSource
addChangeListener, copyTo, fireChangeEvent, fireChangeEvent, removeChangeListener, setUseObjectEquals
 
Methods inherited from class oracle.javatools.data.HashStructureAdapter
addStructureChangeListener, containsKey, copyToImpl, equalsImpl, findOrCreate, forcedCopyTo, getHashStructure, removeStructureChangeListener, useObjectEquals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.javatools.util.Copyable
copyTo
 

Field Detail

ITEM_TEXT

public static final java.lang.String ITEM_TEXT
See Also:
Constant Field Values

ITEM_PRIORITYID

public static final java.lang.String ITEM_PRIORITYID
See Also:
Constant Field Values

ITEM_LINE

public static final java.lang.String ITEM_LINE
See Also:
Constant Field Values

ITEM_COLUMN

public static final java.lang.String ITEM_COLUMN
See Also:
Constant Field Values

ITEM_URL

public static final java.lang.String ITEM_URL
See Also:
Constant Field Values

ITEM_DONE

public static final java.lang.String ITEM_DONE
See Also:
Constant Field Values

ITEM_DATE

public static final java.lang.String ITEM_DATE
See Also:
Constant Field Values

ITEM_USERDATA

public static final java.lang.String ITEM_USERDATA
See Also:
Constant Field Values

ITEM_ATTRIBUTES

public static final java.lang.String ITEM_ATTRIBUTES
See Also:
Constant Field Values
Constructor Detail

AbstractToDoItem

public AbstractToDoItem()
Constructor


AbstractToDoItem

public AbstractToDoItem(java.lang.String text,
                        int priorityId,
                        int line,
                        int column,
                        java.net.URL url,
                        boolean done,
                        java.util.Date date)
Method Detail

asHash

public HashStructure asHash()

getText

public java.lang.String getText()
Gets the descriptive text of the to do item

Specified by:
getText in interface ToDoItem
Returns:
the description of the to do item

setText

public void setText(java.lang.String text)
Sets the descriptive text of the to do item

Specified by:
setText in interface ToDoItem
Parameters:
text - the description of the to do item

getTooltip

public java.lang.String getTooltip()
Returns a text string that can be used for a tooltip, typically in a file overview margin.

Returns:
string to represent the tooltip for the item

getPriorityId

public int getPriorityId()
Gets the unique id associated with the priority

Specified by:
getPriorityId in interface ToDoItem
Returns:
unique id associated with the priority

setPriorityId

public void setPriorityId(int priorityId)
Sets the unique id associated with the priority

Specified by:
setPriorityId in interface ToDoItem
Parameters:
priorityId - unique id associated with the priority

getLine

public int getLine()
Gets the line this to do item is associated with in a code editor

Specified by:
getLine in interface LocatableItem
Returns:
the line this to do item is associated with

setLine

public void setLine(int line)
Sets the line this to do item is associated with in a code editor

Specified by:
setLine in interface LocatableItem
Parameters:
line - the line to associate this to do item with

getColumn

public int getColumn()
Gets the column this to do item is associated with in a code editor

Specified by:
getColumn in interface LocatableItem
Returns:
the column this to do item is associated with

setColumn

public void setColumn(int column)
Sets the column this to do item is associated with in a code editor

Parameters:
column - the column to associate this to do item with

getURL

public java.net.URL getURL()
Gets the URL this to do item is associated with

Specified by:
getURL in interface Locatable
Returns:
the URL this to do item is associated with

setURL

public void setURL(java.net.URL url)
Sets the URL this to do item is associated with

Specified by:
setURL in interface Locatable
Parameters:
url - the URL to associate this to do item with

isDone

public boolean isDone()
Gets whether the to do item has been marked as complete or not

Specified by:
isDone in interface ToDoItem
Returns:
true if the to do item is marked as completed; false otherwise

setDone

public void setDone(boolean done)
Sets whether the to do item is completed or not

Specified by:
setDone in interface ToDoItem
Parameters:
done - true if the to do item is completed; false otherwise

getDate

public java.util.Date getDate()
Gets the Date associated with the to do item

Specified by:
getDate in interface ToDoItem
Returns:
the Date associated with the to do item

setDate

public void setDate(java.util.Date date)
Sets the Date associated with the to do item

Specified by:
setDate in interface ToDoItem
Parameters:
date - the Date to associate this to do item with

getUserData

public java.lang.Object getUserData()
Description copied from interface: ToDoItem
Gets the user-specified data object

Specified by:
getUserData in interface ToDoItem
Returns:

setUserData

public void setUserData(java.lang.Object userData)
Description copied from interface: ToDoItem
Sets the user-specified data object

Specified by:
setUserData in interface ToDoItem

isEditable

public boolean isEditable()
Determines whether the to do item can be edited.

Specified by:
isEditable in interface ToDoItem
Returns:
true if the to do item can be edited; false otherwise

shouldPersist

public boolean shouldPersist()
By default the expectation is that the ToDoItem should be persisted in the IDE's data file.

Specified by:
shouldPersist in interface ToDoItem
Returns:
true to indicate the IDE should save the to do item

toString

public java.lang.String toString()
Description copied from interface: Displayable
Returns the Short Label displayed to a user. This overrides the toString method in java.lang.Object.

Implementors of the Displayable interface should override this as appropriate. The default implementation is the same as getShortLabel

Specified by:
toString in interface Displayable
Overrides:
toString in class java.lang.Object
See Also:
Object.toString(), Displayable.getShortLabel()

equals

public boolean equals(java.lang.Object object)
Description copied from class: HashStructureAdapter
Equals support. As long as the subclass stores all data in the HashStructureAdapter._hash, this base equals implementation should be sufficient and not need to be overridden.

Overrides:
equals in class HashStructureAdapter

canGoTo

public boolean canGoTo()
Called to determine if the to do item allows goTo navigation. Returning false will disable the context menu item.

Specified by:
canGoTo in interface ToDoItem
Returns:
true if the to do item has an URL

goTo

public abstract void goTo()
Called when a to do item is double-clicked on in the To Do Log page If the item is linked to a url and line, this should navigate to the editor and position the cursor on that line.

Specified by:
goTo in interface ToDoItem

dispose

public abstract void dispose()
Description copied from interface: ToDoItem
Called when the to do item is being deleted.

Specified by:
dispose in interface ToDoItem

stateChanged

public abstract void stateChanged()
Description copied from interface: ToDoItem
Called when the state of the ToDoItem has changed

Specified by:
stateChanged in interface ToDoItem

mayHaveChildren

public boolean mayHaveChildren()
Whether or not the item can have children. Always false

Specified by:
mayHaveChildren in interface Element
Returns:
false

getChildren

public java.util.Iterator<Element> getChildren()
Provides an iterator over the children, always returns null

Specified by:
getChildren in interface Element
Returns:
null

getAttributes

public Attributes getAttributes()
Provides an attribute set

Specified by:
getAttributes in interface Element
Returns:
the attribute set for the to do item

getData

public java.lang.Object getData()
Provides the ToDoItem that is being wrapped

Specified by:
getData in interface Element
Returns:
the to do item that is being wrapped

getShortLabel

public java.lang.String getShortLabel()
Returns a short label

Specified by:
getShortLabel in interface Displayable
Returns:
the getText() of the ToDoItem

getLongLabel

public java.lang.String getLongLabel()
Returns a long label

Specified by:
getLongLabel in interface Displayable
Returns:
the getText() of the ToDoItem

getIcon

public javax.swing.Icon getIcon()
Returns an icon to represent the to do item

Specified by:
getIcon in interface Displayable
Returns:
null

getToolTipText

public java.lang.String getToolTipText()
Returns a tooltip

Specified by:
getToolTipText in interface Displayable
Returns:
the getText() of the ToDoItem

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.