Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Mylyn/Porting Guide"

(Context Framework)
m (sorting changes only)
Line 30: Line 30:
 
** moved from <code>org.eclipse.mylar.context.core</code> to <code>org.eclipse.mylar.core</code>
 
** moved from <code>org.eclipse.mylar.context.core</code> to <code>org.eclipse.mylar.core</code>
  
== Tasks Framework ==  
+
== Tasks API ==  
  
* <code>TaskListImages</code>
+
* <code>AbstractRepositoryConnector</code>
** renamed to <code>TasksUiImages</code> (still an internal class, should move to API)
+
** + getLastSyncTimestamp(TaskRepository repository, Set<AbstractRepositoryTask> changedTasks)  (may change as part of [https://bugs.eclipse.org/bugs/show_bug.cgi?id=176934 bug#176934])
 +
** <code>getSupportedVersions()</code> has been removed ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=176815 #1768159])
  
* <code>DateRangeContainer</code>
+
* <code>AbstractRepositoryConnectorUi</code>
** getChildren() now returns set of underlying task objects (not DateRangeActivityDelegates which will be deprecated)
+
** <code>openRemoteTask(String repositoryUrl, String id)</code>: removed, this method no longer needs to be implemented by the connector.  Instead classes can rely on the new <code>openRepositoryTask(..)</code> method, and override it if necessary.
** getDateRangeDelegates() returns the delegate formerly returned by getChildren()
+
** getRepositoryUrl and all ID/URL methods: now final, change via setters
 +
** + findHyperlinks(...) override to detect hyperlinks in editors
  
* <code>ITaskListExternalizer</code>
+
*<code>AbstractRepositorySettingsPage</code> validation changes.
** <code>readTask(..)</code> renamed to <code>createTask(..)</code>, no longer needs to set taskId, label, or repositoryUrl
+
**<code>setNeedsValidation(boolean needsValidation)</code> if true validate button will be visible
* <code>DelegatingTaskExternalizer</code>
+
**<code>getValidator(TaskRepository repository)</code> return an instance of <code>Validator</code>.  
** <code>readTaskInfo(..)</code> and <code>readQueryHitInfo(..)</code> are now called automatically and are private.  Use your <code>createTask(..)</code> or <code>createQueryHit(..)</code> methods to customize reading additional attributes.
+
  
* <code>Task</code> .....''updates in progress''
+
* <code>AbstractRepositoryTaskEditor</code>
** handleIdentifier: now private
+
**<code>attributeChanged()</code> Anything that needs to be saved must be in attribute form and passed to this method. Most if this is all done for you but if you override AbstractRepositoryTaskEditor.createCustomAttributeLayout() then you will want to ensure that attributeChanged is called upon editing. Utility method createTextField() handles this call. 
** get/setUrl are now get/setTaskUrl (to disambiguate with get/setRepositoryUrl())
+
** <code>createLabel()</code> Utility method  added. It will put an '*' at the front of the label if the attribute has been modified. Eventually this will be applied upon editing but currently only happens after re-freshing or re-opening the editor.
** (-) <code>getElapsedTime()</code>
+
** <code>SECTION_NAME</code> is an enum that holds default titles for the default sections. To override these default titles, set the appropriate (SECTION_NAME, new name) in <code>alternateSectionLabels</code> on <code>AbstractRepositoryTaskEditor</code>.
** (-) <code>setElapsedTime()</code>
+
** <code>updateEditor()</code> refreshes editor with new input in-place.
 +
 
 +
* <code>AbstractRepositoryQuery</code>
 +
** Constrctor no longer takes number of hits. Connectors can use QueryHitCollector.MAX_HITS (currently 5000) when setting max number of hits to return.
  
 
* <code>AbstractRepositoryTask</code> .....''updates in progress''
 
* <code>AbstractRepositoryTask</code> .....''updates in progress''
Line 60: Line 64:
 
** with:
 
** with:
 
     ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), taskId);
 
     ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), taskId);
 
* <code>AbstractRepositoryQuery</code>
 
