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"

(General)
(Tasks API)
Line 109: Line 109:
  
 
* <code>AbstractRepositoryTaskEditor</code>
 
* <code>AbstractRepositoryTaskEditor</code>
 +
** <code>attachContext()</code> Added <code>IProgressMonitor</code> parameter ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=143011 #143011])
 
**<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>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>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>createTaskFromExistingId()</code> Added <code>IProgressMonitor</code> parameter ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=143011 #143011])
 +
** <code>handleNewBugPost()</code> Added <code>IProgressMonitor</code> parameter ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=143011 #143011])
 
** <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>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>updateEditor()</code> refreshes editor with new input in-place.
 +
** <code>uploadTaskFromRepository()</code> Added <code>IProgressMonitor</code> parameter ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=143011 #143011])
 +
  
 
*<code> AttributeContainer</code>
 
*<code> AttributeContainer</code>
Line 127: Line 132:
 
** init() removed
 
** init() removed
 
** readTaskData() removed
 
** readTaskData() removed
 +
 +
* <code>IAttachmentHandler</code>
 +
** <code>downloadAttachment()</code> Added <code>IProgressMonitor</code> parameter ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=143011 #143011])
 +
** <code>getAttachmentData()</code> Added <code>IProgressMonitor</code> parameter ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=143011 #143011])
 +
** <code>uploadAttachment()</code> Added <code>IProgressMonitor</code> parameter ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=143011 #143011])
  
 
* ITask
 
* ITask
Line 134: Line 144:
 
** <code>getChangedSinceLastSync()</code> method moved to <code>AbstractRepositoryConnector</code>
 
** <code>getChangedSinceLastSync()</code> method moved to <code>AbstractRepositoryConnector</code>
 
** New comment now held in an attribute: <code>RepositoryTaskAttribute.COMMENT_NEW</code> will need to update handler and factory to produce connector specific attribute
 
** New comment now held in an attribute: <code>RepositoryTaskAttribute.COMMENT_NEW</code> will need to update handler and factory to produce connector specific attribute
 +
** <code>getTaskData()</code> Added <code>IProgressMonitor</code> parameter ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=143011 #143011])
 
** <code>initializeTaskData(TaskRepository repository, RepositoryTaskData data, IProgressMonitor monitor)</code> called by NewTaskWizard to initialize new taskData objects (currently only in use by Trac but will adopt).
 
** <code>initializeTaskData(TaskRepository repository, RepositoryTaskData data, IProgressMonitor monitor)</code> called by NewTaskWizard to initialize new taskData objects (currently only in use by Trac but will adopt).
 
** <code>getAttributeFactory(String repositoryUrl, String repositoryKind, String taskKind)</code> signature changed
 
** <code>getAttributeFactory(String repositoryUrl, String repositoryKind, String taskKind)</code> signature changed
 
** <code>getDateForAttributeType(...)</code> moved to <code>AbstractAttributeFactory</code>
 
** <code>getDateForAttributeType(...)</code> moved to <code>AbstractAttributeFactory</code>
 +
** <code>postTaskData()</code> Added <code>IProgressMonitor</code> parameter ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=143011 #143011])
  
 
* <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])

Revision as of 00:40, 3 June 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. Note that changes involving classes moving packages are not listed, use Organize Imports to resolve.

Porting from Mylar 1.0 to 2.0

Pending Changes

The following changes are planned but not yet implemented. Email mylar-dev if any of these pose a problem.

  • AbstractRepositoryTaskEditor
    • creation of the Composite for "Attributes" section moved out of the createAttributeLayout(..) method into createSections(). So, method createAttributeLayout(..) is now takes that composite as parameter and returns void.
  • AbstractRepositoryConnector:
    • rename createTaskFromExistingKey(..) to addExistingTask(..)
    • rename getRepositoryType() to getConnectorKind()
  • AbstractRepositoryConnectorUi:
    • remove hasRichEditor();
  • AbstractRepositoryQuery
    • rename to AbstractRepositoryTaskContainer or merge with AbstractTaskContainer
  • AbstractRepositoryTask
    • rename getRepositoryKind() to getConnectorKind()
    • rename setLastSyncDateStamp() to setLastReadTimeStamp()
    • rename getLastSyncDateStamp() to getLastReadTimeStamp()
  • IRepositoryConstants
    • rename PROPERTY_KIND to PROPERTY_CONNECTOR_KIND
  • Task
    • rename getRepositoryKind() to getConnectorKind()
    • rename getDescription() to getSummary()
    • rename setKind() to setTaskKind()
  • TaskListManager
    • task activity methods might move to a new TaskActivityManager class
  • TaskRepository:
    • rename getKind() to getConnectorKind()
    • Make class final
  • Bridges:
    • Dtructure bridge: consider changing contentType -> structureKind

