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 2.0
Contents
Migrating from Mylar 1.0 to Mylyn 2.0
Follow these instructions to migrate from the Mylyn 1.0 to 2.0 APIs, noting that the project changed names during this period.
Bugzilla
- Open each query that you have, select Update Attributes and change the product from Mylar to Mylyn.
- Note that
mylar-inbox@eclipse.org
has been renamed tomylyn-inbox@eclipse.org
. - After synchronizing you may see a large number of bugs with incoming changes. This is due to the product name having changed on those bugs. If you have too many incomings to read through, we recommend selecting resolved bugs and using Mark->Read via the context menu.
General
- Mylar to Mylyn project name refactoring
- Use Search > File Search, enter in "org.eclipse.mylar" as search string and enter file types "*.java, *.xml, *.xsd, *.properties, *.mf" and click on Replace... at bottom of Search dialog. In resulting Replace dialog enter "org.eclipse.mylyn" as the replace text.
- Select all projects and execute Source > Organize Imports.
- If you get compile errors after Organizing Imports related to HttpClient ensure that the apache commons HttpClient (contained in org.eclipse.mylyn.web.core package) has been imported NOT the jvm's version.
- Library dependencies have moved to
org.eclipse.mylar
-
MylarStatusHandler
andIStatusHandler
- moved from
org.eclipse.mylar.context.core
toorg.eclipse.mylar.core
- moved from
-
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.
-
-
WebClientUtil
- moved from
..mylar.tasks.core
to..mylar.core.net
- moved from
- Methods that do I/O operations now take an
IProgressMonitor
parameter (#143011)
Tasks API
Sorting is alphabetical.
-
AbstractAttributeFactory
-
getIsReadOnly()
renamed toisReadOnly
-
-
AbstractNewRepositoryTaskEditor
- handleNewBugPost() renamed to updatedSubmittedTask()
-
AbstractQueryHit
- The notion of special hit objects (AbstractQueryHit) has been completely removed from the Mylyn code base. Where once you provided hit objects (i.e. to a ITaskCollector) you may now provide AbstractTask objects or in many cases raw RepositoryTaskData.
-
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)
added. Must be implemented to handle updating information on theAbstractRepositoryTask
with data from theRepositoryTaskData
- renamed
updateTask
toupdateTaskFromRepository
-
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. -
retrieveContext()
moved toAbstractAttachmentHandler
-
getContextAttachments()
moved toAbstractAttachmentHandler
-
hasRepositoryContext()
moved toAbstractAttachmentHandler
-
setTaskDataManagern()
moved toAbstractAttachmentHandler
-
downloadContext()
moved toAbstractAttachmentHandler
-
attachContext()
moved toAbstractAttachmentHandler
-
getTaskWebUrl()
renamed togetTaskUrl()
-
repositoryPropertyNames()
renamed to getRepositoryPropertyNames()</code> -
getRepositoryType()
renamed togetConnectorKind()
-
-
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
- 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
- getRepositoryType renamed to getConnectorKind()
- handlesDueDates() renamed to supportsDueDates();
- handlesCustomNotificationHandling() renamed to isCustomNatificationHandling()
- hasRichEditor() removed
-
-
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. -
updateHits
removed (hits/tasks added by sync job via TaskList.addTask(...) -
addHit
removed -
removeHit
removed (use methods from parent class AbstractTaskContainer) -
findQueryHit
removed -
getHits()
removde (is a AbstractTaskContainer so can call getChildren() ) -
setCurrentlySynchronizing()
rename tosetSyncrhonizing()
-
setLastRefreshTimestamp()
renamesetLastSynchronizedTimeStamp()
-
getLastRefreshTimeStamp()
rename togetLastSynchronizedTimeStamp()
-
setStatus()
renamedsetSynchronizationStatus()
-
getStatus()
renamedgetSynchronizationStatus()
-
- <codde>AbstractRepositoryQueryPage</code>
- saveWidgetValues() renamed to saveState()
AbstractRepositorySettingsPage
validation changes.setNeedsValidation(boolean needsValidation)
if true validate button will be visiblegetValidator(TaskRepository repository)
return an instance ofValidator
.
-
AbstractRepositoryTask
-
Task
: constructor no longer takes newTask bookean, use setCreationDate(new Date()) for creating a new task instead - 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()
AddedIProgressMonitor
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()
AddedIProgressMonitor
parameter (#143011) -
handleNewBugPost()
AddedIProgressMonitor
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) inalternateSectionLabels
onAbstractRepositoryTaskEditor
. -
updateEditor()
refreshes editor with new input in-place. -
uploadTaskFromRepository()
AddedIProgressMonitor
parameter (#143011) - ComboSelectionListener removed (see createAttributeLayout for exmaple of attribute update lister)
- comboListenerMap, removed
- changedAttributes now private
- setAttachContext() removed
- attachContext renamed attachContextEnabled and private (use setAttachContextEnabled())
- showAttachments now private, use setShowAttachments()
- backgroundIncoming private, use getColorIncoming()
- connector private, use getConnector()
- HEADER_DATE_FORMAT private, use getCommonDateFormat()
- isDisposed() removed, use getManagedForm().getForm().isDisposed()
- updateTask() removed, implimentation moved to saveTaskOffline()
- select(...) private
- checkText() removed
- toolkit private, use getManagedForm.getToolkit()
- SummaryListener removed
- display, VALUE, HEADER, PROPERTY, HYPERLINK_TYPE_TASK, HYPERLINK_TYPE_JAVA, HORZ_INDENT - removed
- alternateSectionLabels, removed - overload getSectionLabel() if necessary
- currentSelectedText removed
- cutAction, pastAction removed
- scrollIncrement, scrollVertPageIncrement, scrollHorzPageIncrement were protected now private
- commetStyleText, textsindex, removed
- createReportHeaderLayout() renamed to createSummaryLayout()
-
AbstractRepositoryTaskEditorInput
- constructor takes TaskRepository and task id
-
AbstractTaskDecorator
removed
AbstractTaskEditorInput
renamed to AbstractRepositoryTaskEditorInput
AttributeContainer
getAttributeFactory()
new method
AbstractTaskContainer
- constructor no longer takes a TaskList
- getChildern() requires taskList parameter
- setDescription() renamed to setSummary()
- setSummary() removed, use setHandleIdentifier()
-
DateRangeContainer
- getChildren() now returns set of underlying task objects (not DateRangeActivityDelegates which will be deprecated)
- getDateRangeDelegates() returns the delegate formerly returned by getChildren()
-
DelegatingTaskExternalizer
now extend AbstractTaskListFactory to externalize connector specific task-
readTaskInfo(..)
andreadQueryHitInfo(..)
are now called automatically and are private. Use yourcreateTask(..)
orcreateQueryHit(..)
methods to customize reading additional attributes. - init() removed
- readTaskData() removed
-
-
IAttachmentHandler
removed, all methods moved to AbstractAttachmentHandler-
downloadAttachment()
AddedIProgressMonitor
parameter (#143011). The data is now written to anOutputStream
instead of aFile
(#186070). A default implementation for this method which usesgetAttachmentAsStream()
for retrieving the attachment is provided inAbstractAttachmentHandler
. -
getAttachmentData()
has been replaced bygetAttachmentAsStream()
which now returns an InputStream for reading the attachment data (#186070). -
uploadAttachment()
AddedIProgressMonitor
parameter (#143011). Attachment properties are now passed as an object of typeITaskAttachment
. This interface provides acreateInputStream()
method to create a stream for reading the data source (#186070).
-
- ITask
- ITask and ITaskListElement have merged to form a single abstract class
AbstractClass
. This class extendsAbstractTaskContainer
which provides identity and containment facility. -
setDescription(...)
renamed tosetSummary
-
addSubTask()
removed -
removeSubTask()
removed
- ITask and ITaskListElement have merged to form a single abstract class
-
ITaskDataHandler
- made abstract and renamed to
AstractTaskDataHandler<code>
- <code>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()
AddedIProgressMonitor
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 toAbstractAttributeFactory
-
postTaskData()
AddedIProgressMonitor
parameter (#143011)
- made abstract and renamed to
-
ITaskCollector
- getTaskHits renamed getTasks()
-
ITaskEditorFactory
renamed to AbstractTaskEditorFactory- getPriority() renamed to getTabOrderPriority()
-
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)
-
ITaskListExternalizer
-
readTask(..)
renamed tocreateTask(..)
, no longer needs to set taskId, label, or repositoryUrl -
createQueryElement(...)
requires additional TaskList parameter -
getQueryHitTagName()
removed -
createQueryHitElement()<code> removed (hit read/write now handled by framework)
- <code>canReadQueryHit() removed
-
createQueryHit()
removed
-
-
MylarStatusHandler
renamed toStatusHandler
-
MylarStatus
merged withIMylarStatusConstants
renamed toRepositoryStatus
-
NewTaskEditorInput
- Constructor takes (TaskRepository repository, RepositoryTaskData taskData)
-
QueryHitCollector
- MAX_HITS constant can be used as standard default number of hits handled per query. User notified when >= hits returned.
-
RepositoryTaskEditorInput
- constructor takes (TaskRepository repository, String taskId, String taskUrl)
-
RepositorySynchronizationManager
-
updateOfflineState
is nowsaveIncoming
andsaveOutgoing
. -
discardOutgoing
discards any pending outgoing changes
-
-
RepositoryTaskAttribute
- getID() -> getId()
- COMMENT_AUTHOR property now used to set/get TaskComment author (was using USER_OWNER)
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.- getCC renamed to getCc
- constructor now requires a task kind (string) (i.e.
-
SynchronizeQueryJob
- renamed setSynchTasks() to setSynchChangedTasks()
-
Task
renamed to AbstractTask- constructor no longer takes newTask boolean, use setCreationDate(new Date()) for creating a new task instead
-
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, useTaskListManager.getElapsedTime(ITask)
instead (note this method might move) -
setElapsedTime()
: removed, not used -
getParent()
removed -
setParent()
removed (tasks can have multiple parent tasks) -
isCategory()
removed -
setIsCategory()
removed -
addSubTask(), removeSubTask(), dropSubTasks()
removed Task extends AbstractTaskContainer so task containment semantics handled by parent. To ADD subtasks use TaskList.addTask(child, parent) getting and dropping of subtasks can be performed via methods on the Task (inherited from AbstrTactTaskContainer)remove(), clear()
-
getRepositoryTaskSyncState
renamed togetSynchronizationState()
- getRepositoryKind() renamed to getConnectorKind()
- setLastSyncDateStamp() renamed to setLastReadTimeStamp()
- getLastSyncDateStamp() renamed to getLastReadTimeStamp()
- setKind() renamed to setTaskKind()
- setStatus() renamed to setShcyronizationStatus()
- getState() renamed to getSynchronizationState()
- setCurrentlySynchronizting() renamed to setSynchronizing()
- hasBeenReminded() renamed to isReminded()
- removed getTaskUrl() use getUrl from parent AbstractTaskContainer
-
TaskContainer
and all others extendingAbstractTaskContainer
- constructor no longer takes tasklist parameter
-
TaskEditor
-
protected void pageChange(intNewPageIndex)
method removed (only called super)
-
-
TaskList
-
getChangeListeners()
: returns aSet
instead ofList
-
getRootCategory
renamed togetUncategorizedCategory
-
movedToRoot
usemoveToContainer()
-
removeFromRoot
removed -
getRootTasks()
removed, use default category
-
-
TaskListImages
- renamed to
TasksUiImages
(still an internal class, should move to API)
- renamed to
-
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())
- getSyncTyimeStamp() renamed getSynchronizationTimeStamp()
- setSynchTimeStamp() renamed setSynchronizationTimeStamp()
- userDefaultProxy() renamed isDefaultProxyEnabled()
- getKind() renamed to getConnnectorKind()
-
TaskRepositoryManager
- SetSyncTime() renamed to setSynchronizationTime()
-
TasksUiPlugin
- getRepositoryUi renamed to getConnectorUi
- isEclipseVersion_3_3 removed
- isMultipleActiveTasksMode() removed
- isShellActive() removed
-
TasksUiUtil
-
openUrl(String url)
: moved toopenUrl(String url, boolean useRichEditor)
-
getImageDescriptorForPriority(..)
moved to TasksUiImages -
getImageForPriority(..)
moved to TasksUiImages
-
---
- Moved to appropriate internal package:
AttachmentTableLabelProvider
EditorBusyIndicator
IBusyEditor
RepositoryTaskEditorDropListener
RepositoryTaskOutlineNode
RepositoryTaskSelection
RepositoryTextViewer
TaskFormPage
TaskHyperlinkDetector
TaskUrlHyperlinkDetector
TaskUrlHyperlink
SearchScoreComputerAdapterFactory
RepositorySynchronizationManager
SynchronizeTaskJob
SynchronizeQueryJob
ProjectPreferenceLinkProvider
OpenRepositoryTaskJob
IRepositoryConstants
ContextUiUtil
MylarMessages
(moved to Bugzilla internal)UnrecognizedResponseException
(moved to Bugzilla internal)TaskRepositoryFilter
TaskCategory
Context API
-
AbstractContextUiBridge<code>
use- removed: <code>restoreEditor(IMylarElement)
open(IMylarElement)
instead
AbstractContextStore
-
notifyContextStoreMoved()
: change tocontextStoreMoved()
AbstractContextStructureBridge
-
getDegreesOfSeparation()
: moved toAbstractRelationProvider
-
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 toIInteractionContextListener
-
contextCleared(..)
: added -
presentationSettingsChanging(..)
: removed, not used -
presentationSettingsChanged(..)
: removed, not used -
UpdateKind
: removed, not used
-
-
IMylarContext
: renamed toIInteranctionContext
-
getHandleIdentifier()
: added to facilitate mapping
-
-
IMylarElement
: renamed toIInteractionElement
-
IMylarObject
: renamed toIInteractionObject
-
IMylarRelation
: renamed toIInteractionRelation
-
IContextWriter
: renamed toIInteractionContextWriter
-
IContextReader
: renamed toIInteractionContextReader
-
IMylarContextListener
: renamed toIInteractionContextListener
-
MylarContextManager
: renamed toInteractionContextManager
Monitor API
-
MylarMonitorUiPlugin
: renamed toMonitorUiPlugin
- (-) setInactivityTimeout(...)
-
MylarUsageMonitorPlugin
: renamed toUiUsageMonitorPlugin
-
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
Headless API
- TaskRepository defautls to use platform proxy. To avoid dependance on a running platform you must manually set property TaskRepository.PROXY_USEDEFAULT to false