** Constrctor no longer takes number of hits. Connectors can use QueryHitCollector.MAX_HITS (currently 5000) when setting max number of hits to return.
 
  
 
* <code>AbstractQueryHit</code>
 
* <code>AbstractQueryHit</code>
 
** <code>setDescription(..)</code> renamed to <code>setSummary(..)</code>
 
** <code>setDescription(..)</code> renamed to <code>setSummary(..)</code>
  
* <code>AbstractRepositoryConnectorUi</code>
+
*<code> AttributeContainer</code>
** <code>openRemoteTask(String repositoryUrl, String id)</code>: removed, this method no longer needs to be implemented by the connector.  Instead classes can rely on the new <code>openRepositoryTask(..)</code> method, and override it if necessary.
+
**<code>getAttributeFactory()</code> new method
** getRepositoryUrl and all ID/URL methods: now final, change via setters
+
** + findHyperlinks(...) override to detect hyperlinks in editors
+
  
* <code>AbstractRepositoryConnector</code>
+
* <code>DateRangeContainer</code>
** + getLastSyncTimestamp(TaskRepository repository, Set<AbstractRepositoryTask> changedTasks) (may change as part of [https://bugs.eclipse.org/bugs/show_bug.cgi?id=176934 bug#176934])
+
** getChildren() now returns set of underlying task objects (not DateRangeActivityDelegates which will be deprecated)
** <code>getSupportedVersions()</code> has been removed ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=176815 #1768159])
+
** getDateRangeDelegates() returns the delegate formerly returned by getChildren()
  
 
* <code>ITaskListElement</code>: now extends <code>java.lang.Comparable</code>, so Collections support of sorting can be used, since task list elements have a natural ordering. Default implementations are provided for tasks and containers. ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=171590 bug 171590])
 
* <code>ITaskListElement</code>: now extends <code>java.lang.Comparable</code>, so Collections support of sorting can be used, since task list elements have a natural ordering. Default implementations are provided for tasks and containers. ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=171590 bug 171590])
 
* <code>QueryHitCollector</code>
 
** MAX_HITS constant can be used as standard default number of hits handled per query. User notified when >= hits returned.
 
 
* <code>TasksUiUtil</code>
 
** <code>openUrl(String url)</code>: moved to <code>openBrowser(String url)</code>
 
 
* <code>Task</code>
 
** <code>getTooltipText()</code>: deleted, not used
 
** Due dates are now supported <code>getDueDate(), setDueDate()</code>
 
 
* <code>MylarStatus</code> (place holder, will improve as we solidify this)
 
** <code>MylarStatusHandler.displayStatus(dialog title, IStatus status)</code> - call to display error and information dialogs
 
** When returning <code>CoreException</code> pass in a <code>MylarStatus</code> with appropriate code (see <code>IMylarStatusConstants</code>).
 
** If <code>IMylarStatusConstants.INTERNAL_ERROR</code> is sent to <code>MylarStatusHandler.displayStatus</code> an error dialog will appear and the error will be logged.
 
** <code>IMylarStatusConstants.REPOSITORY_COLLISION</code> used for mid-air collision. Pass repository url and appropriate dialog will be displayed.
 
  
 
* <code>ITaskDataHandler</code>
 
* <code>ITaskDataHandler</code>
Line 101: Line 84:
 
** <code>getDateForAttributeType(...)</code> moved to <code>AbstractAttributeFactory</code>
 
** <code>getDateForAttributeType(...)</code> moved to <code>AbstractAttributeFactory</code>
  
*<code> AttributeContainer</code>
+
* <code>ITaskListExternalizer</code>
**<code>getAttributeFactory()</code> new method
+
** <code>readTask(..)</code> renamed to <code>createTask(..)</code>, no longer needs to set taskId, label, or repositoryUrl
 