General

  • Library dependencies have moved to org.eclipse.mylar
  • MylarStatusHandler and IStatusHandler
    • moved from org.eclipse.mylar.context.core to org.eclipse.mylar.core
  • MylarStatus (place holder, will improve as we solidify this)
    • MylarStatusHandler.displayStatus(dialog title, IStatus status) - call to display error and information dialogs
    • When returning CoreException pass in a MylarStatus with appropriate code (see IMylarStatusConstants).
    • If IMylarStatusConstants.INTERNAL_ERROR is sent to MylarStatusHandler.displayStatus an error dialog will appear and the error will be logged.
    • IMylarStatusConstants.REPOSITORY_COLLISION used for mid-air collision. Pass repository url and appropriate dialog will be displayed.
  • WebClientUtil
    • moved from ..mylar.tasks.core to ..mylar.core.net
  • Methods that do I/O operations now take an IProgressMonitor parameter (#143011)

Tasks API

Sorting is alphabetical.

  • AbstractQueryHit
    • setDescription(..) renamed to setSummary(..)
  • AbstractRepositoryConnector
    • getLastSyncTimestamp(TaskRepository repository, Set<AbstractRepositoryTask> changedTasks): added (may change as part of bug#176934)
    • getSupportedVersions() has been removed (#1768159)
    • createTaskFromExistingId() is no longer abstract and takes care of task creation
    • updateTaskFromTaskData(TaskRepository, AbstractRepositoryTask, RepositoryTaskData, boolean retrieveSubTasks) added. Must be implemented to handle updating information on the AbstractRepositoryTask with data from the RepositoryTaskData
    • renamed updateTask to updateTaskFromRepository
    • createTaskFromExistingKey() renamed to createTaskFromExistingId() and is final
    • makeTask() added. Connector specific repository task construction
    • setTaskDataManager() added. Manager set upon connector construction in TasksUiPlugin. If being used headless, will need to manually set for offline support.
  • 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
    • handlesDueDates() added. Override and return true if connector capable of handling due dates.
    • getTaskKindLabel(RepositoryTaskData) returns suitable label for task kind (default is 'Task') override to suit
  • AbstractRepositoryQuery
    • setMaxHits() removed and constrctor no longer takes number of hits. Connectors can use QueryHitCollector.MAX_HITS (currently 5000) when setting max number of hits to return.
  • AbstractRepositorySettingsPage validation changes.
    • setNeedsValidation(boolean needsValidation) if true validate button will be visible
    • getValidator(TaskRepository repository) return an instance of Validator.
  • AbstractRepositoryTask
    • constructor now requires taskId (now immutable)
    • getIdentifyingLabel() -> getTaskKey()
    • 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);
    • isDirty() and setDirty() removed
    • isDownloaded() removed
    • getTaskData(), setTaskData() removed
    • isSubmitting(), setSubmitting() added
  • AbstractRepositoryTaskEditor
    • attachContext() Added IProgressMonitor parameter (#143011)
    • 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.
    • createTaskFromExistingId() Added IProgressMonitor parameter (#143011)
    • handleNewBugPost() Added IProgressMonitor parameter (#143011)
    • 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.
    • uploadTaskFromRepository() Added IProgressMonitor parameter (#143011)


  • 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()
  • DelegatingTaskExternalizer
    • readTaskInfo(..) and readQueryHitInfo(..) are now called automatically and are private. Use your createTask(..) or createQueryHit(..) methods to customize reading additional attributes.
  • DelegatingTaskExternalizer
    • init() removed
    • readTaskData() removed
  • IAttachmentHandler
    • downloadAttachment() Added IProgressMonitor parameter (#143011)
    • getAttachmentData() Added IProgressMonitor parameter (#143011)
    • uploadAttachment() Added IProgressMonitor parameter (#143011)
  • ITask
    • setDescription(...) renamed to setSummary
  • 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
    • getTaskData() Added IProgressMonitor parameter (#143011)
    • 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
    • postTaskData() Added IProgressMonitor parameter (#143011)
  • 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)
  • ITaskListExternalizer
    • readTask(..) renamed to createTask(..), no longer needs to set taskId, label, or repositoryUrl
  • QueryHitCollector
    • MAX_HITS constant can be used as standard default number of hits handled per query. User notified when >= hits returned.
  • 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.
  • SynchronizeQueryJob
    • renamed setSynchTasks() to setSynchChangedTasks()
  • Task
    • dropSubTasks: added, removes all subtasks
    • 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(): removed, not used previously, use TaskListManager.getElapsedTime(ITask) instead (note this method might move)
    • setElapsedTime(): removed, not used
  • TaskEditor
    • protected void pageChange(intNewPageIndex) method removed (only called super)
  • TaskList
    • getChangeListeners(): returns a Set instead of List
    • getRootCategory renamed to getUncategorizedCategory


  • 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
  • TaskListWriter
    • setTaskDataManager() removed
  • TaskRepository
    • TaskRepository.isAnonymous()
    • TaskRepository.setAnonymous(boolean)
    • (-) TaskRepository.getDefaultProxy() (Renamed and moved to WebClientUtil.getPlatformProxy())
  • TasksUiUtil
    • openUrl(String url): moved to openUrl(String url, boolean useRichEditor)
    • getImageDescriptorForPriority(..) moved to TasksUiImages
    • getImageForPriority(..)moved to TasksUiImages

Context API

  • AbstractContextUiBridge<code>
    • removed: <code>restoreEditor(IMylarElement) use open(IMylarElement) instead
  • 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>
  • IMylarContextListener: renamed to IInteractionContextListener
    • contextCleared(..): added
    • presentationSettingsChanging(..): removed, not used
    • presentationSettingsChanged(..): removed, not used
    • UpdateKind: removed, not used
  • IMylarContext: renamed to IInteranctionContext
    • getHandleIdentifier(): added to facilitate mapping
  • IMylarElement: renamed to IInteractionElement
  • IMylarObject: renamed to IInteractionObject
  • IMylarRelation: renamed to IInteractionRelation
  • IContextWriter: renamed to IInteractionContextWriter
  • IContextReader: renamed to IInteractionContextReader
  • IMylarContextListener: renamed to IInteractionContextListener
  • MylarContextManager: renamed to InteractionContextManager

Monitor API

  • MylarMonitorUiPlugin: renamed to MonitorUiPlugin
    • (-) 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