Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Mylyn/Porting Guide
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.
Contents
Porting from Mylar 1.0 to 2.0
General
- All library dependencies have moved
-
MylarStatusHandler
andIStatusHandler
- moved from
org.eclipse.mylar.context.core
toorg.eclipse.mylar.core
- moved from
Tasks Framework
.....updates in progress.....
-
ITaskListExternalizer
-
readTask(..)
renamed tocreateTask(..)
, no longer needs to set taskId, label, or repositoryUrl
-
-
DelegatingTaskExternalizer
-
readTaskInfo(..)
andreadQueryHitInfo(..)
are now called automatically and are private. Use yourcreateTask(..)
orcreateQueryHit(..)
methods to customize reading additional attributes.
-
-
Task
.....updates in progress- handleIdentifier: now private
- get/setUrl are now get/setTaskUrl (to disambiguate with get/setRepositoryUrl())
-
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);
-
AbstractRepositoryQuery
- Constrctor no longer takes number of hits. Connectors can use QueryHitCollector.MAX_HITS (currently 5000) when setting max number of hits to return.
-
AbstractQueryHit
-
setDescription(..)
renamed tosetSummary(..)
-
-
AbstractRepositoryConnectorUi
-
openRemoteTask(String repositoryUrl, String id)
: removed, this method no longer needs to be implemented by the connector. Instead classes can rely on the newopenRepositoryTask(..)
method, and override it if necessary. - getRepositoryUrl and all ID/URL methods: now final, change via setters
- + findHyperlinks(...) override to detect hyperlinks in editors
-
-
AbstractRepositoryConnector
- + getLastSyncTimestamp(TaskRepository repository, Set<AbstractRepositoryTask> changedTasks) (may change as part of bug#176934)
-
getSupportedVersions()
has been removed (#1768159)
-
ITaskListElement
: now extendsjava.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)
-
QueryHitCollector
- MAX_HITS constant can be used as standard default number of hits handled per query. User notified when >= hits returned.
-
TasksUiUtil
-
openUrl(String url)
: moved toopenBrowser(String url)
-
-
Task
-
getTooltipText()
: deleted, not used - Due dates are now supported
getDueDate(), setDueDate()
-
-
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 aMylarStatus
with appropriate code (seeIMylarStatusConstants
). - If
IMylarStatusConstants.INTERNAL_ERROR
is sent toMylarStatusHandler.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.
-
-
ITaskDataHandler
-
getChangedSinceLastSync()
method moved toAbstractRepositoryConnector
- 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 toAbstractAttributeFactory
-
AttributeContainer
getAttributeFactory()
new method
RepositoryTaskData
- constructor now requires a task kind (string) (i.e.
Task.DEFAULT_TASK_KIND
) getTaskKind
return the task kindsetNew(boolean)
signifies that this is unsubmitted task data. Used by editor factory to determine if existing or new editor to be opened.
- constructor now requires a task kind (string) (i.e.
RepositoryTaskAttribute
- getID() -> getId()
AbstractRepositorySettingsPage
validation changes.setNeedsValidation(boolean needsValidation)
if true validate button will be visiblegetValidator(TaskRepository repository)
return an instance ofValidator
.
-
TaskRepository
- TaskRepository.isAnonymous()
- TaskRepository.setAnonymous(boolean)
- RepositorySynchronizationManager
-
updateOfflineState
is nowsaveIncoming
andsaveOutgoing
. -
discardOutgoing
discards any pending outgoing changes
-
-
TaskEditor
-
protected void pageChange(intNewPageIndex)
method removed (only called super)
-
-
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) inalternateSectionLabels
onAbstractRepositoryTaskEditor
. -
updateEditor()
refreshes editor with new input in-place.
-
WebClientUtil
- moved from
..mylar.tasks.core
to..mylar.core.net
- moved from
-
TaskList
-
getChangeListeners()
: returns aSet
instead ofList
-
-
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
-
Context Framework
-
AbstractContextStore
-
notifyContextStoreMoved()
: change tocontextStoreMoved()
-
Monitor Framework
-
org.eclipse.mylar.monitor
: split intomonitor.core
andmonitor.ui
, organize imports and update extension point IDs -
HandleObfuscator
- moved to
InteractionEventObfuscator
- moved to
-
org.eclipse.mylar.monitor.usage.core
andorg.eclipse.mylar.monitor.usage.ui
- moved to
..mylar.monitor.core
,..mylar.monitor.usage
and..mylar.monitor.usage.internal
- moved to