+
* <code>DelegatingTaskExternalizer</code>
*<code>RepositoryTaskData</code>
+
** <code>readTaskInfo(..)</code> and <code>readQueryHitInfo(..)</code> are now called automatically and are private. Use your <code>createTask(..)</code> or <code>createQueryHit(..)</code> methods to customize reading additional attributes.
**constructor now requires a task kind (string) (i.e. <code>Task.DEFAULT_TASK_KIND</code>)
+
**<code>getTaskKind</code> return the task kind
+
**<code>setNew(boolean)</code> '''signifies that this is unsubmitted task data. Used by editor factory to determine if existing or new editor to be opened'''.
+
 
+
*<code>RepositoryTaskAttribute</code>
+
** getID() -> getId()
+
 
+
*<code>AbstractRepositorySettingsPage</code> validation changes.
+
**<code>setNeedsValidation(boolean needsValidation)</code> if true validate button will be visible
+
**<code>getValidator(TaskRepository repository)</code> return an instance of <code>Validator</code>.  
+
  
 
* <code>TaskRepository</code>
 
* <code>TaskRepository</code>
Line 124: Line 97:
 
** <code>updateOfflineState</code> is now <code>saveIncoming</code> and <code>saveOutgoing</code>.  
 
** <code>updateOfflineState</code> is now <code>saveIncoming</code> and <code>saveOutgoing</code>.  
 
** <code>discardOutgoing</code> discards any pending outgoing changes
 
** <code>discardOutgoing</code> discards any pending outgoing changes
 +
 +
* <code>RepositoryTaskAttribute</code>
 +
** getID() -> getId()
 +
 +
*<code>RepositoryTaskData</code>
 +
**constructor now requires a task kind (string) (i.e. <code>Task.DEFAULT_TASK_KIND</code>)
 +
**<code>getTaskKind</code> return the task kind
 +
**<code>setNew(boolean)</code> '''signifies that this is unsubmitted task data. Used by editor factory to determine if existing or new editor to be opened'''.
 +
 +
* <code>Task</code> .....''updates in progress''
 +
** <code>getTooltipText()</code>: deleted, not used
 +
** Due dates are now supported <code>getDueDate(), setDueDate()</code>
 +
** handleIdentifier: now private
 +
** get/setUrl are now get/setTaskUrl (to disambiguate with get/setRepositoryUrl())
 +
** (-) <code>getElapsedTime()</code>
 +
** (-) <code>setElapsedTime()</code>
  
 
* <code>TaskEditor</code>
 
* <code>TaskEditor</code>
 
** <code>protected void pageChange(intNewPageIndex)</code> method removed (only called super)
 
** <code>protected void pageChange(intNewPageIndex)</code> method removed (only called super)
 
* <code>AbstractRepositoryTaskEditor</code>
 
**<code>attributeChanged()</code> Anything that needs to be saved must be in attribute form and passed to this method. Most if this is all done for you but if you override AbstractRepositoryTaskEditor.createCustomAttributeLayout() then you will want to ensure that attributeChanged is called upon editing. Utility method createTextField() handles this call. 
 
** <code>createLabel()</code> Utility method  added. It will put an '*' at the front of the label if the attribute has been modified. Eventually this will be applied upon editing but currently only happens after re-freshing or re-opening the editor.
 
** <code>SECTION_NAME</code> is an enum that holds default titles for the default sections. To override these default titles, set the appropriate (SECTION_NAME, new name) in <code>alternateSectionLabels</code> on <code>AbstractRepositoryTaskEditor</code>.
 
** <code>updateEditor()</code> refreshes editor with new input in-place.
 
 
* <code>WebClientUtil</code>
 
** moved from <code>..mylar.tasks.core</code> to <code>..mylar.core.net</code>
 
  
 
* <code>TaskList</code>
 
* <code>TaskList</code>
 
** <code>getChangeListeners()</code>: returns a <code>Set</code> instead of <code>List</code>
 
** <code>getChangeListeners()</code>: returns a <code>Set</code> instead of <code>List</code>
 +
 +
* <code>TaskListImages</code>
 +
** renamed to <code>TasksUiImages</code> (still an internal class, should move to API)
  
 
* <code>TaskListManager</code>
 
* <code>TaskListManager</code>
 
** <code>setDueDate()</code> used to set due date on a task and cause notification of local info changed.
 
** <code>setDueDate()</code> used to set due date on a task and cause notification of local info changed.
 
** <code>isDue(ITask)</code> true if task's due date isn't null and date has past
 
** <code>isDue(ITask)</code> true if task's due date isn't null and date has past
 +
 +
* <code>TasksUiUtil</code>
 +
** <code>openUrl(String url)</code>: moved to <code>openBrowser(String url)</code>
 +
 +
* <code>QueryHitCollector</code>
 +
** MAX_HITS constant can be used as standard default number of hits handled per query. User notified when >= hits returned.
  
 
== Context Framework ==
 
== Context Framework ==

Revision as of 19:48, 10 April 2007

This document will have Mylar 2.0 specific API changes added to it as we make them. If interested in keeping up with these changes we suggest setting a watch for this page.

Porting from Mylar 1.0 to 2.0

Pending Changes

The following changes are being considered but not yet implemented.

  • TaskRepository:
    • rename getKind() to getConnectorKind()
    • Make class FINAL
  • AbstractRepositoryConnector:
    • rename createTaskFromExistingKey(..) to addExistingTask(..)
    • rename getRepositoryType() to getConnectorKind()
  • AbstractRepositoryTask
  • rename getRepositoryKind() to getConnectorKind()
  • Task
  • renamte getRepositoryKind() to getConnectorKind()
  • IRepositoryConstants
    • rename PROPERTY_KIND to PROPERTY_CONNECTOR_KIND

General

  • All library dependencies have moved
  • MylarStatusHandler and IStatusHandler
    • moved from org.eclipse.mylar.context.core to org.eclipse.mylar.core

Tasks API

  • AbstractRepositoryConnector
    • + getLastSyncTimestamp(TaskRepository repository, Set<AbstractRepositoryTask> changedTasks) (may change as part of bug#176934)
    • getSupportedVersions() has been removed (#1768159)
  • AbstractRepositoryConnectorUi
    • openRemoteTask(String repositoryUrl, String id): removed, this method no longer needs to be implemented by the connector. Instead classes can rely on the new openRepositoryTask(..) method, and override it if necessary.
    • getRepositoryUrl and all ID/URL methods: now final, change via setters
    • + findHyperlinks(...) override to detect hyperlinks in editors
  • AbstractRepositorySettingsPage validation changes.
    • setNeedsValidation(boolean needsValidation) if true validate button will be visible
    • getValidator(TaskRepository repository) return an instance of Validator.
  • AbstractRepositoryTaskEditor
    • attributeChanged() Anything that needs to be saved must be in attribute form and passed to this method. Most if this is all done for you but if you override AbstractRepositoryTaskEditor.createCustomAttributeLayout() then you will want to ensure that attributeChanged is called upon editing. Utility method createTextField() handles this call.
    • createLabel() Utility method added. It will put an '*' at the front of the label if the attribute has been modified. Eventually this will be applied upon editing but currently only happens after re-freshing or re-opening the editor.
    • SECTION_NAME is an enum that holds default titles for the default sections. To override these default titles, set the appropriate (SECTION_NAME, new name) in alternateSectionLabels on AbstractRepositoryTaskEditor.
    • updateEditor() refreshes editor with new input in-place.
  • AbstractRepositoryQuery
    • Constrctor no longer takes number of hits. Connectors can use QueryHitCollector.MAX_HITS (currently 5000) when setting max number of hits to return.
  • AbstractRepositoryTask .....updates in progress
    • getIdLabel() -> getTasKey()
    • constructor changed
    • getLastRefreshTimeInMinutes(Date) removed
    • no more static methods (use RepositoryTaskHandleUtil)
    • Replace this idiom:
   String handleIdentifier = AbstractRepositoryTask.getHandle(repository.getUrl(), taskId);
   ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(handle);
    • with:
   ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), taskId);
  • AbstractQueryHit
    • setDescription(..) renamed to setSummary(..)
  • AttributeContainer
    • getAttributeFactory() new method
  • DateRangeContainer
    • getChildren() now returns set of underlying task objects (not DateRangeActivityDelegates which will be deprecated)
    • getDateRangeDelegates() returns the delegate formerly returned by getChildren()
  • ITaskListElement: now extends java.lang.Comparable, so Collections support of sorting can be used, since task list elements have a natural ordering. Default implementations are provided for tasks and containers. (bug 171590)
  • ITaskDataHandler
    • getChangedSinceLastSync() method moved to AbstractRepositoryConnector
    • New comment now held in an attribute: RepositoryTaskAttribute.COMMENT_NEW will need to update handler and factory to produce connector specific attribute
    • initializeTaskData(TaskRepository repository, RepositoryTaskData data, IProgressMonitor monitor) called by NewTaskWizard to initialize new taskData objects (currently only in use by Trac but will adopt).
    • getAttributeFactory(String repositoryUrl, String repositoryKind, String taskKind) signature changed
    • getDateForAttributeType(...) moved to AbstractAttributeFactory
  • ITaskListExternalizer
    • readTask(..) renamed to createTask(..), no longer needs to set taskId, label, or repositoryUrl
  • DelegatingTaskExternalizer
    • readTaskInfo(..) and readQueryHitInfo(..) are now called automatically and are private. Use your createTask(..) or createQueryHit(..) methods to customize reading additional attributes.
  • TaskRepository
    • TaskRepository.isAnonymous()
    • TaskRepository.setAnonymous(boolean)
    • (-) TaskRepository.getDefaultProxy() (Renamed and moved to WebClientUtil.getPlatformProxy())
  • RepositorySynchronizationManager
    • updateOfflineState is now saveIncoming and saveOutgoing.
    • discardOutgoing discards any pending outgoing changes
  • RepositoryTaskAttribute
    • getID() -> getId()
  • RepositoryTaskData
    • constructor now requires a task kind (string) (i.e. Task.DEFAULT_TASK_KIND)
    • getTaskKind return the task kind
    • setNew(boolean) signifies that this is unsubmitted task data. Used by editor factory to determine if existing or new editor to be opened.
  • Task .....updates in progress
    • getTooltipText(): deleted, not used
    • Due dates are now supported getDueDate(), setDueDate()
    • handleIdentifier: now private
    • get/setUrl are now get/setTaskUrl (to disambiguate with get/setRepositoryUrl())
    • (-) getElapsedTime()
    • (-) setElapsedTime()
  • TaskEditor
    • protected void pageChange(intNewPageIndex) method removed (only called super)
  • TaskList
    • getChangeListeners(): returns a Set instead of List
  • TaskListImages
    • renamed to TasksUiImages (still an internal class, should move to API)
  • TaskListManager
    • setDueDate() used to set due date on a task and cause notification of local info changed.
    • isDue(ITask) true if task's due date isn't null and date has past
  • TasksUiUtil
    • openUrl(String url): moved to openBrowser(String url)
  • QueryHitCollector
    • MAX_HITS constant can be used as standard default number of hits handled per query. User notified when >= hits returned.

Context Framework

  • AbstractContextStore
    • notifyContextStoreMoved(): change to contextStoreMoved()
  • AbstractContextStructureBridge
    • getDegreesOfSeparation(): moved to AbstractRelationProvider
    • getRelationshipProviders(): moved to extensions point, e.g.:
 <extension point="org.eclipse.mylar.context.core.bridges">
    <relationProvider
          class="org.eclipse.mylar.internal.java.search.JavaImplementorsProvider"
          contentType="java"/>
 </extension>

Monitor Framework

  • MylarMonitorUiPlugin
    • (-) setInactivityTimeout(...)
  • org.eclipse.mylar.monitor: split into monitor.core and monitor.ui, organize imports and update extension point IDs
  • HandleObfuscator
    • moved to InteractionEventObfuscator
  • org.eclipse.mylar.monitor.usage.core and org.eclipse.mylar.monitor.usage.ui
    • moved to ..mylar.monitor.core, ..mylar.monitor.usage and ..mylar.monitor.usage.internal

Back to the top